summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2013-10-20 01:08:36 -0200
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2013-10-20 01:08:36 -0200
commit47787b394ff68725628be11e109fe385aa4799b1 (patch)
tree18dc1253e1b0814957033715ca37e1a415c81da2
parent967e753bc65f3e33269f8fe86e5116eb8cb30b57 (diff)
downloadabslibre-47787b394ff68725628be11e109fe385aa4799b1.tar.gz
abslibre-47787b394ff68725628be11e109fe385aa4799b1.tar.bz2
abslibre-47787b394ff68725628be11e109fe385aa4799b1.zip
syslinux-6.02-3: updating version
-rw-r--r--libre-testing/syslinux/PKGBUILD169
-rw-r--r--libre-testing/syslinux/splash.pngbin11947 -> 0 bytes
-rw-r--r--libre-testing/syslinux/splash.xcfbin30757 -> 0 bytes
-rw-r--r--libre-testing/syslinux/syslinux-dont-build-dos-windows-targets.patch12
-rw-r--r--libre-testing/syslinux/syslinux-install_update461
-rw-r--r--libre-testing/syslinux/syslinux.cfg78
-rw-r--r--libre-testing/syslinux/syslinux.install36
-rw-r--r--libre/syslinux/PKGBUILD193
-rw-r--r--libre/syslinux/syslinux-6.00-efi-export-kbdmap.patch (renamed from libre-testing/syslinux/syslinux-6.00-efi-export-kbdmap.patch)0
-rw-r--r--libre/syslinux/syslinux-6.00-efi-fix-libcom32.patch (renamed from libre-testing/syslinux/syslinux-6.00-efi-fix-libcom32.patch)0
-rw-r--r--libre/syslinux/syslinux-6.02-fix-chainloading.patch47
-rw-r--r--libre/syslinux/syslinux-dont-build-dos-windows-targets.patch6
-rw-r--r--libre/syslinux/syslinux-install_update104
-rw-r--r--libre/syslinux/syslinux.cfg31
-rw-r--r--libre/syslinux/syslinux.install25
15 files changed, 294 insertions, 868 deletions
diff --git a/libre-testing/syslinux/PKGBUILD b/libre-testing/syslinux/PKGBUILD
deleted file mode 100644
index 8a8845f0b..000000000
--- a/libre-testing/syslinux/PKGBUILD
+++ /dev/null
@@ -1,169 +0,0 @@
-# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
-# Maintainer: Thomas Bächler <thomas@archlinux.org>
-# Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
-# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>
-
-pkgname="syslinux"
-pkgver="6.01"
-pkgrel="4.1"
-arch=('x86_64' 'i686')
-pkgdesc="Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE (Parabola rebranded)"
-url="http://syslinux.zytor.com/"
-license=('GPL2')
-options=('!makeflags' '!emptydirs')
-backup=('boot/syslinux/syslinux.cfg'
- 'boot/syslinux/splash.png')
-makedepends=('python2' 'nasm' 'gnu-efi-libs')
-depends=('perl' 'glibc')
-optdepends=('perl-passwd-md5: For md5pass'
- 'perl-digest-sha1: For sha1pass'
- 'mtools: For mkdiskimage and syslinux support'
- 'gptfdisk: For GPT support'
- 'util-linux: For isohybrid'
- 'efibootmgr: For EFI support'
- 'dosfstools: For EFI support')
-md5sums=('5fe8959b92255143a334167ca1c395a6'
- 'f048880b57e2c5a7017ff8804bfda327'
- '0e7d47e1f791f0c5e7bd40ed5c6d80cc'
- 'cb46ca47c6b6323127d908440057d98f')
-
-install="${pkgname}.install"
-
-source=("https://www.kernel.org/pub/linux/utils/boot/syslinux/${pkgname}-${pkgver}.tar.xz"
- 'syslinux.cfg'
- 'syslinux-install_update'
- 'splash.png')
-
-_build_syslinux_bios() {
-
- rm -rf "${srcdir}/${pkgname}-${pkgver}-bios/" || true
- cp -r "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/${pkgname}-${pkgver}-bios"
- cd "${srcdir}/${pkgname}-${pkgver}-bios/"
-
- ## Do not try to build syslinux with our default LDFLAGS, it will fail
- unset LDFLAGS
-
- make PYTHON="python2" bios
- make PYTHON="python2" bios installer
-
-}
-
-_build_syslinux_efi64() {
-
- rm -rf "${srcdir}/${pkgname}-${pkgver}-efi64/" || true
- cp -r "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/${pkgname}-${pkgver}-efi64"
- cd "${srcdir}/${pkgname}-${pkgver}-efi64/"
-
- ## Unset all compiler FLAGS for efi64 build
- unset CFLAGS
- unset CPPFLAGS
- unset CXXFLAGS
- unset LDFLAGS
- unset MAKEFLAGS
-
- make PYTHON="python2" efi64
- make PYTHON="python2" efi64 installer
-
-}
-
-_build_syslinux_efi32() {
-
- rm -rf "${srcdir}/${pkgname}-${pkgver}-efi32/" || true
- cp -r "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/${pkgname}-${pkgver}-efi32"
- cd "${srcdir}/${pkgname}-${pkgver}-efi32/"
-
- ## Unset all compiler FLAGS for efi32 build
- unset CFLAGS
- unset CPPFLAGS
- unset CXXFLAGS
- unset LDFLAGS
- unset MAKEFLAGS
-
- make PYTHON="python2" efi32
- make PYTHON="python2" efi32 installer
-
-}
-
-build() {
-
- cd "${srcdir}/${pkgname}-${pkgver}/"
-
- ## Do not try to build the Windows or DOS installers and DIAG files
- sed 's|diag libinstaller dos win32 win64 dosutil txt|libinstaller txt|g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
- sed 's|win32/syslinux.exe win64/syslinux64.exe||g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
- sed 's|dosutil/*.com dosutil/*.sys||g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
- sed 's|dos/syslinux.com||g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
- sed 's|INSTALLSUBDIRS = com32 utils dosutil|INSTALLSUBDIRS = com32 utils|g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
- sed 's|install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)|# install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)|g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
-
- ## Fix FHS manpage path
- sed 's|/usr/man|/usr/share/man|g' -i "${srcdir}/${pkgname}-${pkgver}/mk/syslinux.mk" || true
-
- ## Build syslinux-efi
- if [[ "${CARCH}" == "x86_64" ]]; then
- _build_syslinux_efi64
- fi
-
- if [[ "${CARCH}" == "i686" ]]; then
- _build_syslinux_efi32
- fi
-
- ## Build syslinux-bios
- _build_syslinux_bios
-
-}
-
-_package_syslinux_bios() {
-
- cd "${srcdir}/${pkgname}-${pkgver}-bios/"
-
- ## Install Syslinux bios
- make INSTALLROOT="${pkgdir}/" AUXDIR="/usr/lib/syslinux/bios/" bios install
-
- ## Remove syslinux.exe,syslinux64.exe,syslinux.com and dosutil dir
- rm "${pkgdir}/usr/lib/syslinux/bios"/syslinux.{com,exe} || true
- rm "${pkgdir}/usr/lib/syslinux/bios/syslinux64.exe" || true
- rm -rf "${pkgdir}/usr/lib/syslinux/bios/dosutil/" || true
-
- ## Remove com32 and diag dirs
- rm -rf "${pkgdir}/usr/lib/syslinux/bios/diag/" || true
- rm -rf "${pkgdir}/usr/lib/syslinux/bios/com32/" || true
-
- ## Move extlinux binary to /usr/bin
- install -d "${pkgdir}/usr/bin"
- mv "${pkgdir}/sbin/extlinux" "${pkgdir}/usr/bin/extlinux"
- rm -rf "${pkgdir}/sbin/"
-
- ## Install docs
- install -d "${pkgdir}/usr/share/doc"
- cp -ar "${srcdir}/${pkgname}-${pkgver}/doc" "${pkgdir}/usr/share/doc/syslinux"
-
- ## Install the default configuration
- install -D -m0644 "${srcdir}/syslinux.cfg" "${pkgdir}/boot/syslinux/syslinux.cfg"
-
- ## Install the installation and update script
- ## This script is maintained at git://gist.github.com/772138.git
- ## Script not yet updated for syslinux-efi
- install -D -m0755 "${srcdir}/syslinux-install_update" "${pkgdir}/usr/bin/syslinux-install_update"
-
- # Install Parabola splash
- install -D -m644 "${srcdir}/splash.png" "${pkgdir}/boot/syslinux/splash.png"
-}
-
-package() {
-
- cd "${srcdir}/${pkgname}-${pkgver}/"
-
- if [[ "${CARCH}" == "x86_64" ]]; then
- cd "${srcdir}/${pkgname}-${pkgver}-efi64/"
- make INSTALLROOT="${pkgdir}/" AUXDIR="/usr/lib/syslinux/" efi64 install
- fi
-
- if [[ "${CARCH}" == "i686" ]]; then
- cd "${srcdir}/${pkgname}-${pkgver}-efi32/"
- make INSTALLROOT="${pkgdir}/" AUXDIR="/usr/lib/syslinux/" efi32 install
- fi
-
- _package_syslinux_bios
-
-}
diff --git a/libre-testing/syslinux/splash.png b/libre-testing/syslinux/splash.png
deleted file mode 100644
index eac14536b..000000000
--- a/libre-testing/syslinux/splash.png
+++ /dev/null
Binary files differ
diff --git a/libre-testing/syslinux/splash.xcf b/libre-testing/syslinux/splash.xcf
deleted file mode 100644
index c27d04445..000000000
--- a/libre-testing/syslinux/splash.xcf
+++ /dev/null
Binary files differ
diff --git a/libre-testing/syslinux/syslinux-dont-build-dos-windows-targets.patch b/libre-testing/syslinux/syslinux-dont-build-dos-windows-targets.patch
deleted file mode 100644
index 54151ab87..000000000
--- a/libre-testing/syslinux/syslinux-dont-build-dos-windows-targets.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nur syslinux-4.02.orig//Makefile syslinux-4.02//Makefile
---- syslinux-4.02.orig//Makefile 2010-07-21 21:33:13.000000000 +0200
-+++ syslinux-4.02//Makefile 2010-07-22 11:14:03.325522937 +0200
-@@ -54,7 +54,7 @@
- # files that depend only on the B phase, but may have to be regenerated
- # for "make installer".
- BSUBDIRS = codepage com32 lzo core memdisk mbr memdump gpxe sample \
-- diag libinstaller dos win32 win64 dosutil txt
-+ libinstaller txt
- ITARGET =
- IOBJECTS = $(ITARGET) \
- utils/gethostip utils/isohybrid utils/mkdiskimage \
diff --git a/libre-testing/syslinux/syslinux-install_update b/libre-testing/syslinux/syslinux-install_update
deleted file mode 100644
index 4dc09696a..000000000
--- a/libre-testing/syslinux/syslinux-install_update
+++ /dev/null
@@ -1,461 +0,0 @@
-#!/usr/bin/env bash
-#
-# Syslinux Installer / Updater Script (for BIOS only)
-# Copyright (C) 2013 Matthew Gyurgyik <pyther@pyther.net>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-#-----------------
-# Exit Codes:
-# 1 - get_boot_device or other function failed
-# 2 - install/update failed
-# 3 - set_active failed
-# 4 - install_mbr failed
-#
-shopt -s nullglob
-
-bios_libpath="/usr/lib/syslinux/bios/"
-bios_bootpath="/boot/syslinux/"
-EXTLINUX="/usr/bin/extlinux"
-
-bios_core_modules=(config.c32 chain.c32 ldlinux.c32 libcom32.c32 libgpl.c32 liblua.c32 libmenu.c32 libutil.c32 linux.c32 menu.c32 vesamenu.c32)
-bios_autoupdate_file="/boot/syslinux/SYSLINUX_AUTOUPDATE"
-pciids_file="/usr/share/hwdata/pci.ids"
-
-## Helper functions ##
-# Taken from libui-sh
-# $1 needle
-# $2 set (array) haystack
-check_is_in() {
- local needle="$1" element
- shift
- for element; do
- [[ $element = $needle ]] && return 0
- done
- return 1
-}
-
-# return true when blockdevice is an md raid, otherwise return a unset value
-# get all devices that are part of raid device $1
-device_is_raid() {
- [[ $1 && -f /proc/mdstat ]] || return 1
- local devmajor=$(stat -c %t "$1")
- (( devmajor == 9 ))
-}
-
-mdraid_all_slaves() {
- local slave slaves
- for slave in /sys/class/block/${1##*/}/slaves/*; do
- source "$slave/uevent"
- slaves="$slaves/dev/$DEVNAME "
- unset DEVNAME
- done
- echo $slaves
-}
-
-# Check /sys/block to see if device is partitioned
-# If we have a partitioned block device (sda1) /sys/block/sda1/dev will not exist
-# However, if we have an unpartitioned block device (sda) /sys/block/sda/dev will exist
-dev_is_part() {
- # $1 - blockdevice
- local dev=$1
-
- # If block device uevent file should be found
- # If a partition is passed in path shouldn't exist
- if [[ $dev = *cciss* ]]; then
- [[ -f /sys/block/cciss\!${dev##*/}/dev ]] && return 1
- elif [[ $dev = *ida* ]]; then
- [[ -f /sys/block/ida\!${dev##*/}/dev ]] && return 1
- else
- [[ -f /sys/block/${dev##*/}/dev ]] && return 1
- fi
-
- return 0
-}
-
-# If EFI PART is present in the first 8 bytes then it must be a GPT disk
-device_is_gpt() {
- local partsig=$(dd if="$1" skip=64 bs=8 count=1 2>/dev/null)
- [[ $partsig = "EFI PART" ]]
-}
-
-clear_gpt_attr2() {
- # $1 - Block Device, no partitions
- local disk=$1
-
- # Special Exception for cciss controllers
- if [[ $disk = *cciss* ]]; then
- for part in /dev/cciss/${disk##*/}*p*; do
- local partnum="${part##*[[:alpha:]]}"
- sgdisk "$disk" --attributes="$partnum":clear:2 &>/dev/null
- done
- # Smart 2 Controllers
- elif [[ $disk = *ida* ]]; then
- for part in /dev/ida/${disk##*/}*p*; do
- local partnum="${part##*[[:alpha:]]}"
- sgdisk "$disk" --attributes="$partnum":clear:2 &>/dev/null
- done
- else
- for part in /sys/block/${disk##*/}/${disk##*/}*; do
- local partnum="${part##*[[:alpha:]]}"
- sgdisk "$disk" --attributes="$partnum":clear:2 &>/dev/null
- done
- fi
- return 0
-}
-
-usage() {
-cat << EOF
-usage: $0 options
-
-This script will install or upgrade Syslinux (for BIOS only)
-
-OPTIONS:
- -h Show this message
- -i Install Syslinux
- -u Update Syslinux
- -a Set Boot flag on boot partiton
- -m Install Syslinux MBR
- -s Updates Syslinux if /boot/syslinux/SYSLINUX_AUTOUPDATE exists
-
- Arguments Required:
- -c Chroot install (ex: -c /mnt)
-
-Example Usage: $0 -i -a -m # (install, set boot flag, install mbr)
- $0 -u # (update)
-EOF
-}
-
-# Trys to find the partition that /boot resides on
-# This will either be on /boot or / (root)
-getBoot() {
- if [[ ! -d "$bios_bootpath" ]]; then
- echo "Could not find $bios_bootpath"
- echo "Is boot mounted? Is Syslinux installed?"
- exit 1
- fi
-
- syslinux_fs=(ext2 ext3 ext4 btrfs vfat)
-
- # Use DATA from findmnt see rc.sysint for more info
- if [[ -f /proc/self/mountinfo ]]; then
- read rootdev rootfs < <(findmnt -run -t noautofs -o SOURCE,FSTYPE "$CHROOT/")
- read bootdev bootfs < <(findmnt -run -t noautofs -o SOURCE,FSTYPE "$CHROOT/boot")
- else
- echo "Could not find /proc/self/mountinfo"
- echo "Are you running a kernel greater than 2.6.24?"
- exit 1
- fi
-
- if [[ $bootfs ]]; then
- if ! check_is_in "$bootfs" "${syslinux_fs[@]}"; then
- echo "/boot file system is not supported by Syslinux"
- exit 1
- fi
- boot="boot"
- bootpart="$bootdev"
- elif [[ $rootfs ]]; then
- if ! check_is_in "$rootfs" "${syslinux_fs[@]}"; then
- echo "/ (root) file system is not supported by Syslinux"
- exit 1
- fi
- boot="root"
- bootpart="$rootdev"
- else
- echo "Could not find filesystem on / (root) or /boot."
- exit 1
- fi
-}
-
-# We store the partition table type either gpt or mbr in var ptb
-# In rare cases a user could have one raid disk using mbr and another using gpt
-# In such cases we accept that the output may be incomplete
-
-# Calls get_ptb() for $bootpart or for all device in RAID
-declare -A bootdevs
-get_boot_devices() {
- if device_is_raid "$bootpart"; then
- slaves=$(mdraid_all_slaves "$bootpart")
-
- for slave in ${slaves[@]}; do
- local disk="${slave%%[[:digit:]]*}"
- device_is_gpt "$disk" && local ptb="GPT" || local ptb="MBR"
- bootdevs[$slave]="$ptb"
- done
- else
- local disk="${bootpart%%[[:digit:]]*}"
- device_is_gpt "$disk" && local ptb="GPT" || local ptb="MBR"
- bootdevs[$bootpart]="$ptb"
- fi
-}
-
-# Function Assumes the boot partition should be marked as active
-# All other partitions should not have the boot flag set
-set_active() {
- # If any bootdev is a block device without partitions bail
- # we want to set the boot flag on partitioned disk
- for dev in "${!bootdevs[@]}"; do
- dev_is_part $dev || { echo "$dev - is a block device. Aborting set_active!"; return 1; }
- done
-
- # Clear BIOS Bootable Legacy Attribute for GPT drives
- # In rare cases where a RAID device has slaves on the same block device
- # Attribute 2 will be cleared for each partition multiple times
- for dev in "${!bootdevs[@]}"; do
- local ptb="${bootdevs[$dev]}"
- if [[ "$ptb" = GPT ]]; then
- local disk="${dev%%[[:digit:]]*}" #ex: /dev/sda
- clear_gpt_attr2 "$disk"
- fi
- done
-
- # Set the boot flag on bootdevs (generated from get_boot_devices)
- for part in "${!bootdevs[@]}"; do
- local ptb="${bootdevs[$part]}"
- local partnum="${part##*[[:alpha:]]}"
- case "$part" in
- *[[:digit:]]p[[:digit:]]*)
- local disk="${part%%p$partnum}" # get everything before p1
- ;;
- *)
- local disk="${part%%[[:digit:]]*}"
- ;;
- esac
-
- if [[ "$ptb" = MBR ]]; then
- if sfdisk "$disk" -A "$partnum" &>/dev/null; then
- echo "Boot Flag Set - $part"
- else
- echo "FAILED to Set the boot flag on $part"
- exit 3
- fi
- elif [[ "$ptb" = GPT ]]; then
- if sgdisk "$disk" --attributes="$partnum":set:2 &>/dev/null; then
- echo "Attribute Legacy Bios Bootable Set - $part"
- else
- echo "FAILED to set attribute Legacy BIOS Bootable on $part"
- exit 3
- fi
- fi
- done
- return 0
-}
-
-install_mbr() {
- # If any bootdev is a block device without partitions bail
- # we want to install the mbr to a partitioned disk
- for dev in "${!bootdevs[@]}"; do
- dev_is_part "$dev" || { echo "$dev - is a block device. Aborting MBR install"; return 1; }
- done
-
- for part in "${!bootdevs[@]}"; do
- local partnum="${part##*[[:alpha:]]}"
- case "$part" in
- *[[:digit:]]p[[:digit:]]*)
- local disk="${part%%p$partnum}" # get everything before p1
- ;;
- *)
- local disk="${part%%[[:digit:]]*}"
- ;;
- esac
- local ptb="${bootdevs[$part]}"
-
- # We want to install to the root of the block device
- # If the device is a partition - ABORT!
- dev_is_part "$disk" && \
- { echo "ABORT! MBR installation to partition ($disk)!"; exit 4;}
-
- if [[ "$ptb" = MBR ]]; then
- mbrfile="$bios_libpath/mbr.bin"
- elif [[ "$ptb" = GPT ]]; then
- mbrfile="$bios_libpath/gptmbr.bin"
- fi
-
- if dd bs=440 count=1 conv=notrunc if="$mbrfile" of="$disk" &> /dev/null; then
- echo "Installed MBR ($mbrfile) to $disk"
- else
- echo "Error Installing MBR ($mbrfile) to $disk"
- exit 4
- fi
- done
- return 0
-}
-
-install_modules() {
- # Copy all com32 files to /boot
- for file in "${bios_libpath}"/*.c32; do
- file=${file##*/}
- rm "$bios_bootpath/$file" &> /dev/null
- if [[ "$boot" = root ]]; then
- # Symlink files if /boot resides on the same partition as root
- ln -sf "${bios_libpath#$CHROOT}/$file" "$bios_bootpath/$file" &> /dev/null
- elif [[ "$boot" = boot ]]; then
- cp "$bios_libpath/$file" "$bios_bootpath/$file"
- fi
- done
-
- # Copy / Symlink pci.ids if pci.ids exists on the FS
- if [[ -f $pciids_file ]]; then
- rm "$bios_bootpath/pci.ids" &> /dev/null
- if [[ "$boot" = root ]]; then
- ln -sf "$pciids_file" "$bios_bootpath/pci.ids" &> /dev/null
- elif [[ "$boot" = boot ]]; then
- cp "$pciids_file" "$bios_bootpath/pci.ids" &> /dev/null
- fi
- fi
-}
-
-_install() {
- install_modules
-
- if device_is_raid "$bootpart"; then
- echo "Detected RAID on /boot"
- "$EXTLINUX" --install "$bios_bootpath" --raid &> /dev/null
- else
- "$EXTLINUX" --install "$bios_bootpath" &> /dev/null
- fi
-
- if (( $? )); then
- echo "Syslinux BIOS install failed"
- exit 2
- else
- echo "Syslinux BIOS install successful"
- fi
-
- touch "$CHROOT/$bios_autoupdate_file"
-}
-
-update() {
- install_modules
-
- if device_is_raid $bootpart; then
- echo "Detected RAID on /boot"
- "$EXTLINUX" --update "$bios_bootpath" --raid &> /dev/null
- else
- "$EXTLINUX" --update "$bios_bootpath" &> /dev/null
- fi
-
- if (($?)); then
- echo "Syslinux BIOS update failed"
- exit 2
- else
- echo "Syslinux BIOS update successful"
- fi
-}
-
-if (( $# == 0 )); then
- usage
- exit 1
-fi
-
-while getopts "c:uihmas" opt; do
- case $opt in
- c)
- CHROOT=$(readlink -e "$OPTARG")
- if [[ -z $CHROOT ]]; then
- echo "error: chroot path ``$OPTARG does not exist";
- exit 1
- fi
- ;;
- h)
- USAGE="True"
- ;;
- i)
- INSTALL="True"
- ;;
- u)
- UPDATE="True"
- ;;
- m)
- MBR="True"
- ;;
- a)
- SET_ACTIVE="True"
- ;;
- s)
- # If AUTOUPDATE_FILE does not exist exit the script
- if [[ -f $bios_autoupdate_file ]]; then
- UPDATE="True"
- else
- exit 0
- fi
- ;;
- *)
- usage
- exit 1
- ;;
- esac
-done
-
-if [[ $USAGE ]]; then
- usage
- exit 0
-fi
-
-# Make sure only root can run our script
-if (( $(id -u) != 0 )); then
- echo "This script must be run as root" 1>&2
- exit 1
-fi
-
-# Display Usage Information if both Install and Update are passed
-if [[ $INSTALL && $UPDATE ]]; then
- usage
- exit 1
-fi
-
-# If a chroot dir is path set variables to reflect chroot
-if [[ "$CHROOT" ]]; then
- bios_libpath="$CHROOT$bios_libpath"
- bios_bootpath="$CHROOT$bios_bootpath"
- EXTLINUX="$CHROOT$EXTLINUX"
-fi
-
-# Exit if no /boot path exists
-if ( f=("$bios_bootpath"/*); (( ! ${#f[@]} )) ); then
- echo "Error: $bios_bootpath is empty!"
- echo "Is /boot mounted?"
- exit 1
-fi
-
-# Get the boot device if any of these options are passed
-if [[ $INSTALL || $UPDATE || $SET_ACTIVE || $MBR ]]; then
- getBoot
-fi
-
-# Install or Update
-if [[ $INSTALL ]]; then
- _install || exit
-elif [[ $UPDATE ]]; then
- update || exit
-fi
-
-
-# SET_ACTIVE and MBR
-if [[ $SET_ACTIVE ]] || [[ $MBR ]]; then
- get_boot_devices
-
- if [[ $SET_ACTIVE ]]; then
- set_active || exit
- fi
-
- if [[ $MBR ]]; then
- install_mbr || exit
- fi
-fi
-
-exit 0
-
-# vim: set et sw=4:
diff --git a/libre-testing/syslinux/syslinux.cfg b/libre-testing/syslinux/syslinux.cfg
deleted file mode 100644
index 0c0c6339a..000000000
--- a/libre-testing/syslinux/syslinux.cfg
+++ /dev/null
@@ -1,78 +0,0 @@
-# Config file for Syslinux -
-# /boot/syslinux/syslinux.cfg
-#
-# Comboot modules:
-# * menu.c32 - provides a text menu
-# * vesamenu.c32 - provides a graphical menu
-# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
-# * hdt.c32 - hardware detection tool
-# * reboot.c32 - reboots the system
-#
-# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
-# If /usr and /boot are on the same file system, symlink the files instead
-# of copying them.
-#
-# If you do not use a menu, a 'boot:' prompt will be shown and the system
-# will boot automatically after 5 seconds.
-#
-# Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
-# The wiki provides further configuration examples
-
-DEFAULT parabola
-PROMPT 0 # Set to 1 if you always want to display the boot: prompt
-TIMEOUT 50
-# You can create syslinux keymaps with the keytab-lilo tool
-#KBDMAP de.ktl
-
-# Menu Configuration
-# Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux
-#UI menu.c32
-UI vesamenu.c32
-
-# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
-MENU TITLE Parabola GNU/Linux-libre
-MENU BACKGROUND splash.png
-MENU COLOR border 35;40 #ff777caa #a0000000 std
-MENU COLOR title 1;35;40 #ff777caa #a0000000 std
-MENU COLOR sel 7;35;47 #e0ffffff #20777caa all
-MENU COLOR unsel 35;40 #ff777caa #a0000000 std
-MENU COLOR help 35;40 #c0b2b2b2 #a0000000 std
-MENU COLOR timeout_msg 35;40 #ff777caa #00000000 std
-MENU COLOR timeout 1;35;40 #ff777caa #00000000 std
-MENU COLOR msg07 35;40 #ff777caa #a0000000 std
-MENU COLOR tabmsg 35;40 #ff777caa #00000000 std
-
-# boot sections follow
-#
-# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
-#
-#-*
-
-LABEL parabola
- MENU LABEL Parabola GNU/Linux-libre
- LINUX ../vmlinuz-linux-libre
- APPEND root=/dev/sda3 rw
- INITRD ../initramfs-linux-libre.img
-
-LABEL parabolafallback
- MENU LABEL Parabola GNU/Linux-libre Fallback
- LINUX ../vmlinuz-linux-libre
- APPEND root=/dev/sda3 rw
- INITRD ../initramfs-linux-libre-fallback.img
-
-# If you want Memtest on syslinux, use this LABEL section to launch it (install the memtest86+ package)
-# LABEL memtest
-# MENU LABEL Memtest86+
-# LINUX ../memtest86+/memtest.bin
-
-LABEL hdt
- MENU LABEL HDT (Hardware Detection Tool)
- COM32 hdt.c32
-
-LABEL reboot
- MENU LABEL Reboot
- COM32 reboot.c32
-
-LABEL poweroff
- MENU LABEL Poweroff
- COM32 poweroff.c32
diff --git a/libre-testing/syslinux/syslinux.install b/libre-testing/syslinux/syslinux.install
deleted file mode 100644
index ac8553a97..000000000
--- a/libre-testing/syslinux/syslinux.install
+++ /dev/null
@@ -1,36 +0,0 @@
-post_install() {
- echo "==> If you want to use syslinux as your BIOS bootloader"
- echo "==> edit /boot/syslinux/syslinux.cfg and run"
- echo "==> # /usr/bin/syslinux-install_update -i -a -m"
- echo "==> to install it."
-
- cat << EOF
-Syslinux efi64 and efi32 files have been installed at
-/usr/lib/syslinux/{efi64,efi32}/ respectively.
-
-To install, copy /usr/lib/syslinux/efi64 to (ESP)/EFI/syslinux and
-syslinux.cfg to (ESP)/EFI/syslinux/syslinux.cfg and add a boot entry
-using efibootmgr for (ESP)/EFI/syslinux/syslinux.efi
-EOF
-
-}
-
-post_upgrade() {
- # auto-update syslinux if /boot/syslinux/SYSLINUX_AUTOUPDATE exists
- /usr/bin/syslinux-install_update -s
- # update to 5.01 message
- if [ "$(vercmp $2 5.01)" -lt 0 ]; then
- echo "If you used syslinux-install_update to install syslinux:"
- echo "==> If you want to use syslinux with menu and all modules please rerun"
- echo "==> # /usr/bin/syslinux-install_update -i -a -m"
- echo ""
- echo "If you manually installed syslinux:"
- echo "==> Please copy or symlink all .c32 modules to your /boot/syslinux directory."
- echo "==> If (/ and /boot on seperate fs):"
- echo "==> # cp /usr/lib/syslinux/bios/*.c32 /boot/syslinux"
- echo "==> If (/ and /boot on same fs):"
- echo "==> # ln -s /usr/lib/syslinux/bios/*.c32 /boot/syslinux"
- fi
-}
-
-# vim:set ts=2 sw=2 et:
diff --git a/libre/syslinux/PKGBUILD b/libre/syslinux/PKGBUILD
index 01505c5d2..a2ca4c657 100644
--- a/libre/syslinux/PKGBUILD
+++ b/libre/syslinux/PKGBUILD
@@ -1,57 +1,172 @@
-# Maintainer: Thomas Bächler <thomas@archlinux.org>
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+# Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>
-pkgname=syslinux
-pkgver=4.07
-pkgrel=1.1
-arch=('i686' 'x86_64')
+pkgname="syslinux"
+pkgver="6.02"
+pkgrel="3"
+arch=('x86_64' 'i686')
pkgdesc="Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE (Parabola rebranded)"
url="http://syslinux.zytor.com/"
license=('GPL2')
+options=('!makeflags' '!emptydirs')
+backup=('boot/syslinux/syslinux.cfg'
+ 'boot/syslinux/splash.png')
+makedepends=('python2' 'nasm' 'gnu-efi-libs')
depends=('perl' 'glibc')
optdepends=('perl-passwd-md5: For md5pass'
'perl-digest-sha1: For sha1pass'
'mtools: For mkdiskimage and syslinux support'
'gptfdisk: For GPT support'
- 'util-linux: For isohybrid')
-makedepends=('nasm')
-backup=('boot/syslinux/syslinux.cfg'
- 'boot/syslinux/splash.png')
-install=syslinux.install
-source=(http://www.kernel.org/pub/linux/utils/boot/syslinux/$pkgname-${pkgver}.tar.bz2
- syslinux-dont-build-dos-windows-targets.patch
- syslinux.cfg
- syslinux-install_update
- splash.png)
-md5sums=('9ff6e1b94efab931fb4717b600d88779'
- '1528c376e43f0eaccaa80d8ad1bc13b4'
- 'a43bd903face611bcc148522265dfe6c'
- '8559fb3daf3afa8688600d8a38118918'
+ 'util-linux: For isohybrid'
+ 'efibootmgr: For EFI support'
+ 'dosfstools: For EFI support')
+md5sums=('6f275813a1b08cf852e55c0a3f8fbc78'
+ 'f048880b57e2c5a7017ff8804bfda327'
+ '0e7d47e1f791f0c5e7bd40ed5c6d80cc'
+ '9dbede6b71a4de9e46aac4aad65334d7'
'cb46ca47c6b6323127d908440057d98f')
+install="${pkgname}.install"
+
+source=("https://www.kernel.org/pub/linux/utils/boot/syslinux/${pkgname}-${pkgver}.tar.xz"
+ 'syslinux.cfg'
+ 'syslinux-install_update'
+ 'syslinux-6.02-fix-chainloading.patch'
+ 'splash.png')
+
+_build_syslinux_bios() {
+
+ rm -rf "${srcdir}/${pkgname}-${pkgver}-bios/" || true
+ cp -r "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/${pkgname}-${pkgver}-bios"
+ cd "${srcdir}/${pkgname}-${pkgver}-bios/"
+
+ ## Do not try to build syslinux with our default LDFLAGS, it will fail
+ unset LDFLAGS
+ make PYTHON="python2" bios
+ make PYTHON="python2" bios installer
+}
+
+_build_syslinux_efi64() {
+
+ rm -rf "${srcdir}/${pkgname}-${pkgver}-efi64/" || true
+ cp -r "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/${pkgname}-${pkgver}-efi64"
+ cd "${srcdir}/${pkgname}-${pkgver}-efi64/"
+
+ ## Unset all compiler FLAGS for efi64 build
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ make PYTHON="python2" efi64
+ make PYTHON="python2" efi64 installer
+}
+
+_build_syslinux_efi32() {
+
+ rm -rf "${srcdir}/${pkgname}-${pkgver}-efi32/" || true
+ cp -r "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/${pkgname}-${pkgver}-efi32"
+ cd "${srcdir}/${pkgname}-${pkgver}-efi32/"
+
+ ## Unset all compiler FLAGS for efi32 build
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ make PYTHON="python2" efi32
+ make PYTHON="python2" efi32 installer
+}
+
build() {
- # Do not try to build syslinux with our default LDFLAGS, it will fail
- unset LDFLAGS
- cd "$srcdir"/$pkgname-${pkgver}
- # Do not try to build the Windows or DOS installers
- patch -p1 -i "$srcdir"/syslinux-dont-build-dos-windows-targets.patch
- # Fix FHS manpage path
- sed 's|/usr/man|/usr/share/man|g' -i mk/syslinux.mk
- make installer
- make -C utils
- make -C com32
+
+ cd "${srcdir}/${pkgname}-${pkgver}/"
+
+ ## Do not try to build the Windows or DOS installers and DIAG files
+ sed 's|diag libinstaller dos win32 win64 dosutil txt|libinstaller txt|g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
+ sed 's|win32/syslinux.exe win64/syslinux64.exe||g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
+ sed 's|dosutil/*.com dosutil/*.sys||g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
+ sed 's|dos/syslinux.com||g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
+ sed 's|INSTALLSUBDIRS = com32 utils dosutil|INSTALLSUBDIRS = com32 utils|g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
+ sed 's|install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)|# install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)|g' -i "${srcdir}/${pkgname}-${pkgver}/Makefile" || true
+
+ ## Fix FHS manpage path
+ sed 's|/usr/man|/usr/share/man|g' -i "${srcdir}/${pkgname}-${pkgver}/mk/syslinux.mk" || true
+
+ # fix chainloading
+ # http://bugzilla.syslinux.org/show_bug.cgi?id=31
+ # http://www.syslinux.org/archives/2013-October/020971.html
+ patch -Np1 -i "${srcdir}/syslinux-6.02-fix-chainloading.patch"
+
+ ## Build syslinux-efi
+ if [[ "${CARCH}" == "x86_64" ]]; then
+ _build_syslinux_efi64
+ fi
+
+ if [[ "${CARCH}" == "i686" ]]; then
+ _build_syslinux_efi32
+ fi
+
+ ## Build syslinux-bios
+ _build_syslinux_bios
+
+}
+
+_package_syslinux_bios() {
+
+ cd "${srcdir}/${pkgname}-${pkgver}-bios/"
+
+ ## Install Syslinux bios
+ make INSTALLROOT="${pkgdir}/" AUXDIR="/usr/lib/syslinux/bios/" bios install
+
+ ## Remove syslinux.exe,syslinux64.exe,syslinux.com and dosutil dir
+ rm "${pkgdir}/usr/lib/syslinux/bios"/syslinux.{com,exe} || true
+ rm "${pkgdir}/usr/lib/syslinux/bios/syslinux64.exe" || true
+ rm -rf "${pkgdir}/usr/lib/syslinux/bios/dosutil/" || true
+
+ ## Remove com32 and diag dirs
+ rm -rf "${pkgdir}/usr/lib/syslinux/bios/diag/" || true
+ rm -rf "${pkgdir}/usr/lib/syslinux/bios/com32/" || true
+
+ ## Move extlinux binary to /usr/bin
+ install -d "${pkgdir}/usr/bin"
+ mv "${pkgdir}/sbin/extlinux" "${pkgdir}/usr/bin/extlinux"
+ rm -rf "${pkgdir}/sbin/"
+
+ ## Install docs
+ install -d "${pkgdir}/usr/share/doc"
+ cp -ar "${srcdir}/${pkgname}-${pkgver}/doc" "${pkgdir}/usr/share/doc/syslinux"
+
+ ## Install the default configuration
+ install -D -m0644 "${srcdir}/syslinux.cfg" "${pkgdir}/boot/syslinux/syslinux.cfg"
+
+ ## Install the installation and update script
+ ## This script is maintained at git://gist.github.com/772138.git
+ ## Script not yet updated for syslinux-efi
+ install -D -m0755 "${srcdir}/syslinux-install_update" "${pkgdir}/usr/bin/syslinux-install_update"
+
+ # Install Parabola splash
+ install -D -m644 "${srcdir}/splash.png" "${pkgdir}/boot/syslinux/splash.png"
}
package() {
- cd "$srcdir"/$pkgname-${pkgver}
- make INSTALLROOT="$pkgdir" SBINDIR=/usr/bin AUXDIR=/usr/lib/syslinux install
-
- # Install the default configuration
- install -D -m644 "$srcdir"/syslinux.cfg "$pkgdir"/boot/syslinux/syslinux.cfg
- # Install Parabola splash
- install -D -m644 "$srcdir"/splash.png "$pkgdir"/boot/syslinux/splash.png
- # Install the installation and update script
- # This script is maintained at git://gist.github.com/772138.git
- install -D -m755 "$srcdir"/syslinux-install_update "$pkgdir"/usr/bin/syslinux-install_update
+
+ cd "${srcdir}/${pkgname}-${pkgver}/"
+
+ if [[ "${CARCH}" == "x86_64" ]]; then
+ cd "${srcdir}/${pkgname}-${pkgver}-efi64/"
+ make INSTALLROOT="${pkgdir}/" AUXDIR="/usr/lib/syslinux/" efi64 install
+ fi
+
+ if [[ "${CARCH}" == "i686" ]]; then
+ cd "${srcdir}/${pkgname}-${pkgver}-efi32/"
+ make INSTALLROOT="${pkgdir}/" AUXDIR="/usr/lib/syslinux/" efi32 install
+ fi
+
+ _package_syslinux_bios
+
}
diff --git a/libre-testing/syslinux/syslinux-6.00-efi-export-kbdmap.patch b/libre/syslinux/syslinux-6.00-efi-export-kbdmap.patch
index cbcd9a6da..cbcd9a6da 100644
--- a/libre-testing/syslinux/syslinux-6.00-efi-export-kbdmap.patch
+++ b/libre/syslinux/syslinux-6.00-efi-export-kbdmap.patch
diff --git a/libre-testing/syslinux/syslinux-6.00-efi-fix-libcom32.patch b/libre/syslinux/syslinux-6.00-efi-fix-libcom32.patch
index 7460cd195..7460cd195 100644
--- a/libre-testing/syslinux/syslinux-6.00-efi-fix-libcom32.patch
+++ b/libre/syslinux/syslinux-6.00-efi-fix-libcom32.patch
diff --git a/libre/syslinux/syslinux-6.02-fix-chainloading.patch b/libre/syslinux/syslinux-6.02-fix-chainloading.patch
new file mode 100644
index 000000000..6fd7ef4a8
--- /dev/null
+++ b/libre/syslinux/syslinux-6.02-fix-chainloading.patch
@@ -0,0 +1,47 @@
+Reported-by: Dark Raven <drdarkraven at gmail.com>
+Signed-off-by: Raphael S. Carvalho <raphael.scarv at gmail.com>
+---
+ com32/lib/syslinux/disk.c | 22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/com32/lib/syslinux/disk.c b/com32/lib/syslinux/disk.c
+index 0b0c737..47ecb52 100644
+--- a/com32/lib/syslinux/disk.c
++++ b/com32/lib/syslinux/disk.c
+@@ -171,22 +171,28 @@ out:
+ static void *ebios_setup(const struct disk_info *const diskinfo, com32sys_t *inreg,
+ uint64_t lba, uint8_t count, uint8_t op_code)
+ {
+- static __lowmem struct disk_ebios_dapa dapa;
++ static struct disk_ebios_dapa *dapa = NULL;
+ void *buf;
+
++ if (!dapa) {
++ dapa = lmalloc(sizeof *dapa);
++ if (!dapa)
++ return NULL;
++ }
++
+ buf = lmalloc(count * diskinfo->bps);
+ if (!buf)
+ return NULL;
+
+- dapa.len = sizeof(dapa);
+- dapa.count = count;
+- dapa.off = OFFS(buf);
+- dapa.seg = SEG(buf);
+- dapa.lba = lba;
++ dapa->len = sizeof(*dapa);
++ dapa->count = count;
++ dapa->off = OFFS(buf);
++ dapa->seg = SEG(buf);
++ dapa->lba = lba;
+
+ inreg->eax.b[1] = op_code;
+- inreg->esi.w[0] = OFFS(&dapa);
+- inreg->ds = SEG(&dapa);
++ inreg->esi.w[0] = OFFS(dapa);
++ inreg->ds = SEG(dapa);
+ inreg->edx.b[0] = diskinfo->disk;
+
+ return buf;
diff --git a/libre/syslinux/syslinux-dont-build-dos-windows-targets.patch b/libre/syslinux/syslinux-dont-build-dos-windows-targets.patch
index 2b86ab828..54151ab87 100644
--- a/libre/syslinux/syslinux-dont-build-dos-windows-targets.patch
+++ b/libre/syslinux/syslinux-dont-build-dos-windows-targets.patch
@@ -4,9 +4,9 @@ diff -Nur syslinux-4.02.orig//Makefile syslinux-4.02//Makefile
@@ -54,7 +54,7 @@
# files that depend only on the B phase, but may have to be regenerated
# for "make installer".
- BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
-- diag libinstaller dos win32 win64 dosutil
-+ libinstaller
+ BSUBDIRS = codepage com32 lzo core memdisk mbr memdump gpxe sample \
+- diag libinstaller dos win32 win64 dosutil txt
++ libinstaller txt
ITARGET =
IOBJECTS = $(ITARGET) \
utils/gethostip utils/isohybrid utils/mkdiskimage \
diff --git a/libre/syslinux/syslinux-install_update b/libre/syslinux/syslinux-install_update
index 34fe8e916..4dc09696a 100644
--- a/libre/syslinux/syslinux-install_update
+++ b/libre/syslinux/syslinux-install_update
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
-# Sylinux Installer / Updater Scripts
-# Copyright (C) 2011 Matthew Gyurgyik <pyther@pyther.net>
+# Syslinux Installer / Updater Script (for BIOS only)
+# Copyright (C) 2013 Matthew Gyurgyik <pyther@pyther.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -26,13 +26,13 @@
#
shopt -s nullglob
-libpath="/usr/lib/syslinux"
-bootpath="/boot/syslinux"
-extlinux="/usr/bin/extlinux"
+bios_libpath="/usr/lib/syslinux/bios/"
+bios_bootpath="/boot/syslinux/"
+EXTLINUX="/usr/bin/extlinux"
-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
+bios_core_modules=(config.c32 chain.c32 ldlinux.c32 libcom32.c32 libgpl.c32 liblua.c32 libmenu.c32 libutil.c32 linux.c32 menu.c32 vesamenu.c32)
+bios_autoupdate_file="/boot/syslinux/SYSLINUX_AUTOUPDATE"
+pciids_file="/usr/share/hwdata/pci.ids"
## Helper functions ##
# Taken from libui-sh
@@ -120,7 +120,7 @@ usage() {
cat << EOF
usage: $0 options
-This script will install or upgrade Syslinux
+This script will install or upgrade Syslinux (for BIOS only)
OPTIONS:
-h Show this message
@@ -133,16 +133,16 @@ OPTIONS:
Arguments Required:
-c Chroot install (ex: -c /mnt)
-Example Usage: syslinux-install_update.sh -i -a -m (install, set boot flag, install mbr)
- syslinux-install_update.sh -u (update)
+Example Usage: $0 -i -a -m # (install, set boot flag, install mbr)
+ $0 -u # (update)
EOF
}
# Trys to find the partition that /boot resides on
# This will either be on /boot or / (root)
getBoot() {
- if [[ ! -d "$bootpath" ]]; then
- echo "Could not find $bootpath"
+ if [[ ! -d "$bios_bootpath" ]]; then
+ echo "Could not find $bios_bootpath"
echo "Is boot mounted? Is Syslinux installed?"
exit 1
fi
@@ -278,9 +278,9 @@ install_mbr() {
{ echo "ABORT! MBR installation to partition ($disk)!"; exit 4;}
if [[ "$ptb" = MBR ]]; then
- mbrfile="$libpath/mbr.bin"
+ mbrfile="$bios_libpath/mbr.bin"
elif [[ "$ptb" = GPT ]]; then
- mbrfile="$libpath/gptmbr.bin"
+ mbrfile="$bios_libpath/gptmbr.bin"
fi
if dd bs=440 count=1 conv=notrunc if="$mbrfile" of="$disk" &> /dev/null; then
@@ -293,67 +293,65 @@ install_mbr() {
return 0
}
-_install() {
- # Copy files to /boot
- for file in "${com32_files[@]}"; do
- # Symlink files even if links exist
+install_modules() {
+ # Copy all com32 files to /boot
+ for file in "${bios_libpath}"/*.c32; do
+ file=${file##*/}
+ rm "$bios_bootpath/$file" &> /dev/null
if [[ "$boot" = root ]]; then
- ln -s "${libpath#$CHROOT}/$file" "$bootpath/$file" &> /dev/null
+ # Symlink files if /boot resides on the same partition as root
+ ln -sf "${bios_libpath#$CHROOT}/$file" "$bios_bootpath/$file" &> /dev/null
elif [[ "$boot" = boot ]]; then
- cp "$libpath/$file" "$bootpath/$file"
+ cp "$bios_libpath/$file" "$bios_bootpath/$file"
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
+ rm "$bios_bootpath/pci.ids" &> /dev/null
if [[ "$boot" = root ]]; then
- ln -s "$pciids_file" "$bootpath/pci.ids" &> /dev/null
+ ln -sf "$pciids_file" "$bios_bootpath/pci.ids" &> /dev/null
elif [[ "$boot" = boot ]]; then
- cp "$pciids_file" "$bootpath/pci.ids" &> /dev/null
+ cp "$pciids_file" "$bios_bootpath/pci.ids" &> /dev/null
fi
fi
+}
+
+_install() {
+ install_modules
if device_is_raid "$bootpart"; then
- echo "Detected RAID on /boot - installing Syslinux with --raid"
- "$extlinux" --install "$bootpath" -r > /dev/null 2>&1
+ echo "Detected RAID on /boot"
+ "$EXTLINUX" --install "$bios_bootpath" --raid &> /dev/null
else
- "$extlinux" --install "$bootpath" > /dev/null 2>&1
+ "$EXTLINUX" --install "$bios_bootpath" &> /dev/null
fi
if (( $? )); then
- echo "Syslinux install failed"
+ echo "Syslinux BIOS install failed"
exit 2
else
- echo "Syslinux install successful"
+ echo "Syslinux BIOS install successful"
fi
- touch "$CHROOT/$autoupdate_file"
+ touch "$CHROOT/$bios_autoupdate_file"
}
update() {
- # Update any com and c32 files in /boot
- if [[ "$boot" = boot ]]; then
- for file in "$bootpath"/*.{c32,com}; do
- file=$(basename "$file")
- cp "$libpath/$file" "$bootpath/$file" &> /dev/null
- done
- if [[ -f "$bootpath/pci.ids" ]]; then
- cp "$pciids_file" "$bootpath/pci.ids" &> /dev/null
- fi
- fi
+ install_modules
if device_is_raid $bootpart; then
- echo "Detected RAID on /boot - installing Syslinux with --raid"
- "$extlinux" --update "$bootpath" -r &> /dev/null
+ echo "Detected RAID on /boot"
+ "$EXTLINUX" --update "$bios_bootpath" --raid &> /dev/null
else
- "$extlinux" --update "$bootpath" &> /dev/null
+ "$EXTLINUX" --update "$bios_bootpath" &> /dev/null
fi
if (($?)); then
- echo "Syslinux update failed"
+ echo "Syslinux BIOS update failed"
exit 2
else
- echo "Syslinux update successful"
+ echo "Syslinux BIOS update successful"
fi
}
@@ -388,7 +386,7 @@ while getopts "c:uihmas" opt; do
;;
s)
# If AUTOUPDATE_FILE does not exist exit the script
- if [[ -f $autoupdate_file ]]; then
+ if [[ -f $bios_autoupdate_file ]]; then
UPDATE="True"
else
exit 0
@@ -420,14 +418,14 @@ fi
# If a chroot dir is path set variables to reflect chroot
if [[ "$CHROOT" ]]; then
- libpath="$CHROOT$libpath"
- bootpath="$CHROOT$bootpath"
- extlinux="$CHROOT$extlinux"
+ bios_libpath="$CHROOT$bios_libpath"
+ bios_bootpath="$CHROOT$bios_bootpath"
+ EXTLINUX="$CHROOT$EXTLINUX"
fi
# Exit if no /boot path exists
-if ( f=("$bootpath"/*); (( ! ${#f[@]} )) ); then
- echo "Error: $bootpath is empty!"
+if ( f=("$bios_bootpath"/*); (( ! ${#f[@]} )) ); then
+ echo "Error: $bios_bootpath is empty!"
echo "Is /boot mounted?"
exit 1
fi
diff --git a/libre/syslinux/syslinux.cfg b/libre/syslinux/syslinux.cfg
index e7199438f..0c0c6339a 100644
--- a/libre/syslinux/syslinux.cfg
+++ b/libre/syslinux/syslinux.cfg
@@ -7,7 +7,6 @@
# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
# * hdt.c32 - hardware detection tool
# * reboot.c32 - reboots the system
-# * poweroff.com - shutdown the system
#
# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
# If /usr and /boot are on the same file system, symlink the files instead
@@ -50,21 +49,21 @@ MENU COLOR tabmsg 35;40 #ff777caa #00000000 std
#-*
LABEL parabola
- MENU LABEL Parabola GNU/Linux-libre
- LINUX ../vmlinuz-linux-libre
- APPEND root=/dev/sda3 rw
- INITRD ../initramfs-linux-libre.img
+ MENU LABEL Parabola GNU/Linux-libre
+ LINUX ../vmlinuz-linux-libre
+ APPEND root=/dev/sda3 rw
+ INITRD ../initramfs-linux-libre.img
LABEL parabolafallback
- MENU LABEL Parabola GNU/Linux-libre Fallback
- LINUX ../vmlinuz-linux-libre
- APPEND root=/dev/sda3 rw
- INITRD ../initramfs-linux-libre-fallback.img
+ MENU LABEL Parabola GNU/Linux-libre Fallback
+ LINUX ../vmlinuz-linux-libre
+ APPEND root=/dev/sda3 rw
+ INITRD ../initramfs-linux-libre-fallback.img
# If you want Memtest on syslinux, use this LABEL section to launch it (install the memtest86+ package)
-# LABEL memtest
-# MENU LABEL Memtest86+
-# LINUX ../memtest86+/memtest.bin
+# LABEL memtest
+# MENU LABEL Memtest86+
+# LINUX ../memtest86+/memtest.bin
LABEL hdt
MENU LABEL HDT (Hardware Detection Tool)
@@ -73,7 +72,7 @@ LABEL hdt
LABEL reboot
MENU LABEL Reboot
COM32 reboot.c32
-
-LABEL off
- MENU LABEL Power Off
- COMBOOT poweroff.com
+
+LABEL poweroff
+ MENU LABEL Poweroff
+ COM32 poweroff.c32
diff --git a/libre/syslinux/syslinux.install b/libre/syslinux/syslinux.install
index 89dbf4e86..ac8553a97 100644
--- a/libre/syslinux/syslinux.install
+++ b/libre/syslinux/syslinux.install
@@ -1,13 +1,36 @@
post_install() {
- echo "==> If you want to use syslinux as your bootloader"
+ echo "==> If you want to use syslinux as your BIOS bootloader"
echo "==> edit /boot/syslinux/syslinux.cfg and run"
echo "==> # /usr/bin/syslinux-install_update -i -a -m"
echo "==> to install it."
+
+ cat << EOF
+Syslinux efi64 and efi32 files have been installed at
+/usr/lib/syslinux/{efi64,efi32}/ respectively.
+
+To install, copy /usr/lib/syslinux/efi64 to (ESP)/EFI/syslinux and
+syslinux.cfg to (ESP)/EFI/syslinux/syslinux.cfg and add a boot entry
+using efibootmgr for (ESP)/EFI/syslinux/syslinux.efi
+EOF
+
}
post_upgrade() {
# auto-update syslinux if /boot/syslinux/SYSLINUX_AUTOUPDATE exists
/usr/bin/syslinux-install_update -s
+ # update to 5.01 message
+ if [ "$(vercmp $2 5.01)" -lt 0 ]; then
+ echo "If you used syslinux-install_update to install syslinux:"
+ echo "==> If you want to use syslinux with menu and all modules please rerun"
+ echo "==> # /usr/bin/syslinux-install_update -i -a -m"
+ echo ""
+ echo "If you manually installed syslinux:"
+ echo "==> Please copy or symlink all .c32 modules to your /boot/syslinux directory."
+ echo "==> If (/ and /boot on seperate fs):"
+ echo "==> # cp /usr/lib/syslinux/bios/*.c32 /boot/syslinux"
+ echo "==> If (/ and /boot on same fs):"
+ echo "==> # ln -s /usr/lib/syslinux/bios/*.c32 /boot/syslinux"
+ fi
}
# vim:set ts=2 sw=2 et: