diff options
-rwxr-xr-x | initramfs-tools/hooks/samizdat | 18 | ||||
-rw-r--r-- | initramfs-tools/scripts/samizdat | 36 | ||||
-rwxr-xr-x | old-school/grok-block | 2 |
3 files changed, 48 insertions, 8 deletions
diff --git a/initramfs-tools/hooks/samizdat b/initramfs-tools/hooks/samizdat index d9e0974..edcaea5 100755 --- a/initramfs-tools/hooks/samizdat +++ b/initramfs-tools/hooks/samizdat | |||
@@ -3,14 +3,20 @@ | |||
3 | 3 | ||
4 | . /usr/share/initramfs-tools/hook-functions | 4 | . /usr/share/initramfs-tools/hook-functions |
5 | 5 | ||
6 | for f in ./old-school/*; do | 6 | for f in ./old-school/*; do copy_exec "$f" /bin; done |
7 | copy_exec "$f" /bin | ||
8 | done | ||
9 | 7 | ||
10 | path_execs='mountpoint' | 8 | path_execs='mountpoint' |
11 | for c in $path_execs; do | 9 | |
12 | copy_exec "$(which $c)" /bin | 10 | for c in $path_execs; do copy_exec "$(which $c)" /bin; done |
13 | done | 11 | |
12 | absolute_path_copies='/lib/terminfo/l/linux' | ||
13 | |||
14 | for f in $absolute_path_copies; do copy_exec "$f" "$f"; done | ||
15 | |||
16 | samizdat_execs_dir=/home/d/src/samizdat # TODO | ||
17 | samizdat_execs='wait_for_files samizdat-pinentry dynmenu' | ||
18 | |||
19 | for c in $samizdat_execs; do copy_exec ${samizdat_execs_dir}/$c /bin; done | ||
14 | 20 | ||
15 | copy_exec vol_id.txt /lib/samizdat/vol_id.txt | 21 | copy_exec vol_id.txt /lib/samizdat/vol_id.txt |
16 | 22 | ||
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 @@ | |||
1 | klogd -c1 # TODO: This should be even earlier. Can it go on the kernel command line? | ||
2 | |||
1 | mountroot() | 3 | mountroot() |
2 | { | 4 | { |
3 | set -x | 5 | set -x |
@@ -16,7 +18,11 @@ mountroot() | |||
16 | samizdat_install_udev_rules | 18 | samizdat_install_udev_rules |
17 | 19 | ||
18 | openvt -c 13 sh | 20 | openvt -c 13 sh |
19 | sleep 100 | 21 | |
22 | mkfifo "$MENUFIFO" || panic "mkfifo '$MENUFIFO' failed" | ||
23 | bootmenu | ||
24 | |||
25 | sleep 1000 | ||
20 | set +x | 26 | set +x |
21 | } | 27 | } |
22 | 28 | ||
@@ -40,4 +46,32 @@ samizdat_restart_udev() | |||
40 | killall systemd-udevd | 46 | killall systemd-udevd |
41 | /lib/systemd/systemd-udevd --resolve-names=never --debug >/var/log/udevd-systemd.log 2>&1 & | 47 | /lib/systemd/systemd-udevd --resolve-names=never --debug >/var/log/udevd-systemd.log 2>&1 & |
42 | udevadm hwdb --update # rule is not executed by 'udevadm trigger' otherwise. not sure why | 48 | udevadm hwdb --update # rule is not executed by 'udevadm trigger' otherwise. not sure why |
49 | } | ||
50 | |||
51 | |||
52 | # TODO: do not duplicate these functions from common.sh | ||
53 | |||
54 | export MENUFIFO=/menu.fifo | ||
55 | |||
56 | addmenu() | ||
57 | { | ||
58 | cat <<END >>$MENUFIFO # mind the tabs | ||
59 | setItem "$1" "dummy" "$2" "$3" | ||
60 | END | ||
61 | } | ||
62 | |||
63 | menutitle() | ||
64 | { | ||
65 | printf 'setTitle "%s"\n' "$1" >>$MENUFIFO | ||
66 | printf 'setWelcomeText "%s"\n' "$2" >>$MENUFIFO | ||
67 | } | ||
68 | |||
69 | bootmenu() | ||
70 | { | ||
71 | local do_trigger="$1" no_panic="$2" | ||
72 | /bin/openvt -f -c 7 -- dynmenu "$MENUFIFO" && | ||
73 | chvt 7 && | ||
74 | 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.' | ||
75 | # menutitle 'Samizdat\nfreedom from surveillance\nno trusted authorities' 'Choose an installation target.' | ||
76 | addmenu "ramdisk" "[ Boot to RAM without installing anything ]" "menu-select boot-ram" | ||
43 | } \ No newline at end of file | 77 | } \ No newline at end of file |
diff --git a/old-school/grok-block b/old-school/grok-block index 3f45bb2..a93cef0 100755 --- a/old-school/grok-block +++ b/old-school/grok-block | |||
@@ -2,7 +2,7 @@ | |||
2 | . common.sh | 2 | . common.sh |
3 | 3 | ||
4 | DEVNAME=$1 | 4 | DEVNAME=$1 |
5 | case "$DEVNAME" in /dev/loop*|/dev/ram*|/dev/dm-*|/dev/md*) exit ;; esac | 5 | case "$DEVNAME" in /dev/loop*|/dev/ram*|/dev/dm-*|/dev/md*|/dev/fd*) exit ;; esac |
6 | [ -b "$DEVNAME" ] || exit | 6 | [ -b "$DEVNAME" ] || exit |
7 | 7 | ||
8 | debug_log "grok-block.${DEVNAME##*/}" | 8 | debug_log "grok-block.${DEVNAME##*/}" |