#!/bin/sh outdev=debian-live-8.4.0-amd64-standard.btrfs.isohybrid2 indev=debian-live-8.4.0-amd64-standard.iso volid=SamizdatLive squashfs_iso_path=live/filesystem.squashfs btrfs_iso_path=live/filesystem.btrfs btrfs_filesystem=debian-live-8.4.0-amd64-standard.btrfs gpg_iso_path=samizdat/gpg/gnupghome gnupghome=gnupghome secrets=secrets 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 set -ex # http://www.syslinux.org/wiki/index.php?title=Isohybrid # xorriso -as mkisofs \ # -o output.iso \ # -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \ # -c isolinux/boot.cat \ # -b isolinux/isolinux.bin \ # -no-emul-boot -boot-load-size 4 -boot-info-table \ # -eltorito-alt-boot \ # -e isolinux/efiboot.img \ # -no-emul-boot \ # -isohybrid-gpt-basdat \ # CD_root # http://ftp.nluug.nl/os/Linux/distr/slackware/slackware64-current/isolinux/ # http://ftp.nluug.nl/os/Linux/distr/slackware/slackware64-current/isolinux/efiboot.img # -boot_image isolinux dir=isolinux \ # -boot_image isolinux next -boot_image isolinux system_area=/usr/lib/ISOLINUX/isohdpfx.bin \ # -add "${btrfs_iso_path}=${btrfs_filesystem}" -- \ # -add "${gpg_iso_path}=${gnupghome}" -- \ # -rm "$squashfs_iso_path" -- \ # -rm_r isolinux live -- \ # -add isolinux=isolinux -- \ xorriso \ -drive_class clear_list all \ -outdev "$outdev"~ -indev "$indev" \ -report_about mishap \ -return_with sorry 0 \ -volid "$volid" \ -pathspecs on -overwrite on \ \ -rm_r / -- -pathspecs on -add live=isolinux/live/ isolinux -- \ \ -as mkisofs \ -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot \ -e isolinux/efiboot.img \ -no-emul-boot \ -isohybrid-gpt-basdat \ mv -f "$outdev"~ "$outdev"