From 662e3e15f6aa20c7f9b1dc8d6e28eb70c16a5bfa Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 31 Mar 2017 13:26:45 -0400 Subject: xorriso-usb: cleanup/reorg that should not affect behavior --- src/xorriso-usb.sh | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/xorriso-usb.sh b/src/xorriso-usb.sh index 0adbb70..7017447 100644 --- a/src/xorriso-usb.sh +++ b/src/xorriso-usb.sh @@ -80,26 +80,41 @@ try_mount() mount -r "$1" /mnt && trap 'umount -l /mnt' EXIT } +verbosely() +{ + (set -x; "$@") +} + xorriso_cmd() { # input variables: - # INPUT_DEVICE - # NEED_STDIO + ## that do not affect the output ISO image: + + # SHOW_XORRISO_CMD # SILENT + # NEED_STDIO + + ## that do not vary by invocation: + # volid - # INPUT_DEVICE_COPIES - # REMOVE_BTRFS - # ADD_BTRFS # vmlinuz_dir + # efi_dir # gpg_iso_path + + ## that specify sources of input: + + # INPUT_DEVICE # gnupghome - # efi_dir + # $@ (btrfs filesystems) + # INPUT_DEVICE_COPIES + + ## boolean flags - # $@ = btrfs filesystems + # REMOVE_BTRFS + # ADD_BTRFS - ([ "$SHOW_CMD" ] && set -x; - ${NO_ACT:+ :} \ + ${SHOW_XORRISO_CMD:+ verbosely} ${NO_ACT:+ :} \ xorriso \ ${INPUT_DEVICE:+ -indev "$INPUT_DEVICE" } \ -outdev ${NEED_STDIO:+stdio:}"$outdev" \ @@ -133,7 +148,6 @@ xorriso_cmd() --embedded-boot "${efi_dir}"/embedded.img \ --protective-msdos-label \ grub="${efi_dir}"/grub - ) } run_xorriso() @@ -266,6 +280,6 @@ if [ "$REPLACE_INITRD" ]; then fi SILENT= -SHOW_CMD=y +SHOW_XORRISO_CMD=y run_xorriso "$@" -- cgit v1.2.3