Machine:variant operates in two modes - macro and micro.
Support for each variant is based on two scripts:
setup.sh
config.sh
Once multistrap has unpacked the downloaded packages, the
setup.sh script can be called, passing the location and
architecture of the root filesystem, so that other fine tuning can
take place. At this stage, any operations inside the rootfs must not
try to execute any binaries within the rootfs. As the final stage of
the multistrap process, config.sh is copied into the root directory
of the rootfs.
One advantage of using machine:variant support is that the
entire root filesystem can be managed by a single call to multistrap -
this is useful when building root filesystems in userspace.
To enable variant support, specify the path to the scripts
to be called in the variant configuration file (General section):
[General]
include=/path/to/general.conf
setup_script=/path/to/setup.sh
config_script=/path/to/config.sh
These two shell scripts can call, include or execute other files or scripts
but if these scripts or files are intended for use within the rootfs,
setup.sh must arrange for them to be included into the tarball.
Skeleton versions of these files are available in the multistrap package.
Machine variants
Once the first stage install is complete, multistrap
calls setup.sh from the same directory, passing the location
and architecture of the tarball, so that other fine tuning can take
place prior to creating the tarball. At this stage, any operations
inside the rootfs must not try to execute any binaries within the
rootfs. Immediately before creating the tarball,
config.sh is copied into the /machine/$MACHINE/default/
directory of the rootfs, ready to be called when emsecondstage has
completed the second stage of the debootstrap process.
Example
$ cat /etc/dpkg/origins/my-vendor
Vendor: my-vendor
Vendor-Name: My Vendor
Grip-Build-Option: usecrush
Short-Desc-Suffix: flavoured
$ export DEB_VENDOR my-vendor
$ cat /etc/emvendor.d/my-vendor.conf
[avahi]
EXCONFARGS= --disable-mono --disable-gobject --with-distro debian
[busybox]
configfile=/foo/bar/myhome/vendor/busybox/config
$ emsource -b busybox
Once the Emdebian patches for busybox are updated to support DEB_VENDOR
in this way, busybox would be built with the vendor specific config file
and then gripped using the options specified in
/etc/dpkg/origins/my-vendor.