From 2b948633f002af0dd1e428bfeca0453cb6ac72c3 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 28 Mar 2017 09:25:16 -0400 Subject: use mountpoint /plaintext for samizdat-plaintext partition --- src/initrd/grok-block | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/initrd/grok-block') diff --git a/src/initrd/grok-block b/src/initrd/grok-block index 1152584..d3fe7a2 100755 --- a/src/initrd/grok-block +++ b/src/initrd/grok-block @@ -136,14 +136,15 @@ grok_block() esac # Skip partitions that we created. - # TODO: make these names more unique + # The name 'samizdat-plaintext' is recognized and used to add the menu entry, below. + case "$DEVNAME" in + # Avoid mouting this multiple times in case this script gets called multiple times, + # because while it's mounted, the dmsetup stuff will fail with device busy. + /dev/nbd0) [ -e /bootwait/samizdat-nbd-dev ] && return ;; + esac case "$ID_PART_ENTRY_NAME" in samizdat-grub-incomplete|samizdat-plaintext-incomplete|samizdat-luks-encrypted-incomplete) return ;; - samizdat-grub|samizdat-plaintext|samizdat-luks-encrypted) - # TODO: Possibly only some of these are complete - addmenu_choose_native_root "$(parent_device "$DEVNAME")" - return - ;; + samizdat-grub|samizdat-luks-encrypted) return ;; esac if [ "$ID_FS_TYPE" = hfsplus ] && ! fsck.hfsplus -q "$DEVNAME"; then @@ -168,6 +169,13 @@ grok_block() # TODO: Need option to boot the partitions we create # TODO: And what if we create partitions and then reboot the machine mid-install? + elif [ "$ID_PART_ENTRY_NAME" = samizdat-plaintext ]; then + # TODO: First ensure we can decrypt the key + if [ -e "$mountpoint"/disk.key ]; then + addmenu_choose_native_root "$(parent_device "$DEVNAME")" + fi + umount "$mountpoint" + elif [ "$DEVNAME" = /dev/nbd0 ]; then # This is our rootfs, over the network umount "$mountpoint" -- cgit v1.2.3