diff options
author | Eric Hameleers <alien@slackware.com> | 2017-09-10 19:34:14 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2017-09-10 19:34:14 +0200 |
commit | 78009b58e39793c8016be2faa04c0f62b7dfd918 (patch) | |
tree | 030b910d86932c26128e08725ac9c9381eb80232 | |
parent | 83f92293c826a2a5ba222ee1133401b56ac9fd3e (diff) | |
download | liveslak-78009b58e39793c8016be2faa04c0f62b7dfd918.tar.gz liveslak-78009b58e39793c8016be2faa04c0f62b7dfd918.tar.xz |
Prefer syslinux files available on the computer.
We will use our own copy of syslinux files only as a fallback,
because it is safer to use the versions of files that come
with syslinux on the computer which runs iso2usb.sh.
Diffstat (limited to '')
-rw-r--r-- | iso2usb.sh | 24 | ||||
-rwxr-xr-x | make_slackware_live.sh | 3 |
2 files changed, 24 insertions, 3 deletions
@@ -66,7 +66,18 @@ DOLUKS=0 REFRESH=0 # These tools are required by the script, we will check for their existence: -REQTOOLS="blkid cpio extlinux fdisk gdisk isoinfo mkdosfs sgdisk" +REQTOOLS="blkid cpio extlinux fdisk gdisk isoinfo mkdosfs sgdisk syslinux" + +# Path to syslinux files: +if [ -d /usr/share/syslinux ]; then + SYSLXLOC="/usr/share/syslinux" +elif [ -d /usr/lib/syslinux ]; then + SYSLXLOC="/usr/lib/syslinux" +else + # Should not happen... in this case we use what we have on the ISO + # and hope for the best: + SYSLXLOC="" +fi # Initialize more variables: CNTBASE="" @@ -714,6 +725,11 @@ echo "--- Making the USB drive '$TARGET' bootable using extlinux..." mv ${USBMNT}/boot/syslinux ${USBMNT}/boot/extlinux mv ${USBMNT}/boot/extlinux/isolinux.cfg ${USBMNT}/boot/extlinux/extlinux.conf rm -f ${USBMNT}/boot/extlinux/isolinux.* +if [ -f "$SYSLXLOC"/vesamenu.c32 ]; then + # We will use our own copy only as a fallback, + # because it is better to use the version that comes with syslinux: + cp -a ${SYSLXLOC}/vesamenu.c32 ${USBMNT}/boot/extlinux/ +fi extlinux --install ${USBMNT}/boot/extlinux if [ $EFIBOOT -eq 1 ]; then @@ -749,8 +765,10 @@ if mount |grep -qw ${US2MNT} ; then umount ${US2MNT} ; fi cleanup # Install a GPT compatible MBR record: -if [ -f /usr/share/syslinux/gptmbr.bin ]; then - cat /usr/share/syslinux/gptmbr.bin > ${TARGET} +if [ -f ${SYSLXLOC}/gptmbr.bin ]; then + cat ${SYSLXLOC}/gptmbr.bin > ${TARGET} +elif [ -f ${USBMNT}/boot/extlinux/gptmbr.bin ]; then + cat ${USBMNT}/boot/extlinux/gptmbr.bin > ${TARGET} else echo "*** Failed to make USB device bootable - 'gptmbr.bin' not found!" cleanup diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 37f95eb..f54e8f9 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -2227,6 +2227,9 @@ for SLFILE in message.txt f2.txt syslinux.cfg lang.cfg ; do -e "s/@SL_VERSION@/$SL_VERSION/g" fi done +# The iso2usb.sh script can use this copy of a MBR file as fallback: +cp -a /usr/share/syslinux/gptmbr.bin ${LIVE_STAGING}/boot/syslinux/ +# We have memtest in the syslinux bootmenu: mv ${LIVE_STAGING}/boot/syslinux/memtest ${LIVE_STAGING}/boot/ # Make use of proper console font if we have it available: |