syslinux: split syslinux configuration in multiple files

Normal and menu templates share a lot of common stuff and then
a splited syslinux.cfg is much better to handle that.
This commit is contained in:
Otavio Salvador 2007-09-25 14:52:24 -03:00 committed by Daniel Baumann
parent 8fa8db6324
commit 80ffa22281
9 changed files with 71 additions and 65 deletions

View File

@ -354,8 +354,10 @@ case "${LH_BINARY_IMAGES}" in
# Syslinux templates # Syslinux templates
cp -r "${TEMPLATES}"/common/* binary/isolinux cp -r "${TEMPLATES}"/common/* binary/isolinux
if [ "${LH_SYSLINUX_MENU}" != "disabled" ] if [ "${LH_SYSLINUX_MENU}" = "disabled" ]
then then
cp -r "${TEMPLATES}"/normal/* binary/isolinux
else
cp -r "${TEMPLATES}"/menu/* binary/isolinux cp -r "${TEMPLATES}"/menu/* binary/isolinux
fi fi
@ -411,7 +413,7 @@ case "${LH_BINARY_IMAGES}" in
# Copying menu module # Copying menu module
if [ "${LH_SYSLINUX_MENU}" != "disabled" ] if [ "${LH_SYSLINUX_MENU}" != "disabled" ]
then then
MENUPATH="$(grep 'menu.c32' binary/isolinux/isolinux.cfg | sed 's,DEFAULT\s*\(.*menu.c32\)$,\1,g')" MENUPATH="$(grep 'menu.c32' binary/isolinux/header.cfg | sed 's,DEFAULT\s*\(.*menu.c32\)$,\1,g')"
MENUMODULE="$(basename ${MENUPATH})" MENUMODULE="$(basename ${MENUPATH})"
mkdir -p binary/isolinux/"$(dirname ${MENUPATH})" mkdir -p binary/isolinux/"$(dirname ${MENUPATH})"
@ -426,7 +428,7 @@ case "${LH_BINARY_IMAGES}" in
else else
if [ "${LH_SYSLINUX_MENU}" != "disabled" ] if [ "${LH_SYSLINUX_MENU}" != "disabled" ]
then then
SPLASHPATH="$(grep -i 'MENU BACKGROUND' binary/isolinux/isolinux.cfg | sed 's,MENU\sBACKGROUND\s*\(.*\)$,\1,g')" SPLASHPATH="$(grep -i 'menu background' binary/isolinux/header.cfg | sed 's,menu\sbackground\s*\(.*\)$,\1,g')"
if [ ! -e "${LH_SYSLINUX_SPLASH}" ] if [ ! -e "${LH_SYSLINUX_SPLASH}" ]
then then
Echo_error "${LH_SYSLINUX_SPLASH} doen't exist" Echo_error "${LH_SYSLINUX_SPLASH} doen't exist"
@ -440,8 +442,8 @@ case "${LH_BINARY_IMAGES}" in
fi fi
# Configure syslinux templates # Configure syslinux templates
sed -i -e "s@LINUX_LIVE@${LINUX_LIVE}@" -e "s@LINUX_INSTALL@${LINUX_INSTALL}@" -e "s@MEMTEST@${MEMTEST}@" binary/isolinux/isolinux.cfg sed -i -e "s@LINUX_LIVE@${LINUX_LIVE}@" -e "s@LINUX_INSTALL@${LINUX_INSTALL}@" -e "s@MEMTEST@${MEMTEST}@" binary/isolinux/menu.cfg
sed -i -e "s#LH_BOOTAPPEND_INSTALL#${LH_BOOTAPPEND_INSTALL}#" -e "s#LH_BOOTAPPEND_LIVE#${LH_BOOTAPPEND_LIVE}#" binary/isolinux/isolinux.cfg sed -i -e "s#LH_BOOTAPPEND_INSTALL#${LH_BOOTAPPEND_INSTALL}#" -e "s#LH_BOOTAPPEND_LIVE#${LH_BOOTAPPEND_LIVE}#" binary/isolinux/menu.cfg
if [ -e binary/isolinux/f1.txt ] if [ -e binary/isolinux/f1.txt ]
then then
sed -i -e "s/LH_DISTRIBUTION/${LH_DISTRIBUTION}/" -e "s/LH_DATE/$(date +%Y%m%d)/" -e "s/LH_MEDIA/CD-ROM/" binary/isolinux/f1.txt sed -i -e "s/LH_DISTRIBUTION/${LH_DISTRIBUTION}/" -e "s/LH_DATE/$(date +%Y%m%d)/" -e "s/LH_MEDIA/CD-ROM/" binary/isolinux/f1.txt
@ -465,18 +467,18 @@ case "${LH_BINARY_IMAGES}" in
mv "${DESTDIR_LIVE}"/vmlinuz-*-${FLAVOUR} "${DESTDIR_LIVE}"/vmlinuz${NUMBER} mv "${DESTDIR_LIVE}"/vmlinuz-*-${FLAVOUR} "${DESTDIR_LIVE}"/vmlinuz${NUMBER}
mv "${DESTDIR_LIVE}"/initrd.img-*-${FLAVOUR} "${DESTDIR_LIVE}"/initrd${NUMBER}.img mv "${DESTDIR_LIVE}"/initrd.img-*-${FLAVOUR} "${DESTDIR_LIVE}"/initrd${NUMBER}.img
sed -i -e "s/vmlinuz-.*-${FLAVOUR}$/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR} /initrd${NUMBER}.img /g" binary/isolinux/isolinux.cfg sed -i -e "s/vmlinuz-.*-${FLAVOUR}$/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR} /initrd${NUMBER}.img /g" binary/isolinux/menu.cfg
done done
else else
mv "${DESTDIR_LIVE}"/vmlinuz-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz mv "${DESTDIR_LIVE}"/vmlinuz-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz
mv "${DESTDIR_LIVE}"/initrd.img-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img mv "${DESTDIR_LIVE}"/initrd.img-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img
sed -i -e "s/vmlinuz-.*-${LH_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LH_LINUX_FLAVOURS}/initrd.img/g" binary/isolinux/isolinux.cfg sed -i -e "s/vmlinuz-.*-${LH_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LH_LINUX_FLAVOURS}/initrd.img/g" binary/isolinux/menu.cfg
fi fi
sed -i -e "s/LINUX_TIMEOUT/${LH_SYSLINUX_TIMEOUT}/" binary/isolinux/isolinux.cfg sed -i -e "s/LINUX_TIMEOUT/${LH_SYSLINUX_TIMEOUT}/" binary/isolinux/footer.cfg
# Remove whitespaces # Remove whitespaces
sed -i -e 's/\ $//g' binary/isolinux/isolinux.cfg sed -i -e 's/\ $//g' binary/isolinux/*.cfg
;; ;;
net) net)

View File

@ -0,0 +1,19 @@
default live
LINUX_LIVE
LINUX_INSTALL
MEMTEST
#label floppy
# localboot 0x00
#label disk1
# localboot 0x80
#label disk2
# localboot 0x81
#label nextboot
# localboot -1

View File

@ -0,0 +1,15 @@
prompt 1
display boot.txt
timeout 0
include menu.cfg
f1 f1.txt
f2 f2.txt
f3 f3.txt
f4 f4.txt
f5 f5.txt
f6 f6.txt
f7 f7.txt
f8 f8.txt
f9 f9.txt
f0 f10.txt

View File

@ -1,36 +1,6 @@
include header.cfg
include menu.cfg
include footer.cfg
DISPLAY boot.txt DISPLAY boot.txt
F1 f1.txt
F2 f2.txt
F3 f3.txt
F4 f4.txt
F5 f5.txt
F6 f6.txt
F7 f7.txt
F8 f8.txt
F9 f9.txt
F0 f10.txt
DEFAULT live
LINUX_LIVE
LINUX_INSTALL
MEMTEST
#LABEL floppy
# localboot 0x00
#LABEL disk1
# localboot 0x80
#LABEL disk2
# localboot 0x81
#LABEL nextboot
# localboot -1
PROMPT 1 PROMPT 1
TIMEOUT LINUX_TIMEOUT

View File

@ -0,0 +1,4 @@
label help
menu label ^Help
say
config prompt.cfg

View File

@ -0,0 +1,17 @@
font data/lat1-16.psf
default data/vesamenu.c32
timeout 1000
prompt 0
menu background data/splash.png
menu color title * #ffffffff *
menu color border * #00000000 #00000000 none
menu color sel * #ffffffff #76a1d0ff *
menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *
menu color hotkey 1;37;40;44 #90ffffff #00000000 std
menu vshift 7
menu hshift 6
menu width 67
menu tabmsg Press [tab] to edit the menu entry
menu timeoutrow 16

View File

@ -1,23 +0,0 @@
FONT data/lat1-16.psf
DEFAULT data/vesamenu.c32
TIMEOUT 1000
PROMPT 0
MENU BACKGROUND data/splash.png
MENU COLOR TITLE * #FFFFFFFF *
MENU COLOR BORDER * #00000000 #00000000 none
MENU COLOR SEL * #ffffffff #76a1d0ff *
MENU COLOR HOTSEL 1;7;37;40 #ffffffff #76a1d0ff *
MENU COLOR HOTKEY 1;37;40;44 #90ffffff #00000000 std
MENU VSHIFT 7
MENU HSHIFT 6
MENU WIDTH 67
MENU TABMSG Press [tab] to edit the menu entry
MENU TIMEOUTROW 16
LINUX_LIVE
LINUX_INSTALL
MEMTEST

View File

@ -0,0 +1 @@
timeout LINUX_TIMEOUT

View File

@ -0,0 +1 @@
include prompt.cfg