From 0761c1d99fbce952d6ebfd04f91943d5ab6bdbbd Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 11 Jan 2014 18:18:10 +0100 Subject: [PATCH] syslinux: update to 6.02 and add EFI support. --- srcpkgs/syslinux/INSTALL | 16 +++++++ .../syslinux-6.02-fix-bios-isolinux.patch | 10 +++++ .../syslinux-6.02-fix-chainloading.patch | 45 +++++++++++++++++++ ...linux-dont-build-dos-windows-targets.patch | 11 ----- srcpkgs/syslinux/template | 29 +++++++++--- 5 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 srcpkgs/syslinux/INSTALL create mode 100644 srcpkgs/syslinux/patches/syslinux-6.02-fix-bios-isolinux.patch create mode 100644 srcpkgs/syslinux/patches/syslinux-6.02-fix-chainloading.patch delete mode 100644 srcpkgs/syslinux/patches/syslinux-dont-build-dos-windows-targets.patch diff --git a/srcpkgs/syslinux/INSTALL b/srcpkgs/syslinux/INSTALL new file mode 100644 index 0000000000..27096aeef3 --- /dev/null +++ b/srcpkgs/syslinux/INSTALL @@ -0,0 +1,16 @@ +case "${ACTION}" in +post) + cat <<_EOF +======================================================================= + +Some optional packages must be installed for additional functionality: + + - mtools: mkdiskimage and syslinux support + - gptfdisk: GPT support + - efibootmgr: EFI support + - dosfstools: EFI support + +======================================================================= +_EOF + ;; +esac diff --git a/srcpkgs/syslinux/patches/syslinux-6.02-fix-bios-isolinux.patch b/srcpkgs/syslinux/patches/syslinux-6.02-fix-bios-isolinux.patch new file mode 100644 index 0000000000..75c871ea16 --- /dev/null +++ b/srcpkgs/syslinux/patches/syslinux-6.02-fix-bios-isolinux.patch @@ -0,0 +1,10 @@ +--- core/isolinux.asm ++++ core/isolinux.asm +@@ -420,7 +420,7 @@ MaxLMA equ 384*1024 ; Reasonable limit (384K) + call getlinsec + pop eax + pop cx +- mov dx,cx ++ movzx edx,cx + pop bp + pop bx diff --git a/srcpkgs/syslinux/patches/syslinux-6.02-fix-chainloading.patch b/srcpkgs/syslinux/patches/syslinux-6.02-fix-chainloading.patch new file mode 100644 index 0000000000..6f513f364a --- /dev/null +++ b/srcpkgs/syslinux/patches/syslinux-6.02-fix-chainloading.patch @@ -0,0 +1,45 @@ +Reported-by: Dark Raven +Signed-off-by: Raphael S. Carvalho +--- + com32/lib/syslinux/disk.c | 22 ++++++++++++++-------- + 1 files changed, 14 insertions(+), 8 deletions(-) + +--- com32/lib/syslinux/disk.c ++++ 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/srcpkgs/syslinux/patches/syslinux-dont-build-dos-windows-targets.patch b/srcpkgs/syslinux/patches/syslinux-dont-build-dos-windows-targets.patch deleted file mode 100644 index 2c88f8e044..0000000000 --- a/srcpkgs/syslinux/patches/syslinux-dont-build-dos-windows-targets.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile 2010-07-21 21:33:13.000000000 +0200 -+++ 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/srcpkgs/syslinux/template b/srcpkgs/syslinux/template index c2bd2e2ccc..e4753b3801 100644 --- a/srcpkgs/syslinux/template +++ b/srcpkgs/syslinux/template @@ -1,22 +1,41 @@ # Template file for 'syslinux' pkgname=syslinux -version=5.01 +version=6.02 revision=1 -makedepends="perl nasm libuuid-devel" +hostmakedepends="perl python nasm" +makedepends="gnu-efi-libs libuuid-devel" short_desc="A boot loader for the Linux operating system" maintainer="Juan RP " homepage="http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project" license="GPL-2" distfiles="${KERNEL_SITE}/utils/boot/$pkgname/$pkgname-$version.tar.xz" -checksum=41320ae9c8211bb99b1322fdbf98a83d3bdc0f9a78291ad27f8512b12e16b411 +checksum=afa31b7cbf72e1c0c1752a0636ba724ce01c0e374366e46e61db6862b4685478 + +pre_build() { + # 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 Makefile + sed 's|win32/syslinux.exe win64/syslinux64.exe||g' -i Makefile + sed 's|dosutil/*.com dosutil/*.sys||g' -i Makefile + sed 's|dos/syslinux.com||g' -i Makefile + sed 's|INSTALLSUBDIRS = com32 utils dosutil|INSTALLSUBDIRS = com32 utils|g' -i Makefile + sed 's|install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)|# install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)|g' -i Makefile + # Fix FHS manpage path + sed 's|/usr/man|/usr/share/man|g' -i mk/syslinux.mk +} do_build() { unset CFLAGS LDFLAGS - sed 's|/usr/man|/usr/share/man|g' -i mk/syslinux.mk + case "$XBPS_TARGET_MACHINE" in + i686*) sed -e 's,^firmware =.*,firmware = bios efi32,g' -i Makefile;; + x86_64*) sed -e 's,^firmware =.*,firmware = bios efi64,g' -i Makefile;; + esac make installer } do_install() { make INSTALLROOT=${DESTDIR} install - vmove "sbin/*" usr/bin + mv ${DESTDIR}/sbin/* ${DESTDIR}/usr/bin + # Remove completely development stuff. + rm -r ${DESTDIR}/usr/share/syslinux/com32/include + rm ${DESTDIR}/usr/share/syslinux/com32/*.a }