aboutsummaryrefslogtreecommitdiffstats
path: root/initramfs-init.in
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-12-01 09:20:43 +0200
committerTimo Teräs <timo.teras@iki.fi>2014-12-01 09:20:43 +0200
commit932c48410589399a3d1a6e0ab47088b5777d3864 (patch)
treeff80367af33a0af9a5bdd1ef12cd791dc6c278aa /initramfs-init.in
parent8427257b986105d09c4c287e739af152dc6ccfce (diff)
downloadmkinitfs-932c48410589399a3d1a6e0ab47088b5777d3864.tar.bz2
mkinitfs-932c48410589399a3d1a6e0ab47088b5777d3864.tar.xz
init: preliminary support for splash image during boot
Diffstat (limited to 'initramfs-init.in')
-rwxr-xr-xinitramfs-init.in15
1 files changed, 13 insertions, 2 deletions
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