[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Support for %Post section of .spec file?

From: Stuart Hughes
Subject: Re: [Ltib] Support for %Post section of .spec file?
Date: Thu, 18 Sep 2008 11:27:11 +0100

On Wed, 2008-09-17 at 10:09 -0500, Chip Webb wrote:
Hi Stuart

What we need to do is modify/edit files in the root file system prior to
building the initramfs image.


I also understand your desire to prevent people from hosing their own
root file system by running RPM inside a chroot jail. However that is
not so important to us since we use CentOS virtual machines for our builds,
and keep everything for LTIB in a separate subversion server.

but you understand that I can't change things just for this environment.  So the rpm/chroot will stay.

You list three other options
  1. rc.local - Don't think this works because we can't wait till the target boots up.


  1. merge directory - Not sure this can help us because what we want to do
    isn't replacing one file with another or just adding files to the filesystem.

No, merge comes last, so merge contents win.  If you have
whatever you put in there will wind up in the image.   You can override
as many files as you like.

  1. separate RPM  - Wouldn't this option suffer from the same chroot limitations
    as I'm trying to solve?

No, rpm is how all the files get onto the rootfs image.

So none of these alternatives would work for us.

Yes they would

It would seem that we have a couple of options
  1. Stick with the patch I've made since it works for now.
    Deal with the chroot issue when/if we upgrade to
    a version of LTIB that implements the chroot jail for RPM.

bad idea, %post is intended to be run on the target

  1. Write a separate script to run outside of LTIB to fix up
    the file system (sudoing to root). This is doable and is
    what I would have done if I had known it would be so
    difficult to accomplish what I wanted inside of LTIB.

bad idea, fragile

  1. Build a host-executable version of busybox and place it
    (temporarily) into the chroot jail so that RPM's %post
    and %pre sections can at least run busybox commands
    to edit files (which would be sufficient for us). In that case
    I'd still need the patch I proposed, and then we'd also have
    to build the host-executable busybox package, and
    then find a way to install it ahead of time, and remove it
    before building the initramfs.
We are going to stick with #1 for now for the sake of expediency.
We may switch to #2 in the future if we upgrade and that breaks
the build process.

use a merge directory.  it's simple and will do what you want.

FWIW, we are using a version of LTIB that was packaged last November for
the MPC8544DS evaluation board. Since we're getting ready to
release our product in a month or so, we're not going to update to the
latest version from the CVS repository on savannah in the near future.

that's fine, but as you see things change, so your fundamental approach needs to
be one that doesn't make to many assumptions.  Did I say it before, use a
merge directory.

Best Regards and thanks again,

Chip Webb

Regards, Stuart

reply via email to

[Prev in Thread] Current Thread [Next in Thread]