summaryrefslogtreecommitdiff
path: root/helpers/lh_binary_syslinux
diff options
context:
space:
mode:
authorJesse Hathaway <jesse@mbuki-mvuki.org>2007-10-15 18:04:48 -0400
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:27 +0100
commite7d99b5116495b5727c9271963d1901760867c58 (patch)
treebeec1626d851ebbd33bf0259f184d241a29bdadd /helpers/lh_binary_syslinux
parent777875f2f23cc241510bc65e224cb89df2162b46 (diff)
downloadvyos-live-build-e7d99b5116495b5727c9271963d1901760867c58.tar.gz
vyos-live-build-e7d99b5116495b5727c9271963d1901760867c58.zip
lh_binary_syslinux: fix usb-hdd etch images
I did not realize that the syslinux boot methods, iso, net, & hdd do not have feature parity for any given version. As per old comments etch syslinux v3.31 does not support sub directories on FAT images
Diffstat (limited to 'helpers/lh_binary_syslinux')
-rwxr-xr-xhelpers/lh_binary_syslinux58
1 files changed, 41 insertions, 17 deletions
diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux
index 8732c1c70..e52c5d372 100755
--- a/helpers/lh_binary_syslinux
+++ b/helpers/lh_binary_syslinux
@@ -166,9 +166,11 @@ Copy_syslinux_templates ()
if [ "${LH_SYSLINUX_MENU}" = "disabled" ]
then
- cp -r "${TEMPLATES}"/normal/* ${SCREEN_PATH}
+ cp "${TEMPLATES}"/normal/*.cfg ${SCREEN_PATH}
+ cp "${TEMPLATES}"/normal/data/* ${DATA_PATH}
else
- cp -r "${TEMPLATES}"/menu/* ${SCREEN_PATH}
+ cp "${TEMPLATES}"/menu/*.cfg ${SCREEN_PATH}
+ cp "${TEMPLATES}"/menu/data/* ${DATA_PATH}
# Grab menu binary from chroot
MENUMODULE=$(grep 'menu.c32' ${TEMPLATES}/menu/header.cfg | sed 's,default\s*.*/\(.*menu.c32\)$,\1,g')
cp chroot/usr/lib/syslinux/"${MENUMODULE}" ${DATA_PATH}
@@ -257,27 +259,36 @@ Configure_syslinux_templates ()
$template_file
done
- # Syslinux v3.31 in etch does not support include statement
+ # Syslinux v3.31 in etch does not support include statements
if [ "${LH_DISTRIBUTION}" = "etch" ]
then
- while grep -q ^include ${SYSLINUX_PATH}/syslinux.cfg
+ while grep -q ^include ${SCREEN_PATH}/syslinux.cfg
do
- INCLUDES=$(grep ^include ${SYSLINUX_PATH}/syslinux.cfg |awk '{print $2}')
+ INCLUDES=$(grep ^include ${SCREEN_PATH}/syslinux.cfg |awk '{print $2}')
for FILE_PATH in ${INCLUDES}
do
FILE_NAME=$(basename ${FILE_PATH})
sed -i -e '\@include '${FILE_PATH}'@ {
- r '${SYSLINUX_PATH}/${FILE_NAME}'
- d
- }' ${SYSLINUX_PATH}/syslinux.cfg
+ r '${SCREEN_PATH}/${FILE_NAME}'
+ d
+ }' ${SCREEN_PATH}/syslinux.cfg
# remove the files, which were included
- if [ -e ${SYSLINUX_PATH}/${FILE_NAME} ]
+ if [ -e ${SCREEN_PATH}/${FILE_NAME} ]
then
- rm ${SYSLINUX_PATH}/${FILE_NAME}
+ rm ${SCREEN_PATH}/${FILE_NAME}
fi
done
done
- fi
+ # Syslinux v3.31 in etch does not support sub directories, /path/kernel,
+ # when using FAT hard drive images, remove leading /'s
+ if [ "${LH_BINARY_IMAGES}" = "usb-hdd" ]
+ then
+ for FILE in ${SCREEN_PATH}/syslinux.cfg ${SCREEN_PATH}/boot.txt
+ do
+ sed -i -e 's@/@@' ${FILE}
+ done
+ fi
+ fi
}
# Setting up common variables
@@ -326,7 +337,20 @@ case "${LH_BINARY_IMAGES}" in
LIVE_INSTALL_KERNEL_PATH="/install"
LIVE_SCREEN_PATH="/syslinux"
LIVE_DATA_PATH="${LIVE_SCREEN_PATH}/data"
- MEDIA="hd-media"
+ # Syslinux v3.31 in etch does not support sub directories, /path/kernel,
+ # when using FAT hard drive images
+ if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BINARY_IMAGES}" = "usb-hdd" ]
+ then
+ SYSLINUX_PATH="binary"
+ KERNEL_PATH="binary"
+ SCREEN_PATH="binary"
+ DATA_PATH="binary"
+ LIVE_KERNEL_PATH=""
+ LIVE_INSTALL_KERNEL_PATH=""
+ LIVE_SCREEN_PATH=""
+ LIVE_DATA_PATH=""
+ fi
+ MEDIA="hd-media"
;;
esac
@@ -408,12 +432,12 @@ LH_BOOTAPPEND_LIVE="$(echo ${LH_BOOTAPPEND_LIVE} | sed -e 's/ //')"
# Parameters are listed at: linux/Documentation/kernel-parameters.txt
FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal"
-# Assembling kernel configuration
-if [ ${LH_BINARY_IMAGES} = "net" ]
+# Moving kernels into place
+if [ "binary/${LH_INITRAMFS}" != "${KERNEL_PATH}" ]
then
- mv ${SYSLINUX_PATH}/vmlinuz* ${KERNEL_PATH}
- mv ${SYSLINUX_PATH}/initrd* ${KERNEL_PATH}
- mv ${SYSLINUX_PATH}/memtest ${KERNEL_PATH}
+ mv binary/${LH_INITRAMFS}/vmlinuz* ${KERNEL_PATH}
+ mv binary/${LH_INITRAMFS}/initrd* ${KERNEL_PATH}
+ mv binary/${LH_INITRAMFS}/memtest ${KERNEL_PATH}
fi
# Default entries