[oe-users] grub; general configuration files

Marcin Juszkiewicz openembedded at hrw.one.pl
Tue Apr 3 10:05:24 UTC 2007


Dnia poniedziałek, 2 kwietnia 2007, joseph at pfeifferfamily.net napisał:

> Indeed, the upstream distribution of grub just installs into
> /usr/lib/grub/i386-pc/, and relies on you running grub-install (or
> otherwise installing grub from there.  Also, there is no default
> menu.lst distributed with grub.  openembedded follows this lead.

> I'm in the process of trying to create a machine configuration for the
> Technologic Systems TS5500 SBC, and one of the things I'd like to do
> is add things like a grub menu.lst and a pcmciautils config.opts file,
> specific to this machine.  I've been having a hard time finding a good
> way to do it...  So, I'll describe what I've done in the case of grub,
> and ask for guidance on how to do it right.

> In the case of grub, I've modified the existing grub_0.97.bb file by
> adding the following:
>
> SRC_URI_append_ts5500 = " file://${MACHINE}/menu.lst"
> PACKAGE_ARCH = "${MACHINE}"
>
> do_install_append_ts5500() {
>         install -d ${D}/boot/
>         ln -sf ../usr/lib/grub/i386-pc ${D}/boot/grub
>
>         install -m 0644 ${WORKDIR}/ts5500/menu.lst ${D}/boot/grub
> }

You can add default menu.lst into Grub and then also add machine related 
one. Then you will just install it into /boot/grub/ and BitBake will take 
care about getting ts5500 version instead of default one. Same thing with 
this symlink. So both parts can be default for all builds... Please test 
it and submit patch.

> and created a ts5500 directory including my menu.lst file.  This
> works, but I don't like it:  I've gone in and messed with somebody
> else's very general recipe, for the sake of my particular board.  If
> 15 other people modify the recipe for their own boards, it turns into
> a royal mess!  (I noticed, incidentally, that there was already a
> do_install_append_vmware() defined in there...  so I'm not the only
> one to take this approach).

My solution will take care of such stuff.

> As I start looking at pcmciautils, I'm realizing that the same
> approach would work there...  but would have the same drawbacks
> (actually, that one's a little bit different since it would be
> modifying config.opts, which would look more like a patch).

Provide default config.opts and machine related one too.

> Over in the machine configuration file, I was able to define
> SERIAL_CONSOLE = "ttyS1 115200"
> which adds a line to /etc/inittab.  What I'd really like would be a
> centralized place (probably someplace like ts5500.conf) that would
> allow me to specify a central location for a bunch of config files and
> post-install steps for this machine, which would then be plugged in as
> needed to their relevant recipes.

You can have post processing commands which will run after image is 
created. 

You can create ts5500-configs recipe which will keep all files and add 
this package into image. I did such thing for one of clients.

-- 
JID: hrw-jabber.org
OpenEmbedded developer/consultant

                   Smile a lot; it makes others nervous.






More information about the Openembedded-users mailing list