Error in custom kernel compilation for ubuntu

Asked by ajay patil

Hi ,
We are building own kernel image on the system ubuntu 20.04.4 and kernel version 5.13.0-40-generic and compiling kernel version is 5.4.0-104-generic but get below error as follow.

INSTALL ubuntu/hio/hio.ko
  INSTALL ubuntu/xr-usb-serial/xr_usb_serial_common.ko
  DEPMOD 5.4.0-104-generic
make[2]: Leaving directory '/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/build/build-generic'
make[1]: Leaving directory '/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal'
#
# Build module blacklists:
# - blacklist all watchdog drivers (LP:1432837)
#
install -d /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modprobe.d
echo "# Kernel supplied blacklist for linux 5.4.0-104-generic amd64" \
 >/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modprobe.d/blacklist_linux_5.4.0-104-generic.conf
for conf in amd64-generic amd64 common.conf; do \
 if [ -f debian.master/modprobe.d/$conf ]; then \
  echo "# modprobe.d/$conf"; \
  cat debian.master/modprobe.d/$conf; \
 fi; \
done >>/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modprobe.d/blacklist_linux_5.4.0-104-generic.conf
echo "# Autogenerated watchdog blacklist" \
 >>/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modprobe.d/blacklist_linux_5.4.0-104-generic.conf
ls -1 /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel/drivers/watchdog/ | \
 grep -v '^bcm2835_wdt$' | \
 sed -e 's/^/blacklist /' -e 's/.ko$//' | \
 sort -u \
 >>/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modprobe.d/blacklist_linux_5.4.0-104-generic.conf
#
# Remove all modules not in the inclusion list.
#
if [ -f debian.master/control.d/generic.inclusion-list ] ; then \
 /sbin/depmod -v -b /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic 5.4.0-104-generic | \
  sed -e "s@/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel/@@g" | \
  awk '{ print $1 " " $NF}' >/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/build/build-generic/module-inclusion.depmap; \
 mkdir -p /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-extra-5.4.0-104-generic/lib/modules/5.4.0-104-generic; \
 mv /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel \
  /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-extra-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel; \
 /bin/bash -e debian/scripts/module-inclusion --master \
  /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-extra-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel \
  /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel \
  debian.master/control.d/generic.inclusion-list \
  /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/build/build-generic/module-inclusion.depmap 2>&1 | \
   tee generic.inclusion-list.log; \
 /sbin/depmod -b /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic -ea -F /home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/boot/System.map-5.4.0-104-generic \
  5.4.0-104-generic 2>&1 |tee generic.depmod.log; \
 if [ `grep -c 'unknown symbol' generic.depmod.log` -gt 0 ]; then \
  echo "EE: Unresolved module dependencies in base package!"; \
  exit 1; \
 fi \
fi
mv: cannot move '/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel' to '/home/embed/workspace/Intel_atom/kernel_5.13_40/5.4/focal/debian/linux-modules-extra-5.4.0-104-generic/lib/modules/5.4.0-104-generic/kernel/kernel': Directory not empty
make: *** [debian/rules.d/2-binary-arch.mk:158: install-generic] Error 1

Please help me this regarding issue.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
ajay patil
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

I suggest that you try compiling your custom 5.13 kernel on a system that runs a 5.13 version of the kernel itself.
This can be Ubuntu 22.04 or Ubuntu 20.04 with the HWE kernel.

Revision history for this message
ajay patil (ajay9292) said :
#2

Hi m-hampal,
Thanks for reply.
As per your suggestion we are try kernel hwe-5.13 version but getting below error.

  CC /home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal/debian/build/build-generic/tools/bpf/resolve_btfids/str_error_r.o
  LD /home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal/debian/build/build-generic/tools/bpf/resolve_btfids/resolve_btfids-in.o
  LINK resolve_btfids
make[2]: Leaving directory '/home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal/debian/build/build-generic'
make[1]: Leaving directory '/home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal'
touch /home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal/debian/stamps/stamp-prepare-tree-generic
Debug: config-prepare-check-generic
check-config: /home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal/debian/build/build-generic/.config: loading config
check-config: /home/embed/workspace/Intel_atom/5_13_40/New_5.13/focal/debian.hwe-5.13/config/annotations loading annotations
check-config: FAIL (n != -): CONFIG_KCSAN policy<{'amd64': '-', 'arm64': '-', 'armhf': '-', 'ppc64el': '-', 's390x': '-'}>
check-config: 11083/11084 checks passed -- exit 1
make: *** [debian/rules.d/4-checks.mk:25: config-prepare-check-generic] Error 1

more information through command

embed@embed:~/workspace/Intel_atom/5_13_40/New_5.13/focal$ git branch
* hwe-5.13
  master
embed@embed:~/workspace/Intel_atom/5_13_40/New_5.13/focal$ uname -r
5.13.0-40-generic

We install gcc-11 as per your previous suggestion.but error is not solved.

Thanks again for reply.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Sorry, no idea.

Do you need KCSAN? If not, then you can disable it. Maybe the compilation works then.

Revision history for this message
ajay patil (ajay9292) said :
#4

Hi m-hampl,
Thanks for reply.
I was disabled KCSAN but issue was not solved.

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

If check-config fails, you should try executing editconfig first
see e.g. https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel#Modifying_the_configuration

"you need to go through each (Y, Exit, Y, Exit..) or get a complaint about config later"

Revision history for this message
ajay patil (ajay9292) said :
#6

Hi m-hampl,
Thanks for reply.
Yes I we config first but get the same error.

Revision history for this message
ajay patil (ajay9292) said :
#7

Hi m-hampl,

for just information we are sharing the editconfigs command result.

Creating stub configs ...
  processing config.common.s390x ... done.
  processing config.common.ppc64el ... done.
  processing config.common.arm64 ... done.
  processing config.common.armhf ... done.
  processing config.common.amd64 ... done.

Running config-check for all configurations ...

check-config: /tmp/tmp.a9LsSVvkQa/CONFIGS/amd64-config.flavour.generic: loading config
check-config: /home/embed/workspace/Intel_atom/5_13_40/New_5.13_v2/New_5.13/focal/debian.hwe-5.13/config/annotations loading annotations
check-config: FAIL (n != -): CONFIG_KCSAN policy<{'amd64': '-', 'arm64': '-', 'armhf': '-', 'ppc64el': '-', 's390x': '-'}>
check-config: 11083/11084 checks passed -- exit 1
check-config: /tmp/tmp.a9LsSVvkQa/CONFIGS/amd64-config.flavour.lowlatency: loading config
check-config: /home/embed/workspace/Intel_atom/5_13_40/New_5.13_v2/New_5.13/focal/debian.hwe-5.13/config/annotations loading annotations
check-config: FAIL (n != -): CONFIG_KCSAN policy<{'amd64': '-', 'arm64': '-', 'armhf': '-', 'ppc64el': '-', 's390x': '-'}>
check-config: 11083/11084 checks passed -- exit 1

*** ERROR: 2 config-check failures detected

WARNING: configuration operation applied only to a subset of architectures (skipped armhf arm64 ppc64el s390x)

rm -rf build

above error shows.

Revision history for this message
ajay patil (ajay9292) said :
#8

hi m-hampl,
Thanks for supports,
We solved issue with taken ubuntu20.04 with 5.13 kernel version on other system.with upgrading to current version to 5.13 issue was not solved.
thanks for help.

ajay