summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinitramfs-tools/hooks/samizdat4
-rwxr-xr-xsrc/qemu.sh13
-rw-r--r--src/xorriso-usb.sh19
3 files changed, 25 insertions, 11 deletions
diff --git a/initramfs-tools/hooks/samizdat b/initramfs-tools/hooks/samizdat
index c02b8c6..5ec8688 100755
--- a/initramfs-tools/hooks/samizdat
+++ b/initramfs-tools/hooks/samizdat
@@ -10,7 +10,7 @@ PATH=/usr/local/bin:$PATH
10 10
11repo_execs=$(echo "${samizdat_initrd_files_dir}"/*) 11repo_execs=$(echo "${samizdat_initrd_files_dir}"/*)
12 12
13path_execs='mountpoint openvt rsync gpg2 gpg-agent pinentry-curses truncate cryptsetup mkfs.btrfs btrfs fsck.hfsplus' 13path_execs='mountpoint openvt rsync gpg2 gpg-agent pinentry-curses truncate cryptsetup mkfs.btrfs btrfs fsck.hfsplus wait_for_files samizdat-pinentry dynmenu src/samizdat-password-agent src/samizdat-gpg-agent'
14 14
15graft_paths=" 15graft_paths="
16 /bin/OpenVT=/bin/openvt 16 /bin/OpenVT=/bin/openvt
@@ -23,8 +23,6 @@ graft_paths="
23 23
24absolute_path_copies='/lib/terminfo/l/linux' 24absolute_path_copies='/lib/terminfo/l/linux'
25 25
26samizdat_execs='wait_for_files samizdat-pinentry dynmenu src/samizdat-password-agent src/samizdat-gpg-agent'
27for c in $samizdat_execs; do CopyExec ${samizdat_execs_dir}/$c /bin; done
28modules='loop xts dm-crypt hfs hfsplus' 26modules='loop xts dm-crypt hfs hfsplus'
29modules_dirs='kernel/drivers/net/ethernet kernel/fs/nls' 27modules_dirs='kernel/drivers/net/ethernet kernel/fs/nls'
30 28
diff --git a/src/qemu.sh b/src/qemu.sh
index 3b355b4..207ca68 100755
--- a/src/qemu.sh
+++ b/src/qemu.sh
@@ -24,11 +24,20 @@ initrd=${samizdat_isolinux_dir}/linux/initrd.img
24kernel=${samizdat_isolinux_dir}/linux/vmlinuz 24kernel=${samizdat_isolinux_dir}/linux/vmlinuz
25kcmdline='boot=samizdat components quiet splash' 25kcmdline='boot=samizdat components quiet splash'
26 26
27if [ "$QEMU_LOADS_LINUX" ]; then
28 set -- -initrd "$initrd" -kernel "$kernel" -append "$kcmdline"
29fi
30
31if [ "$USE_ISO" ]; then
32 set -- -cdrom "$iso"
33else
34 set -- -boot n
35fi
36
27sudo qemu-system-x86_64 -enable-kvm -smp 2 -m 640 -k en-us \ 37sudo qemu-system-x86_64 -enable-kvm -smp 2 -m 640 -k en-us \
28 -vga qxl \ 38 -vga qxl \
29 -net nic,vlan=0,model=virtio \ 39 -net nic,vlan=0,model=virtio \
30 -net "$NET" \ 40 -net "$NET" \
31 -rtc base=localtime \ 41 -rtc base=localtime \
32 -cdrom "$iso" \
33 -hda "$disk" \ 42 -hda "$disk" \
34 -initrd "$initrd" -kernel "$kernel" -append "$kcmdline" 43 "$@"
diff --git a/src/xorriso-usb.sh b/src/xorriso-usb.sh
index ef26cb2..0d7773d 100644
--- a/src/xorriso-usb.sh
+++ b/src/xorriso-usb.sh
@@ -12,29 +12,35 @@ efi_dir=$samizdat_grub_efi_dir
12 12
13die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; } 13die() { printf "%s: Error: %s\n" "$0" "$*" >&2; exit 1; }
14 14
15TEMP="$(getopt -o '' --long adam,usb,detach,in:,out:,test -n "$0" -- "$@")" || 15TEMP="$(getopt -o '' --long bootloader,adam,usb,detach,in:,out:,test -n "$0" -- "$@")" ||
16 die 'getopt error' 16 die 'getopt error'
17eval set -- "$TEMP" 17eval set -- "$TEMP"
18 18
19ADAM=; DETACH=; USB= 19ADAM=; DETACH=; USB=y
20while [ $# -gt 0 ]; do 20while [ $# -gt 0 ]; do
21 case "$1" in 21 case "$1" in
22 --adam) shift; ADAM=y;; 22 --adam) shift; ADAM=y;;
23 --usb) shift; USB=y;; 23 --bootloader) shift; BOOTLOADER_ONLY=y;;
24 --cdrom) shift; USB=;;
24 --detach) shift; DETACH=y;; 25 --detach) shift; DETACH=y;;
25 --test) shift; QUICK_TEST=y;; 26 --test) shift; QUICK_TEST=y;;
26 --out) CMDLINE_OUTDEV="$2"; shift 2;; 27 --out) CMDLINE_OUTDEV="$2"; USB=; shift 2;;
27 --in) INPUT_DEVICE="$2"; shift 2;; 28 --in) INPUT_DEVICE="$2"; shift 2;;
28 --) shift; break;; 29 --) shift; break;;
29 *) die 'getopt error';; 30 *) die 'getopt error';;
30 esac 31 esac
31done 32done
32 33
33if [ -z "$INPUT_DEVICE" -a $# = 0 ]; then 34if [ -z "$INPUT_DEVICE" -a $# = 0 -a -z "$BOOTLOADER_ONLY" ]; then
34 if mountpoint -q /cdrom; then 35 if mountpoint -q /cdrom; then
35 INPUT_DEVICE=/cdrom 36 INPUT_DEVICE=/cdrom
36 elif [ -e debian-live-8.4.0-amd64-standard.btrfs -a -e layer.btrfs ]; then 37 elif [ -e debian-live-8.4.0-amd64-standard.btrfs -a -e layer.btrfs ]; then
37 set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs 38 set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs
39 elif [ -e /srv/nbd.btrfs ]; then
40 set -- /srv/nbd.btrfs
41 elif [ "$(blockdev --getsz /dev/nbd0)" -gt 0 ]; then
42 (set -x; dd if=/dev/nbd0 of=/srv/nbd.btrfs~ && mv /srv/nbd.btrfs~ /srv/nbd.btrfs) || die "failed to copy network block device"
43 set -- /srv/nbd.btrfs
38 else 44 else
39 die "no input device and no input btrfs layers: aborting." 45 die "no input device and no input btrfs layers: aborting."
40 fi 46 fi
@@ -113,7 +119,7 @@ choose_outdev()
113 119
114generate_keys() 120generate_keys()
115{ 121{
116 if [ "$ADAM" ]; then 122 if [ "$ADAM" -o "$BOOTLOADER_ONLY" ]; then
117 kiki init || die 'kiki init failed' 123 kiki init || die 'kiki init failed'
118 gnupghome=/root/.gnupg 124 gnupghome=/root/.gnupg
119 else 125 else
@@ -170,6 +176,7 @@ if [ "$REPLACE_INITRD" ]; then
170 # support tftp pointing to the cdrom. This probably means a tftp directory 176 # support tftp pointing to the cdrom. This probably means a tftp directory
171 # that contains a symlink to /cdrom/linux which gets updated on success here 177 # that contains a symlink to /cdrom/linux which gets updated on success here
172 mv "${vmlinuz_dir}" "${vmlinuz_dir}".bak 178 mv "${vmlinuz_dir}" "${vmlinuz_dir}".bak
179 mkdir "${vmlinuz_dir}"
173 initrd.sh || { 180 initrd.sh || {
174 mv "${vmlinuz_dir}.bak" "${vmlinuz_dir}" 181 mv "${vmlinuz_dir}.bak" "${vmlinuz_dir}"
175 die 'initrd.sh failed' 182 die 'initrd.sh failed'