From ceee310706bfc18d9ef5850ecc8a956ea6c83cee Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 19 Apr 2016 15:15:09 -0400 Subject: make the samizdat boot menu show up --- initramfs-tools/scripts/samizdat | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'initramfs-tools/scripts/samizdat') diff --git a/initramfs-tools/scripts/samizdat b/initramfs-tools/scripts/samizdat index 3f2ee43..89eb3ab 100644 --- a/initramfs-tools/scripts/samizdat +++ b/initramfs-tools/scripts/samizdat @@ -1,3 +1,5 @@ +klogd -c1 # TODO: This should be even earlier. Can it go on the kernel command line? + mountroot() { set -x @@ -16,7 +18,11 @@ mountroot() samizdat_install_udev_rules openvt -c 13 sh - sleep 100 + + mkfifo "$MENUFIFO" || panic "mkfifo '$MENUFIFO' failed" + bootmenu + + sleep 1000 set +x } @@ -40,4 +46,32 @@ samizdat_restart_udev() killall systemd-udevd /lib/systemd/systemd-udevd --resolve-names=never --debug >/var/log/udevd-systemd.log 2>&1 & udevadm hwdb --update # rule is not executed by 'udevadm trigger' otherwise. not sure why +} + + +# TODO: do not duplicate these functions from common.sh + +export MENUFIFO=/menu.fifo + +addmenu() +{ + cat <>$MENUFIFO # mind the tabs +setItem "$1" "dummy" "$2" "$3" +END +} + +menutitle() +{ + printf 'setTitle "%s"\n' "$1" >>$MENUFIFO + printf 'setWelcomeText "%s"\n' "$2" >>$MENUFIFO +} + +bootmenu() +{ + local do_trigger="$1" no_panic="$2" + /bin/openvt -f -c 7 -- dynmenu "$MENUFIFO" && + chvt 7 && + menutitle 'Samizdat\n\nAs the Internet develops there are\ntransitions in the management arrangements.\nThe time has come to take\na small step in one of those transitions.' 'Choose an installation target.' +# menutitle 'Samizdat\nfreedom from surveillance\nno trusted authorities' 'Choose an installation target.' + addmenu "ramdisk" "[ Boot to RAM without installing anything ]" "menu-select boot-ram" } \ No newline at end of file -- cgit v1.2.3