summaryrefslogtreecommitdiff
path: root/src/initrd/grok-block
diff options
context:
space:
mode:
Diffstat (limited to 'src/initrd/grok-block')
-rwxr-xr-xsrc/initrd/grok-block22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/initrd/grok-block b/src/initrd/grok-block
index 01265b0..1152584 100755
--- a/src/initrd/grok-block
+++ b/src/initrd/grok-block
@@ -36,6 +36,14 @@ addmenu_chooseroot()
36 "menu-select --fs=$ID_FS_TYPE boot-luks $device ${loopfile:-$device}" 36 "menu-select --fs=$ID_FS_TYPE boot-luks $device ${loopfile:-$device}"
37} 37}
38 38
39addmenu_choose_native_root()
40{
41 local device="$1" loopfile="$2"
42 addmenu "$device//$device" \
43 "[ Boot the system on $device ]" \
44 "menu-select --fs=$ID_FS_TYPE boot-native $device"
45}
46
39addmenu_makeroot() 47addmenu_makeroot()
40{ 48{
41 local device="$1" loopfile="$2" megs="$3" copy_cdrom="$4" 49 local device="$1" loopfile="$2" megs="$3" copy_cdrom="$4"
@@ -50,7 +58,7 @@ addmenu_destroy_hard_drive()
50{ 58{
51 local device="$1" 59 local device="$1"
52 ( 60 (
53 addmenu "$device//$loopfile" \ 61 addmenu "$device//$device" \
54 "[ Install Samizdat to $device -- THIS DESTROYS ALL DATA ]" \ 62 "[ Install Samizdat to $device -- THIS DESTROYS ALL DATA ]" \
55 "menu-select boot-destroy-disk $device" 63 "menu-select boot-destroy-disk $device"
56 ) & 64 ) &
@@ -108,6 +116,13 @@ is_incomplete_samizdat_install()
108 [ "$partition_names" = 'samizdat-grub-incomplete:samizdat-plaintext-incomplete:samizdat-luks-encrypted-incomplete:' ] 116 [ "$partition_names" = 'samizdat-grub-incomplete:samizdat-plaintext-incomplete:samizdat-luks-encrypted-incomplete:' ]
109} 117}
110 118
119parent_device()
120{
121 local d="$1"
122 while [ "$d" != "${d%[0-9]}" ]; do d=${d%[0-9]}; done
123 printf '%s' "$d"
124}
125
111grok_block() 126grok_block()
112{ 127{
113 local mountpoint="/mnt/${DEVNAME##*/}" 128 local mountpoint="/mnt/${DEVNAME##*/}"
@@ -124,6 +139,11 @@ grok_block()
124 # TODO: make these names more unique 139 # TODO: make these names more unique
125 case "$ID_PART_ENTRY_NAME" in 140 case "$ID_PART_ENTRY_NAME" in
126 samizdat-grub-incomplete|samizdat-plaintext-incomplete|samizdat-luks-encrypted-incomplete) return ;; 141 samizdat-grub-incomplete|samizdat-plaintext-incomplete|samizdat-luks-encrypted-incomplete) return ;;
142 samizdat-grub|samizdat-plaintext|samizdat-luks-encrypted)
143 # TODO: Possibly only some of these are complete
144 addmenu_choose_native_root "$(parent_device "$DEVNAME")"
145 return
146 ;;
127 esac 147 esac
128 148
129 if [ "$ID_FS_TYPE" = hfsplus ] && ! fsck.hfsplus -q "$DEVNAME"; then 149 if [ "$ID_FS_TYPE" = hfsplus ] && ! fsck.hfsplus -q "$DEVNAME"; then