summaryrefslogtreecommitdiff
path: root/src/initrd/btrfs-create.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-03-25 15:22:08 -0400
committerAndrew Cady <d@jerkface.net>2017-03-25 15:22:08 -0400
commit8d64781d948fd211045f1e71837772a68f07fff7 (patch)
tree4e15162ec0c7400277144e8aa490b726f4dab1bf /src/initrd/btrfs-create.sh
parent492c1ac5030d0826afc1d69ff3b2ec9ffa0345f2 (diff)
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).
Diffstat (limited to 'src/initrd/btrfs-create.sh')
-rw-r--r--src/initrd/btrfs-create.sh15
1 files changed, 15 insertions, 0 deletions
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()
168 [ "$n" != 1 ] 168 [ "$n" != 1 ]
169} 169}
170 170
171partition_new_hard_drive_DESTROYING_EVERYTHING()
172{
173 local target="$1"
174 # [ "$(parted -sm "$target" print | grep -c :)" = 1 ] || return
175 parted "$target" -sm \
176 unit B \
177 mklabel gpt \
178 mkpart primary 32KiB 4MiB \
179 set 1 bios_grub on \
180 mkpart primary btrfs 4MiB 1GiB \
181 name 2 gpg-incomplete \
182 mkpart primary 1GiB 100% \
183 name 3 luks-incomplete
184}
185
171open_samizdat() 186open_samizdat()
172{ 187{
173 local imgfile="$1" keyfile="$2" 188 local imgfile="$1" keyfile="$2"