diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/xorriso-usb.sh | 13 |
1 files changed, 11 insertions, 2 deletions
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 | |||
31 | done | 31 | done |
32 | 32 | ||
33 | if [ -z "$INPUT_DEVICE" -a $# = 0 ]; then | 33 | if [ -z "$INPUT_DEVICE" -a $# = 0 ]; then |
34 | if [ -e debian-live-8.4.0-amd64-standard.btrfs -a -e layer.btrfs ]; then | 34 | if mountpoint -q /cdrom; then |
35 | INPUT_DEVICE=/cdrom | ||
36 | elif [ -e debian-live-8.4.0-amd64-standard.btrfs -a -e layer.btrfs ]; then | ||
35 | set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs | 37 | set -- debian-live-8.4.0-amd64-standard.btrfs layer.btrfs |
36 | else | 38 | else |
37 | die "no input device and no input btrfs layers: aborting." | 39 | die "no input device and no input btrfs layers: aborting." |
@@ -164,7 +166,14 @@ if [ "$QUICK_TEST" ]; then | |||
164 | fi | 166 | fi |
165 | 167 | ||
166 | if [ "$REPLACE_INITRD" ]; then | 168 | if [ "$REPLACE_INITRD" ]; then |
167 | initrd.sh || die 'initrd.sh failed' | 169 | # TODO: fix the paths so this backup isn't needed. What we need to do is |
170 | # 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 | ||
172 | mv "${vmlinuz_dir}" "${vmlinuz_dir}".bak | ||
173 | initrd.sh || { | ||
174 | mv "${vmlinuz_dir}.bak" "${vmlinuz_dir}" | ||
175 | die 'initrd.sh failed' | ||
176 | } | ||
168 | fi | 177 | fi |
169 | 178 | ||
170 | SILENT= | 179 | SILENT= |