diff mbox series

[3/3,SRU,G] UBUNTU: [Packaging] Fix ODM support in actual build

Message ID 20210611095751.14524-4-acelan.kao@canonical.com
State New
Headers show
Series Add support for selective build of special drivers | expand

Commit Message

AceLan Kao June 11, 2021, 9:57 a.m. UTC
From: Stefan Bader <stefan.bader@canonical.com>

BugLink: https://bugs.launchpad.net/bugs/1912789

The config update was working with the conditional entry but the actual
build is different and was just ignoring everything.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
(cherry picked commit from 198971108d5dfe12b9846bf0d115accc3d1c3fe8
focal)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 debian/scripts/misc/arch-has-odm-enabled.sh | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/debian/scripts/misc/arch-has-odm-enabled.sh b/debian/scripts/misc/arch-has-odm-enabled.sh
index 7bc8a5db0db0..23fe34a868a7 100755
--- a/debian/scripts/misc/arch-has-odm-enabled.sh
+++ b/debian/scripts/misc/arch-has-odm-enabled.sh
@@ -3,7 +3,16 @@ 
 set -e
 
 if [ "$1" = "" ]; then
-	return 1
+	# This would be set doing the actual kernel build
+	if [ "$KBUILD_VERBOSE" = "" ]; then
+		return 1
+	fi
+	case $ARCH in
+	x86)	ARCH=amd64;;
+	*)	;;
+	esac
+else
+	ARCH=$1
 fi
 
 TOPDIR=$(dirname $0)/../../..
@@ -11,7 +20,7 @@  TOPDIR=$(dirname $0)/../../..
 RULESDIR=$TOPDIR/$DEBIAN/rules.d
 
 do_odm_drivers=false
-for f in $1.mk hooks.mk; do
+for f in $ARCH.mk hooks.mk; do
 	eval $(cat $RULESDIR/$f | sed -n -e '/do_odm_drivers/s/ \+//gp')
 done
 if [ "$do_odm_drivers" != "true" ]; then