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
This commit is contained in:
parent
777875f2f2
commit
e7d99b5116
|
@ -47,32 +47,13 @@ Check_lockfile .lock
|
||||||
# Creating lock file
|
# Creating lock file
|
||||||
Create_lockfile .lock
|
Create_lockfile .lock
|
||||||
|
|
||||||
# Setting destination directory
|
case "${LH_INITRAMFS}" in
|
||||||
case "${LH_BINARY_IMAGES}" in
|
casper)
|
||||||
iso)
|
DESTDIR="binary/casper"
|
||||||
case "${LH_INITRAMFS}" in
|
|
||||||
casper)
|
|
||||||
DESTDIR="binary/casper"
|
|
||||||
;;
|
|
||||||
|
|
||||||
live-initramfs)
|
|
||||||
DESTDIR="binary/live"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
net)
|
live-initramfs)
|
||||||
DESTDIR="tftpboot"
|
|
||||||
;;
|
|
||||||
|
|
||||||
tar|usb-hdd)
|
|
||||||
DESTDIR="binary/live"
|
DESTDIR="binary/live"
|
||||||
|
|
||||||
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
|
|
||||||
if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BOOTLOADER}" = "syslinux" ]
|
|
||||||
then
|
|
||||||
DESTDIR="binary"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -88,39 +88,13 @@ Restore_cache cache/packages_binary
|
||||||
Install_package
|
Install_package
|
||||||
|
|
||||||
# Setting destination directory
|
# Setting destination directory
|
||||||
case "${LH_BINARY_IMAGES}" in
|
case "${LH_INITRAMFS}" in
|
||||||
iso)
|
casper)
|
||||||
case "${LH_INITRAMFS}" in
|
DESTDIR="binary/casper"
|
||||||
casper)
|
|
||||||
DESTDIR="binary/casper"
|
|
||||||
;;
|
|
||||||
|
|
||||||
live-initramfs)
|
|
||||||
DESTDIR="binary/live"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
net)
|
live-initramfs)
|
||||||
DESTDIR="tftpboot"
|
DESTDIR="binary/live"
|
||||||
;;
|
|
||||||
|
|
||||||
tar|usb-hdd)
|
|
||||||
case "${LH_INITRAMFS}" in
|
|
||||||
casper)
|
|
||||||
DESTDIR="binary/casper"
|
|
||||||
;;
|
|
||||||
|
|
||||||
live-initramfs)
|
|
||||||
DESTDIR="binary/live"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
|
|
||||||
if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BOOTLOADER}" = "syslinux" ]
|
|
||||||
then
|
|
||||||
DESTDIR="binary"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -166,9 +166,11 @@ Copy_syslinux_templates ()
|
||||||
|
|
||||||
if [ "${LH_SYSLINUX_MENU}" = "disabled" ]
|
if [ "${LH_SYSLINUX_MENU}" = "disabled" ]
|
||||||
then
|
then
|
||||||
cp -r "${TEMPLATES}"/normal/* ${SCREEN_PATH}
|
cp "${TEMPLATES}"/normal/*.cfg ${SCREEN_PATH}
|
||||||
|
cp "${TEMPLATES}"/normal/data/* ${DATA_PATH}
|
||||||
else
|
else
|
||||||
cp -r "${TEMPLATES}"/menu/* ${SCREEN_PATH}
|
cp "${TEMPLATES}"/menu/*.cfg ${SCREEN_PATH}
|
||||||
|
cp "${TEMPLATES}"/menu/data/* ${DATA_PATH}
|
||||||
# Grab menu binary from chroot
|
# Grab menu binary from chroot
|
||||||
MENUMODULE=$(grep 'menu.c32' ${TEMPLATES}/menu/header.cfg | sed 's,default\s*.*/\(.*menu.c32\)$,\1,g')
|
MENUMODULE=$(grep 'menu.c32' ${TEMPLATES}/menu/header.cfg | sed 's,default\s*.*/\(.*menu.c32\)$,\1,g')
|
||||||
cp chroot/usr/lib/syslinux/"${MENUMODULE}" ${DATA_PATH}
|
cp chroot/usr/lib/syslinux/"${MENUMODULE}" ${DATA_PATH}
|
||||||
|
@ -257,27 +259,36 @@ Configure_syslinux_templates ()
|
||||||
$template_file
|
$template_file
|
||||||
done
|
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" ]
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
||||||
then
|
then
|
||||||
while grep -q ^include ${SYSLINUX_PATH}/syslinux.cfg
|
while grep -q ^include ${SCREEN_PATH}/syslinux.cfg
|
||||||
do
|
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}
|
for FILE_PATH in ${INCLUDES}
|
||||||
do
|
do
|
||||||
FILE_NAME=$(basename ${FILE_PATH})
|
FILE_NAME=$(basename ${FILE_PATH})
|
||||||
sed -i -e '\@include '${FILE_PATH}'@ {
|
sed -i -e '\@include '${FILE_PATH}'@ {
|
||||||
r '${SYSLINUX_PATH}/${FILE_NAME}'
|
r '${SCREEN_PATH}/${FILE_NAME}'
|
||||||
d
|
d
|
||||||
}' ${SYSLINUX_PATH}/syslinux.cfg
|
}' ${SCREEN_PATH}/syslinux.cfg
|
||||||
# remove the files, which were included
|
# remove the files, which were included
|
||||||
if [ -e ${SYSLINUX_PATH}/${FILE_NAME} ]
|
if [ -e ${SCREEN_PATH}/${FILE_NAME} ]
|
||||||
then
|
then
|
||||||
rm ${SYSLINUX_PATH}/${FILE_NAME}
|
rm ${SCREEN_PATH}/${FILE_NAME}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
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
|
# Setting up common variables
|
||||||
|
@ -326,7 +337,20 @@ case "${LH_BINARY_IMAGES}" in
|
||||||
LIVE_INSTALL_KERNEL_PATH="/install"
|
LIVE_INSTALL_KERNEL_PATH="/install"
|
||||||
LIVE_SCREEN_PATH="/syslinux"
|
LIVE_SCREEN_PATH="/syslinux"
|
||||||
LIVE_DATA_PATH="${LIVE_SCREEN_PATH}/data"
|
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
|
esac
|
||||||
|
|
||||||
|
@ -408,12 +432,12 @@ LH_BOOTAPPEND_LIVE="$(echo ${LH_BOOTAPPEND_LIVE} | sed -e 's/ //')"
|
||||||
# Parameters are listed at: linux/Documentation/kernel-parameters.txt
|
# Parameters are listed at: linux/Documentation/kernel-parameters.txt
|
||||||
FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal"
|
FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal"
|
||||||
|
|
||||||
# Assembling kernel configuration
|
# Moving kernels into place
|
||||||
if [ ${LH_BINARY_IMAGES} = "net" ]
|
if [ "binary/${LH_INITRAMFS}" != "${KERNEL_PATH}" ]
|
||||||
then
|
then
|
||||||
mv ${SYSLINUX_PATH}/vmlinuz* ${KERNEL_PATH}
|
mv binary/${LH_INITRAMFS}/vmlinuz* ${KERNEL_PATH}
|
||||||
mv ${SYSLINUX_PATH}/initrd* ${KERNEL_PATH}
|
mv binary/${LH_INITRAMFS}/initrd* ${KERNEL_PATH}
|
||||||
mv ${SYSLINUX_PATH}/memtest ${KERNEL_PATH}
|
mv binary/${LH_INITRAMFS}/memtest ${KERNEL_PATH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Default entries
|
# Default entries
|
||||||
|
|
Loading…
Reference in New Issue