On Wed, 2008-09-17 at 10:09 -0500, Chip Webb wrote:|
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
- rc.local - Don't think this works because we can't wait till the target boots up.
- 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.
- 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
- 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
- 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
We are going to stick with #1 for now for the sake of expediency.
- 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 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
Best Regards and thanks again,