GENIMAGE(1)
π« Genimage β The Image Creation Tool π«
π NAME π
okay bestie, genimage is literally the tool for generating multiple filesystem and flash/disk images from a given root filesystem tree. π¦ It's intended to be run inside a fakeroot environment β no cap. It also supports creating flash/disk images out of different file-system images and files. π
Configuration lives in a config file that gets parsed by libconfuse. Stuff like the path to tools can be handed over via environment variables, the config file, or from commandline switches. β¨
π¦ The Configuration File π¦
The config file of genimage uses a simple configuration language, provided by libconfuse β that's over at the libconfuse repo on GitHub. π It supports nested sections, plus simple key-value pairs.
Single-line comments can be introduced with # or //, and multi-line comments look like /* β¦ */ (as in C). π
The config file is separated into the main sections image, flash and config, and it provides an include primitive. π
πΈ The image section πΈ
An image section describes a single filesystem or disk image to be built. π«Ά It can be given multiple times to generate multiple images. An image can also have multiple partitions which refer to images themselves. Each image must have a type, which can have different suboptions depending on the type. Periodt.
Let's have a look at an example:
image nand-pcm038.img {
flash {
}
flashtype = "nand-64M-512"
partition barebox {
image = "barebox-pcm038.bin"
size = 512K
}
partition root {
image = "root-nand.jffs2"
size = 24M
}
}
This would generate a nand-pcm038.img, which is a flash of type "nand-64M-512". π The image contains two partitions, "barebox-pcm038.bin" and "root-nand.jffs2", which must refer to images described elsewhere in the config file. For example, the "root-nand.jffs2" partition could be described like this:
image root-nand.jffs2 {
name = "root"
jffs2 {}
size = 24M
mountpoint = "/"
}
In this case a single jffs2 image is generated from the root mountpoint. π
Here are all options for images:
nameβ the name of this image. It's used for some image types to set the name of the image.sizeβ size of this image in bytes.'k','M'or'G'can be used as a suffix to specify the size in a multiple of 1024 etc. The suffix's'specifies a multiple of the (traditional) sector size of 512. If the image is filled from a mountpoint, then'%'as a suffix indicates a percentage.'200%'means the resulting filesystem should be about 50% filled. Note that this is only a rough estimate based on the original size of the content. πmountpointβ mountpoint if image refers to a filesystem image. The default is"/". The content of"${rootpath}${mountpoint}"will be used to fill the filesystem.srcpathβ if this is set, the specified path will be directly used to fill the filesystem. It ignores rootpath/mountpoint logic. The path might be absolute or relative to the current working directory. π§emptyβ if this is set to true, then the specifiedrootpathandmountpointare ignored for this image and an empty filesystem is created. This option is only used for writeable filesystem types, such asextX,vfat,ubifsandjffs2. Defaults tofalse.temporaryβ if this is set to true, the image is created intmppathrather thanoutputpath. This can be useful for intermediate images defined in the configuration file which aren't needed by themselves after the main image is created. Defaults tofalse.exec-preβ custom command to run before generating the image. The available variables are documented in the Environment Variables section below. βexec-postβ custom command to run after generating the image.flashtypeβ refers to aflashsection. Optional for non flash like images, like hd images.partitionβ can be given multiple times and refers to a partition described below.
Additionally each image can have one of the following sections describing the type of the image: π
cpio, cramfs, custom, erofs, ext2, ext3, ext4, f2fs, file, flash, hdimage, iso, jffs2, mdraid, qemu, squashfs, tar, ubi, ubifs, vfat.
π Partition options π
offsetβ the offset of this partition as a total offset to the beginning of the device.sizeβ the size of this partition in bytes. If thesizeandautoresizeare both not set then the size of the partition image is used.alignβ alignment value to use for automatic computation of offset and size. Defaults to1for partitions not in the partition table, otherwise to the image'salignvalue.partition-typeβ used by dos partition tables to specify the partition type.imageβ the image file this partition shall be filled with.imageoffsetβ the offset within the partition image to start reading from.fillβ boolean specifying that all bytes of the partition should be explicitly initialized. Any bytes beyond the size of the specified image will be set to0.sparseβ if true (the default)'holes'in the input images are preserved and the remaining free space in the partition is also a'hole'. If false, the'holes'in the input image are explicitly filled with zeros when the image is copied. Iffillis specified as well then the remaining free space is also filled with zeros.autoresizeβ boolean specifying that the partition should be resized automatically. For UBI volumes this means that the autoresize flag is set, and only one volume can have this flag. For hd images this can be used for the last partition β if set, the partition will fill the remaining space of the image. π₯bootableβ boolean specifying whether to set the bootable flag.hiddenβ boolean specifying whether to set the hidden flag (only with GPT).no-automountβ boolean specifying whether to set the no-automount flag (only with GPT).read-onlyβ boolean specifying whether to set the read-only flag (only with GPT).in-partition-tableβ boolean specifying whether to include this partition in the partition table. Defaults totrue.forced-primaryβ force this partition to be a primary partition in the MBR partition table, useful when the extended partition should be followed by primary partitions. If there are more partitions defined after the firstforced-primary, they must be also defined asforced-primary. Defaults tofalse.partition-uuidβ UUID string used by GPT partition tables to specify the partition id. Defaults to a random value.partition-type-uuidβ string used by GPT partition tables to specify the partition type. Either a UUID or a shortcut:L,linux,linux-generic: Linux filesystem (0fc63daf-8483-4772-8e79-3d69d8477de4)S,swap: Swap (0657fd6d-a4ab-43c4-84e5-0933c84b4f4f)H,home: Home (933ac7e1-2eb4-4f13-b844-0e14e2aef915)U,esp,uefi: EFI System Partition (c12a7328-f81f-11d2-ba4b-00a0c93ec93b)R,raid: Linux RAID (a19d880f-05fc-4d3b-a006-743f0f84911e)V,lvm: Linux LVM (e6d6d379-f507-44c2-a23c-238f2a3df928)F,fat32: FAT32 / Basic Data Partition (ebd0a0a2-b9e5-4433-87c0-68b6b72699c7)barebox-state(previouslyB): Barebox State (4778ed65-bf42-45fa-9c5b-287a1dc4aab1)barebox-env: Barebox Environment (6c3737f2-07f8-45d1-ad45-15d260aab24d)u-boot-env: U-Boot Environment (3de21764-95bd-54bd-a5c3-4abe786f38a8)
Furthermore, for {arch} being one of alpha, arc, arm, arm64, ia64, loongarch64, mips, mips64, mips-le, mips64-le, parisc, ppc, ppc64, ppc64-le, riscv32, riscv64, s390, s390x, tilegx, x86, x86-64, the following shortcuts from the Discoverable Partitions Specification (https://uapi-group.org/specifications/specs/discoverable_partitions_specification/) are accepted (see the spec for the respective UUIDs): π
root-{arch}: Root Partitionusr-{arch}: /usr Partitionroot-{arch}-verity: Root Verity Partitionusr-{arch}-verity: /usr Verity Partitionroot-{arch}-verity-sig: Root Verity Signature Partitionusr-{arch}-verity-sig: /usr Verity Signature Partitionxbootldr: Extended Boot Loader Partitionsrv: Server Data Partitionvar: Variable Data Partitiontmp: Temporary Data Partitionuser-home: Per-user Home Partition
Custom shortcuts can be defined in the global config section: π
config {
gpt-shortcuts {
forty-two = "2a422a42-2a42-2a42-2a42-2a422a422a42"
}
}
Defaults to L.
For each partition, its final alignment, offset and size are determined as follows:
- If the
alignoption is not present, it defaults to the value of the image'salignoption if the partition is in the partition table, otherwise to1. - If the
offsetoption is absent or zero, andin-partition-tableis true, the partition is placed after the end of all previously defined partitions, with the final offset rounded up to the partition'salignvalue. - Otherwise, the
offsetoption is used as-is. Note that if absent, that option defaults to0, so in practice one must specify an offset for any partition that is not in the partition table (with at most one exception, e.g. a bootloader). π - If the partition has the
autoresizeflag set, its size is computed as the space remaining in the image from its offset (for a GPT image, space is reserved at the end for the backup GPT table), rounded down to the partition'salignvalue. If the partition also has asizeoption, it is ensured that the computed value is not less than that size. - Otherwise, if the
sizeoption is present and non-zero, its value is used as-is. - Otherwise, if the partition has an
imageoption, the size of that image, rounded up to the partition'salignvalue, is used to determine the size of the partition. β¨
okay so before we even get into the actual image types, genimage does a little sanity check on the final values β and honestly in many cases these are automatically satisfied when the value came from one of the rules above instead of you typing it in explicitly:
- For a partition in the partition table, the partition's
alignvalue must be greater than or equal to the image'salignvalue. - The partition's
offsetandsizemust both be multiples of itsalign. - The
sizemust not be0. - The partition must not overlap any other partition, or the areas occupied by the partition table.
β¨ The image configuration options β¨
π¦ android-sparse π¦
okay so this one generates android sparse images. They are typically used by fastboot. Sparse images encode "don't care" areas and areas that are filled with a single 32 bit value. As a result, they are often much smaller than raw disk images. Genimage assumes that all 'holes' in the input file are "don't care" areas. This is a reasonable assumption: Tools to generate filesystems typically operate on devices. So they only create holes in areas they don't care about. Genimage itself operates the same way when generating HD images.
Options:
imageβ The source image that will be converted.block-sizeβ The granularity that the sparse image uses to find "don't care" or "fill" blocks. The supported block sizes depend on the user. The default is4k.fill-holesβ If enabled, 'holes' are filled with zero instead of "don't care". Disabled by default.add-crcβ Generate sparse comptible images containing the CRC. Ensure that your sparse tool can handle CRC sparse images. Defaults tofalse.
πΈ cpio πΈ
Generates cpio images.
Options:
formatβ archive format. Passed to the-Hoption to thecpiocommand. Valid options arebin,odc,newc,crc,tar,ustar,hpbinandhpodcextraargsβ Extra arguments passed to thecpiotoolcompressβ If given, pipe image through compression tool. Valid options are for examplegzip,lzopor any other tool that compresses from stdin to stdout.
π cramfs π
Generates cramfs images.
Options:
extraargsβ Extra arguments passed tomkfs.cramfs
π custom π
Generate images with a custom command.
execβ The command that creates the image.
If the image size is set, then image is created with the configured size before the exec command is executed. Otherwise the file is removed and the size is queried after the command is executed.
The image file that should be generated is defined in the environment variable $IMAGEOUTFILE. It can be used directly in the exec command. For more variables and pitfalls when using them, see the Environment Variables section below.
π erofs π
Generates erofs images.
Options:
extraargsβ Extra arguments passed tomkfs.erofs.
π ext2, ext3, ext4 π
Generates ext* images.
Options:
use-mke2fsβ If set totrue, thenmke2fsis used to create the image. Otherwise,genext2fsis used. Defaults tofalse.mke2fs-confβmke2fs.confthat should be used. If unspecified, the system default is used.extraargsβ Extra arguments passed togenext2fsormke2fs.featuresβ Filesystem features. Passed to the-Ooption oftune2fs. This is a comma separated list of enabled or disabled features. Seeman ext4for features. Forgenext2fsall feature are specified. Default for ext3 images ishas_journal. Default for ext4 images isextents,uninit_bg,dir_index,has_journal. Formke2fsthese features are added in addition to the default features of the ext type. Already enabled features can be disabled by prefixing the feature with^.labelβ Specify the volume-label. Passed to the-Loption oftune2fsfs-timestampβ Sets different timestamps in the image. Sets the given timestamp using thedebugfscommandsset_current_time,set_super_value mkfs_timeandset_super_value lastcheckroot-ownerβ User and group IDs for the root directory. Defaults to0:0. Only valid withmke2fs.usage-typeβ Specify the usage type for the filesystem. Only valid withmke2fs. More details can be found in themke2fsman-page.
π f2fs π
Generates F2FS images.
Options:
labelβ Specify the volume-label.extraargsβ Extra arguments passed tomkfs.f2fs
π¦ file π¦
This represents a pre-existing image which will be used as-is. When a partition section references an image that is not defined elsewhere in the configuration file, a file rule is implicitly generated. It is up to the user to ensure that the image exists in the input directory, or to use an absolute path to the image.
It is possible to add a file image explicitly, which allows one to provide genimage with some information about the image which can not be deduced automatically. Currently, one such option exists:
holesβ A list of"(<start>;<end>)"pairs specifying ranges of the file that do not contain meaningful data, and which can therefore be allowed to overlap other partitions or image metadata.
For example:
image foo {
hdimage {
partition-table-type = "gpt"
gpt-location = 64K
}
partition bootloader {
in-partition-table = false
offset = 0
image = "/path/to/bootloader.img"
}
partition rootfs {
offset = 1M
image = "rootfs.ext4"
}
}
image /path/to/bootloader.img {
file {
holes = {"(440; 1K)", "(64K; 80K)"}
}
}
This tells genimage that despite the bootloader partition overlapping both the last 72 bytes of the MBR (where the DOS partition table is located) and the GPT header occupying the sector starting at offset 512, this is all OK because bootloader.img does not contain useful data in that range. Further, in this example, the bootloader image has been carefully crafted to also allow placing the GPT array at offset 64K (the GPT header is always at offset 512).
If the bootloader image is not declared explicitly and only used once then the holes can also be configured in the partition. This simplifies the config file for simple use-cases.
For example:
image bar {
hdimage {}
partition bootloader {
in-partition-table = false
offset = 0
image = "/path/to/bootloader.img"
holes = {"(440; 512)"}
}
partition rootfs {
offset = 1M
image = "rootfs.ext4"
}
}
π FIT π
Generates U-Boot FIT images.
Options:
itsβ String option holding the path of the input its filekeydirβ String option holding the directory containing the keys used for signing.
π₯ flash π₯
Generates flash images. These are basically the partition contents padded to the partition sizes concatenated together. There is no partition table. Needs a valid flashtype where the flash parameters are read from.
π hdimage π
Generates DOS partition images.
Options:
alignβ Partition alignment. Defaults to512bytespartition-tableβ Boolean. Iftrue, writes a partition table. Iffalse, no partition table is generated. Defaults totrue. Deprecated: usepartition-table-typeinstead.partition-table-typeβ Define what kind of partition table should be used. Valid options are:
System Message: ERROR/3 (README.rst:, line 456) Unexpected indentation.
none: No partition table at all. In this case, thein-partition-tableoption for each partition is ignored.mbr: Legacy DOS/MBR partition tablegpt: GUID Partition Tablehybrid: A hybrid MBR/GPT partition table. Partitions with an explicitpartition-typewill be placed in in the MBR table. At most 3 such partitions are allowed. This limit does not effect the maximum number of GPT partition entries in the same image.
extended-partitionβ Number of the extended partition. Contains the number of the extended partition between 1 and 4 or 0 for automatic. Defaults to 0.disk-signatureβ 32 bit integer used as disk signature (offset 440 in the MBR). Using a special valuerandomwill result in using random 32 bit number.gptβ Boolean. Iftrue, a GPT type partition table is written. Iffalsea DOS type partition table is written. Defaults tofalse. Deprecated: usepartition-table-typeinstead.gpt-locationβ Location of the GPT table. Occasionally useful for moving the GPT table away from where a bootloader is placed due to hardware requirements. All partitions in the table must begin after this table. Regardless of this setting, the GPT header will still be placed at 512 bytes (sector 1). Defaults to 1024 bytes (sector 2).gpt-no-backupβ Boolean. Iftrue, then the backup partition table at the end of the image is not written.disk-uuidβ UUID string used as disk id in GPT partitioning. Defaults to a random value.fillβ If this is set totrue, then the image file will be filled up to the end of the last partition. This might make the file bigger. This is necessary if the image will be processed by such tools aslibvirt,libguestfsorparted.
β¨ GPT partition flags β¨
Okay so listen β when you've got a GPT partition table, genimage is gonna take these partition configs and translate them into the matching GPT flags, then set them in the GPT partition table. Look at her go π
read-onlyβGPT_PE_FLAG_READ_ONLY(Bit 60)bootableβGPT_PE_FLAG_BOOTABLE(Bit 2)hiddenβGPT_PE_FLAG_HIDDEN(Bit 62)no-automountβGPT_PE_FLAG_NO_AUTO(Bit 63)
Other GPT Flags are currently not supported. That's the whole menu, periodt. β¨
π iso π
Generates an ISO image. Iconic behaviour, no notes.
Options:
boot-imageβ path to the El Torito boot image. Gets handed to the-boption ofgenisofs.bootargsβ bootargs for the El Torito boot image. Defaults to-no-emul-boot -boot-load-size 4 -boot-info-table -c boot.cat -hide boot.cat.extraargsβ extra arguments passed togenisofs.input-charsetβ the input charset. Passed to the-input-charsetoption ofgenisofs. Defaults todefault.volume-idβ Volume ID. Passed to the-Voption ofgenisofs.
πΈ jffs2 πΈ
Generates a JFFS image. She needs a valid flashtype tho, bc that's where the flash parameters get read from. π₯
Options:
extraargsβ extra arguments passed tomkfs.jffs2.
π mdraid π
Okay so the original README.rst literally ships a Sphinx build warning right here and we're keeping it bc facts are facts:System Message: WARNING/2 (README.rst:, line 531)βTitle underline too short.Yeah. Themdraidheading's underline was too short. Not a genimage thing, just the docs being dramatic. π
Generates MD RAID images.
Options:
labelβ optional hostname and name of array separated by colon, eg:any:42. Special hostnameanycan be used to make array local to machine with any hostname. Name will be used by OS to name/dev/md/*device (as long as the hostname matches).levelβ RAID level, currently only level 1 (default) is supported.devicesβ number of devices in array (default 1).roleβ 0 based index of this image in whole array. (autoassigned by default).timestampβ Unix timestamp of array creation (current time by default, has to match across array devices).raid-uuidβ UUID of whole array (has to be identical across all disks in array, random by default).disk-uuidβ UUID of disk (has to be unique for each array member disk, random by default).imageβ image of data to be preloaded into array (optional).parentβ image to inherit array identity/config from (when creating extra members of existing array). Effectively overrides all array-wide options mentioned here and replaces them with values from parent.
For example, here only the first image has configuration and the UUID/timestamp is generated on demand:
image mdraid-a.img {
mdraid {
level = 1
devices = 2
image = "mdraid-ext4.img"
}
}
Then to create the second member of that array we just inherit config from the parent member:
image mdraid-b.img {
mdraid {
parent = "mdraid-a.img"
}
}
Default role number is 0 for the parent image, and when other images inherit configuration from it, they are assigned roles from an autoincrementing counter. Cute, right? π
π¦ qemu π¦
Generates a QEMU image. Needs at least one valid partition, bestie β don't skip that part.
Options:
formatβ a validqemu-imglikeqcow,qcow2,parallels,vdi,vhdxorvmdk. Checkqemu-img convert --helpfor the complete list of possible values. Defaults toqcow2.extraargsβ extra arguments passed toqemu-img convert.
π squashfs π
Generates a squashfs image.
Options:
extraargsβ extra arguments passed tomksquashfs.compressionβ compression type for the image. Possible values aregzip(default),noneand any other compressors supported bymksquashfssuch aslzo,lz4,xz,zstdorlzma.block-sizeβ Block size. Passed to the-boption ofmksquashfs. Defaults to4096.
π rauc π
Generates a RAUC update bundle.
Options:
extraargsβ extra arguments passed to RAUC.fileβ specify a file to be added into the RAUC bundle. Usage is:file foo { image = "bar" }which adds a file"foo"in the RAUC bundle from the input file"bar".filesβ a list of filenames added into the RAUC bundle. Likefileabove, but without the ability to add the files under a different name.keyβ path to the key file or PKCS#11 URI. Passed to the--keyoption of RAUC.certβ path to the certificate file or PKCS#11 URI. Passed to the--certoption of RAUC.keyringβ optional path to the keyring file. Passed to the--keyringoption of RAUC.manifestβ content of the manifest file.
π§ tar π§
Generates a tar image. The image will be compressed as defined by the filename suffix. Yes bestie, the suffix is doing the heavy lifting here. π
π ubi π
Generates an UBI image. Needs a valid flashtype where the flash parameters are read from.
Options:
extraargsβ extra arguments passed toubinize.
β ubifs β
Generates a UBIFS image. Needs a valid flashtype where the flash parameters are read from.
Options:
extraargsβ extra arguments passed tomkubifs.max-sizeβ maximum size of the UBIFS image.space-fixupβ instructs the file-system free space to be freed up on first mount.
π vfat π
Generates a VFAT image.
Options:
extraargsβ extra arguments passed tomkdosfs.labelβ specify the volume-label. Passed to the-noption ofmkdosfs.fileβ specify a file to be added into the filesystem image. Usage is:file foo { image = "bar" }which adds a file"foo"in the filesystem image from the input file"bar".filesβ a list of filenames added into the filesystem image. Likefileabove, but without the ability to add the files under a different name.
Note: if no content is specified withfileorfilesthenrootpathandmountpointare used to provide the content.
π₯ fip π₯
Generates a Firmware Image Package (FIP). A format used to bundle firmware to be loaded by ARM Trusted Firmware.
Options:
extraargsβ extra arguments passed tofiptool.fw-configβ Firmware Configuration (device tree), usually provided by BL2 (Trusted Firmware).nt-fwβ Non-Trusted Firmware (BL33).hw-configβ Hardware Configuration (device tree), passed to BL33.tos-fwβ Trusted OS (BL32) binaries. Second and third binary are used as extra1 and extra2 binaries if specified. Example:tos-fw = {"tee-header_v2.bin", "tee-pager_v2.bin", "tee-pageable_v2.bin"}.scp-fwu-cfgβ SCP Firmware Updater Configuration FWU SCP_BL2U.ap-fwu-cfgβ AP Firmware Updater Configuration BL2U.fwuβ Firmware Updater NS_BL2U.fwu-certβ Non-Trusted Firmware Updater certificate.tb-fwβ Trusted Boot Firmware BL2.scp-fwβ SCP Firmware SCP_BL2.soc-fwβ EL3 Runtime Firmware BL31.tb-fw-configβ TB_FW_CONFIG.soc-fw-configβ SOC_FW_CONFIG.tos-fw-configβ TOS_FW_CONFIG.nt-fw-configβ NT_FW_CONFIG.rot-certβ Root Of Trust key certificate.trusted-key-certβ Trusted key certificate.scp-fw-key-certβ SCP Firmware key certificate.soc-fw-key-certβ SoC Firmware key certificate.tos-fw-key-certβ Trusted OS Firmware key certificate.nt-fw-key-certβ Non-Trusted Firmware key certificate.tb-fw-certβ Trusted Boot Firmware BL2 certificate.scp-fw-certβ SCP Firmware content certificate.soc-fw-certβ SoC Firmware content certificate.tos-fw-certβ Trusted OS Firmware content certificate.nt-fw-certβ Non-Trusted Firmware content certificate.sip-sp-certβ SiP owned Secure Partition content certificate.plat-sp-certβ Platform owned Secure Partition content certificate.
π«Ά The Flash Section π«Ά
The flash section can be given multiple times and each section describes a flash chip. The option names are mostly derived from the UBI terminology, iykyk. There are the following options:
pebsizeβ the size of a physical eraseblock in bytes.lebsizeβ the size of a logical eraseblock in bytes (for ubifs).numpebsβ number of physical eraseblocks on this device. The total size of the device is determined bypebsize * numpebs.minimum-io-unit-sizeβ the minimum size in bytes accessible on this device.vid-header-offsetβ offset of the volume identifier header.sub-page-sizeβ the size of a sub page in bytes.
Several flash related image types need a valid flash section. From the image types, the flash type section is referred to using the flashtype option which contains the name of the flash type to be used.
For more information on the meaning of these values see the ubi(fs) and mtd FAQs:
<http://www.linux-mtd.infradead.org/faq/general.html>
Example flash section:
flash nand-64M-512 {
pebsize = 16384
lebsize = 15360
numpebs = 4096
minimum-io-unit-size = 512
vid-header-offset = 512
sub-page-size = 512
}
...
image jffs2 {
flashtype = "nand-64M-512"
}
β¨ The config section β¨
Okay bestie, this part is all about how genimage behaves globally. π
Unless it says otherwise below, every single option here can come from environment variables, the config file, or command line switches. So if you have a config option called foo, you can pass it as a --foo command line switch or as a GENIMAGE_FOO environment variable. No cap. β¨
configβ default:genimage.cfg. Path to the genimage config file. πloglevelβ default:1. genimage log level. πoutputpathβ default:images. Mandatory path where all images are written to (must exist). π«Άinputpathβ default:input. This mandatory path is searched for input images, for example bootloader binaries, kernel images (must exist). πΈrootpathβ default:root. Mandatory path to the root filesystem (must exist). πtmppathβ default:tmp. Optional path to a temporary directory. There must be enough space available here to hold a copy of the root filesystem. π¦includepathβ Colon-separated list of directories to search for files included via theincludefunction. The current directory is searched after these. Thus, if this option is not given, only the current directory is searched. This has no effect when given in the config file. πconfigdumpβ File to write the final configuration to. This includes the results of all include directives, expansions of environment variables and application of default values - thinkgcc -E. Use-for stdout. π₯cpioβ path to thecpioprogram (defaultcpio).ddβ path to theddprogram (defaultdd).e2fsckβ path to thee2fsckprogram (defaulte2fsck).genext2fsβ path to thegenext2fsprogram (defaultgenext2fs).genisoimageβ path to thegenisoimageprogram (defaultgenisoimage).mcopyβ path to themcopyprogram (defaultmcopy).mmdβ path to themmdprogram (defaultmmd).mkcramfsβ path to themkcramfsprogram (defaultmkfs.cramfs).mkdosfsβ path to themkdosfsprogram (defaultmkdosfs).mkfserofsβ path to themkfs.erofsprogram (defaultmkfs.erofs).mkfsf2fsβ path to themkfs.f2fsprogram (defaultmkfs.f2fs).mkfsjffs2β path to themkfs.jffs2program (defaultmkfs.jffs2).mkfsubifsβ path to themkfs.ubifsprogram (defaultmkfs.ubifs).mksquashfsβ path to themksquashfsprogram (defaultmksquashfs).qemu-imgβ path to theqemu-imgprogram (defaultqemu-img).tarβ path to thetarprogram (defaulttar).tune2fsβ path to thetune2fsprogram (defaulttune2fs).ubinizeβ path to theubinizeprogram (defaultubinize).fiptoolβ path to thefiptoolutility (defaultfiptool).
π Include Configurations Fragments π
To include a "foo.cfg" config file, use the following statement:
include("foo.cfg")
This allows to re-use, for example flash configuration files, across different image configurations. Obsessed. π
π§ Environment Variables π§
The following environment variables are defined when the commands that create images are executed. This includes the exec-pre, exec-post commands and the exec command of the custom image type. β¨
Warning: If an exec* command is quoted with double-quotes and a variable is specified with curly braces then variables are substituted when the config file is parsed. At that point variables defined by genimage are not yet set. So use single quotes instead. β οΈ
π Common Variables for all Images π
OUTPUTPATHβ Directory where images are created. π«ΆINPUTPATHβ Directory where input images are searched. πROOTPATHβ Root directory of the content for the images. π±TMPPATHβ Directory where temporary files are created. ποΈ
π Image Specific Variables π
IMAGEβ File name relative to$OUTPUTPATH. πIMAGEOUTFILEβ Full path of the file. πIMAGENAMEβ Name of the image. π·οΈIMAGESIZEβ Configured size. πIMAGEMOUNTPOINTβ Absolute'mountpoint'to use. It defines with directory relative to$ROOTPATHshould be used. π€IMAGEMOUNTPATHβ Full path to the data to use. This is effectively$ROOTPATH/$IMAGEMOUNTPOINT. π
π License and Developing π
To contribute to genimage please prepare a pull request on Github. To make it possible to include your modifications it's required that your code additions are licensed under the same terms as genimage itself. So you are required to agree to the following document:
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
a. The contribution was created in whole or in part by me and I have
the right to submit it under the open source license indicated in
the file; or
b. The contribution is based upon previous work that, to the best of
my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under
the same open source license (unless I am permitted to submit
under a different license), as indicated in the file; or
c. The contribution was provided directly to me by some other person
who certified (a), (b) or (c) and I have not modified it.
d. I understand and agree that this project and the contribution are
public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Your agreement is expressed by adding a sign-off line to each of your commits (e.g. using git commit -s) looking as follows:
Signed-off-by: Random J Developer <<random@developer.example.org>>
with your identity and email address matching the commit meta data. π
Before creating pull request, please make sure your tree is passing all unit tests by running make distcheck. π
Slay, bestie! π That's the whole Genimage - The Image Creation Tool vibe β source/version and date are in the footer, go check them there. Periodt. β¨π
π¦ where this page comes from
- fedora 44: genimage 19-5.fc44 Β· GPL-2.0-only
- fedora 44: genimage 19-6.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms