@@ -187,6 +187,10 @@ do_common_headers_indep=true
# add a 'full source' mode
do_full_source=false
+# Add an option to enable special drivers which should only be build when
+# explicitly enabled.
+do_odm_drivers=false
+
# build tools
ifneq ($(wildcard $(CURDIR)/tools),)
ifeq ($(do_tools),)
@@ -86,6 +86,7 @@ printenv:
@echo "do_flavour_header_package = $(do_flavour_header_package)"
@echo "do_common_headers_indep = $(do_common_headers_indep)"
@echo "do_full_source = $(do_full_source)"
+ @echo "do_odm_drivers = $(do_odm_drivers)"
@echo "do_tools = $(do_tools)"
@echo "do_any_tools = $(do_any_tools)"
@echo "do_linux_tools = $(do_linux_tools)"
@@ -31,6 +31,9 @@ $(stampdir)/stamp-prepare-tree-%: $(commonconfdir)/config.common.$(family) $(arc
[ "$(do_full_source)" != 'true' ] && true || \
rsync -a --exclude debian --exclude debian.master --exclude $(DEBIAN) * $(builddir)/build-$*
cat $(wordlist 1,3,$^) | sed -e 's/.*CONFIG_VERSION_SIGNATURE.*/CONFIG_VERSION_SIGNATURE="Ubuntu $(release)-$(revision)-$* $(raw_kernelversion)"/' > $(builddir)/build-$*/.config
+ [ "$(do_odm_drivers)" = 'true' ] && true || \
+ sed -ie 's/.*CONFIG_UBUNTU_ODM_DRIVERS.*/# CONFIG_UBUNTU_ODM_DRIVERS is not set/' \
+ $(builddir)/build-$*/.config
find $(builddir)/build-$* -name "*.ko" | xargs rm -f
$(build_cd) $(kmake) $(build_O) -j1 syncconfig prepare scripts
touch $@
new file mode 100755
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Evaluate whether arch ($1) will be built with do_odm_drivers set to true.
+set -e
+
+if [ "$1" = "" ]; then
+ return 1
+fi
+
+TOPDIR=$(dirname $0)/../../..
+. $TOPDIR/debian/debian.env
+RULESDIR=$TOPDIR/$DEBIAN/rules.d
+
+do_odm_drivers=false
+for f in $1.mk hooks.mk; do
+ eval $(cat $RULESDIR/$f | sed -n -e '/do_odm_drivers/s/ \+//gp')
+done
+if [ "$do_odm_drivers" != "true" ]; then
+ return 1
+fi
+
+return 0
@@ -68,7 +68,7 @@ for arch in $archs; do
# for i386 since it is no longer supported after 19.04, however
# we maintain the configs for hwe.
modify_config=true
- env="ARCH=$kernarch"
+ env="ARCH=$kernarch DEB_ARCH=$arch"
compiler_path=$(which "${cross_compile}gcc" || true)
if [ "$compiler_path" != '' ]; then
env="$env CROSS_COMPILE=$cross_compile"
@@ -1,5 +1,11 @@
menu "Ubuntu Supplied Third-Party Device Drivers"
+
+config UBUNTU_ODM_DRIVERS
+ def_bool $(success,$(srctree)/debian/scripts/misc/arch-has-odm-enabled.sh $(DEB_ARCH))
+ ---help---
+ Turn on support for Ubuntu ODM supplied drivers
+
#
# NOTE: to allow drivers to be added and removed without causing merge
# collisions you should add new entries in the middle of the six lines