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/menu-select | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/initrd/menu-select') diff --git a/src/initrd/menu-select b/src/initrd/menu-select index 129d685..4908b03 100755 --- a/src/initrd/menu-select +++ b/src/initrd/menu-select @@ -1,10 +1,11 @@ #!/bin/sh # usage: -# $0 boot-ram - use memory-only overlay -# $0 boot-new [dev name] [loop file] [megabytes] - create new luks-encrypted overlay -# $0 boot-overwrite [dev name] [loop file] [megabytes] - overwrite with new luks overlay -# $0 boot-luks [dev name] [loop file] - boot existing luks-encrypted overlay -# $0 boot-gpg [key id] [gnupg homedir] [???] - boot any device signed with the key +# $0 boot-ram - use memory-only overlay +# $0 boot-new [dev name] [loop file] [megabytes] - create new luks-encrypted overlay +# $0 boot-overwrite [dev name] [loop file] [megabytes] - overwrite with new luks overlay +# $0 boot-luks [dev name] [loop file] - boot existing luks-encrypted overlay +# $0 boot-destroy-disk [dev-name] - install to a fresh hard disk +# $0 boot-gpg [key id] [gnupg homedir] [???] - boot any device signed with the key . btrfs-create.sh . common.sh @@ -37,7 +38,7 @@ while [ $# -ge 1 ]; do done [ -z "$badopts" ] || error 'usage error' -[ $# -ge 2 -o "$1" = 'boot-ram' ] || error 'usage error' +[ $# -ge 2 -o "$1" = 'boot-ram' -o "$1" = boot-destroy-disk ] || error 'usage error' remountrw() { @@ -80,6 +81,16 @@ case "$1" in error } ;; + boot-destroy-disk) + dev="$2" + partition_new_hard_drive_DESTROYING_EVERYTHING "$dev" || error + + + # TODO: IMPLEMENT ME + # partition disk + # init_samizdat + + ;; boot-overwrite|boot-new|boot-luks) dev="$2" loopfile="$3" -- cgit v1.2.3