Fix "make test" to work when grub2 isn't present.
Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
8e7730434e
commit
0d3237c8cf
186
0001-Only-run-the-grub2-test-suite-on-architectures-where.patch
Normal file
186
0001-Only-run-the-grub2-test-suite-on-architectures-where.patch
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
From 99f59c44b14b81bfa66e419798ed957ba1de5582 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Jones <pjones@redhat.com>
|
||||||
|
Date: Tue, 30 Jul 2013 14:04:10 -0400
|
||||||
|
Subject: [PATCH] Only run the grub2 test suite on architectures where it's
|
||||||
|
meaningful.
|
||||||
|
|
||||||
|
We don't have grub2-editenv on other architectures, so don't run it
|
||||||
|
there.
|
||||||
|
|
||||||
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||||
|
---
|
||||||
|
test.sh | 158 ++++++++++++++++++++++++++++++++++++----------------------------
|
||||||
|
1 file changed, 89 insertions(+), 69 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/test.sh b/test.sh
|
||||||
|
index 3d5869f..6bf6cd3 100755
|
||||||
|
--- a/test.sh
|
||||||
|
+++ b/test.sh
|
||||||
|
@@ -432,75 +432,95 @@ grubTest grub.11 add/g11.1 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default \
|
||||||
|
--args='console=tty0 console=ttyS1,9600n81 single'
|
||||||
|
|
||||||
|
-testing="GRUB2 add kernel"
|
||||||
|
-grub2Test grub2.1 add/g2-1.1 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
- --initrd=/boot/new-initrd --boot-filesystem=/boot/ --copy-default
|
||||||
|
-grub2Test grub2.1 add/g2-1.6 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
- --initrd=/boot/new-initrd --boot-filesystem=/boot/ --copy-default --efi
|
||||||
|
-grub2Test grub2.6 add/g2-1.7 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
- --initrd=/boot/new-initrd --boot-filesystem=/boot/ --copy-default --efi
|
||||||
|
-grub2Test grub2.1 add/g2-1.2 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
- --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
- --copy-default --make-default
|
||||||
|
-grub2Test grub2.1 add/g2-1.3 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
- --boot-filesystem=/boot/ --copy-default --make-default
|
||||||
|
-grub2Test grub2.1 remove/g2-1.4 --remove-kernel=/boot/vmlinuz-2.6.38.2-9.fc15.x86_64 \
|
||||||
|
- --boot-filesystem=/boot/
|
||||||
|
-grub2Test grub2.5 add/g2-1.5 --add-kernel=/boot/new-kernel.img --title='title' \
|
||||||
|
- --initrd=/boot/new-initrd --boot-filesystem=/boot/ --copy-default
|
||||||
|
-
|
||||||
|
-testing="GRUB2 add initrd"
|
||||||
|
-grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \
|
||||||
|
- --initrd=/boot/new-initrd --boot-filesystem=/boot/
|
||||||
|
-
|
||||||
|
-testing="GRUB2 display default index"
|
||||||
|
-grub2DisplayTest grub2.1 defaultindex/0 --default-index
|
||||||
|
-grub2DisplayTest grub2.2 defaultindex/0 --default-index
|
||||||
|
-
|
||||||
|
-testing="GRUB2 display default title"
|
||||||
|
-grub2DisplayTest grub2.1 defaulttitle/g2.1 --default-title
|
||||||
|
-grub2DisplayTest grub2.2 defaulttitle/g2.2 --default-title
|
||||||
|
-
|
||||||
|
-testing="GRUB2 display debug failure"
|
||||||
|
-grub2DisplayTest grub2.1 debug/g2.1 --bad-image-bad --boot-filesystem=/boot --default-kernel --debug
|
||||||
|
-testing="GRUB2 display debug success"
|
||||||
|
-grub2DisplayTest grub2.1 debug/g2.1.2 --boot-filesystem=/boot --default-kernel --debug
|
||||||
|
-
|
||||||
|
-testing="GRUB2 remove kernel via index"
|
||||||
|
-grub2Test grub2.3 remove/g2-1.1 --remove-kernel=1
|
||||||
|
-
|
||||||
|
-testing="GRUB2 remove kernel via title"
|
||||||
|
-grub2Test grub2.3 remove/g2-1.1 --remove-kernel="TITLE=title2"
|
||||||
|
-
|
||||||
|
-testing="GRUB2 (submenu) remove kernel via index"
|
||||||
|
-grub2Test grub2.4 remove/g2-1.2 --remove-kernel=2
|
||||||
|
-
|
||||||
|
-testing="GRUB2 (submenu) remove kernel via title"
|
||||||
|
-grub2Test grub2.4 remove/g2-1.2 --remove-kernel="TITLE=title2"
|
||||||
|
-
|
||||||
|
-testing="GRUB2 default index directive"
|
||||||
|
-grub2Test grub2.1 setdefaultindex/g2.1.0 --set-default-index=0
|
||||||
|
-grub2Test grub2.1 setdefaultindex/g2.1.1 --set-default-index=1
|
||||||
|
-grub2Test grub2.1 setdefaultindex/g2.1.9 --set-default-index=9
|
||||||
|
-
|
||||||
|
-testing="GRUB2 add kernel with default=saved_entry"
|
||||||
|
-grub2Test grub2.7 add/g2-1.8 --env grubenv.1 --add-kernel=/boot/new-kernel.img \
|
||||||
|
- --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
- --copy-default
|
||||||
|
-commandTest "saved_default output" "grub2-editenv test/grub2-support_files/env_temp list" "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64"
|
||||||
|
-
|
||||||
|
-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" "saved_entry=title"
|
||||||
|
-
|
||||||
|
-testing="GRUB2 --default-index with default=saved_entry"
|
||||||
|
-grub2DisplayTest grub2.8 defaultindex/1 --env grubenv.1 --default-index
|
||||||
|
-
|
||||||
|
-testing="GRUB2 --default-index with default=saved_entry"
|
||||||
|
-grub2DisplayTest grub2.8 defaultindex/0 --env grubenv.2 --default-index
|
||||||
|
-
|
||||||
|
-testing="GRUB2 --default-title with default=saved_entry"
|
||||||
|
-grub2DisplayTest grub2.8 defaulttitle/g2.1 --env grubenv.1 --default-title
|
||||||
|
+local testgrub2=n
|
||||||
|
+ARCH=$(uname -m | sed s,i[3456789]86,ia32,)
|
||||||
|
+case $ARCH in
|
||||||
|
+ ppc|ppc64|ia32|x86_64) testgrub2=y ;;
|
||||||
|
+esac
|
||||||
|
+
|
||||||
|
+if [ "$testgrub2" == "y" ]; then
|
||||||
|
+ testing="GRUB2 add kernel"
|
||||||
|
+ grub2Test grub2.1 add/g2-1.1 --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
+ --copy-default
|
||||||
|
+ grub2Test grub2.1 add/g2-1.6 --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
+ --copy-default --efi
|
||||||
|
+ grub2Test grub2.6 add/g2-1.7 --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
+ --copy-default --efi
|
||||||
|
+ grub2Test grub2.1 add/g2-1.2 --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
+ --copy-default --make-default
|
||||||
|
+ grub2Test grub2.1 add/g2-1.3 --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --boot-filesystem=/boot/ --copy-default --make-default
|
||||||
|
+ grub2Test grub2.1 remove/g2-1.4 \
|
||||||
|
+ --remove-kernel=/boot/vmlinuz-2.6.38.2-9.fc15.x86_64 \
|
||||||
|
+ --boot-filesystem=/boot/
|
||||||
|
+ grub2Test grub2.5 add/g2-1.5 --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
+ --copy-default
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 add initrd"
|
||||||
|
+ grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \
|
||||||
|
+ --initrd=/boot/new-initrd --boot-filesystem=/boot/
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 display default index"
|
||||||
|
+ grub2DisplayTest grub2.1 defaultindex/0 --default-index
|
||||||
|
+ grub2DisplayTest grub2.2 defaultindex/0 --default-index
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 display default title"
|
||||||
|
+ grub2DisplayTest grub2.1 defaulttitle/g2.1 --default-title
|
||||||
|
+ grub2DisplayTest grub2.2 defaulttitle/g2.2 --default-title
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 display debug failure"
|
||||||
|
+ grub2DisplayTest grub2.1 debug/g2.1 --bad-image-bad \
|
||||||
|
+ --boot-filesystem=/boot --default-kernel --debug
|
||||||
|
+ testing="GRUB2 display debug success"
|
||||||
|
+ grub2DisplayTest grub2.1 debug/g2.1.2 --boot-filesystem=/boot \
|
||||||
|
+ --default-kernel --debug
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 remove kernel via index"
|
||||||
|
+ grub2Test grub2.3 remove/g2-1.1 --remove-kernel=1
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 remove kernel via title"
|
||||||
|
+ grub2Test grub2.3 remove/g2-1.1 --remove-kernel="TITLE=title2"
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 (submenu) remove kernel via index"
|
||||||
|
+ grub2Test grub2.4 remove/g2-1.2 --remove-kernel=2
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 (submenu) remove kernel via title"
|
||||||
|
+ grub2Test grub2.4 remove/g2-1.2 --remove-kernel="TITLE=title2"
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 default index directive"
|
||||||
|
+ grub2Test grub2.1 setdefaultindex/g2.1.0 --set-default-index=0
|
||||||
|
+ grub2Test grub2.1 setdefaultindex/g2.1.1 --set-default-index=1
|
||||||
|
+ grub2Test grub2.1 setdefaultindex/g2.1.9 --set-default-index=9
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 add kernel with default=saved_entry"
|
||||||
|
+ grub2Test grub2.7 add/g2-1.8 --env grubenv.1 \
|
||||||
|
+ --add-kernel=/boot/new-kernel.img \
|
||||||
|
+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
||||||
|
+ --copy-default
|
||||||
|
+ commandTest "saved_default output" \
|
||||||
|
+ "grub2-editenv test/grub2-support_files/env_temp list" \
|
||||||
|
+ "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64"
|
||||||
|
+
|
||||||
|
+ 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" \
|
||||||
|
+ "saved_entry=title"
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 --default-index with default=saved_entry"
|
||||||
|
+ grub2DisplayTest grub2.8 defaultindex/1 --env grubenv.1 --default-index
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 --default-index with default=saved_entry"
|
||||||
|
+ grub2DisplayTest grub2.8 defaultindex/0 --env grubenv.2 --default-index
|
||||||
|
+
|
||||||
|
+ testing="GRUB2 --default-title with default=saved_entry"
|
||||||
|
+ grub2DisplayTest grub2.8 defaulttitle/g2.1 --env grubenv.1 --default-title
|
||||||
|
+fi
|
||||||
|
|
||||||
|
testing="YABOOT add kernel"
|
||||||
|
yabootTest yaboot.1 add/y1.1 --copy-default --boot-filesystem=/ --add-kernel=/boot/new-kernel \
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
@ -9,12 +9,16 @@ URL: http://git.fedorahosted.org/git/grubby.git
|
|||||||
# git clone git://git.fedorahosted.org/git/grubby.git
|
# git clone git://git.fedorahosted.org/git/grubby.git
|
||||||
# git archive --format=tar --prefix=grubby-%{version}/ HEAD |bzip2 > grubby-%{version}.tar.bz2
|
# git archive --format=tar --prefix=grubby-%{version}/ HEAD |bzip2 > grubby-%{version}.tar.bz2
|
||||||
Source0: %{name}-%{version}.tar.bz2
|
Source0: %{name}-%{version}.tar.bz2
|
||||||
Patch0: 0001-update-extlinux.conf-on-arm-arches-if-it-exists.patch
|
Patch0: 0001-update-extlinux.conf-on-arm-arches-if-it-exists.patch
|
||||||
|
Patch1: 0001-Only-run-the-grub2-test-suite-on-architectures-where.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildRequires: pkgconfig glib2-devel popt-devel
|
BuildRequires: pkgconfig glib2-devel popt-devel
|
||||||
BuildRequires: libblkid-devel git
|
BuildRequires: libblkid-devel git
|
||||||
# for make test / getopt:
|
# for make test / getopt:
|
||||||
BuildRequires: util-linux-ng
|
BuildRequires: util-linux-ng
|
||||||
|
%ifarch i686 x86_64 ppc ppc64
|
||||||
|
BuildRequires: grub2
|
||||||
|
%endif
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
Requires: s390utils-base
|
Requires: s390utils-base
|
||||||
%endif
|
%endif
|
||||||
@ -72,10 +76,11 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Jul 30 2013 Peter Jones <pjones@redhat.com> - 8.27-2
|
* Tue Jul 30 2013 Peter Jones <pjones@redhat.com> - 8.27-1
|
||||||
- Make grubby understand grub's "saved_entry" system
|
- Make grubby understand grub's "saved_entry" system
|
||||||
Resolves: rhbz#768106
|
Resolves: rhbz#768106
|
||||||
Resolves: rhbz#736188
|
Resolves: rhbz#736188
|
||||||
|
- BuildRequire grub2 on appropriate platforms, for the test suite.
|
||||||
|
|
||||||
* Fri Jun 07 2013 Dennis Gilmore <dennis@ausil.us> - 8.26-2
|
* Fri Jun 07 2013 Dennis Gilmore <dennis@ausil.us> - 8.26-2
|
||||||
- add patch to update extlinux.conf file on arm if it exists
|
- add patch to update extlinux.conf file on arm if it exists
|
||||||
|
Loading…
Reference in New Issue
Block a user