From 932c48410589399a3d1a6e0ab47088b5777d3864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 1 Dec 2014 09:20:43 +0200 Subject: init: preliminary support for splash image during boot --- initramfs-init.in | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'initramfs-init.in') diff --git a/initramfs-init.in b/initramfs-init.in index 4b010f6..46ac5c3 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -4,6 +4,7 @@ VERSION=@VERSION@ SINGLEMODE=no sysroot=/sysroot +splashfile=/.splash.ctrl /bin/busybox mkdir -p /usr/bin /usr/sbin /proc /sys /dev $sysroot \ /media/cdrom /media/usb /tmp @@ -386,7 +387,7 @@ eval set -- `cat /proc/cmdline` myopts="alpine_dev autodetect autoraid chart cryptroot cryptdm debug_init dma init_args keep_apk_new modules ovl_dev pkgs quiet root_size root - usbdelay ip alpine_repo apkovl alpine_start nofbcon" + usbdelay ip alpine_repo apkovl alpine_start nofbcon splash" for opt; do case "$opt" in @@ -677,6 +678,14 @@ if [ -f "$sysroot/etc/.default_boot_services" -o ! -f "$ovl" ]; then rm -f "$sysroot/etc/.default_boot_services" fi +if [ "$KOPT_splash" != "no" -a -e $ALPINE_MNT/fbsplash.ppm -a -e $ALPINE_MNT/fbsplash.cfg ]; then + ebegin "Starting bootsplash (from $ALPINE_MNT)" + setsid fbsplash -T 16 -s $ALPINE_MNT/fbsplash.ppm -i $ALPINE_MNT/fbsplash.cfg -f $sysroot/$splashfile & + eend 0 +else + KOPT_splash="no" +fi + if [ -f $sysroot/etc/fstab ]; then has_fstab=1 @@ -742,7 +751,6 @@ if [ "$KOPT_keep_apk_new" != yes ]; then apkflags="$apkflags --clean-protected" [ -n "$ovlfiles" ] && apkflags="$apkflags --overlay-from-stdin" fi - if [ -n "$ovlfiles" ]; then apk add --root $sysroot $repo_opt $apkflags $pkgs <$ovlfiles else @@ -793,6 +801,7 @@ if [ "$KOPT_chart" = yes ]; then fi if [ ! -x $sysroot/sbin/init ]; then + [ "$KOPT_splash" != "no" ] && echo exit > $sysroot/$splashfile echo "/sbin/init not found in new root. Launching emergency recovery shell" echo "Type exit to continue boot." /bin/busybox sh @@ -807,9 +816,11 @@ cat /proc/mounts | while read DEV DIR TYPE OPTS ; do done sync +[ "$KOPT_splash" = "init" ] && echo exit > $sysroot/$splashfile echo "" exec /bin/busybox switch_root $sysroot $chart_init /sbin/init $KOPT_init_args +[ "$KOPT_splash" != "no" ] && echo exit > $sysroot/$splashfile echo "initramfs emergency recovery shell launched" exec /bin/busybox sh reboot -- cgit v1.2.3