From 153d299a41b9be4e15dab1ca29bb93a74bd2445d Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 29 Apr 2016 14:36:26 -0400 Subject: fix paths (in progress) --- src/xorriso.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 src/xorriso.sh (limited to 'src/xorriso.sh') diff --git a/src/xorriso.sh b/src/xorriso.sh new file mode 100755 index 0000000..5068d4b --- /dev/null +++ b/src/xorriso.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +outdev=samizdat.iso +indev=debian-live-8.4.0-amd64-standard.iso +volid=SamizdatLive +gpg_iso_path=gnupghome +gnupghome=gnupghome +secrets=secrets + +if [ $# = 0 ]; then + set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs +fi + +for fs; do + [ -f "$fs" ] || exit 1 + shift + set -- "$@" "rootfs/${fs##*/}=$fs" +done + +die() { printf '%s\n' "$*"; exit 1; } + +make_gnupghome() +{ + [ -d "$gnupghome" ] && return + local reset=$- + set -e + [ ! -d "$gnupghome".tmp ] || die "Error: refusing to overwrite $gnupghome.tmp" + [ ! -d "$secrets".tmp ] || die "Error: refusing to overwrite $secrets.tmp" + mkdir -p "$gnupghome".tmp "$secrets".tmp + local PATH="$HOME"/src/samizdat/src:"$PATH" NO_USE_RAMFS=y + NEW_GNUPGHOME="$gnupghome".tmp SECRETS_DIRECTORY="$secrets".tmp ~/src/samizdat/src/samizdat-make-key --adam + mv "$secrets".tmp "$secrets" + mv "$gnupghome".tmp "$gnupghome" + set -$reset +} + +make_gnupghome + +if [ grub-efi.sh -nt grub-efi ]; then + ./grub-efi.sh || die "Error: grub-efi.sh failed" +fi + +set -ex + +xorriso \ + -drive_class clear_list all \ + -outdev "$outdev"~ \ + -report_about mishap \ + -return_with sorry 0 \ + -volid "$volid" \ + -pathspecs on \ + \ + \ + -add "${gpg_iso_path}=${gnupghome}" -- \ + -add linux=isolinux/linux -- \ + -follow link -add "$@" -- -follow default \ + \ + \ + -as mkisofs -graft-points \ + -b grub/i386-pc/eltorito.img \ + -no-emul-boot -boot-info-table \ + --embedded-boot grub-efi/embedded.img \ + --protective-msdos-label \ + grub=grub-efi/grub + +mv -f "$outdev"~ "$outdev" -- cgit v1.2.3