5 # Including common functions
6 .
"${LB_BASE:-/usr/share/live/build}"/scripts
/build.sh
8 # Setting static variables
9 DESCRIPTION
="$(Echo 'adding CPU autodetection to the syslinux menu')"
13 # Reading configuration files
14 Read_conffiles config
/all config
/bootstrap config
/common config
/binary
18 if [ "${LB_BOOTLOADER}" != "syslinux" ]
22 if [ "${LB_ARCHITECTURE}" != "i386" ]
27 # Seems like we'll have work to do
28 Echo_message
"adding CPU autodetection to the syslinux menu"
30 # Setting boot method specific variables
31 case "${LB_BINARY_IMAGES}" in
33 SYSLINUX_PATH
="binary/isolinux"
34 SYSLINUX_CFG
="${SYSLINUX_PATH}/isolinux.cfg"
37 SYSLINUX_PATH
="binary/syslinux"
38 SYSLINUX_CFG
="${SYSLINUX_PATH}/syslinux.cfg"
43 SYSLINUX_LIVE_CFG
="${SYSLINUX_PATH}/live.cfg"
44 SYSLINUX_MENU_CFG
="${SYSLINUX_PATH}/menu.cfg"
47 Check_package chroot
/usr
/bin
/syslinux syslinux
50 Restore_cache cache
/packages_binary
55 # Copy necessary syslinux modules
56 for module
in ifcpu64.c32
58 cp "chroot/usr/lib/syslinux/${module}" "${SYSLINUX_PATH}/"
62 Save_cache cache
/packages_binary
67 # Replace syslinux.cfg with autodetection "code"
68 cat > "${SYSLINUX_CFG}" <<EOF
71 append menu_amd64 -- menu_486 -- menu_486
82 # Set a few variables in menu.cfg as loading vesamenu.c32 resets its
83 # state to the defaults
84 sed -i -e "1i prompt 0\ntimeout 40\n" "${SYSLINUX_MENU_CFG}"
86 # Copy and adapt live.cfg for each kernel
90 echo "include menu.cfg"
92 if [ $arch = 486 ]; then
97 sed -e "s,/vmlinuz$,/vmlinuz${append}, ; s,initrd\.img,initrd${append}.img," "${SYSLINUX_LIVE_CFG}"
98 ) |
sed -n -e '/^label live-amd64.*/ { q } ; p' \
99 > "${SYSLINUX_PATH}/live${arch}.cfg"
102 # Don't load live.cfg from menu.cfg:
103 # syslinux_cfg automatically loads arch-specific menus
104 sed -i -e '/^include live\.cfg/d' "${SYSLINUX_MENU_CFG}"