[oe] [PATCH 3/3] grub: split menu.lst into a separate package, grub-config.

Chris Larson clarson at kergoth.com
Thu May 7 19:02:04 UTC 2009


I'm not sure if you realize, but you can let your overlay override
file:// files by manipulating FILESPATH.  You don't need to split up
all the recipes.

FILESPATHBASE =.
"/path/to/my/overlay/recipes/${os.path.basename(os.path.dirname(d.getVar('FILE',
1)))}:"

Would ensure that /path/to/my/overlay/recipes + the name of the dir
the recipe resides in is searched before the default location (which
is the dir the recipe is in).  We can't sanely set a default FILESPATH
based on COLLECTIONS because we can't necesasrily globally assume all
collections have the same layout.  But you know your layouts, so you
can set it yourself and have it work just fine.

An alternative, if you're just providing a local change rather than a
overlay specific change would be to do something like:

FILESPATHBASE =. "${TOPDIR}/files"

and drop your menu.lst into ${TOPDIR}/files/grub/.

On Thu, May 7, 2009 at 11:27 AM, Michael Smith <msmith at cbnco.com> wrote:
> This makes it easier for overlays to override the configuration.
>
> Signed-off-by: Michael Smith <msmith at cbnco.com>
> ---
>  recipes/grub/files/menu.lst     |    6 ++++++
>  recipes/grub/grub-0.97/menu.lst |    6 ------
>  recipes/grub/grub-config_1.0.bb |   13 +++++++++++++
>  recipes/grub/grub_0.97.bb       |   12 +++++-------
>  4 files changed, 24 insertions(+), 13 deletions(-)
>  create mode 100644 recipes/grub/files/menu.lst
>  delete mode 100644 recipes/grub/grub-0.97/menu.lst
>  create mode 100644 recipes/grub/grub-config_1.0.bb
>
> diff --git a/recipes/grub/files/menu.lst b/recipes/grub/files/menu.lst
> new file mode 100644
> index 0000000..510e8f8
> --- /dev/null
> +++ b/recipes/grub/files/menu.lst
> @@ -0,0 +1,6 @@
> +# menu.lst
> +default 0
> +timeout 5
> +title   OpenEmbedded Linux (hda1)
> +root    (hd0,0)
> +kernel  /boot/bzImage root=/dev/hda1 ro
> diff --git a/recipes/grub/grub-0.97/menu.lst b/recipes/grub/grub-0.97/menu.lst
> deleted file mode 100644
> index 510e8f8..0000000
> --- a/recipes/grub/grub-0.97/menu.lst
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# menu.lst
> -default 0
> -timeout 5
> -title   OpenEmbedded Linux (hda1)
> -root    (hd0,0)
> -kernel  /boot/bzImage root=/dev/hda1 ro
> diff --git a/recipes/grub/grub-config_1.0.bb b/recipes/grub/grub-config_1.0.bb
> new file mode 100644
> index 0000000..f6e82a7
> --- /dev/null
> +++ b/recipes/grub/grub-config_1.0.bb
> @@ -0,0 +1,13 @@
> +DESCRIPTION = "Configuration file for grub"
> +SECTION = "bootloaders"
> +PRIORITY = "optional"
> +PR = "r0"
> +
> +SRC_URI = "file://menu.lst"
> +
> +do_install() {
> +       install -D -m 0644 ${WORKDIR}/menu.lst \
> +               ${D}${libdir}/grub/i386${TARGET_VENDOR}/menu.lst
> +}
> +
> +FILES_${PN} += "${libdir}"
> diff --git a/recipes/grub/grub_0.97.bb b/recipes/grub/grub_0.97.bb
> index e1162ef..8822b7e 100644
> --- a/recipes/grub/grub_0.97.bb
> +++ b/recipes/grub/grub_0.97.bb
> @@ -3,11 +3,13 @@ HOMEPAGE = "http://www.gnu.org/software/grub"
>  SECTION = "bootloaders"
>  PRIORITY = "optional"
>  RDEPENDS = "diffutils"
> -PR = "r4"
> +PR = "r5"
> +
> +# menu.lst is shipped in a separate package that overlays can override.
> +RRECOMMENDS = "grub-config"
>
>  SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz \
> -           file://automake-1.10.patch;patch=1 \
> -           file://menu.lst"
> +           file://automake-1.10.patch;patch=1"
>
>  inherit autotools
>
> @@ -21,10 +23,6 @@ python __anonymous () {
>  do_install_append() {
>         install -d ${D}/boot/
>        ln -sf ..${libdir}/grub/i386${TARGET_VENDOR}/ ${D}/boot/grub
> -
> -       # TODO: better use grub-set-default script here?
> -       install -m 0644 ${WORKDIR}/menu.lst \
> -               ${D}${libdir}/grub/i386${TARGET_VENDOR}/
>  }
>
>  FILES_${PN}-doc = "${datadir}"
> --
> 1.5.6.5
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



-- 
Chris Larson
clarson at kergoth dot com
clarson at mvista dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Software Engineer
MontaVista Software, Inc.




More information about the Openembedded-devel mailing list