diff options
author | Andrew Cady <d@jerkface.net> | 2016-04-27 20:32:01 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-04-27 20:32:16 -0400 |
commit | a29a3c1c2937891ac64754b3aa8a6e60fb9819fe (patch) | |
tree | 4e26adb60a4844c7405f16b8a10f4485ca3c7f47 /xorriso.test-efi.sh | |
parent | 023728a4564f27195d44b7806f9adfa45c4ec8e2 (diff) |
added efi test script
successfully booted the generated isohybrid image on both EFI macbook
pro and BIOS thinkpad; also qemu -cdrom and qemu -hda
Diffstat (limited to 'xorriso.test-efi.sh')
-rwxr-xr-x | xorriso.test-efi.sh | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/xorriso.test-efi.sh b/xorriso.test-efi.sh new file mode 100755 index 0000000..99c60db --- /dev/null +++ b/xorriso.test-efi.sh | |||
@@ -0,0 +1,83 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | outdev=test-efi.iso | ||
4 | indev=debian-live-8.4.0-amd64-standard.iso | ||
5 | volid=SamizdatLive | ||
6 | gpg_iso_path=gnupghome | ||
7 | gnupghome=gnupghome | ||
8 | secrets=secrets | ||
9 | |||
10 | if [ $# = 0 ]; then | ||
11 | set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs | ||
12 | fi | ||
13 | |||
14 | for fs; do | ||
15 | [ -f "$fs" ] || exit 1 | ||
16 | shift | ||
17 | set -- "$@" "rootfs/${fs##*/}=$fs" | ||
18 | done | ||
19 | |||
20 | die() { printf '%s\n' "$*"; exit 1; } | ||
21 | |||
22 | make_gnupghome() | ||
23 | { | ||
24 | [ -d "$gnupghome" ] && return | ||
25 | local reset=$- | ||
26 | set -e | ||
27 | [ ! -d "$gnupghome".tmp ] || die "Error: refusing to overwrite $gnupghome.tmp" | ||
28 | [ ! -d "$secrets".tmp ] || die "Error: refusing to overwrite $secrets.tmp" | ||
29 | mkdir -p "$gnupghome".tmp "$secrets".tmp | ||
30 | local PATH="$HOME"/src/samizdat/src:"$PATH" NO_USE_RAMFS=y | ||
31 | NEW_GNUPGHOME="$gnupghome".tmp SECRETS_DIRECTORY="$secrets".tmp ~/src/samizdat/src/samizdat-make-key --adam | ||
32 | mv "$secrets".tmp "$secrets" | ||
33 | mv "$gnupghome".tmp "$gnupghome" | ||
34 | set -$reset | ||
35 | } | ||
36 | |||
37 | make_gnupghome | ||
38 | |||
39 | set -ex | ||
40 | |||
41 | # http://www.syslinux.org/wiki/index.php?title=Isohybrid | ||
42 | # xorriso -as mkisofs \ | ||
43 | # -o output.iso \ | ||
44 | # -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \ | ||
45 | # -c isolinux/boot.cat \ | ||
46 | # -b isolinux/isolinux.bin \ | ||
47 | # -no-emul-boot -boot-load-size 4 -boot-info-table \ | ||
48 | # -eltorito-alt-boot \ | ||
49 | # -e isolinux/efiboot.img \ | ||
50 | # -no-emul-boot \ | ||
51 | # -isohybrid-gpt-basdat \ | ||
52 | # CD_root | ||
53 | |||
54 | # http://ftp.nluug.nl/os/Linux/distr/slackware/slackware64-current/isolinux/ | ||
55 | # http://ftp.nluug.nl/os/Linux/distr/slackware/slackware64-current/isolinux/efiboot.img | ||
56 | |||
57 | xorriso \ | ||
58 | -drive_class clear_list all \ | ||
59 | -outdev "$outdev"~ \ | ||
60 | -report_about mishap \ | ||
61 | -return_with sorry 0 \ | ||
62 | -volid "$volid" \ | ||
63 | -pathspecs on \ | ||
64 | \ | ||
65 | \ | ||
66 | -add "${gpg_iso_path}=${gnupghome}" -- \ | ||
67 | -add linux=isolinux/linux -- \ | ||
68 | \ | ||
69 | \ | ||
70 | -as mkisofs -graft-points \ | ||
71 | -b boot/grub/i386-pc/eltorito.img \ | ||
72 | -no-emul-boot -boot-info-table \ | ||
73 | --embedded-boot /home/d/src/grb/rescue/embedded.img \ | ||
74 | --protective-msdos-label \ | ||
75 | boot=/home/d/src/grb/rescue/iso/boot | ||
76 | |||
77 | # -add isolinux -- \ | ||
78 | # -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ | ||
79 | # -isohybrid-gpt-basdat | ||
80 | |||
81 | # -add boot/eltorito.img=/home/d/src/grb/rescue/iso/boot/grub/i386-pc/eltorito.img -- \ | ||
82 | |||
83 | mv -f "$outdev"~ "$outdev" | ||