diff --git a/generate.sh b/generate.sh index f8e5b6ff..3f2e56c0 100755 --- a/generate.sh +++ b/generate.sh @@ -46,6 +46,15 @@ mkdir -p $tmpdir/etc $tmpdir/proc $tmpdir/sys $tmpdir/sysroot # FIXME: we don't install modules right now, but for the testing we're doing # everything is already built-in +# plymouth +if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then + /usr/libexec/plymouth/plymouth-populate-initrd -t "$tmpdir" || : + # since we actually require a patched plymouth at the moment, this is useful + if [ -d plymouth ]; then + pushd plymouth >/dev/null ; make DESTDIR="$tmpdir" install ; popd >/dev/null + fi +fi + pushd $tmpdir >/dev/null find . |cpio -H newc -o |gzip -9 > $INITRDOUT popd >/dev/null diff --git a/init b/init index 7fdd3fcc..615dfc3b 100755 --- a/init +++ b/init @@ -7,10 +7,11 @@ emergency_shell() { + [ -x /bin/plymouth ] && /bin/plymouth --hide-splash echo ; echo echo "Bug in initramfs /init detected. Dropping to a shell. Good luck!" echo - bash + bash < /dev/console } trap "emergency_shell" 0 2 @@ -27,6 +28,30 @@ mount -t proc /proc /proc mount -t sysfs /sys /sys mount -t tmpfs -omode=0755 udev /dev +# FIXME: what device nodes does plymouth really _need_ ? +mknod /dev/console c 5 1 +mknod /dev/null c 1 3 +mknod /dev/kmsg c 1 11 +mknod /dev/ptmx c 5 2 +mknod /dev/fb c 29 0 +mkdir /dev/pts +mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts +mkdir -m 1777 /dev/shm +ln -s /proc/self/fd /dev/fd +ln -s fd/0 /dev/stdin +ln -s fd/1 /dev/stdout +ln -s fd/2 /dev/stderr +mknod /dev/systty c 4 0 +mknod /dev/tty0 c 4 0 +mknod /dev/tty1 c 4 1 +mknod /dev/tty2 c 4 2 + +# start plymouth if it's available +# arguably we need some of udev run first for fbmods and above devnodes :/ +[ -x /sbin/plymouthd ] && /sbin/plymouthd --attach-to-session +[ -x /bin/plymouth ] && /bin/plymouth --show-splash + + # start up udev and trigger cold plugs /sbin/udevd --daemon /sbin/udevadm trigger @@ -83,6 +108,8 @@ mount -t sysfs /sys $NEWROOT/sys # kill off udev kill `pidof udevd` + +[ -x /bin/plymouth ] && /bin/plymouth --newroot=$NEWROOT # FIXME: nash die die die exec /sbin/switch_root # davej doesn't like initrd bugs