Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ba8904d241
!39 enable make test
From: @znzjugod 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2023-02-28 06:59:46 +00:00
znzjugod
fcc2e8544c enable make test 2023-02-18 15:43:37 +08:00
openeuler-ci-bot
3cc8868b47
!24 [sync] PR-21: add loongarch support for grubby
From: @openeuler-sync-bot 
Reviewed-by: @ziyangc 
Signed-off-by: @ziyangc
2022-12-17 09:33:25 +00:00
Wenlong Zhang
d77a6fb903 add loongarch support for grubby
Signed-off-by: root <root@localhost.localdomain>
(cherry picked from commit 667b95a5c93d7b71a6b85a8cf17e9bb683f38de8)
2022-12-17 17:19:54 +08:00
openeuler-ci-bot
d8c54d6161
!16 【轻量级 PR】:rebuild for next release
From: @markeryang 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-10-26 07:56:59 +00:00
Markeryang
baf06ade95
update for mass rebuild and upgrade verification 2022-10-26 02:21:56 +00:00
openeuler-ci-bot
b392bdada6 !15 Fix stringop-overflow warning
From: @yang_zhuang_zhuang
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-07-30 07:23:32 +00:00
yang_zhuang_zhuang
68652c90f3 fix build failed with gcc 10 2021-07-30 14:54:29 +08:00
openeuler-ci-bot
9fac98d589 !14 Remove unnecessary buildrequires:gdb
From: @yang_zhuang_zhuang
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-07-22 08:46:44 +00:00
yang_zhuang_zhuang
890d4bbeb5 Remove unnecessary buildrequires:gdb 2021-07-22 10:03:12 +08:00
6 changed files with 197 additions and 26 deletions

View File

@ -0,0 +1,24 @@
From d62aafe2f5b72dcaae95fa26433eed264fa68f84 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Tue, 25 Oct 2022 01:42:40 +0000
Subject: [PATCH] add loongarch support for grubby, Only EFI startup is supported for loongarch64
---
grubby.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grubby.c b/grubby.c
index 74befea..ea3a636 100644
--- a/grubby.c
+++ b/grubby.c
@@ -60,7 +60,7 @@ int debug = 0; /* Currently just for template debugging */
int isEfi = 0;
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__loongarch64)
#define isEfiOnly 1
#else
#define isEfiOnly 0
--
2.33.0

View File

@ -1,22 +0,0 @@
From c091abfca6c51079478431539b56df0e0d0346b1 Mon Sep 17 00:00:00 2001
From: zhangguangzhi <zhangguangzhi3@huawei.com>
Date: Wed, 18 Sep 2019 03:27:22 -0400
Subject: [PATCH] fix test error g2-1.15
diff --git a/test/results/add/g2-1.15 b/test/results/add/g2-1.15
index b67c373..ee5f868 100644
--- a/test/results/add/g2-1.15
+++ b/test/results/add/g2-1.15
@@ -82,7 +82,7 @@ menuentry 'Fedora 21 Rescue' --class fedora --class gnu-linux --class gnu --clas
search --no-floppy --fs-uuid --set=root 6169b46f-0257-4319-b2e4-caaed2a8e06b
fi
linuxefi /vmlinuz-0-rescue-5a94251776a14678911d4ae0949500f5 root=/fooooo ro rd.lvm.lv=fedora_uefi/root rd.lvm.lv=fedora_uefi/swap rhgb quiet
- initrdefi /initramfs-0-rescue-5a94251776a14678911d4ae0949500f5.img
+ initrd /initramfs-0-rescue-5a94251776a14678911d4ae0949500f5.img
}
menuentry 'Fedora, with Linux 3.15.0-0.rc5.git2.10.fc21.x86_64' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.15.0-0.rc5.git2.10.fc21.x86_64-advanced-a14e3dcb-ade3-42f7-832f-d9f66b5ae6a3' {
load_video
--
2.19.1

View File

@ -0,0 +1,35 @@
From 99d10a31cee89eb45ac0743f484018d36500ce66 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Mon, 10 Feb 2020 20:08:42 +0100
Subject: [PATCH] Fix maybe-uninitialized warning
GCC gives the following compile warning:
grubby.c: In function 'suseGrubConfGetBoot':
grubby.c:2770:5: error: 'grubDevice' may be used uninitialized in this function [-Werror=maybe-uninitialized]
2770 | free(grubDevice);
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:38: grubby.o] Error 1
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grubby.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grubby.c b/grubby.c
index 5de935d..74befea 100644
--- a/grubby.c
+++ b/grubby.c
@@ -2896,7 +2896,7 @@ int grubGetBootFromDeviceMap(const char * device,
}
int suseGrubConfGetBoot(const char * path, char ** bootPtr) {
- char * grubDevice;
+ char * grubDevice = NULL;
if (suseGrubConfGetInstallDevice(path, &grubDevice))
dbgPrintf("error looking for grub installation device\n");
--
1.8.3.1

View File

@ -0,0 +1,73 @@
From c693d9d1f7b0ee4d5fa5fbbeafce3a9fbacbce52 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Mon, 10 Feb 2020 18:15:26 +0100
Subject: [PATCH] Fix stringop-overflow warning
GCC gives the following compile warning:
grubby.c: In function 'main':
grubby.c:4508:27: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
4508 | saved_command_line[0] = '\0';
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
grubby.c:4503:26: note: at offset 0 to an object with size 0 allocated by 'malloc' here
4503 | saved_command_line = malloc(i);
| ^~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:38: grubby.o] Error 1
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grubby.c | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/grubby.c b/grubby.c
index b8115dd..5de935d 100644
--- a/grubby.c
+++ b/grubby.c
@@ -4675,24 +4675,27 @@ int main(int argc, const char ** argv) {
int i = 0;
for (int j = 1; j < argc; j++)
i += strlen(argv[j]) + 1;
- saved_command_line = malloc(i);
- if (!saved_command_line) {
- fprintf(stderr, "grubby: %m\n");
- exit(1);
- }
- saved_command_line[0] = '\0';
- int cmdline_len = 0, arg_len;
- for (int j = 1; j < argc; j++) {
- arg_len = strlen(argv[j]);
- memcpy(saved_command_line + cmdline_len, argv[j], arg_len);
- cmdline_len += arg_len;
- if (j != argc - 1) {
- memcpy(saved_command_line + cmdline_len, " ", 1);
- cmdline_len++;
- }
+ if (i > 0) {
+ saved_command_line = malloc(i);
+ if (!saved_command_line) {
+ fprintf(stderr, "grubby: %m\n");
+ exit(1);
+ }
+
+ saved_command_line[0] = '\0';
+ int cmdline_len = 0, arg_len;
+ for (int j = 1; j < argc; j++) {
+ arg_len = strlen(argv[j]);
+ memcpy(saved_command_line + cmdline_len, argv[j], arg_len);
+ cmdline_len += arg_len;
+ if (j != argc - 1) {
+ memcpy(saved_command_line + cmdline_len, " ", 1);
+ cmdline_len++;
+ }
+ }
+ saved_command_line[cmdline_len] = '\0';
}
- saved_command_line[cmdline_len] = '\0';
optCon = poptGetContext("grubby", argc, argv, options, 0);
poptReadDefaultConfig(optCon, 1);
--
1.8.3.1

View File

@ -0,0 +1,42 @@
From b9c839defe4c78565448ae2b08cd58414beaf459 Mon Sep 17 00:00:00 2001
From: yangmingtai <yangmingtai@huawei.com>
Date: Tue, 9 Mar 2021 04:38:15 -0500
Subject: [PATCH] grubby: aarch64 skip test grub2.15
reason: aarch64 skip test grub2.15
---
test.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test.sh b/test.sh
index 5305c26..f4b5de2 100755
--- a/test.sh
+++ b/test.sh
@@ -508,6 +508,11 @@ if [ "" == "y" ]; then
--title='title' \
--initrd=/boot/new-initrd --boot-filesystem=/boot/ \
--copy-default --efi
+ grub2Test grub2.15 add/g2-1.15 \
+ --add-kernel=/boot/vmlinuz-0-rescue-5a94251776a14678911d4ae0949500f5 \
+ --initrd /boot/initramfs-0-rescue-5a94251776a14678911d4ae0949500f5.img \
+ --copy-default --title "Fedora 21 Rescue" --args=root=/fooooo \
+ --remove-kernel=wtf --boot-filesystem=/boot/ --efi
;;
esac
grub2Test grub2.6 add/g2-1.7 --add-kernel=/boot/new-kernel.img \
@@ -536,11 +541,6 @@ if [ "" == "y" ]; then
--devtree='/boot/dtb-2.6.38.8-32.fc15.x86_64/foobarbaz.dtb' \
--initrd=/boot/initramfs-2.6.38.8-32.fc15.x86_64.img \
--boot-filesystem=/boot/ --copy-default --efi
- grub2Test grub2.15 add/g2-1.15 \
- --add-kernel=/boot/vmlinuz-0-rescue-5a94251776a14678911d4ae0949500f5 \
- --initrd /boot/initramfs-0-rescue-5a94251776a14678911d4ae0949500f5.img \
- --copy-default --title "Fedora 21 Rescue" --args=root=/fooooo \
- --remove-kernel=wtf --boot-filesystem=/boot/ --efi
testing="GRUB2 add initrd"
grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \
--
2.18.1

View File

@ -1,6 +1,6 @@
Name: grubby
Version: 8.40
Release: 26
Release: 31
Summary: Update and display information about the configuration files
License: GPLv2+
URL: https://github.com/rhinstaller/grubby
@ -30,15 +30,18 @@ Patch6012: Fix-GCC-warnings-about-possible-string-truncations-a.patch
Patch6013: Check-that-pointers-are-not-NULL-before-dereferencin.patch
Patch6014: Print-default-image-even-if-isn-t-a-suitable-one.patch
Patch6015: backport-Make-SET_VARIABLE-get-handled-individually-in-GetNex.patch
Patch6016: backport-Fix-stringop-overflow-warning.patch
Patch6017: backport-Fix-maybe-uninitialized-warning.patch
Patch9001: fix-make-test-fail-when-no-boot-partition.patch
Patch9002: Fix-make-test-fail-for-g2-1.15.patch
Patch9002: 0001-add-loongarch-support-for-grubby.patch
Patch9003: grubby-aarch64-skip-test-grub2.15.patch
BuildRequires: gcc pkgconfig glib2-devel popt-devel
BuildRequires: libblkid-devel git-core sed make
BuildRequires: util-linux-ng
%ifarch aarch64 i686 x86_64
BuildRequires: grub2-tools-minimal gdb
BuildRequires: grub2-tools-minimal
Requires: grub2-tools grub2-tools-minimal
%endif
@ -67,7 +70,7 @@ meant to only be used for legacy compatibility users with existing grubby users.
%make_build
%check
#make test
make test
%install
%make_install mandir=%{_mandir} sbindir=%{_sbindir}
@ -107,6 +110,22 @@ sed -e "s,@@LIBEXECDIR@@,%{_libexecdir}/installkernel,g" %{SOURCE3} > %{buildroo
%{_mandir}/man8/*.8*
%changelog
* Sat Feb 18 2023 zhangnan <zhangnan134@huawei.com> - 8.40-31
- enable make test
* Mon Nov 28 2022 Wenlong Zhang <zhangwenlong@loongson.cn> - 8.40-30
- add loongarch support for grubby
* Wed Oct 26 2022 yanglongkang <yanglongkang@h-partners.com> - 8.40-29
- rebuild for next release
* Fri Jul 30 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 8.40-28
- Fix stringop-overflow warning
- Fix maybe-uninitialized warning
* Thu Jul 22 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 8.40-27
- Remove unnecessary buildrequires:gdb
- Thu Jan 1 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 8.40-26
- Fix the following problem:The grub.cfg file is modified.As a result,the system fails to start.