All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] grub: two backported patch for bug 2777
@ 2012-07-17  7:28 Jesse Zhang
  2012-07-17  7:28 ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-17  7:28 UTC (permalink / raw)
  To: openembedded-core

Hi,

Here are two backported patch from upstream for grub.

Fixed two errors:

    # grub-mkconfig 
    /usr/sbin/grub-mkconfig: line 98: /usr/lib/grub/grub-mkconfig_lib: No such file or directory

    # grub-mkconfig 
    /usr/sbin/grub-probe: error: cannot stat `/dev/root'.

The first patch is not exactly the same as upstream, since the upstream commit
contains a lot of trivial aesthetic edits.

The second patch is taken from debian instead of directly from upstream, since
the code base has changed.

Jesse Zhang (2):
  grub: fix grub-mkconfig_lib install dir
  grub: fix error stating the root device

 .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
 .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++
 meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
 3 files changed, 217 insertions(+), 53 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch

-- 
1.7.7




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] grub: fix grub-mkconfig_lib install dir
  2012-07-17  7:28 [PATCH 0/2] grub: two backported patch for bug 2777 Jesse Zhang
@ 2012-07-17  7:28 ` Jesse Zhang
  2012-07-17  7:28 ` [PATCH 2/2] grub: fix error stating the root device Jesse Zhang
  2012-07-17 18:41 ` [PATCH 0/2] grub: two backported patch for bug 2777 Saul Wold
  2 siblings, 0 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-17  7:28 UTC (permalink / raw)
  To: openembedded-core

The current fix_for_automake patch is not complete. It fixes the install
dir of grub-mkconfig_lib but neglects to update its references in
grub-mkconfig and the grub.d/* scripts. grub-mkconfig would complain:

    # grub-mkconfig
    /usr/sbin/grub-mkconfig: line 98: /usr/lib/grub/grub-mkconfig_lib: No such file or directory

Backport upstream patch to fix all the references.

[YOCTO #2777]

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
 .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
 meta/recipes-bsp/grub/grub_1.99.bb                 |    2 +-
 2 files changed, 152 insertions(+), 53 deletions(-)

diff --git a/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch b/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch
index 4d729e5..459b4fc 100644
--- a/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch
+++ b/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch
@@ -1,37 +1,32 @@
-Upstream-Status: Pending
+Upstream-Status: Backport
 
-Fixes these errors observed with automake 1.11.2
-The useof pkglibhas become more strict compared to the earlier release of
-automake resulting in these failures.
-Fixed the files related to automake to avoid the issue.
+http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3766
+    Handle newer autotools. Add some missing quotes while on it.
 
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| grub-core/Makefile.am:5:   `conf/Makefile.common' included from here
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| Makefile.am:6:   `conf/Makefile.common' included from here
-| autoreconf: automake failed with exit status: 1
-| ERROR: autoreconf execution failed.
+http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3983
+    gentpl.py: Remove obsolete pkglib_DATA handling.
 
+Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
 
-
-| conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for `SCRIPTS'
-| grub-core/Makefile.am:5:   `conf/Makefile.common' included from here
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| grub-core/Makefile.am:5:   `conf/Makefile.common' included from here
-| conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for `SCRIPTS'
-| Makefile.am:6:   `conf/Makefile.common' included from here
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| Makefile.am:6:   `conf/Makefile.common' included from here
-| autoreconf: automake failed with exit status: 1
-
-Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/01/12
-
-
-Index: grub-1.99/conf/Makefile.common
-===================================================================
---- grub-1.99.orig/conf/Makefile.common
-+++ grub-1.99/conf/Makefile.common
+diff --git a/Makefile.am b/Makefile.am
+index 9301c91..d706968 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -101,8 +101,8 @@ CLEANFILES += widthspec.h
+ # Install config.h into platformdir
+ platform_HEADERS = config.h
+ 
+-pkglib_DATA += grub-mkconfig_lib
+-pkglib_DATA += update-grub_lib
++pkgdata_DATA += grub-mkconfig_lib
++pkgdata_DATA += update-grub_lib
+ 
+ 
+ if COND_i386_coreboot
+diff --git a/conf/Makefile.common b/conf/Makefile.common
+index 5aa13cd..2040a2e 100644
+--- a/conf/Makefile.common
++++ b/conf/Makefile.common
 @@ -137,7 +137,7 @@ KERNEL_HEADER_FILES =
  
  man_MANS =
@@ -41,40 +36,144 @@ Index: grub-1.99/conf/Makefile.common
  bin_SCRIPTS =
  sbin_SCRIPTS =
  bin_PROGRAMS =
-@@ -147,7 +147,7 @@ check_SCRIPTS =
+@@ -147,7 +147,6 @@ check_SCRIPTS =
  grubconf_DATA =
  check_PROGRAMS =
  noinst_SCRIPTS =
 -pkglib_SCRIPTS =
-+pkglibexec_SCRIPTS =
  noinst_PROGRAMS =
  grubconf_SCRIPTS =
  noinst_LIBRARIES =
-Index: grub-1.99/Makefile.am
-===================================================================
---- grub-1.99.orig/Makefile.am
-+++ grub-1.99/Makefile.am
-@@ -101,8 +101,8 @@ CLEANFILES += widthspec.h
- # Install config.h into platformdir
- platform_HEADERS = config.h
- 
--pkglib_DATA += grub-mkconfig_lib
--pkglib_DATA += update-grub_lib
-+pkgdata_DATA += grub-mkconfig_lib
-+pkgdata_DATA += update-grub_lib
- 
- 
- if COND_i386_coreboot
-Index: grub-1.99/gentpl.py
-===================================================================
---- grub-1.99.orig/gentpl.py
-+++ grub-1.99/gentpl.py
+diff --git a/gentpl.py b/gentpl.py
+index a42a606..7992376 100644
+--- a/gentpl.py
++++ b/gentpl.py
 @@ -440,7 +440,7 @@ def script(platform):
      r += "[+ ENDIF +]"
  
      r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """
 -$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
-+$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkgdata_DATA@,$(pkgdata_DATA),g' > $@
++$(top_builddir)/config.status --file=$@:$<
  chmod a+x [+ name +]
  """)
  
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index afc66f8..0c81084 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -95,7 +95,7 @@ do
+     esac
+ done
+ 
+-. ${libdir}/grub/grub-mkconfig_lib
++. ${datadir}/grub/grub-mkconfig_lib
+ 
+ if [ "x$EUID" = "x" ] ; then
+   EUID=`id -u`
+diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
+index 9da1511..30d61f1 100644
+--- a/util/grub.d/00_header.in
++++ b/util/grub.d/00_header.in
+@@ -25,7 +25,7 @@ libdir=@libdir@
+ locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}`
+ grub_lang=`echo $LANG | cut -d . -f 1`
+ 
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ # Do this as early as possible, since other commands might depend on it.
+ # (e.g. the `loadfont' command might need lvm or raid modules)
+diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
+index 8c54eab..d823ba3 100644
+--- a/util/grub.d/10_hurd.in
++++ b/util/grub.d/10_hurd.in
+@@ -20,7 +20,7 @@ set -e
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ CLASS="--class gnu --class os"
+ 
+diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
+index 3600c74..fd8399b 100644
+--- a/util/grub.d/10_kfreebsd.in
++++ b/util/grub.d/10_kfreebsd.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 1d1eb40..0977700 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in
+index ffd31ad..ce77096 100644
+--- a/util/grub.d/10_netbsd.in
++++ b/util/grub.d/10_netbsd.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in
+index fd068dd..9b73dc6 100644
+--- a/util/grub.d/10_windows.in
++++ b/util/grub.d/10_windows.in
+@@ -20,7 +20,7 @@ set -e
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ case "`uname 2>/dev/null`" in
+   CYGWIN*)  ;;
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index a900760..aef5bea 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
+index d9d4b0a..485b224 100644
+--- a/util/grub.d/30_os-prober.in
++++ b/util/grub.d/30_os-prober.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+ 
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
+   exit 0
+-- 
+1.7.7
+
diff --git a/meta/recipes-bsp/grub/grub_1.99.bb b/meta/recipes-bsp/grub/grub_1.99.bb
index 0d49f23..fc7017d 100644
--- a/meta/recipes-bsp/grub/grub_1.99.bb
+++ b/meta/recipes-bsp/grub/grub_1.99.bb
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 DEPENDS = "autogen-native"
 RDEPENDS_${PN} = "diffutils freetype"
-PR = "r8"
+PR = "r9"
 
 SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://grub-install.in.patch \
-- 
1.7.7




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] grub: fix error stating the root device
  2012-07-17  7:28 [PATCH 0/2] grub: two backported patch for bug 2777 Jesse Zhang
  2012-07-17  7:28 ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
@ 2012-07-17  7:28 ` Jesse Zhang
  2012-07-17 18:41 ` [PATCH 0/2] grub: two backported patch for bug 2777 Saul Wold
  2 siblings, 0 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-17  7:28 UTC (permalink / raw)
  To: openembedded-core

grub-mkconfig (and possibly other commands) complains:
    error: cannot stat /dev/root

Backport an upstream patch to fix the error.

[YOCTO #2777]

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
 .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++++++++++++++++
 meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
 2 files changed, 66 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch

diff --git a/meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch b/meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
new file mode 100644
index 0000000..cde8b87
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Backport
+
+Patch is a slightly edited version from debian. Upstream link is:
+http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3318
+
+Description: Don't stat devices unless we have to
+Author: Vladimir Serbinenko <phcoder@gmail.com>
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/627587
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3318
+Last-Update: 2011-05-31
+
+Index: b/grub-core/kern/emu/getroot.c
+===================================================================
+--- a/grub-core/kern/emu/getroot.c
++++ b/grub-core/kern/emu/getroot.c
+@@ -358,7 +358,7 @@
+ 
+       if (S_ISLNK (st.st_mode)) {
+ #ifdef __linux__
+-	if (strcmp (dir, "mapper") == 0) {
++	if (strcmp (dir, "mapper") == 0 || strcmp (dir, "/dev/mapper") == 0) {
+ 	  /* Follow symbolic links under /dev/mapper/; the canonical name
+ 	     may be something like /dev/dm-0, but the names under
+ 	     /dev/mapper/ are more human-readable and so we prefer them if
+@@ -609,20 +609,27 @@
+ 
+   if (os_dev)
+     {
+-      if (stat (os_dev, &st) >= 0)
+-	dev = st.st_rdev;
+-      else
+-	grub_util_error ("cannot stat `%s'", os_dev);
+-      free (os_dev);
++      char *tmp = os_dev;
++      os_dev = canonicalize_file_name (os_dev);
++      free (tmp);
+     }
+-  else
++
++  if (os_dev)
+     {
+-      if (stat (dir, &st) >= 0)
+-	dev = st.st_dev;
+-      else
+-	grub_util_error ("cannot stat `%s'", dir);
++      if (strncmp (os_dev, "/dev/dm-", sizeof ("/dev/dm-") - 1) != 0)
++	return os_dev;
++      if (stat (os_dev, &st) < 0)
++	grub_util_error ("cannot stat `%s'", os_dev);
++      free (os_dev);
++      dev = st.st_rdev;
++      return grub_find_device ("/dev/mapper", dev);
+     }
+ 
++  if (stat (dir, &st) < 0)
++    grub_util_error ("cannot stat `%s'", dir);
++
++  dev = st.st_dev;
++  
+ #ifdef __CYGWIN__
+   /* Cygwin specific function.  */
+   os_dev = grub_find_device (dir, dev);
diff --git a/meta/recipes-bsp/grub/grub_1.99.bb b/meta/recipes-bsp/grub/grub_1.99.bb
index fc7017d..c38f214 100644
--- a/meta/recipes-bsp/grub/grub_1.99.bb
+++ b/meta/recipes-bsp/grub/grub_1.99.bb
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 DEPENDS = "autogen-native"
 RDEPENDS_${PN} = "diffutils freetype"
-PR = "r9"
+PR = "r10"
 
 SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://grub-install.in.patch \
@@ -23,6 +23,7 @@ SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://grub-1.99-gcc-4.7.0-uninitialized-var-errors.patch \
           file://grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch \
           file://grub-1.99-fix-enable_execute_stack-check.patch \
+          file://grub-1.99-lazy_stat.patch \
           file://40_custom"
 
 SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5"
-- 
1.7.7




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] grub: two backported patch for bug 2777
  2012-07-17  7:28 [PATCH 0/2] grub: two backported patch for bug 2777 Jesse Zhang
  2012-07-17  7:28 ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
  2012-07-17  7:28 ` [PATCH 2/2] grub: fix error stating the root device Jesse Zhang
@ 2012-07-17 18:41 ` Saul Wold
  2012-07-18  1:44   ` Jesse Zhang
  2012-07-18  9:25   ` [PATCH v2 " Jesse Zhang
  2 siblings, 2 replies; 9+ messages in thread
From: Saul Wold @ 2012-07-17 18:41 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 07/17/2012 12:28 AM, Jesse Zhang wrote:
> Hi,
>
> Here are two backported patch from upstream for grub.
>
> Fixed two errors:
>
>      # grub-mkconfig
>      /usr/sbin/grub-mkconfig: line 98: /usr/lib/grub/grub-mkconfig_lib: No such file or directory
>
>      # grub-mkconfig
>      /usr/sbin/grub-probe: error: cannot stat `/dev/root'.
>
> The first patch is not exactly the same as upstream, since the upstream commit
> contains a lot of trivial aesthetic edits.
>
Why can't it be the same, then we don't need to carry it?


> The second patch is taken from debian instead of directly from upstream, since
> the code base has changed.
>
> Jesse Zhang (2):
>    grub: fix grub-mkconfig_lib install dir
>    grub: fix error stating the root device
>
>   .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
>   .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++
>   meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
>   3 files changed, 217 insertions(+), 53 deletions(-)
>   create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
>

This patch set may need to be rebased based on the new automake 1.12.x 
updated.

Please double check.

Thanks	
	Sau!



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] grub: two backported patch for bug 2777
  2012-07-17 18:41 ` [PATCH 0/2] grub: two backported patch for bug 2777 Saul Wold
@ 2012-07-18  1:44   ` Jesse Zhang
  2012-07-18  9:25   ` [PATCH v2 " Jesse Zhang
  1 sibling, 0 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-18  1:44 UTC (permalink / raw)
  To: Saul Wold; +Cc: Patches and discussions about the oe-core layer

Hi Saul,

On 07/18/2012 02:41 AM, Saul Wold wrote:
>> The first patch is not exactly the same as upstream, since the upstream commit
>> contains a lot of trivial aesthetic edits.
>>
> Why can't it be the same, then we don't need to carry it?

The code base has changed, so we need to amend the patch anyway. That
would bring more confusion than to just cherry pick the bits that we
need, I think.

When grub is updated from 1.99 to 2.0, the patch can be simply dropped.

>> The second patch is taken from debian instead of directly from upstream, since
>> the code base has changed.
>>
>> Jesse Zhang (2):
>>    grub: fix grub-mkconfig_lib install dir
>>    grub: fix error stating the root device
>>
>>   .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
>>   .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++
>>   meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
>>   3 files changed, 217 insertions(+), 53 deletions(-)
>>   create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
>>
> 
> This patch set may need to be rebased based on the new automake 1.12.x updated.

Just saw the updates. I will test again and send v2.

Thanks.

jesse



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/2] grub: two backported patch for bug 2777
  2012-07-17 18:41 ` [PATCH 0/2] grub: two backported patch for bug 2777 Saul Wold
  2012-07-18  1:44   ` Jesse Zhang
@ 2012-07-18  9:25   ` Jesse Zhang
  2012-07-18  9:25     ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
                       ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-18  9:25 UTC (permalink / raw)
  To: openembedded-core, sgw

Hi Saul,

Just tested the patches against the latest code (head 5ed19a40f40).

Nothing changed, except I need to rebase the PRs.

Jesse Zhang (2):
  grub: fix grub-mkconfig_lib install dir
  grub: fix error stating the root device

 .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
 .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++
 meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
 3 files changed, 217 insertions(+), 53 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch

-- 
1.7.7




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] grub: fix grub-mkconfig_lib install dir
  2012-07-18  9:25   ` [PATCH v2 " Jesse Zhang
@ 2012-07-18  9:25     ` Jesse Zhang
  2012-07-18  9:25     ` [PATCH 2/2] grub: fix error stating the root device Jesse Zhang
  2012-07-20  4:23     ` [PATCH v2 0/2] grub: two backported patch for bug 2777 Saul Wold
  2 siblings, 0 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-18  9:25 UTC (permalink / raw)
  To: openembedded-core, sgw

The current fix_for_automake patch is not complete. It fixes the install
dir of grub-mkconfig_lib but neglects to update its references in
grub-mkconfig and the grub.d/* scripts. grub-mkconfig would complain:

    # grub-mkconfig
    /usr/sbin/grub-mkconfig: line 98: /usr/lib/grub/grub-mkconfig_lib: No such file or directory

Backport upstream patch to fix all the references.

[YOCTO #2777]

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
 .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
 meta/recipes-bsp/grub/grub_1.99.bb                 |    2 +-
 2 files changed, 152 insertions(+), 53 deletions(-)

diff --git a/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch b/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch
index 4d729e5..459b4fc 100644
--- a/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch
+++ b/meta/recipes-bsp/grub/files/grub-1.99_fix_for_automake_1.11.2.patch
@@ -1,37 +1,32 @@
-Upstream-Status: Pending
+Upstream-Status: Backport
 
-Fixes these errors observed with automake 1.11.2
-The useof pkglibhas become more strict compared to the earlier release of
-automake resulting in these failures.
-Fixed the files related to automake to avoid the issue.
+http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3766
+    Handle newer autotools. Add some missing quotes while on it.
 
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| grub-core/Makefile.am:5:   `conf/Makefile.common' included from here
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| Makefile.am:6:   `conf/Makefile.common' included from here
-| autoreconf: automake failed with exit status: 1
-| ERROR: autoreconf execution failed.
+http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3983
+    gentpl.py: Remove obsolete pkglib_DATA handling.
 
+Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
 
-
-| conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for `SCRIPTS'
-| grub-core/Makefile.am:5:   `conf/Makefile.common' included from here
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| grub-core/Makefile.am:5:   `conf/Makefile.common' included from here
-| conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for `SCRIPTS'
-| Makefile.am:6:   `conf/Makefile.common' included from here
-| conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
-| Makefile.am:6:   `conf/Makefile.common' included from here
-| autoreconf: automake failed with exit status: 1
-
-Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/01/12
-
-
-Index: grub-1.99/conf/Makefile.common
-===================================================================
---- grub-1.99.orig/conf/Makefile.common
-+++ grub-1.99/conf/Makefile.common
+diff --git a/Makefile.am b/Makefile.am
+index 9301c91..d706968 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -101,8 +101,8 @@ CLEANFILES += widthspec.h
+ # Install config.h into platformdir
+ platform_HEADERS = config.h
+ 
+-pkglib_DATA += grub-mkconfig_lib
+-pkglib_DATA += update-grub_lib
++pkgdata_DATA += grub-mkconfig_lib
++pkgdata_DATA += update-grub_lib
+ 
+ 
+ if COND_i386_coreboot
+diff --git a/conf/Makefile.common b/conf/Makefile.common
+index 5aa13cd..2040a2e 100644
+--- a/conf/Makefile.common
++++ b/conf/Makefile.common
 @@ -137,7 +137,7 @@ KERNEL_HEADER_FILES =
  
  man_MANS =
@@ -41,40 +36,144 @@ Index: grub-1.99/conf/Makefile.common
  bin_SCRIPTS =
  sbin_SCRIPTS =
  bin_PROGRAMS =
-@@ -147,7 +147,7 @@ check_SCRIPTS =
+@@ -147,7 +147,6 @@ check_SCRIPTS =
  grubconf_DATA =
  check_PROGRAMS =
  noinst_SCRIPTS =
 -pkglib_SCRIPTS =
-+pkglibexec_SCRIPTS =
  noinst_PROGRAMS =
  grubconf_SCRIPTS =
  noinst_LIBRARIES =
-Index: grub-1.99/Makefile.am
-===================================================================
---- grub-1.99.orig/Makefile.am
-+++ grub-1.99/Makefile.am
-@@ -101,8 +101,8 @@ CLEANFILES += widthspec.h
- # Install config.h into platformdir
- platform_HEADERS = config.h
- 
--pkglib_DATA += grub-mkconfig_lib
--pkglib_DATA += update-grub_lib
-+pkgdata_DATA += grub-mkconfig_lib
-+pkgdata_DATA += update-grub_lib
- 
- 
- if COND_i386_coreboot
-Index: grub-1.99/gentpl.py
-===================================================================
---- grub-1.99.orig/gentpl.py
-+++ grub-1.99/gentpl.py
+diff --git a/gentpl.py b/gentpl.py
+index a42a606..7992376 100644
+--- a/gentpl.py
++++ b/gentpl.py
 @@ -440,7 +440,7 @@ def script(platform):
      r += "[+ ENDIF +]"
  
      r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """
 -$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
-+$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkgdata_DATA@,$(pkgdata_DATA),g' > $@
++$(top_builddir)/config.status --file=$@:$<
  chmod a+x [+ name +]
  """)
  
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index afc66f8..0c81084 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -95,7 +95,7 @@ do
+     esac
+ done
+ 
+-. ${libdir}/grub/grub-mkconfig_lib
++. ${datadir}/grub/grub-mkconfig_lib
+ 
+ if [ "x$EUID" = "x" ] ; then
+   EUID=`id -u`
+diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
+index 9da1511..30d61f1 100644
+--- a/util/grub.d/00_header.in
++++ b/util/grub.d/00_header.in
+@@ -25,7 +25,7 @@ libdir=@libdir@
+ locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}`
+ grub_lang=`echo $LANG | cut -d . -f 1`
+ 
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ # Do this as early as possible, since other commands might depend on it.
+ # (e.g. the `loadfont' command might need lvm or raid modules)
+diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
+index 8c54eab..d823ba3 100644
+--- a/util/grub.d/10_hurd.in
++++ b/util/grub.d/10_hurd.in
+@@ -20,7 +20,7 @@ set -e
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ CLASS="--class gnu --class os"
+ 
+diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
+index 3600c74..fd8399b 100644
+--- a/util/grub.d/10_kfreebsd.in
++++ b/util/grub.d/10_kfreebsd.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 1d1eb40..0977700 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in
+index ffd31ad..ce77096 100644
+--- a/util/grub.d/10_netbsd.in
++++ b/util/grub.d/10_netbsd.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in
+index fd068dd..9b73dc6 100644
+--- a/util/grub.d/10_windows.in
++++ b/util/grub.d/10_windows.in
+@@ -20,7 +20,7 @@ set -e
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ case "`uname 2>/dev/null`" in
+   CYGWIN*)  ;;
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index a900760..aef5bea 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ libdir=@libdir@
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ export TEXTDOMAIN=@PACKAGE@
+ export TEXTDOMAINDIR=@localedir@
+diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
+index d9d4b0a..485b224 100644
+--- a/util/grub.d/30_os-prober.in
++++ b/util/grub.d/30_os-prober.in
+@@ -21,7 +21,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+ 
+-. ${libdir}/grub/grub-mkconfig_lib
++. @datadir@/grub/grub-mkconfig_lib
+ 
+ if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
+   exit 0
+-- 
+1.7.7
+
diff --git a/meta/recipes-bsp/grub/grub_1.99.bb b/meta/recipes-bsp/grub/grub_1.99.bb
index 775c6aa..1009ce8 100644
--- a/meta/recipes-bsp/grub/grub_1.99.bb
+++ b/meta/recipes-bsp/grub/grub_1.99.bb
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 DEPENDS = "autogen-native"
 RDEPENDS_${PN} = "diffutils freetype"
-PR = "r9"
+PR = "r10"
 
 SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://grub-install.in.patch \
-- 
1.7.7




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] grub: fix error stating the root device
  2012-07-18  9:25   ` [PATCH v2 " Jesse Zhang
  2012-07-18  9:25     ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
@ 2012-07-18  9:25     ` Jesse Zhang
  2012-07-20  4:23     ` [PATCH v2 0/2] grub: two backported patch for bug 2777 Saul Wold
  2 siblings, 0 replies; 9+ messages in thread
From: Jesse Zhang @ 2012-07-18  9:25 UTC (permalink / raw)
  To: openembedded-core, sgw

grub-mkconfig (and possibly other commands) complains:
    error: cannot stat /dev/root

Backport an upstream patch to fix the error.

[YOCTO #2777]

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
 .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++++++++++++++++
 meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
 2 files changed, 66 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch

diff --git a/meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch b/meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
new file mode 100644
index 0000000..cde8b87
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Backport
+
+Patch is a slightly edited version from debian. Upstream link is:
+http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3318
+
+Description: Don't stat devices unless we have to
+Author: Vladimir Serbinenko <phcoder@gmail.com>
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/627587
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3318
+Last-Update: 2011-05-31
+
+Index: b/grub-core/kern/emu/getroot.c
+===================================================================
+--- a/grub-core/kern/emu/getroot.c
++++ b/grub-core/kern/emu/getroot.c
+@@ -358,7 +358,7 @@
+ 
+       if (S_ISLNK (st.st_mode)) {
+ #ifdef __linux__
+-	if (strcmp (dir, "mapper") == 0) {
++	if (strcmp (dir, "mapper") == 0 || strcmp (dir, "/dev/mapper") == 0) {
+ 	  /* Follow symbolic links under /dev/mapper/; the canonical name
+ 	     may be something like /dev/dm-0, but the names under
+ 	     /dev/mapper/ are more human-readable and so we prefer them if
+@@ -609,20 +609,27 @@
+ 
+   if (os_dev)
+     {
+-      if (stat (os_dev, &st) >= 0)
+-	dev = st.st_rdev;
+-      else
+-	grub_util_error ("cannot stat `%s'", os_dev);
+-      free (os_dev);
++      char *tmp = os_dev;
++      os_dev = canonicalize_file_name (os_dev);
++      free (tmp);
+     }
+-  else
++
++  if (os_dev)
+     {
+-      if (stat (dir, &st) >= 0)
+-	dev = st.st_dev;
+-      else
+-	grub_util_error ("cannot stat `%s'", dir);
++      if (strncmp (os_dev, "/dev/dm-", sizeof ("/dev/dm-") - 1) != 0)
++	return os_dev;
++      if (stat (os_dev, &st) < 0)
++	grub_util_error ("cannot stat `%s'", os_dev);
++      free (os_dev);
++      dev = st.st_rdev;
++      return grub_find_device ("/dev/mapper", dev);
+     }
+ 
++  if (stat (dir, &st) < 0)
++    grub_util_error ("cannot stat `%s'", dir);
++
++  dev = st.st_dev;
++  
+ #ifdef __CYGWIN__
+   /* Cygwin specific function.  */
+   os_dev = grub_find_device (dir, dev);
diff --git a/meta/recipes-bsp/grub/grub_1.99.bb b/meta/recipes-bsp/grub/grub_1.99.bb
index 1009ce8..f1ed7ca 100644
--- a/meta/recipes-bsp/grub/grub_1.99.bb
+++ b/meta/recipes-bsp/grub/grub_1.99.bb
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 DEPENDS = "autogen-native"
 RDEPENDS_${PN} = "diffutils freetype"
-PR = "r10"
+PR = "r11"
 
 SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://grub-install.in.patch \
@@ -24,6 +24,7 @@ SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch \
           file://grub-1.99-fix-enable_execute_stack-check.patch \
           file://remove-gets.patch \
+          file://grub-1.99-lazy_stat.patch \
           file://40_custom"
 
 SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5"
-- 
1.7.7




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] grub: two backported patch for bug 2777
  2012-07-18  9:25   ` [PATCH v2 " Jesse Zhang
  2012-07-18  9:25     ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
  2012-07-18  9:25     ` [PATCH 2/2] grub: fix error stating the root device Jesse Zhang
@ 2012-07-20  4:23     ` Saul Wold
  2 siblings, 0 replies; 9+ messages in thread
From: Saul Wold @ 2012-07-20  4:23 UTC (permalink / raw)
  To: Jesse Zhang; +Cc: openembedded-core

On 07/18/2012 02:25 AM, Jesse Zhang wrote:
> Hi Saul,
>
> Just tested the patches against the latest code (head 5ed19a40f40).
>
> Nothing changed, except I need to rebase the PRs.
>
> Jesse Zhang (2):
>    grub: fix grub-mkconfig_lib install dir
>    grub: fix error stating the root device
>
>   .../files/grub-1.99_fix_for_automake_1.11.2.patch  |  203 +++++++++++++++-----
>   .../grub/grub-1.99/grub-1.99-lazy_stat.patch       |   64 ++++++
>   meta/recipes-bsp/grub/grub_1.99.bb                 |    3 +-
>   3 files changed, 217 insertions(+), 53 deletions(-)
>   create mode 100644 meta/recipes-bsp/grub/grub-1.99/grub-1.99-lazy_stat.patch
>

Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-20  4:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17  7:28 [PATCH 0/2] grub: two backported patch for bug 2777 Jesse Zhang
2012-07-17  7:28 ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
2012-07-17  7:28 ` [PATCH 2/2] grub: fix error stating the root device Jesse Zhang
2012-07-17 18:41 ` [PATCH 0/2] grub: two backported patch for bug 2777 Saul Wold
2012-07-18  1:44   ` Jesse Zhang
2012-07-18  9:25   ` [PATCH v2 " Jesse Zhang
2012-07-18  9:25     ` [PATCH 1/2] grub: fix grub-mkconfig_lib install dir Jesse Zhang
2012-07-18  9:25     ` [PATCH 2/2] grub: fix error stating the root device Jesse Zhang
2012-07-20  4:23     ` [PATCH v2 0/2] grub: two backported patch for bug 2777 Saul Wold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.