febootstrap: what am I doing wrong?
Good evening, I just tried following the steps in "Tip: Creating throwaway appliances with febootstrap"[1] on my workstation at home running Debian/unstable. I ran into problems: ,---- | $ mkdir supermin.d | $ febootstrap --names 'bash' 'coreutils' -o supermin.d | Get: 1 http://ftp.de.debian.org/debian/ sid/main bash amd64 4.1-3 [1325 kB] | Get: 2 http://ftp.de.debian.org/debian/ sid/main base-files amd64 6.4 [69.1 kB] | Get: 3 http://ftp.de.debian.org/debian/ sid/main coreutils amd64 8.5-1 [5102 kB] | Get: 4 http://ftp.de.debian.org/debian/ sid/main libacl1 amd64 2.2.49-5 [28.7 kB] | Get: 5 http://ftp.de.debian.org/debian/ sid/main libattr1 amd64 1:2.4.44-3 [18.4 kB] | Get: 6 http://ftp.de.debian.org/debian/ sid/main dash amd64 0.5.5.1-7.4 [108 kB] | Get: 7 http://ftp.de.debian.org/debian/ sid/main debianutils amd64 4 [75.4 kB] | Get: 8 http://ftp.de.debian.org/debian/ sid/main dpkg amd64 1.16.0.3 [2227 kB] | Get: 9 http://ftp.de.debian.org/debian/ sid/main libbz2-1.0 amd64 1.0.5-6 [46.4 kB] | Get: 10 http://ftp.de.debian.org/debian/ sid/main libc6 amd64 2.13-4 [4312 kB] | Get: 11 http://ftp.de.debian.org/debian/ sid/main libc-bin amd64 2.13-4 [1079 kB] | Get: 12 http://ftp.de.debian.org/debian/ sid/main gawk amd64 1:3.1.7.dfsg-5 [806 kB] | Get: 13 http://ftp.de.debian.org/debian/ sid/main libgcc1 amd64 1:4.6.0-10 [42.8 kB] | Get: 14 http://ftp.de.debian.org/debian/ sid/main gcc-4.6-base amd64 4.6.0-10 [131 kB] | Get: 15 http://ftp.de.debian.org/debian/ sid/main libselinux1 amd64 2.0.98-1+b1 [89.2 kB] | Get: 16 http://ftp.de.debian.org/debian/ sid/main mawk amd64 1.3.3-15 [90.1 kB] | Get: 17 http://ftp.de.debian.org/debian/ sid/main libncurses5 amd64 5.9-1 [382 kB] | Get: 18 http://ftp.de.debian.org/debian/ sid/main original-awk amd64 2010-05-23-1 [73.4 kB] | Get: 19 http://ftp.de.debian.org/debian/ sid/main sensible-utils all 0.0.6 [6428 B] | Get: 20 http://ftp.de.debian.org/debian/ sid/main xz-utils amd64 5.0.0-2 [201 kB] | Get: 21 http://ftp.de.debian.org/debian/ sid/main liblzma2 amd64 5.0.0-2 [184 kB] | Get: 22 http://ftp.de.debian.org/debian/ sid/main zlib1g amd64 1:1.2.3.4.dfsg-3 [79.2 kB] | Fetched 16.5 MB in 13s (1261 kB/s) `---- No obvious problems so far. ,---- | $ ls -lh supermin.d/ | | total 100K | -rw-r--r-- 1 bengen bengen 52K May 29 18:59 base.img | -rw-r--r-- 1 bengen bengen 42K May 29 18:59 hostfiles `---- Well, base.img and hostfiles have been created, but base.img is considerably smaller than in the example. ,---- | $ cat > init | #!/bin/bash - | echo Welcome to my world | bash -i | $ chmod +x init | $ echo init | cpio -o -H newc --quiet > supermin.d/init.img | $ febootstrap-supermin-helper -f ext2 supermin.d x86_64 kernel initrd root | febootstrap-supermin-helper: ext2: parent directory not found: /lib/modules: File not found by ext2_lookup `---- Running febootstrap-supermin-helper with -vv produces these lines before the error: ,---- | ext2_file_stat /var/tmp 041777 | supermin helper [06516ms] visiting supermin.d/init.img | cpio header 070701016E4031000081ED000003E8000003E8000000014DE27BEC00000030000000090000000000000000000000000000000500000000 | ext2 read_file init 100755 | ext2 read_file dirname init basename init | cpio header 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000 | ext2 read_file TRAILER!!! 0 | ext2_file_stat /lib/modules/2.6.39-1-amd64 040755 | febootstrap-supermin-helper: ext2: parent directory not found: /lib/modules: File not found by ext2_lookup `---- Any hints on how to further debug this? Ending on a high note, I have prepared a patch for febootstrap that gets rid of the insmod.static dependency, clearing the path for "proper" Debian packages of febootstrap 3 (and libguestfs). I'll post it once I have been able to verify that it works correctly. Cheers, -Hilko [1] http://rwmj.wordpress.com/2010/12/10/tip-creating-throwaway-appliances-with-...
On Sun, May 29, 2011 at 07:55:59PM +0200, Hilko Bengen wrote:
Good evening,
I just tried following the steps in "Tip: Creating throwaway appliances with febootstrap"[1] on my workstation at home running Debian/unstable. I ran into problems:
[Just a note to say that I'm on holiday off until Tuesday] Which version of febootstrap is this? If you're not using febootstrap from git could you try that version? 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/
* Hilko Bengen:
* Richard W.M. Jones:
Which version of febootstrap is this? If you're not using febootstrap from git could you try that version?
I was using version 3.5 from the tarball. The last commit on the master branch is tagged as 3.5.
After adding a line containing "/lib/modules" to hostfiles solved the immediate problem for me -- febootstrap-supermin-helper finished its run. The attached patch makes sure that febootstrap-supermin-helper always creates this directory. Cheers, -Hilko
On Tue, May 31, 2011 at 12:14:11AM +0200, Hilko Bengen wrote:
* Hilko Bengen:
* Richard W.M. Jones:
Which version of febootstrap is this? If you're not using febootstrap from git could you try that version?
I was using version 3.5 from the tarball. The last commit on the master branch is tagged as 3.5.
After adding a line containing "/lib/modules" to hostfiles solved the immediate problem for me -- febootstrap-supermin-helper finished its run.
The attached patch makes sure that febootstrap-supermin-helper always creates this directory.
Cheers, -Hilko
diff --git a/helper/appliance.c b/helper/appliance.c index 85efd75..50d1d78 100644 --- a/helper/appliance.c +++ b/helper/appliance.c @@ -77,6 +77,7 @@ create_appliance (const char *hostcpu,
iterate_inputs (inputs, nr_inputs, writer);
+ writer->wr_file ("/lib/modules"); /* Kernel modules (3). */ add_kernel_modules (whitelist, modpath, writer);
I guess that either /lib/modules is missing from the Debian packages altogether, or one of the packages that we exclude contains this directory. No matter though, because it seems completely safe to add this patch. Thanks, 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
* Richard W.M. Jones:
I guess that either /lib/modules is missing from the Debian packages altogether, or one of the packages that we exclude contains this directory.
You are right. /lib/modules is not part of the "base system": ,---- | $ dlocate /lib/modules | cut -d: -f1 | sort -u | linux-headers-2.6.39-1-amd64 | linux-image-2.6.38-2-amd64 | linux-image-2.6.39-1-amd64 | module-init-tools `---- I was also wondering about that other thing that failed in my tests: Do RedHat and/or Fedora ship kernels that automatically mount /proc on boot? -Hilko
On Wed, Jun 01, 2011 at 11:26:14AM +0200, Hilko Bengen wrote:
* Richard W.M. Jones:
I guess that either /lib/modules is missing from the Debian packages altogether, or one of the packages that we exclude contains this directory.
You are right. /lib/modules is not part of the "base system":
,---- | $ dlocate /lib/modules | cut -d: -f1 | sort -u | linux-headers-2.6.39-1-amd64 | linux-image-2.6.38-2-amd64 | linux-image-2.6.39-1-amd64 | module-init-tools `----
I was also wondering about that other thing that failed in my tests: Do RedHat and/or Fedora ship kernels that automatically mount /proc on boot?
No, it was failing and we didn't notice. 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://libguestfs.org
participants (2)
-
Hilko Bengen -
Richard W.M. Jones