JohnDuffy
Posts: 19
Joined: Tue Jul 14, 2020 7:04 pm

Advice for Building a New Kernel on Ubuntu 20.04 64-bit

Sat Aug 01, 2020 11:32 am

For Raspberry Pi 4 Ubuntu 20.04 64-bit users who want to build a new kernel, there are two problems with the build system which caused me quite a bit of bother and wasted time, so I thought I would share the fixes....

1. If you follow the steps in the BuildYourOwnKernel guide from the Ubuntu Wiki site, you will get to

Code: Select all

sudo LANG=C fakeroot debian/rules editconfigs
The build process crashes at this point with...

Code: Select all

dh_testdir;
/bin/bash -e debian/scripts/misc/kernelconfig editconfigs
Do you want to edit config: armhf/config.flavour.raspi? [Y/n] n
make[1]: Entering directory '/home/john/picluster/kernel/linux-raspi-5.4.0'
make[2]: Entering directory '/home/john/picluster/kernel/linux-raspi-5.4.0/build'
  GEN     Makefile
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
scripts/Kconfig.include:35: compiler 'arm-linux-gnueabihf-gcc' not found
make[3]: *** [../scripts/kconfig/Makefile:73: syncconfig] Error 1
make[2]: *** [/home/john/picluster/kernel/linux-raspi-5.4.0/Makefile:594: syncconfig] Error 2
make[2]: Leaving directory '/home/john/picluster/kernel/linux-raspi-5.4.0/build'
make[1]: *** [Makefile:179: sub-make] Error 2
make[1]: Leaving directory '/home/john/picluster/kernel/linux-raspi-5.4.0'
make: *** [debian/rules.d/1-maintainer.mk:48: editconfigs] Error 2


The script crashes whether you answer Y or n to the "Do you want to question...". Odd, because we are not building an armhf kernel.

The fix is to go into the debian/raspi/etc directory, and edit the kernelconfig file to remove the armhf reference in the else branch of the for loop. If you then re-run the build process, you are happily taken into the kernel configuration tool.

2. When appending a string to the kernel name, as suggested in BuildYourOwnKernel, you have to edit debian.raspi/changelog, and not debian.master/changelog.

I hope the above is of some use to someone. I posted a question and answered it myself on AskUbuntu.

Raspberry Pi OS team - Please, please, please release a 64-bit lite version as soon as you can.

Best regards

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Advice for Building a New Kernel on Ubuntu 20.04 64-bit

Sat Aug 01, 2020 1:23 pm

JohnDuffy wrote:
Sat Aug 01, 2020 11:32 am
Raspberry Pi OS team - Please, please, please release a 64-bit lite version as soon as you can.

This has been discussed and answered in the appropriate thread, searching will find ;)
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

Return to “Ubuntu”