diff --git a/system/boot/syslinux/files/syslinux.git-0a2dbb3.patch b/system/boot/syslinux/files/syslinux.git-0a2dbb3.patch new file mode 100644 index 0000000000..4d59f85d52 --- /dev/null +++ b/system/boot/syslinux/files/syslinux.git-0a2dbb3.patch @@ -0,0 +1,38 @@ +From 0a2dbb3392ee710838bea6bda80d4daad6b54780 Mon Sep 17 00:00:00 2001 +From: Scot Doyle +Date: Sat, 18 Apr 2015 07:11:07 -0400 +Subject: [PATCH] com32/lib/syslinux/load_linux.c: update prot_mode_base + +If the kernel is relocatable and the protected mode code will not fit +in the initially determined location, that code will be moved to the +next available location. However, beginning with commit 8f470e7b, the +code is moved to the initially determined location instead of the next +available location because prot_mode_base is no longer updated to the +correct location. Since whdr->code32_start is updated, it is pointing +to the wrong execution start location, random code is executed and +the machine is rebooted. + +Restore the old behavior by assigning prot_mode_base the value of +base. Tested on a machine that exposed this behavior. + +Signed-off-by: Scot Doyle +Signed-off-by: Gene Cumm +--- + com32/lib/syslinux/load_linux.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c +index ac73729..fc7f04f 100644 +--- a/com32/lib/syslinux/load_linux.c ++++ b/com32/lib/syslinux/load_linux.c +@@ -323,6 +323,7 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size, + } + + whdr->code32_start += base - prot_mode_base; ++ prot_mode_base = base; + + /* Real mode code */ + if (syslinux_memmap_find(amap, &real_mode_base, +-- +2.7.4.GIT + diff --git a/system/boot/syslinux/files/syslinux.git-138e850fab106b5235178848b3e0d33e25f4d3a2.patch b/system/boot/syslinux/files/syslinux.git-138e850fab106b5235178848b3e0d33e25f4d3a2.patch new file mode 100644 index 0000000000..1368cf7a9c --- /dev/null +++ b/system/boot/syslinux/files/syslinux.git-138e850fab106b5235178848b3e0d33e25f4d3a2.patch @@ -0,0 +1,32 @@ +From 138e850fab106b5235178848b3e0d33e25f4d3a2 Mon Sep 17 00:00:00 2001 +From: Olivier Brunel +Date: Wed, 2 Mar 2016 17:52:23 -0500 +Subject: [PATCH] keytab-lilo: update to support kbd 2.0.3 format + +Since kbd 2.0.3 (commit 6ff47cf2) the format generated by 'loadkeys -m' has +changed slightly, using "unsigned short" instead of "u_short" + +Signed-off-by: Olivier Brunel +--- + utils/keytab-lilo | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/utils/keytab-lilo b/utils/keytab-lilo +index 9e34160..337a869 100755 +--- a/utils/keytab-lilo ++++ b/utils/keytab-lilo +@@ -48,9 +48,9 @@ sub load_map + $empty = 1; + while () { + chop; +- if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) { ++ if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) { + die "active at beginning of map" if defined $current; +- $current = $pfx.":".$2; ++ $current = $pfx.":".$3; + next; + } + undef $current if /^};\s*$/; +-- +2.7.4.GIT + diff --git a/system/boot/syslinux/files/syslinux.git-83aad4f.patch b/system/boot/syslinux/files/syslinux.git-83aad4f.patch new file mode 100644 index 0000000000..572b61fbbf --- /dev/null +++ b/system/boot/syslinux/files/syslinux.git-83aad4f.patch @@ -0,0 +1,32 @@ +From 83aad4f69065509ba5b1c080edccfed316a4cff0 Mon Sep 17 00:00:00 2001 +From: Scot Doyle +Date: Sat, 7 Feb 2015 13:52:05 -0500 +Subject: [PATCH] load_linux: correct a type + +Correct base's type to match its initialization from prot_mode_base and +passage to syslinux_memmap_find(). Tested with extlinux. + +Signed-off-by: Scot Doyle +Signed-off-by: Gene Cumm +--- + com32/lib/syslinux/load_linux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c +index 06ae2a9..ac73729 100644 +--- a/com32/lib/syslinux/load_linux.c ++++ b/com32/lib/syslinux/load_linux.c +@@ -155,8 +155,8 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size, + char *cmdline) + { + struct linux_header hdr, *whdr; +- size_t real_mode_size, prot_mode_size, base; +- addr_t real_mode_base, prot_mode_base, prot_mode_max; ++ size_t real_mode_size, prot_mode_size; ++ addr_t real_mode_base, prot_mode_base, prot_mode_max, base; + addr_t irf_size; + size_t cmdline_size, cmdline_offset; + struct setup_data *sdp; +-- +2.7.4.GIT + diff --git a/system/boot/syslinux/pspec.xml b/system/boot/syslinux/pspec.xml index 9dfe2f56e2..e9b0d662dd 100644 --- a/system/boot/syslinux/pspec.xml +++ b/system/boot/syslinux/pspec.xml @@ -16,16 +16,23 @@ nasm asciidoc + dosfstools + mtools efibootmgr-devel + gptfdisk upx libutil-linux-devel + util-linux - 0001-Add-install-all-target-to-top-side-of-HAVE_FIRMWARE.patch - 0035-SYSAPPEND-Fix-space-stripping.patch + gcc-fix-alignment.patch dont-guess-alignment.patch btrfs-fix.patch + syslinux.git-138e850fab106b5235178848b3e0d33e25f4d3a2.patch + syslinux.git-83aad4f.patch + syslinux.git-0a2dbb3.patch