Issues while porting 5.10 kernel from master branch to 21.02 branch

I brought all the relevant changes related to the 5.10 kernel to the openwrt 21.02 branch. But I am facing one particular issue which breaks the build process.

make[2]: Entering directory '/home/shaheen/openwrt/package/firmware/linux-firmware'
mkdir -p /home/shaheen/openwrt/dl
SHELL= flock /home/shaheen/openwrt/tmp/.linux-firmware-20211216.tar.xz.flock -c '  	/home/shaheen/openwrt/scripts/download.pl "/home/shaheen/openwrt/dl" "linux-firmware-20211216.tar.xz" "eeddb4e6bef31fd1a3757f12ccc324929bbad97855c0b9ec5ed780f74de1837d" "" "@KERNEL/linux/kernel/firmware"    '
echo "r8169-firmware" >> /home/shaheen/openwrt/staging_dir/target-x86_64_musl/pkginfo/linux-firmware.default.install
echo "bnx2-firmware" >> /home/shaheen/openwrt/staging_dir/target-x86_64_musl/pkginfo/linux-firmware.default.install
make[2]: Leaving directory '/home/shaheen/openwrt/package/firmware/linux-firmware'
time: package/firmware/linux-firmware/compile#1.20#0.32#1.33
make[2]: Entering directory '/home/shaheen/openwrt/package/firmware/prism54-firmware'
make[2]: Nothing to be done for 'compile'.
make[2]: Leaving directory '/home/shaheen/openwrt/package/firmware/prism54-firmware'
time: package/firmware/prism54-firmware/compile#0.30#0.06#0.33
make[2]: Entering directory '/home/shaheen/openwrt/package/kernel/linux'
rm -f /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.configured_*
rm -f /home/shaheen/openwrt/staging_dir/target-x86_64_musl/stamp/.linux_installed
( if [ -f /home/shaheen/openwrt/staging_dir/target-x86_64_musl/packages/linux.list ]; then /home/shaheen/openwrt/scripts/clean-package.sh "/home/shaheen/openwrt/staging_dir/target-x86_64_musl/packages/linux.list" "/home/shaheen/openwrt/staging_dir/target-x86_64_musl"; fi; )



touch /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.built_2c7a09cd05b66a539263fa44204a3555
touch /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.built_2c7a09cd05b66a539263fa44204a3555_check





touch /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.built_2c7a09cd05b66a539263fa44204a3555
rm -rf /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.pkgdir/kernel.installed /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.pkgdir/kernel
mkdir -p /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.pkgdir/kernel
# nothing to do

touch /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.pkgdir/kernel.installed
mkdir -p /home/shaheen/openwrt/staging_dir/target-x86_64_musl/root-x86/stamp

SHELL= flock /home/shaheen/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.pkgdir/kernel/. /home/shaheen/openwrt/staging_dir/target-x86_64_musl/root-x86/'
touch /home/shaheen/openwrt/staging_dir/target-x86_64_musl/root-x86/stamp/.kernel_installed
sed: can't read /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.96/modules.builtin: No such file or directory
Packaged contents of /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/ipkg-x86_64/kernel into /home/shaheen/openwrt/bin/targets/x86/64/packages/kernel_5.10.96-1-447d68e2a8b3dcff08803345d319c942_x86_64.ipk
grep: /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.96/modules.builtin: No such file or directory
grep: /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.96/modules.builtin: No such file or directory
grep: /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.96/modules.builtin: No such file or directory

Following are the changes I have done to back port kernel from master branch to the 21.02 branch

  • Copied following folders and files from the master to 21.02 branch
1	target/linux/generic/backport-5.10/
2	target/linux/generic/config-5.10
3	target/linux/generic/hack-5.10/
4	target/linux/generic/pending-5.10/
5	target/linux/x86/64/config-5.10
6	target/linux/x86/config-5.10
7	target/linux/x86/generic/config-5.10
8	target/linux/x86/geode/config-5.10
9	target/linux/x86/legacy/config-5.10
10	target/linux/x86/patches-5.10/`
  • Compared and modified the following files to support the kernel 21.02 changes.
1  	modified:   include/kernel-version.mk
2	modified:   package/kernel/linux/modules/block.mk
3	modified:   package/kernel/linux/modules/crypto.mk
4	modified:   package/kernel/linux/modules/fs.mk
5	modified:   package/kernel/linux/modules/netdevices.mk
6	modified:   package/kernel/linux/modules/netfilter.mk
7	modified:   package/kernel/linux/modules/netsupport.mk
8	modified:   package/kernel/linux/modules/other.mk
9	modified:   package/kernel/linux/modules/usb.mk
10	modified:   target/linux/x86/Makefile`

While building firmware the modules.builtin(build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.96/modules.builtin) file is not getting created inside the build directory which is breaking the build process. When I copy this file from the master branch build_dir and keep it inside the build_dir of the 21.02 branch it will compile successfully. But that is not a permanent solution.

Can anyone suggest how to fix this issue?

2 Likes

That's part of your error. I'm not sure why you'd try backporting 5.10 to 21.02 instead of using master, which will be branched soonish into 22.xx.

  • The reason for backporting 5.10 to 21.02 is because 5.4 kernel have issues with the bridge configuration. If I use 5.10 kernel it fixes the bridge configuration issue. I cannot use master branch because it is getting new commits day by day which will affect the firmware of my x86 device.

  • sed: can't read /home/shaheen/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.10.96/modules.builtin: No such file or directory

sed command it failing because modules.builtin file is not getting created. I need to know what is the reason behind this file not getting created.

…and openwrt-21.02 will never accept kernel v5.10, so you are all on your own with this endeavour.

Kernel v5.10 support has been done, once, for master and the upcoming openwrt-22.03(?) branch, it works nicely - also on x86_64.

1 Like

could you please elaborate why openwrt21.02 will never accept kernel v5.10?

wondering when 22.xx will be released too... there is no indication here: https://openwrt.org/docs/guide-developer/releases/goals/22.xx

1 Like

The release branches are "stable". They have the major kernel version that was there at the branching (in Feb 2021 in case of 21.02). That means 5.4 for 21.02.

Since that branching a year ago, all targets in the development master have already been upgraded to 5.10.

So, the next release, likely 22.03, will have kernel 5.10.

See:

Around 20. March 2022 we plan to branch off the next major release and
would prepare for a first release candidate about 1 week later.

there is now a feature freeze in place! Please don't commit any major changes until the planed branch around March 20th.

After the branch heavy changes (i.e. Kernel 5.15) can be merged, for now we should work on bugs and finish up firewall4 support.

March 20th is not the release date of 22.0x, after the branch we'll give it more time to stabilize.

We were facing similar kind of issue , it would be really helpful ,if some one have already gone through the issue at their end & can provide some suggestion on it .Thanks.