* Update buildroot-patches for 2020.11-rc1 buildroot * Update buildroot to 2020.11-rc1 Signed-off-by: Stefan Agner <stefan@agner.ch> * Don't rely on sfdisk --list-free output The --list-free (-F) argument does not allow machine readable mode. And it seems that the output format changes over time (different spacing, using size postfixes instead of raw blocks). Use sfdisk json output and calculate free partition space ourselfs. This works for 2.35 and 2.36 and is more robust since we rely on output which is meant for scripts to parse. * Migrate defconfigs for Buildroot 2020.11-rc1 In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE). * Rebase/remove systemd patches for systemd 246 * Drop apparmor/libapparmor from buildroot-external * hassos-persists: use /run as directory for lockfiles The U-Boot tools use /var/lock by default which is not created any more by systemd by default (it is under tmpfiles legacy.conf, which we no longer install). * Disable systemd-update-done.service The service is not suited for pure read-only systems. In particular the service needs to be able to write a file in /etc and /var. Remove the service. Note: This is a static service and cannot be removed using systemd-preset. * Disable apparmor.service for now The service loads all default profiles. Some might actually cause problems. E.g. the profile for ping seems not to match our setup for /etc/resolv.conf: [85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
80 lines
2.9 KiB
Makefile
80 lines
2.9 KiB
Makefile
################################################################################
|
|
#
|
|
# ccache
|
|
#
|
|
################################################################################
|
|
|
|
CCACHE_VERSION = 3.7.12
|
|
CCACHE_SITE = https://github.com/ccache/ccache/releases/download/v$(CCACHE_VERSION)
|
|
CCACHE_SOURCE = ccache-$(CCACHE_VERSION).tar.xz
|
|
CCACHE_LICENSE = GPL-3.0+, others
|
|
CCACHE_LICENSE_FILES = LICENSE.adoc GPL-3.0.txt
|
|
|
|
# Force ccache to use its internal zlib. The problem is that without
|
|
# this, ccache would link against the zlib of the build system, but we
|
|
# might build and install a different version of zlib in $(O)/host
|
|
# afterwards, which ccache will pick up. This might break if there is
|
|
# a version mismatch. A solution would be to add host-zlib has a
|
|
# dependency of ccache, but it would require tuning the zlib .mk file
|
|
# to use HOSTCC_NOCCACHE as the compiler. Instead, we take the easy
|
|
# path: tell ccache to use its internal copy of zlib, so that ccache
|
|
# has zero dependency besides the C library.
|
|
HOST_CCACHE_CONF_OPTS += --with-bundled-zlib
|
|
|
|
# We are ccache, so we can't use ccache
|
|
HOST_CCACHE_CONF_ENV = \
|
|
CC="$(HOSTCC_NOCCACHE)" \
|
|
CXX="$(HOSTCXX_NOCCACHE)"
|
|
|
|
# Patch host-ccache as follows:
|
|
# - Use BR_CACHE_DIR instead of CCACHE_DIR, because CCACHE_DIR
|
|
# is already used by autotargets for the ccache package.
|
|
# BR_CACHE_DIR is exported by Makefile based on config option
|
|
# BR2_CCACHE_DIR.
|
|
# - Change hard-coded last-ditch default to match path in .config, to avoid
|
|
# the need to specify BR_CACHE_DIR when invoking ccache directly.
|
|
# CCache replaces "%s" with the home directory of the current user,
|
|
# So rewrite BR_CACHE_DIR to take that into consideration for SDK purpose
|
|
HOST_CCACHE_DEFAULT_CCACHE_DIR = $(patsubst $(HOME)/%,\%s/%,$(BR_CACHE_DIR))
|
|
|
|
define HOST_CCACHE_PATCH_CONFIGURATION
|
|
sed -i 's,getenv("CCACHE_DIR"),getenv("BR_CACHE_DIR"),' $(@D)/src/ccache.c
|
|
sed -i 's,"%s/.ccache","$(HOST_CCACHE_DEFAULT_CCACHE_DIR)",' $(@D)/src/conf.c
|
|
endef
|
|
|
|
HOST_CCACHE_POST_PATCH_HOOKS += HOST_CCACHE_PATCH_CONFIGURATION
|
|
|
|
define HOST_CCACHE_MAKE_CACHE_DIR
|
|
mkdir -p $(BR_CACHE_DIR)
|
|
endef
|
|
|
|
HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_MAKE_CACHE_DIR
|
|
|
|
# Provide capability to do initial ccache setup (e.g. increase default size)
|
|
BR_CCACHE_INITIAL_SETUP = $(call qstrip,$(BR2_CCACHE_INITIAL_SETUP))
|
|
ifneq ($(BR_CCACHE_INITIAL_SETUP),)
|
|
define HOST_CCACHE_DO_INITIAL_SETUP
|
|
@$(call MESSAGE,"Applying initial settings")
|
|
$(CCACHE) $(BR_CCACHE_INITIAL_SETUP)
|
|
$(CCACHE) -s
|
|
endef
|
|
|
|
HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_DO_INITIAL_SETUP
|
|
endif
|
|
|
|
$(eval $(host-autotools-package))
|
|
|
|
ifeq ($(BR2_CCACHE),y)
|
|
ccache-stats: host-ccache
|
|
$(Q)$(CCACHE) -s
|
|
|
|
ccache-options: host-ccache
|
|
ifeq ($(CCACHE_OPTIONS),)
|
|
$(Q)echo "Usage: make ccache-options CCACHE_OPTIONS=\"opts\""
|
|
$(Q)echo "where 'opts' corresponds to one or more valid ccache options" \
|
|
"(see ccache help text below)"
|
|
$(Q)echo
|
|
endif
|
|
$(Q)$(CCACHE) $(CCACHE_OPTIONS)
|
|
endif
|