Lead up, I'm working on a build system, part of it needs to produce an
iso. Need to be able to add a file to the initrd used by the kernel in
the iso when it boots, which is a compressed ext2 image.
The normal procedure would be to mount the ext2 file system as loop
back. The copy in the file, umount and compress with gzip.
Since I do not want the builds to have to run as root, I'm looking for a
solution that works with normal user privileges.
Obviously I could just do the change each time the file needs to be
altered and make the modified initrd available to the builds via the
code repository. Then have the build system bomb any time the modified
initrd is older than the file that should be added to it. Less than
ideal.
Alternatively I could try putting together a script and install it on
the build systems that takes a given file and initrd.img, uncompresses
the initrd, mounts it, adds the file, umounts, and recompresses the
image. Then add permissions to allow users to execute the script,
provided they own the initrd they are modifying.
Of course if anyone happens to know of an alternative method that could
work for a normal user, it would be very useful.
--
Darragh
"Nothing is foolproof to a sufficiently talented fool."
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!