diff options
author | Andrew Cady <d@jerkface.net> | 2017-03-26 07:30:09 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2017-03-26 07:49:54 -0400 |
commit | c470b6ca6075b33c2c696ca34070671ee32a8d76 (patch) | |
tree | 782c311be2835b60c06e3dcc9892a63ad5793a6a /src/initrd/grok-block | |
parent | 217713edcd3a27d21577f8c4765f5b0d89981c7b (diff) |
Implement booting already-installed native install
This option is only available if the partitions have been renamed to
indicate finalization of the install.
The code that finalizes the install by renaming the partitions is
available, but not yet run after the install.
Diffstat (limited to 'src/initrd/grok-block')
-rwxr-xr-x | src/initrd/grok-block | 22 |
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 | ||
39 | addmenu_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 | |||
39 | addmenu_makeroot() | 47 | addmenu_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 | ||
119 | parent_device() | ||
120 | { | ||
121 | local d="$1" | ||
122 | while [ "$d" != "${d%[0-9]}" ]; do d=${d%[0-9]}; done | ||
123 | printf '%s' "$d" | ||
124 | } | ||
125 | |||
111 | grok_block() | 126 | grok_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 |