summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxorriso-layer.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/xorriso-layer.sh b/xorriso-layer.sh
index b8f6ede..7ce4776 100755
--- a/xorriso-layer.sh
+++ b/xorriso-layer.sh
@@ -3,12 +3,24 @@
3outdev=debian-live-8.4.0-amd64-standard.btrfs.layered.iso 3outdev=debian-live-8.4.0-amd64-standard.btrfs.layered.iso
4indev=debian-live-8.4.0-amd64-standard.btrfs.iso 4indev=debian-live-8.4.0-amd64-standard.btrfs.iso
5volid=SamizdatLive 5volid=SamizdatLive
6btrfs_layer_iso_path=live/layer.btrfs 6btrfs_layer_iso_path=live/layer%s.btrfs
7btrfs_layer_filesystem="$1" 7btrfs_layer_filesystem="$1"
8 8
9die() { printf '%s\n' "$*"; exit 1; } 9die() { printf '%s\n' "$*"; exit 1; }
10 10
11[ -f "$btrfs_layer_filesystem" ] || die "Usage: $0 <layer.btrfs>" 11[ -f "$btrfs_layer_filesystem" ] || die "Usage: $0 <layer.btrfs> [layer2.btrfs ...]"
12
13i=0
14while [ $i -lt $# ]; do
15 arg=$1
16 [ $i -eq 0 ] && n='' || n=$((i + 1))
17 arg=$(printf "${btrfs_layer_iso_path}=%s" "$n" "$arg")
18 shift
19 set -- "$@" "$arg"
20 i=$((i + 1))
21done
22
23for arg; do echo "a=$arg"; done; exit;
12 24
13set -ex 25set -ex
14 26
@@ -21,5 +33,6 @@ time xorriso \
21 -return_with sorry 0 \ 33 -return_with sorry 0 \
22 -pathspecs on -overwrite on \ 34 -pathspecs on -overwrite on \
23 -add_plainly any \ 35 -add_plainly any \
24 "${btrfs_layer_iso_path}=${btrfs_layer_filesystem}" 36 "$@"
37
25mv -f "$outdev"~ "$outdev" 38mv -f "$outdev"~ "$outdev"