From c2482125126bb6aeaa9894415a079de89d5fb1aa Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 30 Apr 2016 02:14:26 -0400 Subject: shitty workaround for pxe with inappropriate symlink i haven't had enough sleep to deal with path changes again --- src/xorriso-usb.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/xorriso-usb.sh') diff --git a/src/xorriso-usb.sh b/src/xorriso-usb.sh index 100288d..ef26cb2 100644 --- a/src/xorriso-usb.sh +++ b/src/xorriso-usb.sh @@ -31,7 +31,9 @@ while [ $# -gt 0 ]; do done if [ -z "$INPUT_DEVICE" -a $# = 0 ]; then - if [ -e debian-live-8.4.0-amd64-standard.btrfs -a -e layer.btrfs ]; then + if mountpoint -q /cdrom; then + INPUT_DEVICE=/cdrom + elif [ -e debian-live-8.4.0-amd64-standard.btrfs -a -e layer.btrfs ]; then set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs else die "no input device and no input btrfs layers: aborting." @@ -164,7 +166,14 @@ if [ "$QUICK_TEST" ]; then fi if [ "$REPLACE_INITRD" ]; then - initrd.sh || die 'initrd.sh failed' + # TODO: fix the paths so this backup isn't needed. What we need to do is + # support tftp pointing to the cdrom. This probably means a tftp directory + # that contains a symlink to /cdrom/linux which gets updated on success here + mv "${vmlinuz_dir}" "${vmlinuz_dir}".bak + initrd.sh || { + mv "${vmlinuz_dir}.bak" "${vmlinuz_dir}" + die 'initrd.sh failed' + } fi SILENT= -- cgit v1.2.3