Build failure as invalid use of return in arch-has-odm-enabled.sh removes AAEON modules

Bug #1957049 reported by Tadeus Prastowo
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-hwe-5.11 (Ubuntu)
Undecided
Unassigned

Bug Description

[Steps to reproduce from scratch]

1. Download ubuntu-20.04.3-desktop-amd64.iso, install it on some machine, restart to login to the newly installed Ubuntu, and open GNOME Terminal to type the following commands to bring the system up-to-date:

sudo apt-get update
sudo apt-get -y dist-upgrade

2. Restart, login to the updated Ubuntu, and open GNOME Terminal to type the following commands to prepare linux-hwe-5.11 build:

sudo apt-get install -y --install-suggests build-essential
sudo apt-get build-dep -y linux-image-unsigned-`uname -r`
mkdir ~/workspace
cd ~/workspace
apt-get source linux-image-unsigned-`uname -r`

3. Type the following command to make /bin/sh to point to bash:

sudo ln -sf bash /bin/sh

4. Type the following command to build linux-hwe-5.11 and reproduce the error:

cd ~/workspace/linux-hwe-5.11-5.11.0
time dpkg-buildpackage --no-sign -us -ui -uc --unsigned-changes

[The failure]

Step 4 terminates with the following error message, quoting:

Debug: module-check-generic
II: Checking modules for generic...
   reading new modules...read 5836 modules.
   reading old modules...
      MISS: gpio-aaeon
      MISS: hwmon-aaeon
      MISS: leds-aaeon
      MISS: mfd-aaeon
      MISS: wdt_aaeon
      NEW : ks8851_spi
      NEW : ks8851_common
      NEW : ks8851_par
      read 5838 modules : new(3) missing(5)
EE: Missing modules (start begging for mercy)
make: *** [debian/rules.d/4-checks.mk:10: module-check-generic] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2

real 57m1.098s
user 554m59.082s
sys 86m12.597s

End quote.

[The error]

The executable shell script ~/workspace/linux-hwe-5.11-5.11.0/debian/scripts/misc/arch-has-odm-enabled.sh, which is executed during the syncconfig phase as directed by the file ~/workspace/linux-hwe-5.11-5.11.0/ubuntu/Kconfig, uses the builtin `return' outside a shell function. While `dash' ignores the incorrect usage, `bash' errors out immediately with the error message "/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/scripts/misc/arch-has-odm-enabled.sh: line 30: return: can only `return' from a function or sourced script". That results in the absent of AAEON from the files "~/workspace/linux-hwe-5.11-5.11.0/debian/build/build-generic/.config" and "~/workspace/linux-hwe-5.11-5.11.0/debian/build/build-lowlatency/.config" as demonstrated below:

grep AAEON ~/workspace/linux-hwe-5.11-5.11.0/debian/build/build-{generic,lowlatency}/.config # prints nothing
grep AAEON ~/workspace/linux-hwe-5.11-5.11.0/debian/build/build-{generic,lowlatency}/.config.old # prints:
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-generic/.config.old:CONFIG_AAEON_IWMI_WDT=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-generic/.config.old:CONFIG_GPIO_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-generic/.config.old:CONFIG_LEDS_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-generic/.config.old:CONFIG_MFD_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-generic/.config.old:CONFIG_SENSORS_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-lowlatency/.config.old:CONFIG_AAEON_IWMI_WDT=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-lowlatency/.config.old:CONFIG_GPIO_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-lowlatency/.config.old:CONFIG_LEDS_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-lowlatency/.config.old:CONFIG_MFD_AAEON=m
/home/builder/workspace/linux-hwe-5.11-5.11.0/debian/build/build-lowlatency/.config.old:CONFIG_SENSORS_AAEON=m

Hence, the AAEON modules are not built, resulting in the five missing modules and the build failure.

[The fix]

Replace the use of `return' in the script ~/workspace/linux-hwe-5.11-5.11.0/debian/scripts/misc/arch-has-odm-enabled.sh with `exit' as shown in the attachment to obtain a successful build as shown in the quote below:

Debug: module-check-generic
II: Checking modules for generic...
   reading new modules...read 5841 modules.
   reading old modules...
      NEW : ks8851_common
      NEW : ks8851_par
      NEW : ks8851_spi
      read 5838 modules : new(3) missing(0)
II: New modules (you've been busy, wipe the poop off your nose)
II: Done

[...]

Debug: module-check-lowlatency
II: Checking modules for lowlatency...
   reading new modules...read 5842 modules.
   reading old modules...
      NEW : ks8851_common
      NEW : ks8851_par
      NEW : ks8851_spi
      read 5839 modules : new(3) missing(0)
II: New modules (you've been busy, wipe the poop off your nose)
II: Done

[...]

real 64m38.885s
user 551m1.081s
sys 86m39.039s

End quote.

Revision history for this message
Tadeus Prastowo (software-freedom) wrote :
description: updated
description: updated
tags: added: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers