kumquat-buildroot/package/Config.in.host
Yann E. MORIN c2fee90943 package/eudev: introduce a host variant
eudev and systemd provide a hardware database (hwdb) as a set of
multiple files. Various other utilities may also use that database.

Those files have to be "compiled" into a binary to be useful; libudev
(and thus all utilities based on it) only use the compiled hwdb.

Compiling the hwdb is done with udevadm, using the hwdb sub-command:
    udevadm hwdb --update

Provide a simple host-variant of eudev, so that we can call udevadm at
build time.

When it is configured, eudev will shoehorn its --prefix path as the base
location where the .hwdb file will be searched from, as well as where
the hwdb.bin will be generated in. This means that with the usual
--prefix=$(HOST_DIR), it would look into there.

udevadm also accepts a --root=/path option at runtime, which prepends
/path to all the paths it uses to find and generate files.

Obviously, combining --root=$(TARGET_DIR) and --prefix=$(HOST_DIR) would
not do what we want: all files would be searched for, and generated, in
$(HOST_DIR)$(TARGET_DIR)/ . Avoiding use of --root would not help much
either, as files would still searched in $(HOST_DIR) (we could use a
trick to copy files there, generate and then move the hwdb.bin, but
that's not nice).

However, since we only need udevadm, and since udevadm has no internal
and no external dependency, we can use a less dirty trick and configure
host-eudev with --prefix=/usr (and similar for the other paths), manually
copy udevadm to HOST_DIR, and then use --root when calling it.

Then, we get a udevadm that can read files from, and generate files into
$(TARGET_DIR). We register a target-finalize hook to generate the
hwdb.bin, so that any pakage may install its .hwdb files (currently only
eudev and systemd do, but other packages might (e.g. sane is known to do
so on standard desktop distros))

The *.hwdb source files consume a lot of space, roughly the same as the
generated database, i.e. ~8MiB as of today, and they are totally useless
on the target; only the generated hwdb.bin is useful. So we want to get
rid of them.

However, we also want to be able to complete a build (e.g. make
foo-reinstall to reinstall more hwdb files), so we don't want to
irremediably lose them. As such, we register a pre-rootfs-cmd hook, that
removes them just before assembling the filesystems, when we're only
using a copy of the target directory.

Note that this is the first host package to register a target-finalize
hook, and also the first to register a pre-rootfs-cmd hook. This avoids
duplicating these hooks logic in both eudev and systemd.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-11-01 08:30:34 +01:00

83 lines
3.3 KiB
Plaintext

menu "Host utilities"
source "package/aespipe/Config.in.host"
source "package/android-tools/Config.in.host"
source "package/btrfs-progs/Config.in.host"
source "package/cargo/Config.in.host"
source "package/cbootimage/Config.in.host"
source "package/checkpolicy/Config.in.host"
source "package/checksec/Config.in.host"
source "package/cmake/Config.in.host"
source "package/cramfs/Config.in.host"
source "package/cryptsetup/Config.in.host"
source "package/dbus-python/Config.in.host"
source "package/dfu-util/Config.in.host"
source "package/dos2unix/Config.in.host"
source "package/dosfstools/Config.in.host"
source "package/dtc/Config.in.host"
source "package/e2fsprogs/Config.in.host"
source "package/e2tools/Config.in.host"
source "package/eudev/Config.in.host"
source "package/f2fs-tools/Config.in.host"
source "package/faketime/Config.in.host"
source "package/fatcat/Config.in.host"
source "package/fwup/Config.in.host"
source "package/genext2fs/Config.in.host"
source "package/genimage/Config.in.host"
source "package/genpart/Config.in.host"
source "package/gnupg/Config.in.host"
source "package/go/Config.in.host"
source "package/go-bootstrap/Config.in.host"
source "package/google-breakpad/Config.in.host"
source "package/gptfdisk/Config.in.host"
source "package/imagemagick/Config.in.host"
source "package/imx-mkimage/Config.in.host"
source "package/imx-usb-loader/Config.in.host"
source "package/jq/Config.in.host"
source "package/jsmin/Config.in.host"
source "package/libp11/Config.in.host"
source "package/lld/Config.in.host"
source "package/lpc3250loader/Config.in.host"
source "package/lttng-babeltrace/Config.in.host"
source "package/mender-artifact/Config.in.host"
source "package/mfgtools/Config.in.host"
source "package/mkpasswd/Config.in.host"
source "package/mtd/Config.in.host"
source "package/mtools/Config.in.host"
source "package/mxsldr/Config.in.host"
source "package/omap-u-boot-utils/Config.in.host"
source "package/openocd/Config.in.host"
source "package/opkg-utils/Config.in.host"
source "package/parted/Config.in.host"
source "package/patchelf/Config.in.host"
source "package/pkgconf/Config.in.host"
source "package/pru-software-support/Config.in.host"
source "package/pwgen/Config.in.host"
source "package/python/Config.in.host"
source "package/python-cython/Config.in.host"
source "package/python-lxml/Config.in.host"
source "package/python-six/Config.in.host"
source "package/python-xlrd/Config.in.host"
source "package/python3/Config.in.host"
source "package/qemu/Config.in.host"
source "package/raspberrypi-usbboot/Config.in.host"
source "package/rauc/Config.in.host"
source "package/rcw/Config.in.host"
source "package/rustc/Config.in.host"
source "package/s6-rc/Config.in.host"
source "package/sam-ba/Config.in.host"
source "package/squashfs/Config.in.host"
source "package/sunxi-tools/Config.in.host"
source "package/swig/Config.in.host"
source "package/tegrarcm/Config.in.host"
source "package/ti-cgt-pru/Config.in.host"
source "package/uboot-tools/Config.in.host"
source "package/util-linux/Config.in.host"
source "package/utp_com/Config.in.host"
source "package/vboot-utils/Config.in.host"
source "package/xorriso/Config.in.host"
source "package/zip/Config.in.host"
source "package/zstd/Config.in.host"
endmenu