From eefad4d27a4578e56bc686b6aa0306e4ec5491c0 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 3 Jan 2023 17:02:21 +0800 Subject: grubby: update to latest git rev * Refresh patches. * Update SRC_URI. The upstrem repository has been archived. * Depends on rpm to rpm-sort build. * Add a patch to fix rpm-sort build error. * Do not specify PREFIX as the issue has been fixed upstream. Signed-off-by: Yi Zhao Signed-off-by: Khem Raj --- ...-variable-LIBS-to-provides-libraries-from.patch | 24 ------- ...0001-rename-grub2-editenv-to-grub-editenv.patch | 78 ++++++++++++++++++++++ ...-variable-LIBS-to-provides-libraries-from.patch | 38 +++++++++++ .../0002-include-paths.h-for-_PATH_MOUNTED.patch | 25 ------- .../0003-include-paths.h-for-_PATH_MOUNTED.patch | 27 ++++++++ ...-rpm-sort-include-string.h-for-strverscmp.patch | 33 +++++++++ ...ubby-rename-grub2-editenv-to-grub-editenv.patch | 76 --------------------- .../recipes-devtools/grubby/grubby_git.bb | 19 +++--- 8 files changed, 186 insertions(+), 134 deletions(-) delete mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch create mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/0001-rename-grub2-editenv-to-grub-editenv.patch create mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/0002-Add-another-variable-LIBS-to-provides-libraries-from.patch delete mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch create mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/0003-include-paths.h-for-_PATH_MOUNTED.patch create mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/0004-rpm-sort-include-string.h-for-strverscmp.patch delete mode 100644 meta-initramfs/recipes-devtools/grubby/grubby/grubby-rename-grub2-editenv-to-grub-editenv.patch (limited to 'meta-initramfs/recipes-devtools/grubby') diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch b/meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch deleted file mode 100644 index dfbe7ba6b4..0000000000 --- a/meta-initramfs/recipes-devtools/grubby/grubby/0001-Add-another-variable-LIBS-to-provides-libraries-from.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b7b3caa9b5c8abcd3c371d0683001cd681e104b3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 15 Jul 2017 10:19:22 -0700 -Subject: [PATCH 1/2] Add another variable LIBS to provides libraries from env - -Signed-off-by: Khem Raj - ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index cc7e823..ae30a07 100644 ---- a/Makefile -+++ b/Makefile -@@ -31,7 +31,7 @@ ifneq ($(VERBOSE_TEST),) - VERBOSE_TEST="--verbose" - endif - --grubby_LIBS = -lblkid -lpopt -+grubby_LIBS = -lblkid -lpopt ${LIBS} - - all: grubby - diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/0001-rename-grub2-editenv-to-grub-editenv.patch b/meta-initramfs/recipes-devtools/grubby/grubby/0001-rename-grub2-editenv-to-grub-editenv.patch new file mode 100644 index 0000000000..7e1615c5b5 --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/0001-rename-grub2-editenv-to-grub-editenv.patch @@ -0,0 +1,78 @@ +From 7a72139d2e3cc80f64090a823afe7bcea76e4792 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +Date: Tue, 4 Aug 2015 23:54:41 -0700 +Subject: [PATCH] rename grub2-editenv to grub-editenv + +We don't use the name grub2-editenv for grub2. + +Upstream-Status: Inactive-Upstream [lastcommit: 2022 lastrelease: 2016] + +Signed-off-by: Jackie Huang +--- + grubby.c | 4 ++-- + test.sh | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/grubby.c b/grubby.c +index 98c1516..be832f6 100644 +--- a/grubby.c ++++ b/grubby.c +@@ -301,7 +301,7 @@ static char *grub2GetEnv(struct configFileInfo *info, char *name) + char *ret = NULL; + char *envFile = info->envFile ? info->envFile : "/boot/grub2/grubenv"; + int rc = +- asprintf(&s, "grub2-editenv %s list | grep '^%s='", envFile, name); ++ asprintf(&s, "grub-editenv %s list | grep '^%s='", envFile, name); + + if (rc < 0) + return NULL; +@@ -373,7 +373,7 @@ static int grub2SetEnv(struct configFileInfo *info, char *name, char *value) + if (!value) + return -1; + +- rc = asprintf(&s, "grub2-editenv %s set '%s=%s'", envFile, name, value); ++ rc = asprintf(&s, "grub-editenv %s set '%s=%s'", envFile, name, value); + free(value); + if (rc < 0) + return -1; +diff --git a/test.sh b/test.sh +index 33d24cf..009479c 100755 +--- a/test.sh ++++ b/test.sh +@@ -573,7 +573,7 @@ if [ "$testgrub2" == "y" ]; then + --remove-kernel=/boot/vmlinuz-2.6.38.2-9.fc15.x86_64 \ + --boot-filesystem=/boot/ + commandTest "saved_default output" \ +- "grub2-editenv test/grub2-support_files/env_temp list" \ ++ "grub-editenv test/grub2-support_files/env_temp list" \ + "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64" + + # copy a stanza and add arguments as well, while using --set-index= +@@ -627,7 +627,7 @@ if [ "$testgrub2" == "y" ]; then + --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ + --copy-default + commandTest "saved_default output" \ +- "grub2-editenv test/grub2-support_files/env_temp list" \ ++ "grub-editenv test/grub2-support_files/env_temp list" \ + "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64" + + testing="GRUB2 add kernel with default=saved_entry and a terrible title" +@@ -640,13 +640,13 @@ if [ "$testgrub2" == "y" ]; then + testing="GRUB2 set default with default=saved_entry and a terrible name" + grub2Test grub2.9 add/g2-1.9 --env grubenv.1 --set-default-index=0 + commandTest "saved_default output" \ +- "grub2-editenv test/grub2-support_files/env_temp list" \ ++ "grub-editenv test/grub2-support_files/env_temp list" \ + 'saved_entry=Fedora (3.10.3-300.fc19.x86_64) 19 (Schrödinger’s Cat)' + + testing="GRUB2 set default with default=saved_entry" + grub2Test grub2.8 add/g2-1.8 --env grubenv.1 --set-default-index=0 + commandTest "saved_default output" \ +- "grub2-editenv test/grub2-support_files/env_temp list" \ ++ "grub-editenv test/grub2-support_files/env_temp list" \ + "saved_entry=title" + + testing="GRUB2 --default-index with default=saved_entry" +-- +2.25.1 + diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/0002-Add-another-variable-LIBS-to-provides-libraries-from.patch b/meta-initramfs/recipes-devtools/grubby/grubby/0002-Add-another-variable-LIBS-to-provides-libraries-from.patch new file mode 100644 index 0000000000..967a4c94fb --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/0002-Add-another-variable-LIBS-to-provides-libraries-from.patch @@ -0,0 +1,38 @@ +From c02d1bf46174656cdb6f7c08fa3e8fa520edcd8e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 15 Jul 2017 10:19:22 -0700 +Subject: [PATCH] Add another variable LIBS to provides libraries from env + +Upstream-Status: Inactive-Upstream [lastcommit: 2022 lastrelease: 2016] + +Signed-off-by: Khem Raj +--- + Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 968c276..75abe44 100644 +--- a/Makefile ++++ b/Makefile +@@ -31,7 +31,8 @@ ifneq ($(VERBOSE_TEST),) + VERBOSE_TEST="--verbose" + endif + +-grubby_LIBS = -lblkid -lpopt ++grubby_LIBS = -lblkid -lpopt ${LIBS} ++rpm-sort_LIBS = ${LIBS} + + all: grubby rpm-sort + +@@ -63,7 +64,7 @@ grubby:: $(OBJECTS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS) + + rpm-sort::rpm-sort.o +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lrpmio ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lrpmio $(rpm-sort_LIBS) + + clean: + rm -f *.o grubby rpm-sort *~ +-- +2.25.1 + diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch b/meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch deleted file mode 100644 index de8133a3a4..0000000000 --- a/meta-initramfs/recipes-devtools/grubby/grubby/0002-include-paths.h-for-_PATH_MOUNTED.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8f844ac7f44b8dc428d06cd6958c5f32d383d01c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 15 Jul 2017 10:19:50 -0700 -Subject: [PATCH 2/2] include paths.h for _PATH_MOUNTED - -Signed-off-by: Khem Raj ---- - grubby.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/grubby.c b/grubby.c -index 47a1a15..59f74a9 100644 ---- a/grubby.c -+++ b/grubby.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - - #include "log.h" --- -2.13.3 - diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/0003-include-paths.h-for-_PATH_MOUNTED.patch b/meta-initramfs/recipes-devtools/grubby/grubby/0003-include-paths.h-for-_PATH_MOUNTED.patch new file mode 100644 index 0000000000..86ae01021f --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/0003-include-paths.h-for-_PATH_MOUNTED.patch @@ -0,0 +1,27 @@ +From 7e68976eb6edd766471c11382f5bf57940ba9315 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 15 Jul 2017 10:19:50 -0700 +Subject: [PATCH] include paths.h for _PATH_MOUNTED + +Upstream-Status: Inactive-Upstream [lastcommit: 2022 lastrelease: 2016] + +Signed-off-by: Khem Raj +--- + grubby.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/grubby.c b/grubby.c +index be832f6..4825797 100644 +--- a/grubby.c ++++ b/grubby.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include + + #include "log.h" +-- +2.25.1 + diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/0004-rpm-sort-include-string.h-for-strverscmp.patch b/meta-initramfs/recipes-devtools/grubby/grubby/0004-rpm-sort-include-string.h-for-strverscmp.patch new file mode 100644 index 0000000000..c68b492ebe --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/0004-rpm-sort-include-string.h-for-strverscmp.patch @@ -0,0 +1,33 @@ +From 45bc228090b3adfc0a5058b9cd019d91831e110a Mon Sep 17 00:00:00 2001 +From: Yi Zhao +Date: Tue, 3 Jan 2023 13:59:48 +0800 +Subject: [PATCH] rpm-sort: include string.h for strverscmp + +Include string.h to fix build error: +rpm-sort.c: In function 'package_version_compare': +rpm-sort.c:156:13: error: 'strverscmp' undeclared (first use in this function) + 156 | cmp = strverscmp; + | ^~~~~~~~~~ + +Upstream-Status: Inactive-Upstream [lastcommit: 2022 lastrelease: 2016] + +Signed-off-by: Yi Zhao +--- + rpm-sort.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/rpm-sort.c b/rpm-sort.c +index f196356..2eb91ce 100644 +--- a/rpm-sort.c ++++ b/rpm-sort.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + typedef enum { + RPMNVRCMP, +-- +2.25.1 + diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/grubby-rename-grub2-editenv-to-grub-editenv.patch b/meta-initramfs/recipes-devtools/grubby/grubby/grubby-rename-grub2-editenv-to-grub-editenv.patch deleted file mode 100644 index e693916e1d..0000000000 --- a/meta-initramfs/recipes-devtools/grubby/grubby/grubby-rename-grub2-editenv-to-grub-editenv.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 15f0572f2f456c2c1b700bc790d9ce7a5c13cc74 Mon Sep 17 00:00:00 2001 -From: Jackie Huang -Date: Tue, 4 Aug 2015 23:54:41 -0700 -Subject: [PATCH] rename grub2-editenv to grub-editenv - -We don't use the name grub2-editenv for grub2. - -Upstream-Status: Inappropriate - -Signed-off-by: Jackie Huang - ---- - grubby.c | 4 ++-- - test.sh | 8 ++++---- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/grubby.c b/grubby.c -index 396041a..3ceae69 100644 ---- a/grubby.c -+++ b/grubby.c -@@ -301,7 +301,7 @@ static char *grub2GetEnv(struct configFileInfo *info, char *name) - char *ret = NULL; - char *envFile = info->envFile ? info->envFile : "/boot/grub2/grubenv"; - int rc = -- asprintf(&s, "grub2-editenv %s list | grep '^%s='", envFile, name); -+ asprintf(&s, "grub-editenv %s list | grep '^%s='", envFile, name); - - if (rc < 0) - return NULL; -@@ -373,7 +373,7 @@ static int grub2SetEnv(struct configFileInfo *info, char *name, char *value) - if (!value) - return -1; - -- rc = asprintf(&s, "grub2-editenv %s set '%s=%s'", envFile, name, value); -+ rc = asprintf(&s, "grub-editenv %s set '%s=%s'", envFile, name, value); - free(value); - if (rc < 0) - return -1; -diff --git a/test.sh b/test.sh -index 33d24cf..009479c 100755 ---- a/test.sh -+++ b/test.sh -@@ -573,7 +573,7 @@ if [ "$testgrub2" == "y" ]; then - --remove-kernel=/boot/vmlinuz-2.6.38.2-9.fc15.x86_64 \ - --boot-filesystem=/boot/ - commandTest "saved_default output" \ -- "grub2-editenv test/grub2-support_files/env_temp list" \ -+ "grub-editenv test/grub2-support_files/env_temp list" \ - "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64" - - # copy a stanza and add arguments as well, while using --set-index= -@@ -627,7 +627,7 @@ if [ "$testgrub2" == "y" ]; then - --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ - --copy-default - commandTest "saved_default output" \ -- "grub2-editenv test/grub2-support_files/env_temp list" \ -+ "grub-editenv test/grub2-support_files/env_temp list" \ - "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64" - - testing="GRUB2 add kernel with default=saved_entry and a terrible title" -@@ -640,13 +640,13 @@ if [ "$testgrub2" == "y" ]; then - testing="GRUB2 set default with default=saved_entry and a terrible name" - grub2Test grub2.9 add/g2-1.9 --env grubenv.1 --set-default-index=0 - commandTest "saved_default output" \ -- "grub2-editenv test/grub2-support_files/env_temp list" \ -+ "grub-editenv test/grub2-support_files/env_temp list" \ - 'saved_entry=Fedora (3.10.3-300.fc19.x86_64) 19 (Schrödinger’s Cat)' - - testing="GRUB2 set default with default=saved_entry" - grub2Test grub2.8 add/g2-1.8 --env grubenv.1 --set-default-index=0 - commandTest "saved_default output" \ -- "grub2-editenv test/grub2-support_files/env_temp list" \ -+ "grub-editenv test/grub2-support_files/env_temp list" \ - "saved_entry=title" - - testing="GRUB2 --default-index with default=saved_entry" diff --git a/meta-initramfs/recipes-devtools/grubby/grubby_git.bb b/meta-initramfs/recipes-devtools/grubby/grubby_git.bb index bbfabf0209..ff673e21bb 100644 --- a/meta-initramfs/recipes-devtools/grubby/grubby_git.bb +++ b/meta-initramfs/recipes-devtools/grubby/grubby_git.bb @@ -9,25 +9,26 @@ LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a" -DEPENDS = "popt util-linux" -DEPENDS:append:libc-musl = " libexecinfo" +DEPENDS = "popt util-linux rpm" +DEPENDS:append:libc-musl = " libexecinfo argp-standalone" S = "${WORKDIR}/git" -SRCREV = "a1d2ae93408c3408e672d7eba4550fdf27fb0201" -SRC_URI = "git://github.com/rhboot/grubby.git;protocol=https;;branch=master \ - file://grubby-rename-grub2-editenv-to-grub-editenv.patch \ +SRCREV = "c01b0d5bb182bde35b464d14996acf354a3ada2e" +SRC_URI = "git://github.com/rhboot/grubby.git;protocol=https;;branch=main \ + file://0001-rename-grub2-editenv-to-grub-editenv.patch \ + file://0002-Add-another-variable-LIBS-to-provides-libraries-from.patch \ + file://0003-include-paths.h-for-_PATH_MOUNTED.patch \ + file://0004-rpm-sort-include-string.h-for-strverscmp.patch \ file://run-ptest \ - file://0001-Add-another-variable-LIBS-to-provides-libraries-from.patch \ - file://0002-include-paths.h-for-_PATH_MOUNTED.patch \ " RDEPENDS:${PN} += "dracut" inherit autotools-brokensep ptest -EXTRA_OEMAKE = "-e 'CC=${CC}' 'LDFLAGS=${LDFLAGS}' LIBS='${LIBS}' 'PREFIX'=${@bb.utils.contains('DISTRO_FEATURES','usrmerge','/usr','',d)}" +EXTRA_OEMAKE = "-e 'CC=${CC}' 'LDFLAGS=${LDFLAGS}' 'LIBS=${LIBS}'" -LIBS:libc-musl = "-lexecinfo" +LIBS:libc-musl = "-lexecinfo -largp" LIBS ?= "" do_install_ptest() { install -d ${D}${PTEST_PATH} -- cgit v1.2.3-54-g00ecf