From 8d64781d948fd211045f1e71837772a68f07fff7 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 25 Mar 2017 15:22:08 -0400 Subject: Initial support for installing to an empty disk device Right now, this just installs a new GPT partition table on the disk, with the partitions samizdat needs. Then nothing happens because nothing else is implemented. It will only allow a disk to be wiped like this if there are no partitions on the disk (or if the only partitions on the disk are partially-installed samizdat partitions). --- src/initrd/btrfs-create.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/initrd/btrfs-create.sh') diff --git a/src/initrd/btrfs-create.sh b/src/initrd/btrfs-create.sh index c13d981..5d359a9 100644 --- a/src/initrd/btrfs-create.sh +++ b/src/initrd/btrfs-create.sh @@ -168,6 +168,21 @@ filesystem_incomplete() [ "$n" != 1 ] } +partition_new_hard_drive_DESTROYING_EVERYTHING() +{ + local target="$1" + # [ "$(parted -sm "$target" print | grep -c :)" = 1 ] || return + parted "$target" -sm \ + unit B \ + mklabel gpt \ + mkpart primary 32KiB 4MiB \ + set 1 bios_grub on \ + mkpart primary btrfs 4MiB 1GiB \ + name 2 gpg-incomplete \ + mkpart primary 1GiB 100% \ + name 3 luks-incomplete +} + open_samizdat() { local imgfile="$1" keyfile="$2" -- cgit v1.2.3