How to compile realtime kernel on aarch64 pi4

Discussion about U-Boot and the kernel.

Re: How to compile realtime kernel on aarch64 pi4

Postby graysky » Tue Oct 06, 2020 3:07 pm

$this->bbcode_second_pass_quote('tombrear', 'u')se df -h
/dev/mmcvbl0p1 253M 55M 198M 22% /boot
/dev/sdb2 59G. 7.5G. 48G. 14%. /home/pi/root


I do not know what would cause the mkinitcpio error... as an aside, is the output above from another machine with the SD card mounted to it?
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: How to compile realtime kernel on aarch64 pi4

Postby tombrear » Tue Oct 06, 2020 5:00 pm

And I tried to use arch7l pi4 and use the template which graysky recommend. Just change _commit=e2e9cec6fb061ba58304fd391ef76747f2963557 to change kernel to 4.19.y_rt.
here is error.
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x8): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x1c): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:99: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:544: scripts/dtc] Error 2
make: *** [Makefile:1061: scripts] Error 2
==> ERROR: A failure occurred in build().
Aborting...
tombrear
 
Posts: 17
Joined: Sun Oct 04, 2020 3:29 pm

Re: How to compile realtime kernel on aarch64 pi4

Postby tombrear » Wed Oct 07, 2020 5:57 am

cp: cannot stat 'arch/arm/boot/dts/overlays/README': No such file or directory
==> ERROR: A failure occurred in package_linux-raspberrypi4().
using raspberry kernel r.4.19.y_rt to compile.
tombrear
 
Posts: 17
Joined: Sun Oct 04, 2020 3:29 pm

Re: How to compile realtime kernel on aarch64 pi4

Postby tombrear » Wed Oct 07, 2020 9:41 am

Finally I made process complete. But after reboot, the screen is blank. QQ
It's really hard to make realtime kernel 4.19.y_rt
tombrear
 
Posts: 17
Joined: Sun Oct 04, 2020 3:29 pm

Re: How to compile realtime kernel on aarch64 pi4

Postby graysky » Wed Oct 07, 2020 10:58 am

You're switching from the 5.4.y tree to 4.19.y tree. That particular branch hasn't been updated in since Dec of 2019. Additionally, there will be many changes needed to the config and potentially to other files/packages (boot loader maybe?). Recommend you stay within the 5.4.y tree if possible. Again, I do not know what is needed for a real time config.

EDIT: just googling gave this https://wiki.linuxfoundation.org/realtime/start

Perhaps you can apply it and adjust the config (add make oldconfig before building) and achieve what you want?
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: How to compile realtime kernel on aarch64 pi4

Postby mrtux » Thu Oct 08, 2020 5:12 am

You can use a PKGBUILD as suggested, and they are compatible with Arch on any architecture, your makepkg.conf file depicts what to build it for, for the most part anyway. The commands I listed earlier will still be needed in your package build though. Are you running mkinitcpio as root or a regular user? And also, is your /boot in the fstab file? If it is mounted read only you won't be able to write to it. If you build your own RT kernel you will definitely need the patch I linked, after applying it too will see the RT options listed in the preemption options configuring the kernel. As I mentioned a PKGBUILD would be the most ideal but if you have never built kernels or packages for the matter, it may be easier to test build them before trying to work out compiling them as a well as a PKGBUILD to package and install them. There were some nice changes for Pi's in the 5.8 kernels, I would recommend modifying the PKGBUILD to use the newer kernels opposed to the 4.19 kernels. I can build an RT kernel for you so you can get your stuff going but I will not be able to update it weekly and you'd need to sort out how exactly you want to keep it up to date. If you would like me to do that send me your kernel config file or I can use the default Arch config. The config file I use is trimmed of all other devices and only supports the Pi 4, not certain it would have all needed modules for what you are trying to accomplish.
mrtux
 
Posts: 32
Joined: Wed Aug 12, 2020 4:06 am

Re: How to compile realtime kernel on aarch64 pi4

Postby mrtux » Thu Oct 08, 2020 5:20 am

Whoops, sorry I did not see there was a page 2 and missed some stuff that happened. Not sure if my post was helpful at all, but I agree with what Graysky is saying. The 4.19 and 5.xx kernels use different methods of booting, again as Graysky mentioned. The 4.19 kernel uses the overlays folder and the newer kernels use a dtbs folder for the device tree overlays. So the PKGBUILD will need to be changed a bit to work for the newer kernel.
mrtux
 
Posts: 32
Joined: Wed Aug 12, 2020 4:06 am

Re: How to compile realtime kernel on aarch64 pi4

Postby tombrear » Sun Oct 11, 2020 6:13 am

$this->bbcode_second_pass_code('', '==> Installing linux-raspberrypi-dsd package group with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...
:: linux-raspberrypi-dsd and linux-aarch64 are in conflict (linux). Remove linux-aarch64? [y/N] y

Packages (3) linux-aarch64-5.8.9-2 [removal] linux-raspberrypi-dsd-4.19.127.rt-5 linux-raspberrypi-dsd-headers-4.19.127.rt-5

Total Installed Size: 88.19 MiB
Net Upgrade Size: -46.90 MiB

:: Proceed with installation? [Y/n] Y
(2/2) checking keys in keyring [########################################################################################] 100%
(2/2) checking package integrity [########################################################################################] 100%
(2/2) loading package files [########################################################################################] 100%
(2/2) checking for file conflicts [########################################################################################] 100%
error: failed to commit transaction (conflicting files)
linux-raspberrypi-dsd: /boot/config.txt exists in filesystem (owned by uboot-raspberrypi)
Errors occurred, no packages were upgraded.
==> WARNING: Failed to install built package(s).')

This is most close one. But It said it's conflict. Just don't know whay?
tombrear
 
Posts: 17
Joined: Sun Oct 04, 2020 3:29 pm

Re: How to compile realtime kernel on aarch64 pi4

Postby mrtux » Mon Oct 12, 2020 2:04 am

It is because the file is owned by uboot-raspberrypi. You should make a full backup of your /boot to another computer, so in the event it borks your Pi, you can put the SD card in your other computer and restore the /boot with the default kernel. You could force the package upgrade, or just remove the files in your /boot (after backing them up of course!)
I have built a 5.6.19 version as realtime since that was the latest the patches were for, besides the 5.9-rc8 kernel which I don't have any experience with and not sure if it works or not. You are welcome to try this kernel, but again, please backup for your boot files in case it does not work. I did not test the RT kernel. It is the same config i use for my pi besides changed to RT full preemption.
https://www.dropbox.com/s/hbot9rffewd6n ... ar.gz?dl=0
mrtux
 
Posts: 32
Joined: Wed Aug 12, 2020 4:06 am

Re: How to compile realtime kernel on aarch64 pi4

Postby tombrear » Mon Oct 12, 2020 5:17 am

Thanks for providing realtime pkg. I would try it.
And I also removed config.txt and make it force to upgrade. After reboot, it just crushed. QQ
Could you also provide your kernel build git repository. Let me could repeat your process? Thanks again.
tombrear
 
Posts: 17
Joined: Sun Oct 04, 2020 3:29 pm

PreviousNext

Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 9 guests