[OpenWrt-Devel] [PATCH] [PATCH V2] [boot] /init: allow easier customisation of ramfs boot.

John Crispin blogic at openwrt.org
Mon Oct 13 15:44:41 EDT 2014


On 13/10/2014 00:03, Stephen Parry wrote:
> /init is the first pid 1 process in an initramfs environment. This fix adds
> lines to check for the existence of /bin/ramfsinit or /sbin/ramfsinit and exec
> if present. This allows packages to switch root early in the boot process. This
> will help support booting or kexecing from external storage and go some way
> toward fixing ticket #17465.


the ticket says extroot fails for !mtd. please elaborate on that. i
would rather we fix extroot to handle this use case rather than build a
way to bypass extroot






> Signed-off-by: Stephen Parry <sgparry at mainscreen.com>
> ---
> V2: Improved script structure using elif
> ---
>  target/linux/generic/base-files/init | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/target/linux/generic/base-files/init b/target/linux/generic/base-files/init
> index 514be57..e80b324 100755
> --- a/target/linux/generic/base-files/init
> +++ b/target/linux/generic/base-files/init
> @@ -1,4 +1,11 @@
>  #!/bin/sh
>  # Copyright (C) 2006 OpenWrt.org
>  export INITRAMFS=1
> -exec /sbin/init
> +
> +if [ -e /bin/ramfsinit ]; then
> +	exec /bin/ramfsinit
> +elif [ -e /sbin/ramfsinit ]; then
> +	exec /sbin/ramfsinit
> +else
> +	exec /sbin/init
> +fi
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list