summaryrefslogtreecommitdiff
path: root/src/xorriso-usb.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-04-02 12:02:40 -0400
committerAndrew Cady <d@jerkface.net>2017-04-02 12:02:40 -0400
commit4c4a7fec418bbc3943118e3224f9ebbd64197cc3 (patch)
tree1cdd241c2f3269e7f5764448aa912eafd5e92b28 /src/xorriso-usb.sh
parent662e3e15f6aa20c7f9b1dc8d6e28eb70c16a5bfa (diff)
xorriso-usb: changes that should not affect behavior
Diffstat (limited to 'src/xorriso-usb.sh')
-rw-r--r--src/xorriso-usb.sh41
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
3die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; }
4
3whole_device() 5whole_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 168find_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
168outdev=
169volid=SamizdatLive 176volid=SamizdatLive
170gpg_iso_path=gnupghome
171gnupghome=
172child_dir=$samizdat_child_dir/child.$$
173vmlinuz_dir=$samizdat_linux_dir 177vmlinuz_dir=$samizdat_linux_dir
174efi_dir=$samizdat_grub_efi_dir 178efi_dir=$samizdat_grub_efi_dir
179gpg_iso_path=gnupghome
175 180
176die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; }
177 181
178TEMP="$(getopt -o '' --long bootloader,reuse-child:,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" || 182outdev=
183gnupghome=
184child_dir=$samizdat_child_dir/child.$$
185
186eval set -- "$(getopt -o '' --long bootloader,reuse-child:,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" ||
179 die 'getopt error' 187 die 'getopt error'
180eval set -- "$TEMP"
181 188
182ADAM=; DETACH=; USB=y 189ADAM=; DETACH=; USB=y
183while [ $# -gt 0 ]; do 190while [ $# -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
196done 203done