Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] 16K page kernel on a raspberry PI 5
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
thegrind
n00b
n00b


Joined: 22 Sep 2024
Posts: 20

PostPosted: Mon Oct 07, 2024 7:35 pm    Post subject: [SOLVED] 16K page kernel on a raspberry PI 5 Reply with quote

I followed the wiki page to install Gentoo a RPI5 but for some reason it's not using the 16k kernel. As uname -r returns 6.6.50-v8+
. I downloaded the stage 3 for arm64 openrc and modified the config.txt to load the dtoverlay=vc4-kms-v3d-pi5. I did the mkswap for 16k and it gave me errors so I had to remake it with 4K. I am running headless for kodi using gbm.

Everything works well. Wifi bluetooth networking. I can't figure out where I went wrong on the kernel and how to fix it.


Last edited by thegrind on Tue Oct 08, 2024 2:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 653

PostPosted: Mon Oct 07, 2024 8:35 pm    Post subject: Reply with quote

Meh, Pi's be a law unto themselves.
What do your [insert prefix DuJour]*/cmdline.txt and [insert prefix DuJour]*/config.txt look like?

*Why [prefix DuYesterJour]/cmdline.txt and [prefix DuYesterJour]/config.txt aren't just fscking symlinks instead of a condescending lecture annoys me, and no "because fat" isn't an argument, it's the invalid excuse of a lazy peon**.

**Sorry, using Debian takes it toll...
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5095
Location: Bavaria

PostPosted: Mon Oct 07, 2024 9:14 pm    Post subject: Reply with quote

Moved from Kernel & Hardware to Gentoo on ARM.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
thegrind
n00b
n00b


Joined: 22 Sep 2024
Posts: 20

PostPosted: Mon Oct 07, 2024 9:36 pm    Post subject: Reply with quote

Thanks for the help.

Here is my cmdline.txt

Code:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait


Here is my config.txt

Code:

# have a properly sized image
disable_overscan=1

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

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d-pi5
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1242
Location: Richmond Hill, Canada

PostPosted: Mon Oct 07, 2024 10:32 pm    Post subject: Reply with quote

thegrind,

Quote:
I followed the wiki page to install Gentoo a RPI5...
Which wiki page?
Back to top
View user's profile Send private message
thegrind
n00b
n00b


Joined: 22 Sep 2024
Posts: 20

PostPosted: Mon Oct 07, 2024 10:36 pm    Post subject: Reply with quote

https://wiki.gentoo.org/wiki/How_to_install_Gentoo_on_Raspberry_Pi_5
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Oct 08, 2024 1:18 am    Post subject: Reply with quote

I followed this one last week, Raspberry Pi Install Guide to install Gentoo on this Pi 5.

My cmdline.txt for that Pi is
Code:
dwc_otg.lpm_enable=0 console=tty root=PARTUUID=c22a8b8b-0dda-47c7-b0c1-07a4c3ddb852 rootfstype=ext4 rootwait cma=256M@256M net.ifnames=0 usbhid.mousepoll=0

I added the mousepoll part to fix my Razer mouse, I also used the root PARTUUID, otherwise it is as found in the guide.
The config.txt
Code:

# If using arm64 on a Pi3, select a 64 bit kernel
arm_64bit=1

# have a properly sized image
disable_overscan=1

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

# Enable DRM VC4 V3D (graphics) driver
dtoverlay=vc4-kms-v3d


I did a Pi 5 install back in February on another. That one and this one both are,
Code:
~ # uname -r
6.6.51-v8-16k+


The first few lines of dmesg are;
Code:
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x414fd0b1]
[    0.000000] Linux version 6.6.51-v8-16k+ (dom@buildbot) (aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1799 SMP PREEMPT Thu Sep 26 16:13:21 BST 2024
[    0.000000] KASLR enabled
[    0.000000] random: crng init done
[    0.000000] Machine model: Raspberry Pi 5 Model B Rev 1.0


I don't remember having any issue on either one when creating the correct swap using
Code:
root #mkswap --pagesize 16384 /dev/sdi2
as found in the guide I listed.

Does your dmesg identify the device as a Pi 5? I thought the magic to select the kernel happened in the gpu during boot and it needed the correct swap partition to boot the correct kernel. But, that could be verified by someone other than me.

Best Regards.
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Oct 08, 2024 1:23 am    Post subject: Reply with quote

Additionally, I have an M1 (Apple Silicon arm) MacBookPro, and used that with Gentoo in a vm to write to the sd card, and, sneak in a chroot to emerge all of my software after the regular install.

The one in February, I installed all of it natively to an nvme booted from RPIos in the sd card slot.
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Oct 08, 2024 1:53 am    Post subject: Reply with quote

I think you can just use swapoff, and then try the
Code:
root #mkswap --pagesize 16384 /dev/xxx
command on your swap partition. After that then swapon and reboot.
Back to top
View user's profile Send private message
thegrind
n00b
n00b


Joined: 22 Sep 2024
Posts: 20

PostPosted: Tue Oct 08, 2024 5:08 am    Post subject: Reply with quote

Thanks for the help.

I went to another computer (x86_64) and put the microSD card in the USB adapter and typed mkswap --pagesize 16384 /dev/sdc2. Do i have to do this on an arm64 computer? I originally did the install from my x86-64 computer.

I then put it my Rpi and it gives me a pagesize mismatch error for swap and the swap doesn't mount. I also get an error of unable to find swap-space signature in dmesg.

I take the microSD back out and do a mkswap /dev/sdc2 and it makes 4K page size. This mounts without issue and shows it as being mount to the point in my fstab.
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Oct 08, 2024 6:27 am    Post subject: Reply with quote

This is from the Pi documentation. https://www.raspberrypi.com/documentation/computers/config_txt.html#kernel
Quote:

kernel

kernel is the alternative filename on the boot partition for loading the kernel. The default value on the Raspberry Pi 1, Zero and Zero W, and Raspberry Pi Compute Module 1 is kernel.img. The default value on the Raspberry Pi 2, 3, 3+ and Zero 2 W, and Raspberry Pi Compute Modules 3 and 3+ is kernel7.img. The default value on the Raspberry Pi 4 and 400, and Raspberry Pi Compute Module 4 is kernel8.img, or kernel7l.img if arm_64bit is set to 0.

The Raspberry Pi 5 firmware defaults to loading kernel_2712.img because this image contains optimisations specific to Raspberry Pi 5 (e.g. 16K page-size). If this file is not present, then the common 64-bit kernel (kernel8.img) will be loaded instead.


Notice that it wants to load the kernel_2712.img file.

This is what I have in /boot after following the guide I listed.
Code:
/boot # ls
bcm2708-rpi-b.dtb       bcm2710-rpi-3-b.dtb       bcm2711-rpi-cm4s.dtb        config.txt     fixup_x.dat       start4db.elf
bcm2708-rpi-b-plus.dtb  bcm2710-rpi-3-b-plus.dtb  bcm2712d0-rpi-5-b.dtb       COPYING.linux  kernel_2712.img   start4.elf
bcm2708-rpi-b-rev1.dtb  bcm2710-rpi-cm3.dtb       bcm2712-rpi-5-b.dtb         fixup4cd.dat   kernel7.img       start4x.elf
bcm2708-rpi-cm.dtb      bcm2710-rpi-zero-2.dtb    bcm2712-rpi-cm5-cm4io.dtb   fixup4.dat     kernel7l.img      start_cd.elf
bcm2708-rpi-zero.dtb    bcm2710-rpi-zero-2-w.dtb  bcm2712-rpi-cm5-cm5io.dtb   fixup4db.dat   kernel8.img       start_db.elf
bcm2708-rpi-zero-w.dtb  bcm2711-rpi-400.dtb       bcm2712-rpi-cm5l-cm4io.dtb  fixup4x.dat    kernel.img        start.elf
bcm2709-rpi-2-b.dtb     bcm2711-rpi-4-b.dtb       bcm2712-rpi-cm5l-cm5io.dtb  fixup_cd.dat   LICENCE.broadcom  start_x.elf
bcm2709-rpi-cm2.dtb     bcm2711-rpi-cm4.dtb       bootcode.bin                fixup.dat      overlays
bcm2710-rpi-2-b.dtb     bcm2711-rpi-cm4-io.dtb    cmdline.txt                 fixup_db.dat   start4cd.el


kernel_2712.img does exist in my /boot, is it in yours?

Also, does dmesg show the "Machine model: Raspberry Pi 5 Model B Rev 1.0" entry found in mine?
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Oct 08, 2024 6:55 am    Post subject: Reply with quote

From the Pi documentation I cited it seems that adding
Code:
kernel=kernel_2712.img
to config.txt would be the way to force that kernel.

Finally, for now, do you have an sd card with RPIos on it, and does it boot into the expected kernel?
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1242
Location: Richmond Hill, Canada

PostPosted: Tue Oct 08, 2024 12:46 pm    Post subject: Reply with quote

thegrind wrote:
https://wiki.gentoo.org/wiki/How_to_install_Gentoo_on_Raspberry_Pi_5


In the wiki, it talk about building kernel in two different way. The wiki focus on using pre-build kernel. But it is unclear which way you do your kernel. So please share how you choose kernel?

Your posted config.txt show no reference to kernel image file. So is the posted config.txt everything or you only posted part of it?

What is in /boot and /boot/firmware?

Also which kernel source you use?
Back to top
View user's profile Send private message
thegrind
n00b
n00b


Joined: 22 Sep 2024
Posts: 20

PostPosted: Tue Oct 08, 2024 2:11 pm    Post subject: Reply with quote

I am using the prebuilt as I didn't emerge my own kernel.

I looked in my /boot directory and I was missing the kernel_2712.img as I had the kernel8.img only. Also, the wiki didn't mention anything about moving the kernel_2712.img to the /boot directory.

Fortunately I kept the git clone directories and I still had the kernel_2712.img in the directory. I moved this to the boot and I had to make the swap proper pagesize and I rebooted and did a uname -r and now I have the 16K kernel loading. Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum