diff mbox series

[SRU,xenial/hwe,v2,1/1] UBUNTU: [Packaging] HWE: disable CONFIG_MODVERSIONS

Message ID 20210409094247.2129234-2-kleber.souza@canonical.com
State New
Headers show
Series Fix boot failure on ppc64el (LP: #1922997) | expand

Commit Message

Kleber Sacilotto de Souza April 9, 2021, 9:42 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1922997

Enabling CONFIG_MODVERSIONS on Xenial is causing the modules to fail
loading on ppc64el systems. Disable it for now on all architectures via
the local-mangle file.

CONFIG_MODULE_REL_CRCS also needs to be removed from the configs as it
depends on CONFIG_MODVERSIONS.

Also unsets CONFIG_SYSTEM_TRUSTED_KEYS as the keys can't be used with
CONFIG_MODVERSIONS disabled.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 debian.hwe/scripts/helpers/local-mangle | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Stefan Bader April 9, 2021, 9:45 a.m. UTC | #1
On 09.04.21 11:42, Kleber Sacilotto de Souza wrote:
> BugLink: https://bugs.launchpad.net/bugs/1922997
> 
> Enabling CONFIG_MODVERSIONS on Xenial is causing the modules to fail
> loading on ppc64el systems. Disable it for now on all architectures via
> the local-mangle file.
> 
> CONFIG_MODULE_REL_CRCS also needs to be removed from the configs as it
> depends on CONFIG_MODVERSIONS.
> 
> Also unsets CONFIG_SYSTEM_TRUSTED_KEYS as the keys can't be used with
> CONFIG_MODVERSIONS disabled.
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>   debian.hwe/scripts/helpers/local-mangle | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/debian.hwe/scripts/helpers/local-mangle b/debian.hwe/scripts/helpers/local-mangle
> index 125c5b251bce..7ffc3a7a3764 100755
> --- a/debian.hwe/scripts/helpers/local-mangle
> +++ b/debian.hwe/scripts/helpers/local-mangle
> @@ -9,3 +9,12 @@ sed -i /snapdragon/d ${DEBIAN}/d-i/kernel-versions
>   sed -i '/_snapdragon/d' ${DEBIAN}/rules.d/arm64.mk
>   sed -i 's/^\(flavo.*\)\ssnapdragon\(.*\)$/\1\2/' ${DEBIAN}/rules.d/arm64.mk
>   rm -f ${DEBIAN}/config/arm64/config.flavour.snapdragon
> +
> +# Disable CONFIG_MODVERSIONS and restore CONFIG_SYSTEM_TRUSTED_KEYS for
> +# linux-hwe and update annotations accordingly (LP: #1922997)
> +sed -i 's/^CONFIG_MODVERSIONS=y/# CONFIG_MODVERSIONS is not set/' ${DEBIAN}/config/config.common.ubuntu
> +sed -i '/^CONFIG_MODULE_REL_CRCS=y/d' ${DEBIAN}/config/config.common.ubuntu
> +sed -i "s/^CONFIG_MODVERSIONS[[:space:]]*policy<.*/CONFIG_MODVERSIONS                              policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'i386': 'n', 'ppc64el': 'n', 's390x': 'n'}>/" ${DEBIAN}/config/annotations
> +sed -i "/^CONFIG_MODVERSIONS[[:space:]]*mark<ENFORCED>.*/d" ${DEBIAN}/config/annotations
> +sed -i 's/^CONFIG_SYSTEM_TRUSTED_KEYS=.*/CONFIG_SYSTEM_TRUSTED_KEYS=""/' ${DEBIAN}/config/config.common.ubuntu
> +sed -i "s/^CONFIG_SYSTEM_TRUSTED_KEYS[[:space:]]*policy<.*/CONFIG_SYSTEM_TRUSTED_KEYS                      policy<{'amd64': '\"\"', 'arm64': '\"\"', 'armhf': '\"\"', 'i386': '\"\"', 'ppc64el': '\"\"', 's390x': '\"\"'}>/" ${DEBIAN}/config/annotations
>
diff mbox series

Patch

diff --git a/debian.hwe/scripts/helpers/local-mangle b/debian.hwe/scripts/helpers/local-mangle
index 125c5b251bce..7ffc3a7a3764 100755
--- a/debian.hwe/scripts/helpers/local-mangle
+++ b/debian.hwe/scripts/helpers/local-mangle
@@ -9,3 +9,12 @@  sed -i /snapdragon/d ${DEBIAN}/d-i/kernel-versions
 sed -i '/_snapdragon/d' ${DEBIAN}/rules.d/arm64.mk
 sed -i 's/^\(flavo.*\)\ssnapdragon\(.*\)$/\1\2/' ${DEBIAN}/rules.d/arm64.mk
 rm -f ${DEBIAN}/config/arm64/config.flavour.snapdragon
+
+# Disable CONFIG_MODVERSIONS and restore CONFIG_SYSTEM_TRUSTED_KEYS for
+# linux-hwe and update annotations accordingly (LP: #1922997)
+sed -i 's/^CONFIG_MODVERSIONS=y/# CONFIG_MODVERSIONS is not set/' ${DEBIAN}/config/config.common.ubuntu
+sed -i '/^CONFIG_MODULE_REL_CRCS=y/d' ${DEBIAN}/config/config.common.ubuntu
+sed -i "s/^CONFIG_MODVERSIONS[[:space:]]*policy<.*/CONFIG_MODVERSIONS                              policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'i386': 'n', 'ppc64el': 'n', 's390x': 'n'}>/" ${DEBIAN}/config/annotations
+sed -i "/^CONFIG_MODVERSIONS[[:space:]]*mark<ENFORCED>.*/d" ${DEBIAN}/config/annotations
+sed -i 's/^CONFIG_SYSTEM_TRUSTED_KEYS=.*/CONFIG_SYSTEM_TRUSTED_KEYS=""/' ${DEBIAN}/config/config.common.ubuntu
+sed -i "s/^CONFIG_SYSTEM_TRUSTED_KEYS[[:space:]]*policy<.*/CONFIG_SYSTEM_TRUSTED_KEYS                      policy<{'amd64': '\"\"', 'arm64': '\"\"', 'armhf': '\"\"', 'i386': '\"\"', 'ppc64el': '\"\"', 's390x': '\"\"'}>/" ${DEBIAN}/config/annotations