diff options
Diffstat (limited to 'src/xorriso-usb.sh')
-rw-r--r-- | src/xorriso-usb.sh | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/xorriso-usb.sh b/src/xorriso-usb.sh index 7017447..04193e0 100644 --- a/src/xorriso-usb.sh +++ b/src/xorriso-usb.sh | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; } | ||
4 | |||
3 | whole_device() | 5 | whole_device() |
4 | { | 6 | { |
5 | case "$1" in | 7 | case "$1" in |
@@ -163,34 +165,39 @@ run_xorriso() | |||
163 | fi | 165 | fi |
164 | } | 166 | } |
165 | 167 | ||
166 | . samizdat-paths.sh || exit 1 | 168 | find_child() |
169 | { | ||
170 | # TODO: Lookup by IP address, MAC address | ||
171 | printf '%s' "$samizdat_child_dir"/child."$1" | ||
172 | } | ||
173 | |||
174 | . samizdat-paths.sh || die 'samizdat-path.sh not found' | ||
167 | 175 | ||
168 | outdev= | ||
169 | volid=SamizdatLive | 176 | volid=SamizdatLive |
170 | gpg_iso_path=gnupghome | ||
171 | gnupghome= | ||
172 | child_dir=$samizdat_child_dir/child.$$ | ||
173 | vmlinuz_dir=$samizdat_linux_dir | 177 | vmlinuz_dir=$samizdat_linux_dir |
174 | efi_dir=$samizdat_grub_efi_dir | 178 | efi_dir=$samizdat_grub_efi_dir |
179 | gpg_iso_path=gnupghome | ||
175 | 180 | ||
176 | die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; } | ||
177 | 181 | ||
178 | TEMP="$(getopt -o '' --long bootloader,reuse-child:,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" || | 182 | outdev= |
183 | gnupghome= | ||
184 | child_dir=$samizdat_child_dir/child.$$ | ||
185 | |||
186 | eval set -- "$(getopt -o '' --long bootloader,reuse-child:,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" || | ||
179 | die 'getopt error' | 187 | die 'getopt error' |
180 | eval set -- "$TEMP" | ||
181 | 188 | ||
182 | ADAM=; DETACH=; USB=y | 189 | ADAM=; DETACH=; USB=y |
183 | while [ $# -gt 0 ]; do | 190 | while [ $# -gt 0 ]; do |
184 | case "$1" in | 191 | case "$1" in |
185 | --adam) shift; ADAM=y;; | 192 | --) shift; break;; |
186 | --bootloader) shift; BOOTLOADER_ONLY=y;; | 193 | --adam) shift; ADAM=y;; |
187 | --cdrom) shift; USB=;; | 194 | --bootloader) shift; BOOTLOADER_ONLY=y;; |
188 | --detach) shift; DETACH=y;; | 195 | --cdrom) shift; USB=;; |
189 | --test) shift; QUICK_TEST=y;; | 196 | --detach) shift; DETACH=y;; |
190 | --out) CMDLINE_OUTDEV="$2"; USB=; shift 2;; | 197 | --in) INPUT_DEVICE="$2"; shift 2;; |
191 | --in) INPUT_DEVICE="$2"; shift 2;; | 198 | --out) CMDLINE_OUTDEV="$2"; USB=; shift 2;; |
192 | --reuse-child) REUSE_CHILD=y; child_dir=$samizdat_child_dir/child."$2"; shift 2;; | 199 | --reuse-child) REUSE_CHILD=y; child_dir="$(find_child "$2")"; shift 2;; |
193 | --) shift; break;; | 200 | --test) shift; QUICK_TEST=y;; |
194 | *) die 'getopt error';; | 201 | *) die 'getopt error';; |
195 | esac | 202 | esac |
196 | done | 203 | done |