From c470b6ca6075b33c2c696ca34070671ee32a8d76 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 26 Mar 2017 07:30:09 -0400 Subject: 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. --- src/initrd/btrfs-create.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/initrd/btrfs-create.sh') diff --git a/src/initrd/btrfs-create.sh b/src/initrd/btrfs-create.sh index b5cc2c5..f31b14d 100644 --- a/src/initrd/btrfs-create.sh +++ b/src/initrd/btrfs-create.sh @@ -184,10 +184,18 @@ partition_new_hard_drive_DESTROYING_EVERYTHING() udevadm settle } +mark_partitions_as_complete() +{ + local dev="$1" + # TODO: Verify existing names + parted "$dev" -sm \ + name 1 samizdat-grub \ + name 2 samizdat-plaintext \ + name 3 samizdat-luks-encrypted +} + open_samizdat() { - local imgfile="$1" keyfile="$2" - open_samizdat_blockdev "$imgfile" "$keyfile" || return local blockdev=/dev/mapper/samizdatcrypt fs # For this part, we don't necessarily need the cdrom. @@ -211,12 +219,18 @@ init_samizdat_lodev() echo "$dev" } -open_samizdat_blockdev() +open_samizdat_blockdev_from_loop() { local imgfile="$1" keyfile="$2" dev - local cryptname=samizdatcrypt dev=$(losetup -f) && losetup "$dev" "$imgfile" || return + open_samizdat_blockdev "$dev" "$keyfile" +} +open_samizdat_blockdev() +{ + local dev="$1" keyfile="$2" + + local cryptname=samizdatcrypt gpg2 --verify "$keyfile" || return # The first --decrypt merely strips the signature. The option is # poorly named for that case. -- cgit v1.2.3