From patchwork Fri Mar 1 09:16:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1906600 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TmMts1cw0z1yXC for ; Fri, 1 Mar 2024 20:17:41 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rfz19-0000on-OG; Fri, 01 Mar 2024 09:17:24 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rfz0W-0000kh-Ul for kernel-team@lists.ubuntu.com; Fri, 01 Mar 2024 09:16:46 +0000 Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 1152A3F275 for ; Fri, 1 Mar 2024 09:16:43 +0000 (UTC) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-5dc91de351fso1600798a12.0 for ; Fri, 01 Mar 2024 01:16:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709284601; x=1709889401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cnoJnR/NwOowIp5HwPr4sVfK/3zcc+VRFhHBsEaOdwY=; b=DFzenwfRrTn9ZbjMN66t1KopqQFAAhl8oN0HoQhq2XHFoJY9U4SsTV4clFzKXeua68 bTj1osD82FQSF0EVGUbqKWs0JmA5j7tD9HtMBfxApEDIq47aHy8Q/Z3up4b3Kr/Ug4is 5crsjHFJKbpFfmo4bx8H8wayWp6EMRh3ExR0Uq6FogGb3iEvL62vST6a9GupXA5xSb5k jK8Ct1nU8IEH2LWI6lcqaaA3bRc3xm1DseEZMa30MNQ8b1k09G9ZfCzrkPp3JlY8Q6JA pYfMJn4Y/bI6WswYc9WawfG+8TvKlqO8jN0h286xYUnks9HZQf7mppCKHAzQj4emtly6 CR/w== X-Gm-Message-State: AOJu0YyiH7ZNktwRyYku4mEwX1Bo4oAIhJeHIXycv+FXna4NC1WmdGyV kEnS68bCvsD37+nBJoKADJ5KgKQE8qLtihfLU2hoKs7dV6qoTk+sr7YHZhbbehNflpn9CA0pZ9Z hwg4lCKf9J0nx4tlUsG2t4QtP3ngyvBSp26LK/JuQtAtacg61iSH2SHBff/ot9kCU4HskKMr7WP WD1rELlrdU8w== X-Received: by 2002:a05:6a20:8e1b:b0:19e:4ab2:c362 with SMTP id y27-20020a056a208e1b00b0019e4ab2c362mr1605203pzj.14.1709284601505; Fri, 01 Mar 2024 01:16:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoAof4Tg2XDOMvqJ93p2k5CLkIN/puNxG4EUHYVB0obRBSJJtkoitKsXxWBQhmVx0oIJ0OSQ== X-Received: by 2002:a05:6a20:8e1b:b0:19e:4ab2:c362 with SMTP id y27-20020a056a208e1b00b0019e4ab2c362mr1605175pzj.14.1709284601025; Fri, 01 Mar 2024 01:16:41 -0800 (PST) Received: from zoe.. ([2001:f74:8f00:c00:6aff::1001]) by smtp.gmail.com with ESMTPSA id n17-20020aa78a51000000b006e56bf07483sm2525356pfa.77.2024.03.01.01.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 01:16:40 -0800 (PST) From: Masahiro Yamada To: kernel-team@lists.ubuntu.com Subject: [Unstable/Noble PATCH 1/1] UBUNTU: [Packaging] remove debian/scripts/misc/arch-has-odm-enabled.sh Date: Fri, 1 Mar 2024 18:16:35 +0900 Message-Id: <20240301091635.1193894-2-masahiro.yamada@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240301091635.1193894-1-masahiro.yamada@canonical.com> References: <20240301091635.1193894-1-masahiro.yamada@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" On Ubuntu, /bin/sh is a symlink to /bin/dash by default. While this is a rare use case, when /bin/sh is a symlink to /bin/bash, the annotation check fails due to a mismatch of CONFIG_UBUNTU_ODM_DRIVERS. debian/scripts/misc/arch-has-odm-enabled.sh always fails with bash. You can see it if you directly execute it. [with dash] $ dash debian/scripts/misc/arch-has-odm-enabled.sh amd64 cat: debian/scripts/misc/../../../debian.master/rules.d/hooks.mk: No such file or directory $ echo $? 0 [with bash] $ bash debian/scripts/misc/arch-has-odm-enabled.sh amd64 cat: debian/scripts/misc/../../../debian.master/rules.d/hooks.mk: No such file or directory debian/scripts/misc/arch-has-odm-enabled.sh: line 26: return: can only `return' from a function or sourced script $ echo $? 2 Bash provides stricter checks, hence the 'return' statement outside a function leads to an error. While it is trivial to fix, I wonder if we need this script in the first place. Its purpose is to make CONFIG_UBUNTU_ODM_DRIVERS a user-unconfigurable option. Given debian.*/config/annotations specifying the CONFIG set for each arch/flavour, why not handle CONFIG_UBUNTU_ODM_DRIVERS just like other normal CONFIG options? Users are still allow to toggle it from menuconfig etc., but I do not see a significant issue, as any trouble comes to users' responsibility when they change CONFIG options by themselves. Signed-off-by: Masahiro Yamada --- debian.master/config/annotations | 2 +- debian.master/rules.d/amd64.mk | 1 - debian/rules.d/0-common-vars.mk | 4 ---- debian/rules.d/1-maintainer.mk | 1 - debian/rules.d/2-binary-arch.mk | 3 --- debian/scripts/misc/arch-has-odm-enabled.sh | 26 --------------------- ubuntu/Kconfig | 2 +- 7 files changed, 2 insertions(+), 37 deletions(-) delete mode 100755 debian/scripts/misc/arch-has-odm-enabled.sh diff --git a/debian.master/config/annotations b/debian.master/config/annotations index b887d9ade5d9..16b884dfca73 100644 --- a/debian.master/config/annotations +++ b/debian.master/config/annotations @@ -14122,7 +14122,7 @@ CONFIG_UBSAN_SHIFT policy<{'amd64': 'y', 'arm64': ' CONFIG_UBSAN_TRAP policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 's390x': 'n'}> CONFIG_UBSAN_UNREACHABLE policy<{'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 's390x': 'n'}> CONFIG_UBUNTU_HOST policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'm'}> -CONFIG_UBUNTU_ODM_DRIVERS policy<{'amd64': 'y'}> +CONFIG_UBUNTU_ODM_DRIVERS policy<{'amd64': 'y', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 'riscv64': 'n', 's390x': 'n'}> CONFIG_UCC policy<{'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y'}> CONFIG_UCC_FAST policy<{'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y'}> CONFIG_UCC_SLOW policy<{'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y'}> diff --git a/debian.master/rules.d/amd64.mk b/debian.master/rules.d/amd64.mk index a005382134aa..26af61cf7c91 100644 --- a/debian.master/rules.d/amd64.mk +++ b/debian.master/rules.d/amd64.mk @@ -19,5 +19,4 @@ do_tools_host = true do_extras_package = true do_tools_common = true do_tools_acpidbg = true -do_odm_drivers = true do_lib_rust = true diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index 9bbd412fb4f7..ab91b4c53a20 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -124,10 +124,6 @@ endif # common headers normally is built as an indep package, but may be arch do_common_headers_indep=true -# 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),) diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk index dfcd814e2d0f..928343e3f7e0 100644 --- a/debian/rules.d/1-maintainer.mk +++ b/debian/rules.d/1-maintainer.mk @@ -72,7 +72,6 @@ printenv: @echo "do_flavour_image_package = $(do_flavour_image_package)" @echo "do_flavour_header_package = $(do_flavour_header_package)" @echo "do_common_headers_indep = $(do_common_headers_indep)" - @echo "do_odm_drivers = $(do_odm_drivers)" @echo "do_lib_rust = $(do_lib_rust)" @echo "do_tools = $(do_tools)" @echo "do_tools_common = $(do_tools_common)" diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 9191fc0e3508..c03a76a391e8 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -18,9 +18,6 @@ $(stampdir)/stamp-prepare-tree-%: debian/scripts/fix-filenames touch $(builddir)/build-$*/ubuntu-build python3 debian/scripts/misc/annotations --export --arch $(arch) --flavour $(target_flavour) > $(builddir)/build-$*/.config sed -i '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 $(kmake) O=$(builddir)/build-$* $(conc_level) rustavailable || true $(kmake) O=$(builddir)/build-$* $(conc_level) olddefconfig diff --git a/debian/scripts/misc/arch-has-odm-enabled.sh b/debian/scripts/misc/arch-has-odm-enabled.sh deleted file mode 100755 index b812cc091983..000000000000 --- a/debian/scripts/misc/arch-has-odm-enabled.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Evaluate whether arch ($1) will be built with do_odm_drivers set to true. -set -e - -if [ "$1" = "" ]; then - case $ARCH in - x86) ARCH=amd64;; - *) ;; - esac -else - ARCH=$1 -fi - -TOPDIR=$(dirname $0)/../../.. -. $TOPDIR/debian/debian.env -RULESDIR=$TOPDIR/$DEBIAN/rules.d - -do_odm_drivers=false -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 - return 1 -fi - -return 0 diff --git a/ubuntu/Kconfig b/ubuntu/Kconfig index 6b6b5495c942..6be41b4644e1 100644 --- a/ubuntu/Kconfig +++ b/ubuntu/Kconfig @@ -2,7 +2,7 @@ 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)) + bool "Ubuntu ODM supplied drivers" help Turn on support for Ubuntu ODM supplied drivers