summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rwxr-xr-xxorriso.sh25
2 files changed, 26 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index f5e47d8..d4b44b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@ boot
4var 4var
5isolinux/live/initrd.img 5isolinux/live/initrd.img
6isolinux/live/vmlinuz 6isolinux/live/vmlinuz
7gnupghome
8secrets
diff --git a/xorriso.sh b/xorriso.sh
index 29e1ff6..784f2ef 100755
--- a/xorriso.sh
+++ b/xorriso.sh
@@ -6,6 +6,28 @@ volid=SamizdatLive
6squashfs_iso_path=live/filesystem.squashfs 6squashfs_iso_path=live/filesystem.squashfs
7btrfs_iso_path=live/filesystem.btrfs 7btrfs_iso_path=live/filesystem.btrfs
8btrfs_filesystem=debian-live-8.4.0-amd64-standard.btrfs 8btrfs_filesystem=debian-live-8.4.0-amd64-standard.btrfs
9gpg_iso_path=samizdat/gpg/gnupghome
10gnupghome=gnupghome
11secrets=secrets
12
13die() { printf '%s\n' "$*"; exit 1; }
14
15make_gnupghome()
16{
17 [ -d "$gnupghome" ] && return
18 local reset=$-
19 set -e
20 [ ! -d "$gnupghome".tmp ] || die "Error: refusing to overwrite $gnupghome.tmp"
21 [ ! -d "$secrets".tmp ] || die "Error: refusing to overwrite $secrets.tmp"
22 mkdir -p "$gnupghome".tmp "$secrets".tmp
23 local PATH="$HOME"/src/samizdat/src:"$PATH" NO_USE_RAMFS=y
24 NEW_GNUPGHOME="$gnupghome".tmp SECRETS_DIRECTORY="$secrets".tmp ~/src/samizdat/src/samizdat-make-key --adam
25 mv "$secrets".tmp "$secrets"
26 mv "$gnupghome".tmp "$gnupghome"
27 set -$reset
28}
29
30make_gnupghome
9 31
10set -ex 32set -ex
11 33
@@ -18,5 +40,6 @@ xorriso \
18 -pathspecs on -overwrite on \ 40 -pathspecs on -overwrite on \
19 -rm "$squashfs_iso_path" -- \ 41 -rm "$squashfs_iso_path" -- \
20 -add_plainly any \ 42 -add_plainly any \
21 "${btrfs_iso_path}=${btrfs_filesystem}" 43 "${btrfs_iso_path}=${btrfs_filesystem}" \
44 "${gpg_iso_path}=${gnupghome}"
22mv -f "$outdev"~ "$outdev" 45mv -f "$outdev"~ "$outdev"