diff --git a/build b/build index b125ba3..53bf4ce 100755 --- a/build +++ b/build @@ -19,6 +19,7 @@ container_run_opts=( ) container_cmd=() +features_disabled=() use_kms=0 resolve_cname=0 @@ -37,6 +38,10 @@ while [ $# -gt 0 ]; do declare -a "container_run_opts=($2)" shift 2 ;; + --disable-feature) + features_disabled+=("$2") + shift 2 + ;; --privileged) container_run_opts+=(--privileged) container_cmd=(--second-stage) @@ -87,7 +92,6 @@ commit="$(./get_commit)" timestamp="$(./get_timestamp)" default_version="$(./get_version)" - if [ "$resolve_cname" = 1 ]; then arch="$("$container_engine" run --rm "${container_run_opts[@]}" "${container_mount_opts[@]}" "$container_image" dpkg --print-architecture)" cname="$("$container_engine" run --rm "${container_run_opts[@]}" "${container_mount_opts[@]}" "$container_image" /builder/parse_features --feature-dir /builder/features --default-arch "$arch" --default-version "$default_version" --cname "$1")" @@ -101,6 +105,7 @@ make_opts=( COMMIT="$commit" TIMESTAMP="$timestamp" DEFAULT_VERSION="$default_version" + FEATURES_DISABLED="$(IFS="," ; echo "${features_disabled[*]}")" ) if [ "$use_kms" = 1 ]; then diff --git a/builder/Makefile b/builder/Makefile index 95c709e..c1d8fe2 100644 --- a/builder/Makefile +++ b/builder/Makefile @@ -24,6 +24,7 @@ endef required_vars := REPO COMMIT TIMESTAMP DEFAULT_VERSION TEMPFS_SIZE $(foreach var,$(required_vars),$(eval $(call require_var,$(var)))) +FEATURES_DISABLED ?= '' SHORT_COMMIT := $(shell head -c 8 <<< '$(COMMIT)') NATIVE_ARCH := $(shell dpkg --print-architecture) @@ -54,7 +55,7 @@ clean: .build/%-$(SHORT_COMMIT).tar: .build/bootstrap-$$(call cname_arch,$$*)-$$(call cname_version,$$*)-$(SHORT_COMMIT).tar .build/native_bin-$$(call cname_version,$$*)-$(SHORT_COMMIT).tar $(shell ./make_directory_sentinel features) $(shell ./make_directory_sentinel cert) target '$@' '$<' info 'configuring rootfs $*-$(SHORT_COMMIT)' - features="$$(./parse_features --feature-dir features --cname '$*' features)" + features="$$(./parse_features --feature-dir features --ignore '$(FEATURES_DISABLED)' --cname '$*' features)" BUILDER_CNAME='$*' BUILDER_VERSION='$(call cname_version,$*)' BUILDER_ARCH='$(call cname_arch,$*)'