Fixing some coding style issues.
This commit is contained in:
parent
034a067667
commit
e743c23cd7
|
@ -83,6 +83,7 @@ Syslinux_memtest_entry ()
|
|||
KERNEL="${3}"
|
||||
|
||||
MEMTEST="${MEMTEST}\nLABEL ${LABEL}\n"
|
||||
|
||||
# Write the menu label if the syslinux menu is being use
|
||||
MEMTEST="${MEMTEST}\tMENU LABEL ${MENULABEL}\n"
|
||||
MEMTEST="${MEMTEST}\tkernel ${LIVE_KERNEL_PATH}/${KERNEL}\n"
|
||||
|
@ -100,17 +101,20 @@ Syslinux_live_entry ()
|
|||
|
||||
if [ ${LH_BINARY_IMAGES} = "iso" ] || [ ${LH_BINARY_IMAGES} = "usb-hdd" ]
|
||||
then
|
||||
num=$(ls -1 ${KERNEL_PATH}|grep 'vmlinuz[0-9]\+$'|wc -l)
|
||||
num=$(($num +1))
|
||||
NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz[0-9]\+$' | wc -l)"
|
||||
NUMBER="$((${NUMBER} +1))"
|
||||
|
||||
# Note: ISOLINUX will not find the kernel if the name ends in ".img".
|
||||
mv ${KERNEL_PATH}/${KERNEL} ${KERNEL_PATH}/vmlinuz${num}
|
||||
mv ${KERNEL_PATH}/${INITRD} ${KERNEL_PATH}/initrd${num}.img
|
||||
KERNEL=vmlinuz${num}
|
||||
INITRD=initrd${num}.img
|
||||
mv ${KERNEL_PATH}/${KERNEL} ${KERNEL_PATH}/vmlinuz${NUMBER}
|
||||
mv ${KERNEL_PATH}/${INITRD} ${KERNEL_PATH}/initrd${NUMBER}.img
|
||||
|
||||
KERNEL=vmlinuz${NUMBER}
|
||||
INITRD=initrd${NUMBER}.img
|
||||
fi
|
||||
|
||||
# Regular kernel
|
||||
LINUX_LIVE="${LINUX_LIVE}\nLABEL ${LABEL}\n"
|
||||
|
||||
# Write the menu label if the syslinux menu is being use
|
||||
LINUX_LIVE="${LINUX_LIVE}\tMENU LABEL ${MENULABEL}\n"
|
||||
LINUX_LIVE="${LINUX_LIVE}\tkernel ${LIVE_KERNEL_PATH}/${KERNEL}\n"
|
||||
|
@ -118,6 +122,7 @@ Syslinux_live_entry ()
|
|||
|
||||
# Failsafe kernel
|
||||
LINUX_LIVE="${LINUX_LIVE}\nLABEL ${LABEL}failsafe\n"
|
||||
|
||||
# Write the menu label if the syslinux menu is being use
|
||||
LINUX_LIVE="${LINUX_LIVE}\tMENU LABEL ${MENULABEL} Failsafe\n"
|
||||
LINUX_LIVE="${LINUX_LIVE}\tkernel ${LIVE_KERNEL_PATH}/${KERNEL}\n"
|
||||
|
@ -143,12 +148,15 @@ Syslinux_install_entry ()
|
|||
Install)
|
||||
TAPPEND="${APPEND}"
|
||||
;;
|
||||
|
||||
Expert)
|
||||
TAPPEND="priority=low ${APPEND}"
|
||||
;;
|
||||
|
||||
Rescue)
|
||||
TAPPEND="rescue/enable=true ${APPEND}"
|
||||
;;
|
||||
|
||||
Auto)
|
||||
TAPPEND="rescue/enable=true ${APPEND}"
|
||||
;;
|
||||
|
@ -172,6 +180,7 @@ Copy_syslinux_templates ()
|
|||
else
|
||||
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}
|
||||
|
@ -241,8 +250,10 @@ Copy_syslinux_templates ()
|
|||
|
||||
Configure_syslinux_templates ()
|
||||
{
|
||||
templates=$(find ${SYSLINUX_PATH} -type f -name '*.cfg' -o -name '*.txt')
|
||||
for template_file in ${templates}; do
|
||||
templates="$(find ${SYSLINUX_PATH} -type f -name '*.cfg' -o -name '*.txt')"
|
||||
|
||||
for template_file in ${templates}
|
||||
do
|
||||
sed -i -e "s@{\$LINUX_LIVE}@${LINUX_LIVE}@" \
|
||||
-e "s@{\$LINUX_INSTALL}@${LINUX_INSTALL}@" \
|
||||
-e "s@{\$MEMTEST}@${MEMTEST}@" \
|
||||
|
@ -265,20 +276,24 @@ Configure_syslinux_templates ()
|
|||
while grep -q ^include ${SCREEN_PATH}/syslinux.cfg
|
||||
do
|
||||
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 '${SCREEN_PATH}/${FILE_NAME}'
|
||||
d
|
||||
}' ${SCREEN_PATH}/syslinux.cfg
|
||||
|
||||
# remove the files, which were included
|
||||
if [ -e ${SCREEN_PATH}/${FILE_NAME} ]
|
||||
then
|
||||
rm ${SCREEN_PATH}/${FILE_NAME}
|
||||
rm -f ${SCREEN_PATH}/${FILE_NAME}
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# 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" ]
|
||||
|
@ -337,6 +352,7 @@ case "${LH_BINARY_IMAGES}" in
|
|||
LIVE_INSTALL_KERNEL_PATH="/install"
|
||||
LIVE_SCREEN_PATH="/syslinux"
|
||||
LIVE_DATA_PATH="${LIVE_SCREEN_PATH}/data"
|
||||
|
||||
# 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" ]
|
||||
|
@ -350,6 +366,7 @@ case "${LH_BINARY_IMAGES}" in
|
|||
LIVE_SCREEN_PATH=""
|
||||
LIVE_DATA_PATH=""
|
||||
fi
|
||||
|
||||
MEDIA="hd-media"
|
||||
;;
|
||||
esac
|
||||
|
@ -531,6 +548,7 @@ case "${LH_BINARY_IMAGES}" in
|
|||
cp "${LH_SYSLINUX_CFG}" ${SCREEN_PATH}/isolinux.cfg
|
||||
fi
|
||||
;;
|
||||
|
||||
net)
|
||||
case "${LH_CHROOT_BUILD}" in
|
||||
enabled)
|
||||
|
@ -553,6 +571,7 @@ case "${LH_BINARY_IMAGES}" in
|
|||
cp "${LH_SYSLINUX_CFG}" ${KERNEL_PATH}/pxelinux.cfg/default
|
||||
fi
|
||||
;;
|
||||
|
||||
tar|usb-hdd)
|
||||
case "${LH_CHROOT_BUILD}" in
|
||||
enabled)
|
||||
|
|
Loading…
Reference in New Issue