summaryrefslogtreecommitdiff
path: root/src/initrd/menu-select
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/menu-select
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/menu-select')
-rwxr-xr-xsrc/initrd/menu-select23
1 files changed, 17 insertions, 6 deletions
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 @@
1#!/bin/sh 1#!/bin/sh
2# usage: 2# usage:
3# $0 boot-ram - use memory-only overlay 3# $0 boot-ram - use memory-only overlay
4# $0 boot-new [dev name] [loop file] [megabytes] - create new luks-encrypted overlay 4# $0 boot-new [dev name] [loop file] [megabytes] - create new luks-encrypted overlay
5# $0 boot-overwrite [dev name] [loop file] [megabytes] - overwrite with new luks overlay 5# $0 boot-overwrite [dev name] [loop file] [megabytes] - overwrite with new luks overlay
6# $0 boot-luks [dev name] [loop file] - boot existing luks-encrypted overlay 6# $0 boot-luks [dev name] [loop file] - boot existing luks-encrypted overlay
7# $0 boot-gpg [key id] [gnupg homedir] [???] - boot any device signed with the key 7# $0 boot-destroy-disk [dev-name] - install to a fresh hard disk
8# $0 boot-gpg [key id] [gnupg homedir] [???] - boot any device signed with the key
8 9
9. btrfs-create.sh 10. btrfs-create.sh
10. common.sh 11. common.sh
@@ -37,7 +38,7 @@ while [ $# -ge 1 ]; do
37done 38done
38[ -z "$badopts" ] || error 'usage error' 39[ -z "$badopts" ] || error 'usage error'
39 40
40[ $# -ge 2 -o "$1" = 'boot-ram' ] || error 'usage error' 41[ $# -ge 2 -o "$1" = 'boot-ram' -o "$1" = boot-destroy-disk ] || error 'usage error'
41 42
42remountrw() 43remountrw()
43{ 44{
@@ -80,6 +81,16 @@ case "$1" in
80 error 81 error
81 } 82 }
82 ;; 83 ;;
84 boot-destroy-disk)
85 dev="$2"
86 partition_new_hard_drive_DESTROYING_EVERYTHING "$dev" || error
87
88
89 # TODO: IMPLEMENT ME
90 # partition disk
91 # init_samizdat
92
93 ;;
83 boot-overwrite|boot-new|boot-luks) 94 boot-overwrite|boot-new|boot-luks)
84 dev="$2" 95 dev="$2"
85 loopfile="$3" 96 loopfile="$3"