I spent the last couple of days rethinking how we go about building the appliance, and the difficulties we have porting that to other Linux distros. I've come up with a much better way that works better and faster on (so far) Fedora and Debian (probably on Ubuntu too, not tried it), and should be much simpler to port to other distros. The current way is to do: +------------------+ +-----------------+ | febootstrap/ | | | | debootstrap | | extract list of | | install packages |---------->| installed files | | in a chroot | | | +------------------+ +-----------------+ ^ | | | | | | V +------------------+ +--------------------------+ | list of | | calculate supermin | | packages | | base image and hostfiles | +------------------+ +--------------------------+ You might be able to see from the way I've drawn the diagram that there is an obvious thing we've been missing: Go directly from the list of packages we want to install, to the supermin appliance base image and hostfiles. In RPM terms, all we need to do is to "rpm -qlp" (find out what files are in the RPMs). +------------------+ +--------------------------+ | list of | ========> | calculate supermin | | packages | | base image and hostfiles | +------------------+ +--------------------------+ This completely eliminates fakeroot, fakechroot, {fe,de}bootstrap, debirf from the equation, and means that we can support any packaging system provided it supports some set of basic operations like downloading packages and listing files from packages. The details are more complex (only a little), but I have reimplemented febootstrap as a general cross-distro supermin appliance building tool, with working backends for YUM/RPM and Debian/APT/dpkg. I'll be pushing patches to implement this over the next few days, so everything will be in flux for a while. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
The febootstrap 3.0 package is now available: http://people.redhat.com/~rjones/febootstrap/ http://git.annexia.org/?p=febootstrap.git;a=commitdiff;h=66a9d53e48f14d7fe1d9f4b801a1c5582d83efa6 libguestfs 1.7.19 includes a relatively large set of changes to build using febootstrap 3.0: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=6d75ce8e6ca1f3f0a946ee4e214f6d2bff07adc4 This has been tested on Fedora 14 and Debian 5.05. There are a few issues described below. On Fedora: - The yum dependency resolving script fails if the yum repos are out of date. If you get an error during 'make' which seems to indicate the yum is trying to write to one of the root-owned yum directories, you need to do 'sudo yum update' (don't need to actually install any packages), then repeat the operation. I'll ask the yum maintainers how to fix this. On Debian: - /sbin/insmod.static is not packaged on Debian. febootstrap-supermin-helper needs this in order to build the appliance. I ended up building a version by hand. - qemu is ancient. You need qemu 0.13 from experimental. - kernel 2.6.32 is ancient. You need to upgrade to 2.6.36 from experimental. - udev gives a big scary warning in the appliance about how it is being run interactively (not actually true) and then pauses for 60 seconds. The warning is wrong, but this means that the Debian appliance has an unnecessary 60 second wait during launch. - The test for db_dump / db_load in configure is wrong somehow (not looked at this closely yet). As a result the phony images in images/ cannot be built during 'make check'. - There are a handful of failing tests on Debian. Not looked closely but doesn't seem too serious. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On Sun, Dec 05, 2010 at 10:09:58AM -0700, Thomas S Hatch wrote:> So I am in the process of Adding libguestfs to ArchLinux, should I use > febootstrap 3 to build a supermin appliance for Arch? And if so > where exactly should I start, do I need to submit patches for febootstrap > for Arch support?Yes please! This brings me to the second part of the email that I didn't write ... To support a new package manager, the package manager has to support some simple operations. (1) There has to be a way to detect that the package manager should be used, eg. by looking for /etc/arch-release (2) There must be a way to take a list of package names, and fully resolve all dependencies (recursively as necessary) to get a complete list of packages that must be installed to bootstrap. (3) Must be a way to download a package. (4) Must be able to list out the files in a downloaded package. (5) Must be able to extract a single file from a downloaded package. (1)-(5) have to work as non-root. You can use the RPM and Debian plugins for comparison: http://git.annexia.org/?p=febootstrap.git;a=blob;f=febootstrap_debian.ml;h=c0cfbacd0e3c8b426ec92a06ba0c52fd0a8c4e67;hb=HEAD http://git.annexia.org/?p=febootstrap.git;a=blob;f=febootstrap_yum_rpm.ml;h=43021ccee7c127f13d582e4d47a5452b0534383e;hb=HEAD The precise API is described here: http://git.annexia.org/?p=febootstrap.git;a=blob;f=febootstrap_package_handlers.mli;h=673e4489d6ad957186b94f565d62593062cfe4d6;hb=HEAD#l21 The git repo is down at the moment, but the contents of the tarball are identical to git right now. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/