diff options
-rwxr-xr-x | xorriso-layer.sh | 19 |
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 @@ | |||
3 | outdev=debian-live-8.4.0-amd64-standard.btrfs.layered.iso | 3 | outdev=debian-live-8.4.0-amd64-standard.btrfs.layered.iso |
4 | indev=debian-live-8.4.0-amd64-standard.btrfs.iso | 4 | indev=debian-live-8.4.0-amd64-standard.btrfs.iso |
5 | volid=SamizdatLive | 5 | volid=SamizdatLive |
6 | btrfs_layer_iso_path=live/layer.btrfs | 6 | btrfs_layer_iso_path=live/layer%s.btrfs |
7 | btrfs_layer_filesystem="$1" | 7 | btrfs_layer_filesystem="$1" |
8 | 8 | ||
9 | die() { printf '%s\n' "$*"; exit 1; } | 9 | die() { 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 | |||
13 | i=0 | ||
14 | while [ $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)) | ||
21 | done | ||
22 | |||
23 | for arg; do echo "a=$arg"; done; exit; | ||
12 | 24 | ||
13 | set -ex | 25 | set -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 | |||
25 | mv -f "$outdev"~ "$outdev" | 38 | mv -f "$outdev"~ "$outdev" |