From 2caa2ff976d8332c0ee467b4c8d2a13fd1d0f199 Mon Sep 17 00:00:00 2001 From: Yue Tao Date: Tue, 19 Oct 2021 16:01:42 +0800 Subject: [PATCH] grub2: add deb folder Porting CentOS patch 1001-add-tboot.patch Ignore 3 CentOS patches: a) 1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch It replaces "CentOS" with "Linux" in grub menu, that is introduced by a patch from grub2-2.02-0.86.el7.centos.src.rpm. 0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b) 1002-Don-t-write-trailing-colon-when-populating-MAC-strin.patch It is the supplement patch of 0263-Fix-grub_net_hwaddr_to_str.patch, which is from grub2-2.02-0.86.el7.centos.src.rpm. The original issue is introduced by 0248-Add-support-for-non-Ethernet-network-cards.patch, which is also from grub2-2.02-0.86.el7.centos.src.rpm. 3) 1003-tftp-roll-over-block-counter-to-prevent-timeouts-wit.patch It is duplicate of the patch in grub2_2.04-20.debian.tar.xz. debian/patches/tftp-roll-over-block-counter.patch Other patches in centos/meta_patches modify the spec file. The grub2 for each distributions is deep customized, so just ignore them. BTW, not using dl_path, because the package on salsa.debian.org has building issue. Test Plan: Pass: successfully build test Pass: successfully install test Pass: successfully boot test Story: 2009221 Task: 43679 Signed-off-by: Yue Tao Change-Id: Icfd2f1993fd123824155c94da26c0ddf9a9c0873 --- grub/grub2/debian/meta_data.yaml | 5 ++ .../debian/patches/0001-grub2-add-tboot.patch | 32 +++++++++++++ ...ecking-if-loop-devices-are-available.patch | 48 +++++++++++++++++++ grub/grub2/debian/patches/series | 2 + 4 files changed, 87 insertions(+) create mode 100644 grub/grub2/debian/meta_data.yaml create mode 100644 grub/grub2/debian/patches/0001-grub2-add-tboot.patch create mode 100644 grub/grub2/debian/patches/0002-grub2-checking-if-loop-devices-are-available.patch create mode 100644 grub/grub2/debian/patches/series diff --git a/grub/grub2/debian/meta_data.yaml b/grub/grub2/debian/meta_data.yaml new file mode 100644 index 000000000..b2963992e --- /dev/null +++ b/grub/grub2/debian/meta_data.yaml @@ -0,0 +1,5 @@ +--- +debver: 2.04-20 +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/grub/grub2/debian/patches/0001-grub2-add-tboot.patch b/grub/grub2/debian/patches/0001-grub2-add-tboot.patch new file mode 100644 index 000000000..696eb3559 --- /dev/null +++ b/grub/grub2/debian/patches/0001-grub2-add-tboot.patch @@ -0,0 +1,32 @@ +From be38cbc51f89493c46e299950937b85893ca05e8 Mon Sep 17 00:00:00 2001 +From: Bin Qian +Date: Tue, 21 Nov 2017 15:36:42 -0500 +Subject: [PATCH] grub2: add tboot + +Original patch is 1001-add-tboot.patch + +Signed-off-by: Bin Qian +Signed-off-by: Yue Tao +--- + util/grub.d/10_linux.in | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 0cd4cf5..81435a8 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -28,6 +28,11 @@ vt_handoff="@VT_HANDOFF@" + + . "$pkgdatadir/grub-mkconfig_lib" + ++tboot=`cat /proc/cmdline | xargs -n1 | grep '^tboot=true$'` || true ++if [ -n "$tboot" ]; then ++ exit 0 ++fi ++ + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-- +2.25.1 + diff --git a/grub/grub2/debian/patches/0002-grub2-checking-if-loop-devices-are-available.patch b/grub/grub2/debian/patches/0002-grub2-checking-if-loop-devices-are-available.patch new file mode 100644 index 000000000..1c5760f5d --- /dev/null +++ b/grub/grub2/debian/patches/0002-grub2-checking-if-loop-devices-are-available.patch @@ -0,0 +1,48 @@ +From bbd8d33b8646785ee31b435e9decf4271d6ecb68 Mon Sep 17 00:00:00 2001 +From: Yue Tao +Date: Sun, 5 Dec 2021 10:01:05 +0800 +Subject: [PATCH] grub2: checking if loop devices are available + +Building in a chroot environment, may not have loop device. + +Signed-off-by: Yue Tao +--- + tests/ext234_test.in | 5 +++++ + tests/fat_test.in | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/tests/ext234_test.in b/tests/ext234_test.in +index 4f1eb52..380850e 100644 +--- a/tests/ext234_test.in ++++ b/tests/ext234_test.in +@@ -25,6 +25,11 @@ if ! which mkfs.ext4 >/dev/null 2>&1; then + exit 77 + fi + ++if ! losetup -f >/dev/null 2>&1; then ++ echo "No loop device, cannot test." ++ exit 77 ++fi ++ + "@builddir@/grub-fs-tester" ext2_old + "@builddir@/grub-fs-tester" ext2 + "@builddir@/grub-fs-tester" ext3 +diff --git a/tests/fat_test.in b/tests/fat_test.in +index b6b4748..ab5348a 100644 +--- a/tests/fat_test.in ++++ b/tests/fat_test.in +@@ -15,6 +15,11 @@ if ! which mkfs.vfat >/dev/null 2>&1; then + exit 77 + fi + ++if ! losetup -f >/dev/null 2>&1; then ++ echo "No loop device, cannot test." ++ exit 77 ++fi ++ + "@builddir@/grub-fs-tester" vfat16a + "@builddir@/grub-fs-tester" vfat12a + "@builddir@/grub-fs-tester" vfat12 +-- +2.25.1 + diff --git a/grub/grub2/debian/patches/series b/grub/grub2/debian/patches/series new file mode 100644 index 000000000..2c01fc76d --- /dev/null +++ b/grub/grub2/debian/patches/series @@ -0,0 +1,2 @@ +0001-grub2-add-tboot.patch +0002-grub2-checking-if-loop-devices-are-available.patch