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:
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:
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 built 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
[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 unsigned- `uname -r` unsigned- `uname -r`
sudo apt-get build-dep -y linux-image-
mkdir ~/workspace
cd ~/workspace
apt-get source linux-image-
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 rules.d/ 4-checks. mk:10: module- check-generic] Error 1
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/
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 linux-hwe- 5.11-5. 11.0/debian/ build/build- {generic, lowlatency} /.config. old # prints: workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- generic/ .config. old:CONFIG_ AAEON_IWMI_ WDT=m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- generic/ .config. old:CONFIG_ GPIO_AAEON= m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- generic/ .config. old:CONFIG_ LEDS_AAEON= m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- generic/ .config. old:CONFIG_ MFD_AAEON= m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- generic/ .config. old:CONFIG_ SENSORS_ AAEON=m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- lowlatency/ .config. old:CONFIG_ AAEON_IWMI_ WDT=m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- lowlatency/ .config. old:CONFIG_ GPIO_AAEON= m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- lowlatency/ .config. old:CONFIG_ LEDS_AAEON= m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- lowlatency/ .config. old:CONFIG_ MFD_AAEON= m workspace/ linux-hwe- 5.11-5. 11.0/debian/ build/build- lowlatency/ .config. old:CONFIG_ SENSORS_ AAEON=m
grep AAEON ~/workspace/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
/home/builder/
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 built 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-lowlatenc y
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.