Provided by: supermin_4.1.6-1_amd64
NAME
supermin-helper - Reconstruct initramfs from supermin appliance.
SYNOPSIS
New style (since supermin 4.1.5): supermin-helper [-f cpio|ext2] -o outputdir input [input...] or: supermin-helper [-f cpio|ext2] --output-kernel kernel \ [--output-dtb dtb] --output-initrd initrd \ [--output-appliance appliance] input [input...] or: supermin-helper -f checksum input [input ...] Old style (still supported in this version but deprecated): supermin-helper [-f cpio] supermin.img hostfiles.txt host_cpu kernel initrd supermin-helper [-f cpio] input [...] host_cpu kernel initrd supermin-helper -f ext2 input [...] host_cpu kernel initrd appliance supermin-helper -f checksum input [...] host_cpu
DESCRIPTION
supermin-helper reconstructs a bootable kernel and initramfs from a supermin appliance. First you should be familiar with supermin(1).
PARAMETERS
Specify the input file(s), and -o or --output-* flags indicating where you want the appliance to be written. Use the -f option to select what type of appliance you want. "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). To write the appliance to a directory, use -o outputdir. The directory should already exist. Files called "outputdir/kernel", "outputdir/dtb", "outputdir/initrd" and/or "outputdir/appliance" will be written. (Not all files are written, it depends on what kind of appliance you asked for and what architecture you are running on) To write files with specific names instead, use the --output-kernel, --output-dtb, --output-initrd and/or --output-appliance options.
OPTIONS
--help Display brief command line usage, and exit. --copy-kernel Copy the kernel (and device tree, if created) instead of symlinking to the kernel in "/boot". This is fractionally slower, but is necessary if you want to change the permissions or SELinux label on the kernel or device tree. --dtb wildcard If specified, search for a device tree which is compatible with the selected kernel and the name of which matches the given wildcard. You can use a wildcard such as "vexpress-*a9*.dtb" which would match "vexpress-v2p-ca9.dtb". Notes: • You may need to quote the wildcard to prevent it from being expanded by your shell. • If no --dtb option is given, no device tree will be looked for. • You only need a device tree on architectures such as ARM and PowerPC which use them. On other architectures, don't use this option. • If you use this option and no compatible device tree can be found, supermin-helper will exit with an error. -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 output names for the "kernel" and "initrd". The "initrd" is the appliance. Note that cpio(1) might not be able to extract this file fully. The format used by the Linux kernel is not quite a true cpio file. ext2 An ext2 filesystem. In this case you have to supply output 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. --host-cpu cpu Specify the host CPU (eg. "i686", "x86_64"). This is used as a substring match when searching for compatible kernels. If not specified, it defaults to the host CPU that supermin-helper was compiled on. -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. -o outputdir Write the appliance to the named directory. Two or more of the following files will be created (the exact files created depends on the type of appliance you asked for and the architecture): "outputdir/kernel" (ie. A file literally called "kernel" in the directory outputdir that you specified). This is usually a symlink to the kernel, unless you gave the --copy-kernel option. "outputdir/dtb" The device tree. See also the --dtb option. This is only created on architectures that use device trees, eg. ARM. This is usually a symlink to the device tree binary file, unless you gave the --copy-kernel option. "outputdir/initrd" The initrd. For -f cpio this also contains the full appliance. For -f ext2 this is just a small initrd which is sufficient to find and mount the appliance disk. "outputdir/appliance" The appliance disk (only for -f ext2). --output-kernel kernel Instead of using the literal hard-coded name "kernel", write the kernel to the named path. This overrides the -o outputdir option (if present). --output-dtb dtb Instead of using the literal hard-coded name "dtb", write the device tree to the named path. This overrides the -o outputdir option (if present). --output-initrd initrd Instead of using the literal hard-coded name "initrd", write the initrd to the named path. This overrides the -o outputdir option (if present). --output-initrd appliance Instead of using the literal hard-coded name "appliance", write the initrd to the named path. This overrides the -o outputdir option (if present). -u user --user user -g group --group group Run 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 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 supermin-helper uses bash in parts, this will result in the creation of an appliance with a mixture of ownerships. -v --verbose Enable verbose messages (give multiple times for more verbosity). -V --version Display version number and exit.
COMPRESSED INPUT FILES
supermin-helper ≥ 4.1.4 supports gzip-compressed input cpio image files. "hostfiles" cannot be compressed. Compressing input files saves space, but can make supermin-helper run fractionally slower.
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 VARIABLES
SUPERMIN_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 "SUPERMIN_MODULES". SUPERMIN_MODULES If "SUPERMIN_KERNEL" and "SUPERMIN_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 "SUPERMIN_KERNEL" is not set. SUPERMIN_DTB Force the given device tree file to be used.
SEE ALSO
supermin(1).
AUTHORS
Richard W.M. Jones <rjones @ redhat . com>
COPYRIGHT
(C) Copyright 2009-2013 Red Hat Inc., <http://people.redhat.com/~rjones/supermin>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.