diff options
Diffstat (limited to 'libre/syslinux/syslinux-install_update')
-rw-r--r-- | libre/syslinux/syslinux-install_update | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/libre/syslinux/syslinux-install_update b/libre/syslinux/syslinux-install_update index 47d4d88be..34fe8e916 100644 --- a/libre/syslinux/syslinux-install_update +++ b/libre/syslinux/syslinux-install_update @@ -30,8 +30,8 @@ libpath="/usr/lib/syslinux" bootpath="/boot/syslinux" 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,10 +294,9 @@ install_mbr() { } _install() { - # 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 + # Copy files to /boot + for file in "${com32_files[@]}"; do + # Symlink files even if links exist if [[ "$boot" = root ]]; then ln -s "${libpath#$CHROOT}/$file" "$bootpath/$file" &> /dev/null elif [[ "$boot" = boot ]]; then @@ -305,8 +304,8 @@ _install() { fi done - # Copy / Symlink pci.ids if pci.ids exists on the FS - if [[ -f $pciids_file ]]; then + # 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 if [[ "$boot" = root ]]; then ln -s "$pciids_file" "$bootpath/pci.ids" &> /dev/null elif [[ "$boot" = boot ]]; then @@ -332,10 +331,10 @@ _install() { } update() { - # Update c32 files in /boot, if /boot is not on same fs + # Update any com and c32 files in /boot if [[ "$boot" = boot ]]; then - for file in "$bootpath"/*.c32; do - file=${file##*/} + for file in "$bootpath"/*.{c32,com}; do + file=$(basename "$file") cp "$libpath/$file" "$bootpath/$file" &> /dev/null done if [[ -f "$bootpath/pci.ids" ]]; then @@ -343,17 +342,6 @@ 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 |