home: hub: mkinitfs

Download patch

ref: 932c48410589399a3d1a6e0ab47088b5777d3864
parent: 8427257b986105d09c4c287e739af152dc6ccfce
author: Timo Teräs <timo.teras@iki.fi>
date: Mon Dec 1 03:20:43 CST 2014

init: preliminary support for splash image during boot

--- 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 @@
 
 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 @@
 	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 @@
 	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 @@
 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 @@
 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