diff --git a/0000-Add-install-all-target-to-top-side-of-HAVE_FIRMWARE.patch b/0000-Add-install-all-target-to-top-side-of-HAVE_FIRMWARE.patch new file mode 100644 index 0000000000000000000000000000000000000000..78cceb6674ad34a204b5b94e7378c6d665789883 --- /dev/null +++ b/0000-Add-install-all-target-to-top-side-of-HAVE_FIRMWARE.patch @@ -0,0 +1,32 @@ +From ca745cdfc27b83b6bcef9f856d858a68c64429de Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 8 Apr 2014 15:28:12 -0400 +Subject: [PATCH] Add "install-all target" to top side of HAVE_FIRMWARE. + +--- + Makefile | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/Makefile b/Makefile +index b472945..6606d31 100644 +--- a/Makefile ++++ b/Makefile +@@ -275,6 +275,16 @@ efi64: + FIRMWARE=EFI64 FWCLASS=EFI \ + $(MAKECMDGOALS) + ++install-all: ++ ++install: ++ ++netinstall: ++ ++clean: ++ ++all: ++ + else # FIRMWARE + + all: all-local subdirs +-- +2.5.5 diff --git a/0001-ext4-64bit-feature.patch b/0001-ext4-64bit-feature.patch new file mode 100644 index 0000000000000000000000000000000000000000..a8fd59b124a209c7cf679351fbd58135ba200134 --- /dev/null +++ b/0001-ext4-64bit-feature.patch @@ -0,0 +1,103 @@ +From 359811d9cfb47a9bfd3b2d0b78ef7e8f36e10152 Mon Sep 17 00:00:00 2001 +From: Paulo Alcantara +Date: Wed, 11 Oct 2017 07:00:31 -0400 +Subject: [PATCH] ext4: Fix 64bit feature + +As per ext4 specification: + +> In ext2, ext3, and ext4 (when the 64bit feature is not enabled), the +> block group descriptor was only 32 bytes long and therefore ends at +> bg_checksum. On an ext4 filesystem with the 64bit feature enabled, the +> block group descriptor expands to at least the 64 bytes described below; +> the size is stored in the superblock. + +Since block group descriptor has been expanded to 64 bytes long (when 64 +bit feature is enabled), we cannot index ext2_group_desc and return it +*directly* -- as we did it in ext2_get_group_desc -- it's still 32 bytes +long. + +Instead, use s_desc_size field from superblock to correctly index and +return block group descriptors. + +Cc: H. Peter Anvin +Cc: Gene Cumm +Signed-off-by: Paulo Alcantara +--- + core/fs/ext2/ext2.c | 23 ++++++++++++++--------- + core/fs/ext2/ext2_fs.h | 1 + + 2 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/core/fs/ext2/ext2.c b/core/fs/ext2/ext2.c +index 76bd1d5..792b567 100644 +--- a/core/fs/ext2/ext2.c ++++ b/core/fs/ext2/ext2.c +@@ -25,22 +25,17 @@ static enum dirent_type ext2_cvt_type(unsigned int d_file_type) + return inode_type[d_file_type]; + } + +-/* +- * get the group's descriptor of group_num +- */ +-static const struct ext2_group_desc * +-ext2_get_group_desc(struct fs_info *fs, uint32_t group_num) ++static const void *__ext2_get_group_desc(struct fs_info *fs, uint32_t group_num) + { + struct ext2_sb_info *sbi = EXT2_SB(fs); + uint32_t desc_block, desc_index; +- const struct ext2_group_desc *desc_data_block; ++ uint8_t *p; + + if (group_num >= sbi->s_groups_count) { + printf ("ext2_get_group_desc" + "block_group >= groups_count - " + "block_group = %d, groups_count = %d", + group_num, sbi->s_groups_count); +- + return NULL; + } + +@@ -49,10 +44,19 @@ ext2_get_group_desc(struct fs_info *fs, uint32_t group_num) + + desc_block += sbi->s_first_data_block + 1; + +- desc_data_block = get_cache(fs->fs_dev, desc_block); +- return &desc_data_block[desc_index]; ++ p = get_cache(fs->fs_dev, desc_block); ++ return p + sbi->s_desc_size * desc_index; + } + ++/* ++ * get the group's descriptor of group_num ++ */ ++static inline const struct ext2_group_desc * ++ext2_get_group_desc(struct fs_info *fs, uint32_t group_num) ++{ ++ return __ext2_get_group_desc(fs, group_num); ++ } ++ + /* + * Unlike strncmp, ext2_match_entry returns 1 for success, 0 for failure. + */ +@@ -306,6 +310,7 @@ static int ext2_fs_init(struct fs_info *fs) + if (sb.s_desc_size < sizeof(struct ext2_group_desc)) + sb.s_desc_size = sizeof(struct ext2_group_desc); + sbi->s_desc_per_block = BLOCK_SIZE(fs) / sb.s_desc_size; ++ sbi->s_desc_size = sb.s_desc_size; + sbi->s_groups_count = (sb.s_blocks_count - sb.s_first_data_block + + EXT2_BLOCKS_PER_GROUP(fs) - 1) + / EXT2_BLOCKS_PER_GROUP(fs); +diff --git a/core/fs/ext2/ext2_fs.h b/core/fs/ext2/ext2_fs.h +index 803a995..d8d07eb 100644 +--- a/core/fs/ext2/ext2_fs.h ++++ b/core/fs/ext2/ext2_fs.h +@@ -278,6 +278,7 @@ struct ext2_sb_info { + uint32_t s_first_data_block; /* First Data Block */ + int s_inode_size; + uint8_t s_uuid[16]; /* 128-bit uuid for volume */ ++ int s_desc_size; /* size of group descriptor */ + }; + + static inline struct ext2_sb_info *EXT2_SB(struct fs_info *fs) +-- +2.27.0 + diff --git a/0002-include-sysmacros-h.patch b/0002-include-sysmacros-h.patch new file mode 100644 index 0000000000000000000000000000000000000000..fdad826b9cde48ff1d15e568bcd53f7832d9afc8 --- /dev/null +++ b/0002-include-sysmacros-h.patch @@ -0,0 +1,34 @@ +From e6f0080d73f4cdd11183736f6e7e7bba8aac67b3 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Tue, 19 Apr 2016 06:50:31 -0400 +Subject: [PATCH] extlinux: pull in sys/sysmacros.h for major/minor/makedev + +These functions are defined in sys/sysmacros.h, so add the include to +main.c. This is already handled correctly in mountinfo.c. Otherwise +we get build failures like: + +main.o: In function 'find_device_sysfs': +extlinux/main.c:1131: undefined reference to 'minor' + +Signed-off-by: Mike Frysinger +Signed-off-by: Gene Cumm + +--- + extlinux/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/extlinux/main.c b/extlinux/main.c +index a7ebd49..ebff7ea 100644 +--- a/extlinux/main.c ++++ b/extlinux/main.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +2.27.0 + diff --git a/0003-Add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch b/0003-Add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch new file mode 100644 index 0000000000000000000000000000000000000000..e55c490dab800f5a54aba43c24fddb0e59355e44 --- /dev/null +++ b/0003-Add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch @@ -0,0 +1,76 @@ +From 5c24d725d5a5f50f0544fbcc544f08a3f9e90e5d Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 8 Aug 2019 05:41:36 -0400 +Subject: [PATCH] Add 'RPMOPTFLAGS' to CFLAGS for some stuff. + +--- + extlinux/Makefile | 4 ++-- + linux/Makefile | 4 ++-- + mtools/Makefile | 4 ++-- + utils/Makefile | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/extlinux/Makefile b/extlinux/Makefile +index 1721ee54aff..d504e23133e 100644 +--- a/extlinux/Makefile ++++ b/extlinux/Makefile +@@ -18,9 +18,9 @@ include $(MAKEDIR)/syslinux.mk + + OPTFLAGS = -g -Os + INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller +-CFLAGS = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ + $(OPTFLAGS) $(INCLUDES) +-LDFLAGS = ++LDFLAGS = $(RPMLDFLAGS) + + SRCS = main.c \ + mountinfo.c \ +diff --git a/linux/Makefile b/linux/Makefile +index 5a49d813de1..9fed68d02c6 100644 +--- a/linux/Makefile ++++ b/linux/Makefile +@@ -18,8 +18,8 @@ include $(MAKEDIR)/syslinux.mk + + OPTFLAGS = -g -Os + INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller +-CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +-LDFLAGS = ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) ++LDFLAGS = $(RPMLDFLAGS) + + SRCS = syslinux.c \ + ../libinstaller/syslxopt.c \ +diff --git a/mtools/Makefile b/mtools/Makefile +index 632b185ba2f..b6e5ebdba6b 100755 +--- a/mtools/Makefile ++++ b/mtools/Makefile +@@ -2,8 +2,8 @@ include $(MAKEDIR)/syslinux.mk + + OPTFLAGS = -g -Os + INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libfat -I$(SRC)/../libinstaller +-CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +-LDFLAGS = ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) ++LDFLAGS = $(RPMLDFLAGS) + + SRCS = syslinux.c \ + ../libinstaller/fs.c \ +diff --git a/utils/Makefile b/utils/Makefile +index dfe625902ce..b4962353f20 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -17,8 +17,8 @@ + VPATH = $(SRC) + include $(MAKEDIR)/syslinux.mk + +-CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC) +-LDFLAGS = -O2 ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC) ++LDFLAGS = $(RPMLDFLAGS) -O2 + + C_TARGETS = isohybrid gethostip memdiskfind + SCRIPT_TARGETS = mkdiskimage +-- +2.21.0 + diff --git a/0004-Workaround-multiple-definition-of-symbol-errors.patch b/0004-Workaround-multiple-definition-of-symbol-errors.patch new file mode 100644 index 0000000000000000000000000000000000000000..b5bbad0ac05520055eeae1f349f9d7ca7a7a81a7 --- /dev/null +++ b/0004-Workaround-multiple-definition-of-symbol-errors.patch @@ -0,0 +1,109 @@ +From 951928f2cad5682c2844e6bd0f7201236c5d9b66 Mon Sep 17 00:00:00 2001 +From: Merlin Mathesius +Date: Wed, 13 May 2020 08:02:27 -0500 +Subject: [PATCH] Workaround multiple definition of symbol errors + +--- + com32/cmenu/Makefile | 2 +- + com32/elflink/ldlinux/Makefile | 2 +- + com32/gpllib/Makefile | 2 +- + com32/hdt/Makefile | 2 +- + core/Makefile | 2 +- + dos/Makefile | 2 +- + efi/Makefile | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile +index b81b68ed..2ae989c4 100644 +--- a/com32/cmenu/Makefile ++++ b/com32/cmenu/Makefile +@@ -49,7 +49,7 @@ makeoutputdirs: + @mkdir -p $(OBJ)/libmenu + + libmenu/libmenu.elf: $(LIBMENU) +- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \ ++ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \ + -o $@ $^ + + tidy dist: +diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile +index 87c0d362..2be2a01a 100644 +--- a/com32/elflink/ldlinux/Makefile ++++ b/com32/elflink/ldlinux/Makefile +@@ -33,7 +33,7 @@ endif + all: $(BTARGET) ldlinux_lnx.a + + ldlinux.elf : $(OBJS) +- $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS) ++ $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS) + + LNXCFLAGS += -D__export='__attribute__((visibility("default")))' + LNXLIBOBJS = get_key.lo +diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile +index 1fec9145..2d764d0b 100644 +--- a/com32/gpllib/Makefile ++++ b/com32/gpllib/Makefile +@@ -24,7 +24,7 @@ makeoutputdirs: + $(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b)) + + libgpl.elf : $(LIBOBJS) +- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ ++ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ + + tidy dist clean: + find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \ +diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile +index 61736d05..1d947857 100644 +--- a/com32/hdt/Makefile ++++ b/com32/hdt/Makefile +@@ -52,7 +52,7 @@ QEMU ?= qemu-kvm + all: $(MODULES) $(TESTFILES) + + hdt.elf : $(OBJS) $(LIBS) $(C_LIBS) +- $(LD) $(LDFLAGS) -o $@ $^ ++ $(LD) $(LDFLAGS) -z muldefs -o $@ $^ + + memtest: + -[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST) +diff --git a/core/Makefile b/core/Makefile +index 46cb037c..f0cfcbe9 100644 +--- a/core/Makefile ++++ b/core/Makefile +@@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld + NASM_ELF = elf + + %.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS) +- $(LD) $(LDFLAGS) -pie -Bsymbolic \ ++ $(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \ + -T $(LDSCRIPT) \ + --unresolved-symbols=report-all \ + -E --hash-style=gnu -M -o $@ $< \ +diff --git a/dos/Makefile b/dos/Makefile +index 4c930d19..5d1c72ca 100644 +--- a/dos/Makefile ++++ b/dos/Makefile +@@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk + CFLAGS += -D__MSDOS__ -mregparm=3 -DREGPARM=3 + # CFLAGS += -DDEBUG + +-LDFLAGS = -T $(SRC)/dosexe.ld ++LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs + OPTFLAGS = -g + INCLUDES = -include code16.h -nostdinc -iwithprefix include \ + -I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \ +diff --git a/efi/Makefile b/efi/Makefile +index bbf23f24..3dd922d5 100644 +--- a/efi/Makefile ++++ b/efi/Makefile +@@ -69,7 +69,7 @@ $(OBJS): | $(OBJ)/$(ARCH) + BTARGET = syslinux.efi + + syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS) +- $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi ++ $(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi + + # We need to rename the .hash section because the EFI firmware + # linker really doesn't like it. +-- +2.25.1 + diff --git a/0005-Replace-builtin-strlen-that-appears-to-get-optimized.patch b/0005-Replace-builtin-strlen-that-appears-to-get-optimized.patch new file mode 100644 index 0000000000000000000000000000000000000000..11160bb80a671d504cd6eebd4d98bb0506e59fa1 --- /dev/null +++ b/0005-Replace-builtin-strlen-that-appears-to-get-optimized.patch @@ -0,0 +1,40 @@ +From eae06bdce9468d7fde263de1c53f80f2faff0c9e Mon Sep 17 00:00:00 2001 +From: Merlin Mathesius +Date: Wed, 13 May 2020 11:58:37 -0500 +Subject: [PATCH] Replace builtin strlen that appears to get optimized away + +--- + dos/string.h | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/dos/string.h b/dos/string.h +index f648de2d..407d0233 100644 +--- a/dos/string.h ++++ b/dos/string.h +@@ -5,12 +5,22 @@ + #ifndef _STRING_H + #define _STRING_H + ++#include ++ + /* Standard routines */ + #define memcpy(a,b,c) __builtin_memcpy(a,b,c) + #define memmove(a,b,c) __builtin_memmove(a,b,c) + #define memset(a,b,c) __builtin_memset(a,b,c) + #define strcpy(a,b) __builtin_strcpy(a,b) +-#define strlen(a) __builtin_strlen(a) ++#define strlen(a) inline_strlen(a) ++ ++/* replacement for builtin strlen that appears to get optimized away */ ++static inline size_t inline_strlen(const char *str) ++{ ++ size_t l; ++ for (l = 0; *str++; l++); ++ return l; ++} + + /* This only returns true or false */ + static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) +-- +2.25.1 + diff --git a/0006-Fix-backspace-when-editing-a-multiline-cmdline.patch b/0006-Fix-backspace-when-editing-a-multiline-cmdline.patch new file mode 100644 index 0000000000000000000000000000000000000000..aacc00471daa6c3f2eb2cdff5b3ff81e84f91074 --- /dev/null +++ b/0006-Fix-backspace-when-editing-a-multiline-cmdline.patch @@ -0,0 +1,137 @@ +From 7ebe10128eef978e99667d741ed4588d80b38441 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Thu, 21 Oct 2021 15:15:33 -0400 +Subject: [PATCH] Fix backspace when editing a multiline cmdline + +Once the cmdline had passed the width of the screen, adding additional +characters introduced a spurious newline, and another newline at the +width of input. Furthermore, hitting backspace would not start +redrawing at the end of input, but rather at the beginning of the +current line - resulting in extra duplicate lines scrolling the console. + +First, fix the assumption that the length of cmdline is the width - it +needs to include the length of the prompt (i.e., length of input and +space). + +Second, fix the behavior of single-line redraw (i.e., redraw == 1) to +move the cursor to the row the line begins at. + +Third, don't scroll the cursor down when a line wrap would occur - it's +not necessary since line wrap is enabled, and results in the extra blank +line. + +Finally, comment all used escape sequences so that I don't need to look +them up again. + +Signed-off-by: Robbie Harwood +--- + com32/elflink/ldlinux/cli.c | 33 ++++++++++++++++++--------------- + 1 file changed, 18 insertions(+), 15 deletions(-) + +diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c +index 3119b11f..4913f038 100644 +--- a/com32/elflink/ldlinux/cli.c ++++ b/com32/elflink/ldlinux/cli.c +@@ -135,6 +135,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + struct cli_command *comm_counter = NULL; + clock_t kbd_to = kbdtimeout; + clock_t tto = totaltimeout; ++ int prompt_len = 1 + strlen(input); + + if (!width) { + int height; +@@ -144,7 +145,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + + len = cursor = 0; + prev_len = 0; +- x = y = 0; ++ y = 0; + + /* + * Before we start messing with the x,y coordinates print 'input' +@@ -152,6 +153,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + * previously. + */ + printf("%s ", input); ++ x = prompt_len; + + while (!done) { + if (redraw > 1) { +@@ -162,8 +164,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + if (pDraw_Menu) + (*pDraw_Menu) (-1, top, 1); + prev_len = 0; +- printf("\033[2J\033[H"); +- // printf("\033[0m\033[2J\033[H"); ++ printf("\033[2J\033[H"); /* Clear entire screen; move to 0, 0. */ + } + + if (redraw > 0) { +@@ -172,10 +173,14 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + prev_len = max(len, prev_len); + + /* Redraw the command line */ +- printf("\033[?25l"); +- printf("\033[1G%s ", input); ++ printf("\033[?25l"); /* Hide cursor. */ ++ printf("\033[1G"); /* Column 1. */ ++ if (y > 0) ++ printf("\033[%dA", y); /* Directly up. */ + +- x = strlen(input); ++ printf("%s ", input); ++ ++ x = prompt_len; + y = 0; + at = 0; + while (at < prev_len) { +@@ -183,23 +188,22 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + at++; + x++; + if (x >= width) { +- printf("\r\n"); + x = 0; + y++; + } + } +- printf("\033[K\r"); ++ printf("\033[K\r"); /* Clear to end of line; go to beginning. */ + +- dy = y - (cursor + strlen(input) + 1) / width; +- x = (cursor + strlen(input) + 1) % width; ++ dy = y - (cursor + prompt_len) / width; ++ x = (cursor + prompt_len) % width; + + if (dy) { +- printf("\033[%dA", dy); ++ printf("\033[%dA", dy); /* Cursor directly up. */ + y -= dy; + } + if (x) +- printf("\033[%dC", x); +- printf("\033[?25h"); ++ printf("\033[%dC", x); /* Cursor forward. */ ++ printf("\033[?25h"); /* Show cursor. */ + prev_len = len; + redraw = 0; + } +@@ -439,7 +443,6 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + cursor++; + x++; + if (x >= width) { +- printf("\r\n\033[K"); + y++; + x = 0; + } +@@ -459,7 +462,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ , + } + } + +- printf("\033[?7h"); ++ printf("\033[?7h"); /* Enable line wrap. */ + + /* Add the command to the history if its length is larger than 0 */ + len = strlen(ret); +-- +2.33.0 + diff --git a/0007-tweak-for-gcc-10.patch b/0007-tweak-for-gcc-10.patch new file mode 100644 index 0000000000000000000000000000000000000000..a033f77ae7bf0c281d022321e878d820ea2936f1 --- /dev/null +++ b/0007-tweak-for-gcc-10.patch @@ -0,0 +1,84 @@ +From 8284530f4bd86a38b9867f847bd844f5d8d08e87 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Mon, 6 Apr 2020 23:46:03 +0100 +Subject: sys-boot/syslinux: tweak for gcc-10, bug #705730 + +Closes: https://bugs.gentoo.org/705730 +Package-Manager: Portage-2.3.96, Repoman-2.3.22 +Signed-off-by: Sergei Trofimovich + +Reference:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8284530f4bd86a38b9867f847bd844f5d8d08e87 +https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53c31ce51ace223e4439cde2b6b2a395e40ae9d5 +--- + mk/com32.mk | 1 + + mk/efi.mk | 2 +- + mk/elf.mk | 1 + + mk/embedded.mk | 1 + + mk/lib.mk | 1 + + 5 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/mk/com32.mk b/mk/com32.mk +index aeb8a2c..5ae14fe 100644 +--- a/mk/com32.mk ++++ b/mk/com32.mk +@@ -47,6 +47,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0) + GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) ++GCCOPT += $(call gcc_ok,-fcommon) + + ifeq ($(FWCLASS),EFI) + GCCOPT += -mno-red-zone +diff --git a/mk/efi.mk b/mk/efi.mk +index f097ad2..a082bad 100644 +--- a/mk/efi.mk ++++ b/mk/efi.mk +@@ -7,7 +7,7 @@ core = $(topdir)/core + # Set up architecture specifics; for cross compilation, set ARCH as apt + # gnuefi sets up architecture specifics in ia32 or x86_64 sub directories + # set up the LIBDIR and EFIINC for building for the appropriate architecture +-GCCOPT := $(call gcc_ok,-fno-stack-protector,) ++GCCOPT := $(call gcc_ok,-fno-stack-protector,) $(call gcc_ok,-fcommon) + EFIINC = $(objdir)/include/efi + LIBDIR = $(objdir)/lib + +diff --git a/mk/elf.mk b/mk/elf.mk +index b46dbd0..7ac7600 100644 +--- a/mk/elf.mk ++++ b/mk/elf.mk +@@ -42,6 +42,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0) + GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) ++GCCOPT += $(call gcc_ok,-fcommon) + + com32 = $(topdir)/com32 + core = $(topdir)/core +diff --git a/mk/embedded.mk b/mk/embedded.mk +index 488dc0f..bfca1a8 100644 +--- a/mk/embedded.mk ++++ b/mk/embedded.mk +@@ -51,6 +51,7 @@ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) + GCCOPT += $(call gcc_ok,-fvisibility=hidden) ++GCCOPT += $(call gcc_ok,-fcommon) + + LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) + +diff --git a/mk/lib.mk b/mk/lib.mk +index 54f1fd5..baad194 100644 +--- a/mk/lib.mk ++++ b/mk/lib.mk +@@ -28,6 +28,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0) + GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) ++GCCOPT += $(call gcc_ok,-fcommon) + + INCLUDE = -I$(SRC) + STRIP = strip --strip-all -R .comment -R .note +-- +2.27.0 + + diff --git a/syslinux-6.04-pre1.tar.gz b/syslinux-6.04-pre1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fa53bfd126b90b38d1e32133dc82cbc5c0b8d319 Binary files /dev/null and b/syslinux-6.04-pre1.tar.gz differ diff --git a/syslinux.spec b/syslinux.spec new file mode 100644 index 0000000000000000000000000000000000000000..aa74f89e4bb75bf7ff2b8f34a08b20a362cad857 --- /dev/null +++ b/syslinux.spec @@ -0,0 +1,206 @@ +%define anolis_release 1 +%define _sbindir /sbin +%define _binaries_in_noarch_packages_terminate_build 0 +%undefine _auto_set_build_flags +%define version_num 6.04 + +Name: syslinux +Version: %{version_num}~pre1 +Release: %{anolis_release}%{?dist} +Summary: Simple kernel loader which boots from a FAT filesystem + +License: GPLv2+ +URL: http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project +Source0: https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/%{name}-%{version_num}-pre1.tar.xz + +ExclusiveArch: x86_64 +BuildRequires: gcc, mingw64-gcc +BuildRequires: nasm >= 0.98.38-1, perl-interpreter, perl-generators, netpbm-progs +BuildRequires: perl(FileHandle) +BuildRequires: glibc-devel +BuildRequires: libuuid-devel + +Requires: syslinux-nonlinux = %{version}-%{release} +Requires: mtools + +Patch0: 0000-Add-install-all-target-to-top-side-of-HAVE_FIRMWARE.patch +Patch1: 0001-ext4-64bit-feature.patch +Patch2: 0002-include-sysmacros-h.patch +Patch3: 0003-Add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch +Patch4: 0004-Workaround-multiple-definition-of-symbol-errors.patch +Patch5: 0005-Replace-builtin-strlen-that-appears-to-get-optimized.patch +Patch6: 0007-tweak-for-gcc-10.patch + +%description +SYSLINUX is a suite of bootloaders, currently supporting DOS FAT +filesystems, Linux ext2/ext3 filesystems (EXTLINUX), PXE network boots +(PXELINUX), or ISO 9660 CD-ROMs (ISOLINUX). It also includes a tool, +MEMDISK, which loads legacy operating systems from these media. + +%package perl +Summary: Syslinux tools written in perl + +%description perl +Syslinux tools written in perl + +%package devel +Summary: Headers and libraries for syslinux development. +Provides: %{name}-static = %{version}-%{release} + +%description devel +Headers and libraries for syslinux development. + +%package extlinux +Summary: The EXTLINUX bootloader, for booting the local system. +Requires: syslinux +Requires: syslinux-extlinux-nonlinux = %{version}-%{release} + +%description extlinux +The EXTLINUX bootloader, for booting the local system, as well as all +the SYSLINUX/PXELINUX modules in /boot. + +%package tftpboot +Summary: SYSLINUX modules in /tftpboot, available for network booting +BuildArch: noarch + +%description tftpboot +All the SYSLINUX/PXELINUX modules directly available for network +booting in the /tftpboot directory. + +%package extlinux-nonlinux +Summary: The parts of the EXTLINUX bootloader which aren't run from linux. +Requires: syslinux = %{version}-%{release} +BuildArch: noarch + +%description extlinux-nonlinux +All the EXTLINUX binaries that run from the firmware rather than +from a linux host. + +%package nonlinux +Summary: SYSLINUX modules which aren't run from linux. +Requires: syslinux = %{version}-%{release} +BuildArch: noarch + +%description nonlinux +All the SYSLINUX binaries that run from the firmware rather than from a +linux host. It also includes a tool, MEMDISK, which loads legacy operating +systems from media. + +%package efi64 +Summary: SYSLINUX binaries and modules for 64-bit UEFI systems + +%description efi64 +SYSLINUX binaries and modules for 64-bit UEFI systems + +%prep +%autosetup -n %{name}-%{version_num}-pre1 -p1 + +%build +make RPMCFLAGS='%{optflags}' RPMLDFLAGS='%{build_ldflags}' bios clean all +make RPMCFLAGS='%{optflags}' RPMLDFLAGS='%{build_ldflags}' efi64 clean all + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_sbindir} +mkdir -p %{buildroot}%{_prefix}/lib/syslinux +mkdir -p %{buildroot}%{_includedir} +make bios install-all \ + INSTALLROOT=%{buildroot} BINDIR=%{_bindir} SBINDIR=%{_sbindir} \ + LIBDIR=%{_prefix}/lib DATADIR=%{_datadir} \ + MANDIR=%{_mandir} INCDIR=%{_includedir} \ + TFTPBOOT=/tftpboot EXTLINUXDIR=/boot/extlinux \ + LDLINUX=ldlinux.c32 + +make efi64 install netinstall \ + INSTALLROOT=%{buildroot} BINDIR=%{_bindir} SBINDIR=%{_sbindir} \ + LIBDIR=%{_prefix}/lib DATADIR=%{_datadir} \ + MANDIR=%{_mandir} INCDIR=%{_includedir} \ + TFTPBOOT=/tftpboot EXTLINUXDIR=/boot/extlinux \ + LDLINUX=ldlinux.c32 + +mkdir -p %{buildroot}%{_pkgdocdir}/sample +install -m 644 sample/sample.* %{buildroot}%{_pkgdocdir}/sample/ +mkdir -p %{buildroot}/etc +( cd %{buildroot}/etc && ln -s ../boot/extlinux/extlinux.conf . ) + +# don't ship libsyslinux, at least, not for now +rm -f %{buildroot}%{_prefix}/lib/libsyslinux* +rm -f %{buildroot}%{_includedir}/syslinux.h + +%post extlinux +# If we have a /boot/extlinux.conf file, assume extlinux is our bootloader +# and update it. +if [ -f /boot/extlinux/extlinux.conf ]; then \ + extlinux --update /boot/extlinux ; \ +elif [ -f /boot/extlinux.conf ]; then \ + mkdir -p /boot/extlinux && \ + mv /boot/extlinux.conf /boot/extlinux/extlinux.conf && \ + extlinux --update /boot/extlinux ; \ +fi + +%files +%license COPYING +%doc NEWS README* doc/* sample +%{_bindir}/gethostip +%{_bindir}/isohybrid +%{_bindir}/memdiskfind +%{_bindir}/syslinux +%dir %{_datadir}/syslinux +%dir %{_datadir}/syslinux/dosutil +%{_datadir}/syslinux/dosutil/* +%dir %{_datadir}/syslinux/diag +%{_datadir}/syslinux/diag/* +%{_datadir}/syslinux/syslinux64.exe +%{_mandir}/man1/gethostip* +%{_mandir}/man1/syslinux* +%{_mandir}/man1/extlinux* +%{_mandir}/man1/isohybrid* +%{_mandir}/man1/memdiskfind* + +%files perl +%license COPYING +%{_bindir}/keytab-lilo +%{_bindir}/lss16toppm +%{_bindir}/md5pass +%{_bindir}/mkdiskimage +%{_bindir}/ppmtolss16 +%{_bindir}/pxelinux-options +%{_bindir}/sha1pass +%{_bindir}/syslinux2ansi +%{_bindir}/isohybrid.pl +%{_mandir}/man1/lss16toppm* +%{_mandir}/man1/ppmtolss16* +%{_mandir}/man1/syslinux2ansi* + +%files devel +%license COPYING +%dir %{_datadir}/syslinux/com32 +%{_datadir}/syslinux/com32/* + +%files extlinux +%config /etc/extlinux.conf +%{_sbindir}/extlinux + +%files tftpboot +/tftpboot + +%files nonlinux +%{_datadir}/syslinux/*.com +%{_datadir}/syslinux/*.exe +%{_datadir}/syslinux/*.c32 +%{_datadir}/syslinux/*.bin +%{_datadir}/syslinux/*.0 +%{_datadir}/syslinux/memdisk + +%files extlinux-nonlinux +/boot/extlinux + +%files efi64 +%license COPYING +%dir %{_datadir}/syslinux/efi64 +%{_datadir}/syslinux/efi64 + +%changelog +* Tue Apr 19 2022 happy_orange - 6.04~pre1-1 +- Init package from upstream