[Buildroot] [PATCH v2] package/coreutils: allow building individual binaries

Thomas Petazzoni thomas.petazzoni at bootlin.com
Thu Apr 11 16:56:58 UTC 2019


Hello Markus,

On Wed, 10 Apr 2019 13:17:46 -0700
Markus Mayer <mmayer at broadcom.com> wrote:

> We add configuration option BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES
> so that coreutils can be built and installed as individual binaries.
> It can be used if the target file system doesn't support symlinks or
> symlinks are undesirable.
> 
> The approach is modelled after Busybox's similarly named configuration
> option.
> 
> Signed-off-by: Markus Mayer <mmayer at broadcom.com>

I tested this, with BR2_ROOTFS_MERGED_USR and got some broken symlinks
in /bin. I believe your patch is not sufficient. Indeed, it doesn't
take care of the following parts of coreutils.mk:

ifeq ($(BR2_ROOTFS_MERGED_USR),)
define COREUTILS_CLEANUP_BIN
        # some things go in /bin rather than /usr/bin
        $(foreach f,$(COREUTILS_BIN_PROGS), \
                rm -f $(TARGET_DIR)/usr/bin/$(f) && \
                ln -sf ../usr/bin/coreutils $(TARGET_DIR)/bin/$(f)
        )
endef
COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CLEANUP_BIN
endif

This probably needs to be changed to move applets from /usr/bin to /bin
rather than changing the symlinks.

define COREUTILS_CLEANUP
        # link for archaic shells
        ln -fs coreutils $(TARGET_DIR)/usr/bin/[
        # gnu thinks chroot is in bin, debian thinks it's in sbin
        rm -f $(TARGET_DIR)/usr/bin/chroot
        ln -sf ../bin/coreutils $(TARGET_DIR)/usr/sbin/chroot
endef

The symlink logic here also needs to be adjusted I guess.

Could you fix this and retest ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list