WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore kernel compile  (Read 2038 times)

Offline srg

  • Newbie
  • *
  • Posts: 6
piCore kernel compile
« on: November 10, 2022, 11:55:31 AM »
Hi all, I am trying to compile the kernel from "linux-5.10.77.tar.xz" as I need to make a change in the file "scsi_sysfs.c"
Everything seems to be going well, but when I mount everything, the raspberry does not start.
if I mount it again with the original kernel everything goes well, it's only when I replace "kernel51077v8.img"
I have a raspberry pi 3b+ with model "bcm2837b0" and I compile as follows:
Code: [Select]
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8
the resulting kernel is generated in "arch/arm64/boot/Image" and I also copy the file "arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b-plus.dtb" just in case
the whole process, although quite slow, is carried out without errors.

Can someone help me if I do something wrong?

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 711
Re: piCore kernel compile
« Reply #1 on: November 10, 2022, 12:10:35 PM »
Have you just forgot to tell config.txt what kernel bit version you use. 32/64
https://www.raspberrypi.com/documentation/computers/config_txt.html#arm_64bit
Maybe you used 32bit before.

Offline srg

  • Newbie
  • *
  • Posts: 6
Re: piCore kernel compile
« Reply #2 on: November 11, 2022, 02:12:19 AM »
This is config.txt:
Code: [Select]
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# RPi PI0-1-2 are not supported on this image.

[PI02]
initramfs rootfs-piCore64-13.1.gz,modules-5.10.77-piCore-v8.gz followkernel
kernel kernel51077v8.img
arm_64bit=1

[PI3]
initramfs rootfs-piCore64-13.1.gz,modules-5.10.77-piCore-v8.gz followkernel
kernel kernel51077v8.img
arm_64bit=1

[PI4]
initramfs rootfs-piCore64-13.1.gz,modules-5.10.77-piCore-v8.gz followkernel
kernel kernel51077v8.img
arm_64bit=1

[CM4]
otg_mode=1

[ALL]
cmdline cmdline.txt

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-kms-v3d-pi4
max_framebuffers=2

[all]
#dtoverlay=vc4-kms-v3d

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 711
Re: piCore kernel compile
« Reply #3 on: November 11, 2022, 02:57:17 AM »
My suggestion is to hook up some serial uart to the pi, to diagnose the problem.
If you have uart connection you can edit the the file that's boot the kernel pi, to see some more.

Here you go:

https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#bootcode-bin-uart-enable
https://www.raspberrypi.com/documentation/computers/config_txt.html#uart_2ndstage


Don't give up...
Make use of the power of compiling your "own" Linux kernel.
And of course the good documentation that raspberry pi gives us.
Oooohhh I forget to mention the great community. (like this forum)   
« Last Edit: November 11, 2022, 03:01:53 AM by patrikg »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1243
Re: piCore kernel compile
« Reply #4 on: November 14, 2022, 08:38:09 AM »
Hi all, I am trying to compile the kernel from "linux-5.10.77.tar.xz" as I need to make a change in the file "scsi_sysfs.c"
Everything seems to be going well, but when I mount everything, the raspberry does not start.
if I mount it again with the original kernel everything goes well, it's only when I replace "kernel51077v8.img"
I have a raspberry pi 3b+ with model "bcm2837b0" and I compile as follows:
Code: [Select]
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8
the resulting kernel is generated in "arch/arm64/boot/Image" and I also copy the file "arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b-plus.dtb" just in case
the whole process, although quite slow, is carried out without errors.

Can someone help me if I do something wrong?

You need to specify which defconfig to use.    You should be using    bcm2711_defconfig

Is that file part of a module?  If so, you just need to rebuild the module.


Offline srg

  • Newbie
  • *
  • Posts: 6
Re: piCore kernel compile
« Reply #5 on: November 29, 2022, 10:31:08 AM »
Sure enough, I tried "bcm2711_defconfig" and it worked!

Thank you!

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 711
Re: piCore kernel compile
« Reply #6 on: November 29, 2022, 11:23:52 AM »
Thank you for letting us know, that the problem is solved.