WIP: Trying to edit kernel config #60

Draft
lee.miller wants to merge 5 commits from lee.miller/openwrt:kernel into main
Collaborator

Hi!

As far as I can test this doesn't work. But you can check this image, maybe it works for rpi4.

Hi! As far as I can test this doesn't work. But you can check this image, maybe it works for rpi4.
Owner

I wasn't able to test it directly, but I tested it indirectly, by comparing the kernel8.img with an old one, and they are the same (size and checksum). So it didn't work.

I wasn't able to test it directly, but I tested it indirectly, by comparing the `kernel8.img` with an old one, and they are the same (size and checksum). So it didn't work.
Author
Collaborator

I realized that Image Builder puts the stock kernel into the image. Investigating.

I realized that Image Builder puts the stock kernel into the image. Investigating.
lee.miller force-pushed kernel from c60e33bc8f to eb998042f1 2023-11-17 05:34:02 +01:00 Compare
Owner

The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help.

The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help.
Owner

The timeout happens if there is nothing on stdout/stderr for 20 minutes, so if you have multiple make children running in parallel it may avoid it.

The timeout happens if there is nothing on stdout/stderr for 20 minutes, so if you have multiple `make` children running in parallel it may avoid it.
Owner

I tested if OpenWRT preserves a third partition, i.e. if it even makes sense to boot from NVMe. The third partition was preserved, so I assume as long as the new image doesn't have a bigger partition assigned in the partition table than the old one, all should be fine.

I tested if OpenWRT preserves a third partition, i.e. if it even makes sense to boot from NVMe. The third partition was preserved, so I assume as long as the new image doesn't have a bigger partition assigned in the partition table than the old one, all should be fine.
Author
Collaborator

The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help.

I need to check it locally more thoroughly. It seems using a wrong config and building modules that we don't need.

In this edition of the kernel-custom I just added the parts needed to build the kernel into the packages/kernel/linux. Previously I removed parts, that seemed irrelevant and the build failed. After reading include/target.mk I thought it can be done by TARGET_BUILD=1 make, but it also failed.

> The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help. I need to check it locally more thoroughly. It seems using a wrong config and building modules that we don't need. In this edition of the `kernel-custom` I just added the parts needed to build the kernel into the `packages/kernel/linux`. Previously I removed parts, that seemed irrelevant and the build failed. After reading `include/target.mk` I thought it can be done by `TARGET_BUILD=1 make`, but it also failed.
Author
Collaborator

The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help.

We'll see, but I'm not sure. BuildKernel in the include/kernel-build.mk has .NOTPARALLEL:

> The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help. We'll see, but I'm not sure. [BuildKernel](https://github.com/openwrt/openwrt/blob/main/include/kernel-build.mk#L84) in the `include/kernel-build.mk` has `.NOTPARALLEL:`
Owner

The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help.

We'll see, but I'm not sure. BuildKernel in the include/kernel-build.mk has .NOTPARALLEL:

We'll see.

> > The build timed out. I don't want to fiddle around with buildbot config at the moment, so how about you enable parallel builds (see #30)? That may help. > > We'll see, but I'm not sure. [BuildKernel](https://github.com/openwrt/openwrt/blob/main/include/kernel-build.mk#L84) in the `include/kernel-build.mk` has `.NOTPARALLEL:` We'll see.
Owner

Seems to run in a single thread :-(

Seems to run in a single thread :-(
Owner

I bumped the timeout to 2 hours, now I'm cleaning the cache, then I'll rerun the job.

I bumped the timeout to 2 hours, now I'm cleaning the cache, then I'll rerun the job.
Owner

Didn't deploy timeout change correctly, now rerunning the job again, with timeout.

Didn't deploy timeout change correctly, now rerunning the job again, with timeout.
Owner

Ok the timout helped to get debug data on the build.

Ok the timout helped to get debug data on the build.
lee.miller force-pushed kernel from 90115e0b47 to 80c019c0b3 2023-11-21 19:21:11 +01:00 Compare
lee.miller force-pushed kernel from 80c019c0b3 to c68f4ed285 2023-11-23 01:06:17 +01:00 Compare
Owner

Tried to boot from NVMe, didn't work, did a md5sum on /boot/kernel8.img and it's still the same as before.

Tried to boot from NVMe, didn't work, did a md5sum on `/boot/kernel8.img` and it's still the same as before.
Owner

With the new kernel, the OS doesn't boot. Pi is stuck at the rainbow screen and ACT LED flashes three times, then a pause and then it repeats. The flashes are very fast, maybe 100ms apart, then about one second pause.

With the new kernel, the OS doesn't boot. Pi is stuck at the rainbow screen and ACT LED flashes three times, then a pause and then it repeats. The flashes are very fast, maybe 100ms apart, then about one second pause.
lee.miller force-pushed kernel from d9524b19d5 to 66393f6aa1 2023-11-24 21:51:12 +01:00 Compare
Owner

Do you want me to test the latest change?

Do you want me to test the latest change?
Author
Collaborator

Do you want me to test the latest change?

Yes, if you have spare time. Currently I'm building a similar image for my rpi. The goal is to check if the vanilla kernel is going to boot, because I see a difference between the .config generated in SDK by BuildKernel and that found in the imagebuilder dir.

> Do you want me to test the latest change? Yes, if you have spare time. Currently I'm building a similar image for my rpi. The goal is to check if the vanilla kernel is going to boot, because I see a difference between the `.config` generated in SDK by `BuildKernel` and that found in the imagebuilder dir.
lee.miller force-pushed kernel from 66393f6aa1 to 82b5291a27 2023-11-26 23:03:43 +01:00 Compare
Author
Collaborator

Do you want me to test the latest change?

Yes, if you have spare time. Currently I'm building a similar image for my rpi. The goal is to check if the vanilla kernel is going to boot, because I see a difference between the .config generated in SDK by BuildKernel and that found in the imagebuilder dir.

Mine boots, so it's probably a config issue.

> > Do you want me to test the latest change? > > Yes, if you have spare time. Currently I'm building a similar image for my rpi. The goal is to check if the vanilla kernel is going to boot, because I see a difference between the `.config` generated in SDK by `BuildKernel` and that found in the imagebuilder dir. Mine boots, so it's probably a config issue.
Owner

Tried the latest one, still doesn't work. I tried to boot it from an SD card as well and the result is basically the same, there is just an additional reboot in the cycle.

Tried the latest one, still doesn't work. I tried to boot it from an SD card as well and the result is basically the same, there is just an additional reboot in the cycle.
Author
Collaborator

Mine boots, so it's probably a config issue.

Oh, I see, the kernel for rpi is not in build_dir/target-${PKG_ARCH}/linux-${OPENWRT_TARGET}_${OPENWRT_DEVICE}. For packages PKG_ARCH=arm_arm1176jzf-s_vfp, but in this sentence it should've been PKG_ARCH=arm_arm1176jzf-s+vfp_musl_eabi. So I used the stock kernel for my rpi builds :(

> Mine boots, so it's probably a config issue. Oh, I see, the kernel for rpi is not in `build_dir/target-${PKG_ARCH}/linux-${OPENWRT_TARGET}_${OPENWRT_DEVICE}`. For packages `PKG_ARCH=arm_arm1176jzf-s_vfp`, but in this sentence it should've been `PKG_ARCH=arm_arm1176jzf-s+vfp_musl_eabi`. So I used the stock kernel for my rpi builds :(
lee.miller force-pushed kernel from 82b5291a27 to e533892391 2023-11-29 00:32:17 +01:00 Compare
Author
Collaborator

Tried the latest one, still doesn't work. I tried to boot it from an SD card as well and the result is basically the same, there is just an additional reboot in the cycle.

This is strange. The latest image should contain a stock kernel, because kernel-custom failed to build: https://buildbot.bitmessage.org/#/builders/33/builds/18817/steps/3/logs/stdio (line 5670).

When I build the kernel for my rpi with the NVME settings, I'm getting this:

make[3]: Entering directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2708_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-5.10.146'
  SYNC    include/config/auto.conf.cmd
  HOSTCC  scripts/kconfig/conf.o
  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/util.o
  HOSTLD  scripts/kconfig/conf
drivers/mtd/Kconfig:30: can't open file "drivers/mtd/mtdsplit/Kconfig"
make[5]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1
make[4]: *** [Makefile:603: syncconfig] Error 2
Makefile:698: include/config/auto.conf.cmd: No such file or directory
make[3]: *** [Makefile:721: include/config/auto.conf.cmd] Error 2
make[3]: Leaving directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2708_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-5.10.146'
make[2]: *** [Makefile:67: /openwrt-sdk-22.03.2-bcm27xx-bcm2708_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-5.10.146/.modules] Error 2
> Tried the latest one, still doesn't work. I tried to boot it from an SD card as well and the result is basically the same, there is just an additional reboot in the cycle. This is strange. The latest image should contain a stock kernel, because kernel-custom failed to build: https://buildbot.bitmessage.org/#/builders/33/builds/18817/steps/3/logs/stdio (line 5670). When I build the kernel for my rpi with the NVME settings, I'm getting this: ``` make[3]: Entering directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2708_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-5.10.146' SYNC include/config/auto.conf.cmd HOSTCC scripts/kconfig/conf.o 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/util.o HOSTLD scripts/kconfig/conf drivers/mtd/Kconfig:30: can't open file "drivers/mtd/mtdsplit/Kconfig" make[5]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1 make[4]: *** [Makefile:603: syncconfig] Error 2 Makefile:698: include/config/auto.conf.cmd: No such file or directory make[3]: *** [Makefile:721: include/config/auto.conf.cmd] Error 2 make[3]: Leaving directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2708_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-5.10.146' make[2]: *** [Makefile:67: /openwrt-sdk-22.03.2-bcm27xx-bcm2708_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-5.10.146/.modules] Error 2 ```
Author
Collaborator

Tried the latest one, still doesn't work. I tried to boot it from an SD card as well and the result is basically the same, there is just an additional reboot in the cycle.

This is strange. The latest image should contain a stock kernel, because kernel-custom failed to build: https://buildbot.bitmessage.org/#/builders/33/builds/18817/steps/3/logs/stdio (line 5670).

Hmm, it looks like the kernel was built despite of the error, because there is no error after the line cp /var/lib/buildbot/workers/default/multibuild_child/build/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/vmlinux build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/rpi-4-kernel.bin

> > Tried the latest one, still doesn't work. I tried to boot it from an SD card as well and the result is basically the same, there is just an additional reboot in the cycle. > > This is strange. The latest image should contain a stock kernel, because kernel-custom failed to build: https://buildbot.bitmessage.org/#/builders/33/builds/18817/steps/3/logs/stdio (line 5670). Hmm, it looks like the kernel was built despite of the error, because there is no error after the line `cp /var/lib/buildbot/workers/default/multibuild_child/build/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/vmlinux build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/rpi-4-kernel.bin`
Owner
Check if this recent post helps: https://forum.openwrt.org/t/guide-how-to-tweak-the-kernel-configuration-to-optimize-it-for-a-specific-device-sub-target-without-breaking-the-kernel-full-build-script-included/181051
Author
Collaborator

Check if this recent post helps: https://forum.openwrt.org/t/guide-how-to-tweak-the-kernel-configuration-to-optimize-it-for-a-specific-device-sub-target-without-breaking-the-kernel-full-build-script-included/181051

# clone openwrt repo and cd to openwrt buildroot
git clone https://github.com/openwrt/openwrt.git

This uses the full source - the environment where the kernel is supposed to be built. I had no problem building kernel from the full source.

> Check if this recent post helps: https://forum.openwrt.org/t/guide-how-to-tweak-the-kernel-configuration-to-optimize-it-for-a-specific-device-sub-target-without-breaking-the-kernel-full-build-script-included/181051 ``` # clone openwrt repo and cd to openwrt buildroot git clone https://github.com/openwrt/openwrt.git ``` This uses the full source - the environment where the kernel is supposed to be built. I had no problem building kernel from the full source.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u kernel:lee.miller-kernel
git checkout lee.miller-kernel
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Sysdeploy/openwrt#60
No description provided.