febootstrap-supermin-helper reconstructs a bootable kernel and initramfs from a supermin appliance. First you should be familiar with febootstrap(8).
Parameters
Of the required parameters, the first few are input files, and the last two or three are output files.
"supermin.img" and "hostfiles.txt" are the input files which describe the supermin appliance. (You can also use a directory name here which is searched for files).
"host_cpu" should be the host CPU, eg. "x86_64" or "i686".
"kernel", "initrd" and "appliance" are the temporary output files that this script produces. These output files are meant to be used just for booting the appliance, and should be deleted straight afterwards. The extra "appliance" parameter is only required when the format is "ext2". None of these parameters are needed for the checksum output "-f checksum".
Options
-f fmt
--format fmt
Select the output format for the appliance. Possible formats are:
cpio
A Linux initramfs. This is the default.
In this case you have to supply names for the "kernel" and "initrd", where the "initrd" is the appliance.
ext2
An ext2 filesystem.
In this case you have to supply names for the "kernel", a small "initrd" which is used just to locate the appliance, and the "appliance" (the ext2 filesystem).
checksum
Output a checksum.
This prints a checksum which only changes when one of the input files changes.
You can use this in order to cache the output of a previous run of this program: computing the checksum is much quicker than building an appliance, and you only need to invalidate the cache (and consequently rebuild the appliance) when the checksum changes. Note that the host_cpu and the UID of the current user are included in the checksum.
-k file
--kmods file
If this option is specified, then "file" should be a list of wildcards matching kernel module names, eg:
virtio*.ko scsi*.ko piix.ko
In this case, only kernel modules matching those wildcards will be included in the output appliance. Note: You must resolve any dependencies yourself as this does not pull in dependent modules automatically.
If this option is not specified, then every kernel module from the host will be included. This is safer, but can produce rather large appliances which need a lot more memory to boot.
-u user
--user user
-g group
--group group
Run febootstrap-supermin-helper as an alternate user and/or group. "user" and "group" can be specified as either a name, which will be resolved using the system name service, or a uid/gid. Use of these options requires root privileges.
Use of these options is required if running febootstrap-supermin-helper as root with the effective uid/gid set to non-root. Bash will reset the effective uid/gid to the real uid/gid when invoked. As febootstrap-supermin-helper uses bash in parts, this will result in the creation of an appliance with a mixture of ownerships.
Speed
In libguestfs, on a mid-range Intel-based PC, we reconstruct the initramfs using this script in around 1/5th of a second (assuming a "hot cache" - it's rather slower when run the first time on a cold cache).
Some tips to improve performance:
•
Use a kernel module whitelist (the "--kmods" option), and only list the kernel modules you really need.
•
Minimize the appliance, removing as much extraneous junk as possible.
Environment
FEBOOTSTRAP_KERNEL
If this environment variable is set, then automatic selection of the kernel is bypassed and this kernel is used.
The environment variable should point to a kernel file, eg. "/boot/vmlinuz-3.0.x86_64"
The corresponding module path is guessed from the kernel name, but you can override that by setting "FEBOOTSTRAP_MODULES".
FEBOOTSTRAP_MODULES
If "FEBOOTSTRAP_KERNEL" and "FEBOOTSTRAP_MODULES" are both set, then automatic selection of the kernel is bypassed and the kernel and module path are set to these values.
The environment variable should point to a module directory, eg. "/lib/modules/3.0.x86_64/"
This has no effect if "FEBOOTSTRAP_KERNEL" is not set.
Releases
2 releases since Debian 6.0 (Squeeze); the text changed 1 time.
--format since Debian 7 (Wheezy);
--group since Debian 7 (Wheezy);
--kmods since Debian 7 (Wheezy);
--user since Debian 7 (Wheezy);
-f since Debian 7 (Wheezy);
-g since Debian 7 (Wheezy);
-k since Debian 7 (Wheezy);
-u since Debian 7 (Wheezy).