diff options
| author | mingli.yu@windriver.com <mingli.yu@windriver.com> | 2016-07-22 10:32:48 +0800 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-07-29 11:00:58 +0200 |
| commit | 014c361d80fc4105f279b9a9976355365892d298 (patch) | |
| tree | f665eba637ea6572c1c7502b84928b94e8ba7bb9 | |
| parent | 520610b6fa9df01c0b96d0a9eef4b1ba1eac903f (diff) | |
| download | meta-openembedded-014c361d80fc4105f279b9a9976355365892d298.tar.gz | |
grubby: add grubby 8.40-1
* Add grubby bb
* Rename grub2-editenv to grub-editenv as
we don't use the name grub2-editenv for grub2
* Add ptest support
* Update #!/bin/bash to #!/bin/sh in test.sh to remove
bashisms
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
4 files changed, 139 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/grubby-remove-bashisms-in-test.sh.patch b/meta-initramfs/recipes-devtools/grubby/grubby/grubby-remove-bashisms-in-test.sh.patch new file mode 100644 index 0000000000..6734e7f0f8 --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/grubby-remove-bashisms-in-test.sh.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From c3a004b8d6dff1a767573dd7baf5d45efddb9f2b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
| 3 | Date: Fri, 15 Jul 2016 11:23:17 +0800 | ||
| 4 | Subject: [PATCH] grubby: remove bashisms in test.sh | ||
| 5 | |||
| 6 | * Update #!/bin/bash to #!/bin/sh in test.sh to | ||
| 7 | remove below warning: | ||
| 8 | QA Issue: /usr/lib/grubby/ptest/test.sh contained | ||
| 9 | in package grubby-ptest requires /bin/bash, but no | ||
| 10 | providers found in RDEPENDS_grubby-ptest? [file-rdeps] | ||
| 11 | |||
| 12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 13 | --- | ||
| 14 | test.sh | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/test.sh b/test.sh | ||
| 18 | index f738388..f3537f3 100755 | ||
| 19 | --- a/test.sh | ||
| 20 | +++ b/test.sh | ||
| 21 | @@ -1,4 +1,4 @@ | ||
| 22 | -#!/bin/bash | ||
| 23 | +#!/bin/sh | ||
| 24 | # | ||
| 25 | # test.sh -- grubby regression tests | ||
| 26 | # | ||
| 27 | -- | ||
| 28 | 2.8.1 | ||
| 29 | |||
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 new file mode 100644 index 0000000000..d936249be8 --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/grubby-rename-grub2-editenv-to-grub-editenv.patch | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | From 0841706a5b5280e501c8e392c70c466c5fbcf0aa Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
| 3 | Date: Tue, 4 Aug 2015 23:54:41 -0700 | ||
| 4 | Subject: [PATCH] rename grub2-editenv to grub-editenv | ||
| 5 | |||
| 6 | We don't use the name grub2-editenv for grub2. | ||
| 7 | |||
| 8 | Upstream-Status: Inappropriate | ||
| 9 | |||
| 10 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
| 11 | --- | ||
| 12 | grubby.c | 4 ++-- | ||
| 13 | test.sh | 6 +++--- | ||
| 14 | 2 files changed, 5 insertions(+), 5 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/grubby.c b/grubby.c | ||
| 17 | index d4ebb86..47a1a15 100644 | ||
| 18 | --- a/grubby.c | ||
| 19 | +++ b/grubby.c | ||
| 20 | @@ -290,7 +290,7 @@ static char *grub2GetEnv(struct configFileInfo *info, char *name) | ||
| 21 | char *s = NULL; | ||
| 22 | char *ret = NULL; | ||
| 23 | char *envFile = info->envFile ? info->envFile : "/boot/grub2/grubenv"; | ||
| 24 | - int rc = asprintf(&s, "grub2-editenv %s list | grep '^%s='", envFile, name); | ||
| 25 | + int rc = asprintf(&s, "grub-editenv %s list | grep '^%s='", envFile, name); | ||
| 26 | |||
| 27 | if (rc < 0) | ||
| 28 | return NULL; | ||
| 29 | @@ -361,7 +361,7 @@ static int grub2SetEnv(struct configFileInfo *info, char *name, char *value) | ||
| 30 | if (!value) | ||
| 31 | return -1; | ||
| 32 | |||
| 33 | - rc = asprintf(&s, "grub2-editenv %s set '%s=%s'", envFile, name, value); | ||
| 34 | + rc = asprintf(&s, "grub-editenv %s set '%s=%s'", envFile, name, value); | ||
| 35 | free(value); | ||
| 36 | if (rc <0) | ||
| 37 | return -1; | ||
| 38 | diff --git a/test.sh b/test.sh | ||
| 39 | index 6379698..f738388 100755 | ||
| 40 | --- a/test.sh | ||
| 41 | +++ b/test.sh | ||
| 42 | @@ -574,7 +574,7 @@ if [ "$testgrub2" == "y" ]; then | ||
| 43 | --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ | ||
| 44 | --copy-default | ||
| 45 | commandTest "saved_default output" \ | ||
| 46 | - "grub2-editenv test/grub2-support_files/env_temp list" \ | ||
| 47 | + "grub-editenv test/grub2-support_files/env_temp list" \ | ||
| 48 | "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64" | ||
| 49 | |||
| 50 | testing="GRUB2 add kernel with default=saved_entry and a terrible title" | ||
| 51 | @@ -587,13 +587,13 @@ if [ "$testgrub2" == "y" ]; then | ||
| 52 | testing="GRUB2 set default with default=saved_entry and a terrible name" | ||
| 53 | grub2Test grub2.9 add/g2-1.9 --env grubenv.1 --set-default-index=0 | ||
| 54 | commandTest "saved_default output" \ | ||
| 55 | - "grub2-editenv test/grub2-support_files/env_temp list" \ | ||
| 56 | + "grub-editenv test/grub2-support_files/env_temp list" \ | ||
| 57 | 'saved_entry=Fedora (3.10.3-300.fc19.x86_64) 19 (Schrödinger’s Cat)' | ||
| 58 | |||
| 59 | testing="GRUB2 set default with default=saved_entry" | ||
| 60 | grub2Test grub2.8 add/g2-1.8 --env grubenv.1 --set-default-index=0 | ||
| 61 | commandTest "saved_default output" \ | ||
| 62 | - "grub2-editenv test/grub2-support_files/env_temp list" \ | ||
| 63 | + "grub-editenv test/grub2-support_files/env_temp list" \ | ||
| 64 | "saved_entry=title" | ||
| 65 | |||
| 66 | testing="GRUB2 --default-index with default=saved_entry" | ||
| 67 | -- | ||
| 68 | 2.3.5 | ||
| 69 | |||
diff --git a/meta-initramfs/recipes-devtools/grubby/grubby/run-ptest b/meta-initramfs/recipes-devtools/grubby/grubby/run-ptest new file mode 100644 index 0000000000..b06ac59460 --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby/run-ptest | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ./test.sh -v | ||
diff --git a/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb b/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb new file mode 100644 index 0000000000..dc6cc624f2 --- /dev/null +++ b/meta-initramfs/recipes-devtools/grubby/grubby_8.40.bb | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | SUMMARY = "A command line tool for updating and displaying info about boot loaders" | ||
| 2 | DESCRIPTION = "grubby is a command line tool for updating and displaying information \ | ||
| 3 | about the configuration files for the grub, lilo, elilo (ia64), yaboot (powerpc) and \ | ||
| 4 | zipl (s390) boot loaders. It is primarily designed to be used from scripts which install \ | ||
| 5 | new kernels and need to find information about the current boot environment. \ | ||
| 6 | " | ||
| 7 | LICENSE = "GPLv2+" | ||
| 8 | |||
| 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a" | ||
| 10 | |||
| 11 | DEPENDS = "popt util-linux" | ||
| 12 | |||
| 13 | SRC_URI = "https://github.com/rhinstaller/${BPN}/archive/${PV}-1.tar.gz;downloadfilename=${BPN}-${PV}-1.tar.gz \ | ||
| 14 | file://grubby-rename-grub2-editenv-to-grub-editenv.patch \ | ||
| 15 | file://run-ptest \ | ||
| 16 | file://grubby-remove-bashisms-in-test.sh.patch \ | ||
| 17 | " | ||
| 18 | |||
| 19 | SRC_URI[md5sum] = "1005907b275d6d93368d045274537d86" | ||
| 20 | SRC_URI[sha256sum] = "85f1c678484f74c8978e8643451594967defce463a86c35cb1ee56d12767a9df" | ||
| 21 | |||
| 22 | S = "${WORKDIR}/${BPN}-${PV}-1" | ||
| 23 | |||
| 24 | RDEPENDS_${PN} += "dracut" | ||
| 25 | |||
| 26 | inherit autotools-brokensep ptest | ||
| 27 | |||
| 28 | EXTRA_OEMAKE = "'CC=${CC}'" | ||
| 29 | |||
| 30 | do_install_ptest() { | ||
| 31 | install -d ${D}${PTEST_PATH} | ||
| 32 | cp -r ${S}/test ${S}/test.sh ${D}${PTEST_PATH} | ||
| 33 | sed -i 's|./grubby|grubby|' ${D}${PTEST_PATH}/test.sh | ||
| 34 | } | ||
| 35 | |||
| 36 | RDEPENDS_${PN}-ptest = "util-linux-getopt" | ||
| 37 | |||
| 38 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)' | ||
