[Buildroot] [PATCH 1/3] package/eudev: introduce a host variant

Carlos Santos unixmania at gmail.com
Tue Oct 29 22:23:59 UTC 2019


On Tue, Oct 29, 2019 at 6:22 AM Peter Korsgaard <peter at korsgaard.com> wrote:
>
> >>>>> "Carlos" == Carlos Santos <unixmania at gmail.com> writes:
>
> Hi,
>
>  >> +HOST_EUDEV_DEPENDENCIES = host-gperf host-pkgconf
>  >> +HOST_EUDEV_CONF_OPTS = \
>  >> +       --disable-manpages \
>  >> +       --sbindir=$(HOST_DIR)/sbin \
>  >> +       --libexecdir=$(HOST_DIR)/lib \
>  >> +       --with-rootlibdir=$(HOST_DIR)/lib \
>  >> +       --disable-introspection \
>  >> +       --disable-kmod \
>  >> +       --disable-blkid \
>  >> +       --disable-rule-generator \
>  >> +       --enable-hwdb \
>  >> +       --disable-selinux
>
>  > This uses the default --prefix=$(HOST_DIR), which ruins the --rut
>  > argument of udevadm and is r=teh reason why the file copies are
>  > required in the following patches. Use this, instead:
>
>  > # Use custom configuration commands because the default --prefix="$(HOST_DIR)"
>  > # argument ruins the "udevadm hwdb --update --root <path>" command, making the
>  > # root be $(HOST_DIR)/<path>. We also customize sysconfdir to create hwdb.bin
>  > # at /usr/lib/udev if systemd is selected.
>  > define HOST_EUDEV_CONFIGURE_CMDS
>  >     (cd $(@D); rm -rf config.cache; \
>  >     $(HOST_CONFIGURE_OPTS) \
>  >     ./configure \
>  >         --enable-shared --disable-static \
>  >         --disable-manpages \
>  >         --sysconfdir=$(if $(BR2_PACKAGE_SYSTEMD),/usr/lib,/etc) \
>  >         --sbindir=/sbin \
>  >         --libexecdir=/lib \
>  >         --with-rootlibdir=/lib \
>  >         --disable-introspection \
>  >         --disable-kmod \
>  >         --disable-blkid \
>  >         --disable-rule-generator \
>  >         --enable-hwdb \
>  >         --disable-selinux \
>  >     )
>  > endef
>
>  > # We just want udevadm
>  > define HOST_EUDEV_INSTALL_CMDS
>  >     $(INSTALL) -D -m 0755 $(@D)/src/udev/udevadm \
>  >         $(HOST_DIR)/bin/udevadm
>  > endef
>
> As long as this is the only reason for having host-eudev, this is indeed
> simpler and means that we can have a single TARGET_FINALIZE hook.
>
> --
> Bye, Peter Korsgaard

I just noticed that eudev by default looks for .hwdb files in
/usr/lib/udev/hwdb.d/ and /etc/udev/hwdb.d/ an that systemd looks for
hwdb.bin at /etc/udev/ too.

So we could simplify the the patches by omitting the --sysconfdir
argument and removing both hwdb.d directories in the rootfs-pre-cmd
hooks.

We could also make the removal optional (default yes) for the cases in
which the user wants to rebuild the database at run-time (e.g. after
adding .hwdb files). I'm not a fan of feature provisioning but  it
would be much harder to do this otherwise.

Finally, the hooks could be moved to a single location instead of
repeated in package/eudev.mk and package/systemd.mk. package/udev.mk
would be the ideal location but virtual packages can't have hooks.

Anyway, these are just optional improvements that can be made later.

-- 
Carlos Santos <unixmania at gmail.com>



More information about the buildroot mailing list