[klibc] run-init: get rid of over paranoid test for /init
switch_root in util-linux hasn't it either.
cc0c0262 added the checks, but probably didn't have the following
application in mind.
In fact it can break chainloading of bigger initramfs out of small one:
"I boot via pxe, kernel + very small ramfs this ramfs start an
application that grabs a bigger ramfs and store it locally
I did the following: creating a tmpfs, uncpio the ramfs and try to
run-init on it, but my miniramfs doesn't have a /init as I specified
rdinit=/sbin/init."
So for now just get rid of that check.
Reported-by: Erwan Velu <erwan.velu@zodiacaerospace.com>
Signed-off-by: maximilian attems <max@stro.at>
diff --git a/usr/kinit/run-init/runinitlib.c b/usr/kinit/run-init/runinitlib.c
index 423637e..50baa3d 100644
--- a/usr/kinit/run-init/runinitlib.c
+++ b/usr/kinit/run-init/runinitlib.c
@@ -176,10 +176,6 @@
if (rst.st_dev == cst.st_dev)
return "current directory on the same filesystem as the root";
- /* The initramfs should have /init */
- if (stat("/init", &ist) || !S_ISREG(ist.st_mode))
- return "can't find /init on initramfs";
-
/* Make sure we're on a ramfs */
if (statfs("/", &sfs))
return "statfs /";