From 4c4a7fec418bbc3943118e3224f9ebbd64197cc3 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 2 Apr 2017 12:02:40 -0400 Subject: xorriso-usb: changes that should not affect behavior --- src/xorriso-usb.sh | 41 ++++++++++++++++++++++++----------------- 1 file 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 @@ #!/bin/bash +die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; } + whole_device() { case "$1" in @@ -163,34 +165,39 @@ run_xorriso() fi } -. samizdat-paths.sh || exit 1 +find_child() +{ + # TODO: Lookup by IP address, MAC address + printf '%s' "$samizdat_child_dir"/child."$1" +} + +. samizdat-paths.sh || die 'samizdat-path.sh not found' -outdev= volid=SamizdatLive -gpg_iso_path=gnupghome -gnupghome= -child_dir=$samizdat_child_dir/child.$$ vmlinuz_dir=$samizdat_linux_dir efi_dir=$samizdat_grub_efi_dir +gpg_iso_path=gnupghome -die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; } -TEMP="$(getopt -o '' --long bootloader,reuse-child:,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" || +outdev= +gnupghome= +child_dir=$samizdat_child_dir/child.$$ + +eval set -- "$(getopt -o '' --long bootloader,reuse-child:,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" || die 'getopt error' -eval set -- "$TEMP" ADAM=; DETACH=; USB=y while [ $# -gt 0 ]; do case "$1" in - --adam) shift; ADAM=y;; - --bootloader) shift; BOOTLOADER_ONLY=y;; - --cdrom) shift; USB=;; - --detach) shift; DETACH=y;; - --test) shift; QUICK_TEST=y;; - --out) CMDLINE_OUTDEV="$2"; USB=; shift 2;; - --in) INPUT_DEVICE="$2"; shift 2;; - --reuse-child) REUSE_CHILD=y; child_dir=$samizdat_child_dir/child."$2"; shift 2;; - --) shift; break;; + --) shift; break;; + --adam) shift; ADAM=y;; + --bootloader) shift; BOOTLOADER_ONLY=y;; + --cdrom) shift; USB=;; + --detach) shift; DETACH=y;; + --in) INPUT_DEVICE="$2"; shift 2;; + --out) CMDLINE_OUTDEV="$2"; USB=; shift 2;; + --reuse-child) REUSE_CHILD=y; child_dir="$(find_child "$2")"; shift 2;; + --test) shift; QUICK_TEST=y;; *) die 'getopt error';; esac done -- cgit v1.2.3