From a84211e8bdccdd64abd5e8fd95b9049db3304ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Sun, 19 May 2013 16:46:33 -0300 Subject: syslinux-5.01-4: updating version --- libre/syslinux/syslinux-install_update | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'libre/syslinux/syslinux-install_update') diff --git a/libre/syslinux/syslinux-install_update b/libre/syslinux/syslinux-install_update index cd1baa572..6d52f7703 100644 --- a/libre/syslinux/syslinux-install_update +++ b/libre/syslinux/syslinux-install_update @@ -28,10 +28,10 @@ shopt -s nullglob libpath="/usr/lib/syslinux" bootpath="/boot/syslinux" -extlinux="/usr/sbin/extlinux" +extlinux="/usr/bin/extlinux" +core_modules=(ldlinux.c32) autoupdate_file=/boot/syslinux/SYSLINUX_AUTOUPDATE -com32_files=(menu.c32 vesamenu.c32 chain.c32 hdt.c32 reboot.c32 poweroff.com) pciids_file=/usr/share/hwdata/pci.ids ## Helper functions ## @@ -294,9 +294,10 @@ install_mbr() { } _install() { - # Copy files to /boot - for file in "${com32_files[@]}"; do - # Symlink files even if links exist + # Copy all com32 files to /boot + for file in "${libpath}"/*.c32; do + file=${file##*/} + # Symlink files if /boot resides on the same partition as root if [[ "$boot" = root ]]; then ln -s "${libpath#$CHROOT}/$file" "$bootpath/$file" &> /dev/null elif [[ "$boot" = boot ]]; then @@ -304,8 +305,8 @@ _install() { fi done - # Copy / Symlink pci.ids if we copy the com32 module and if pci.ids exists in the FS - if check_is_in "hdt.c32" "${com32_files[@]}" && [[ -f $pciids_file ]]; then + # Copy / Symlink pci.ids if pci.ids exists on the FS + if [[ -f $pciids_file ]]; then if [[ "$boot" = root ]]; then ln -s "$pciids_file" "$bootpath/pci.ids" &> /dev/null elif [[ "$boot" = boot ]]; then @@ -331,10 +332,10 @@ _install() { } update() { - # Update any com and c32 files in /boot + # Update c32 files in /boot, if /boot is not on same fs if [[ "$boot" = boot ]]; then - for file in "$bootpath"/*.{c32,com}; do - file=$(basename "$file") + for file in "$bootpath"/*.{c32}; do + file=${file##*/} cp "$libpath/$file" "$bootpath/$file" &> /dev/null done if [[ -f "$bootpath/pci.ids" ]]; then @@ -342,6 +343,17 @@ update() { fi fi + # Ensure core modules exist and if not install them + for file in "${core_modules[@]}"; do + if [[ ! -f $bootpath/$file ]]; then + if [[ "$boot" = root ]]; then + ln -s "${libpath#$CHROOT}/$file" "$bootpath/$file" &> /dev/null + elif [[ "$boot" = boot ]]; then + cp "$libpath/$file" "$bootpath/$file" + fi + fi + done + if device_is_raid $bootpart; then echo "Detected RAID on /boot - installing Syslinux with --raid" "$extlinux" --update "$bootpath" -r &> /dev/null -- cgit v1.2.3-2-g168b