Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting a 32bit Gentoo System from RPI4 running on RPI5
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
tbc233
n00b
n00b


Joined: 03 May 2004
Posts: 11

PostPosted: Tue Feb 27, 2024 1:41 pm    Post subject: Getting a 32bit Gentoo System from RPI4 running on RPI5 Reply with quote

I have a small, well maintained and up to date Gentoo system that i use for years. It's a 32bit sytem, just to say.

The kernel and modules I usualy get from https://github.com/raspberrypi/firmware and keep it up to date regularly.

Upgrading from Raspberry 3 to 4 was quite easy. I just once again got the new kernel from github it booted perfectly.

Now, years later, I wanted to do the same with the raspberry 5. But it does not boot. Keeps telling me "no working init found" and "/sbin/init exists but can't execute it (error -22).

Isn't the new Rapsberry 5 able to execute my binaries? Is there anything I can do beside building everything new from scratch?

Thanks in advance for any hint.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54258
Location: 56N 3W

PostPosted: Tue Feb 27, 2024 2:01 pm    Post subject: Reply with quote

tbc233,

What do you have in /boot?
Code:
ls -l /boot

What is in /boot/config.sys

What does
Code:
file /sbin/init
say for the Pi /sbin/init ?
There is no need to run that on the Pi.

It theory, you can run a 32 bit userland on top of a 64bit kernel but I've never tried it on the Pi5.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
tbc233
n00b
n00b


Joined: 03 May 2004
Posts: 11

PostPosted: Tue Feb 27, 2024 2:13 pm    Post subject: Reply with quote

ls -l /boot

Code:
total 63232
-rwxr-xr-x 1 root root   18693 Feb 23 16:55 COPYING.linux
-rwxr-xr-x 1 root root    1594 Feb 23 16:55 LICENCE.broadcom
-rwxr-xr-x 1 root root   29578 Feb 23 16:55 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root   28937 Feb 23 16:55 bcm2708-rpi-b-rev1.dtb
-rwxr-xr-x 1 root root   29275 Feb 23 16:55 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root   29018 Feb 23 16:55 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root   30755 Feb 23 16:55 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x 1 root root   28888 Feb 23 16:55 bcm2708-rpi-zero.dtb
-rwxr-xr-x 1 root root   31272 Feb 23 16:55 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root   31195 Feb 23 16:55 bcm2709-rpi-cm2.dtb
-rwxr-xr-x 1 root root   31401 Feb 23 16:55 bcm2710-rpi-2-b.dtb
-rwxr-xr-x 1 root root   34228 Feb 23 16:55 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root   33593 Feb 23 16:55 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root   31312 Feb 23 16:55 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root   32570 Feb 23 16:55 bcm2710-rpi-zero-2-w.dtb
-rwxr-xr-x 1 root root   32570 Feb 23 16:55 bcm2710-rpi-zero-2.dtb
-rwxr-xr-x 1 root root   54809 Feb 23 16:55 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root root   54813 Feb 23 16:55 bcm2711-rpi-400.dtb
-rwxr-xr-x 1 root root   38349 Feb 23 16:55 bcm2711-rpi-cm4-io.dtb
-rwxr-xr-x 1 root root   55449 Feb 23 16:55 bcm2711-rpi-cm4.dtb
-rwxr-xr-x 1 root root   52228 Feb 23 16:55 bcm2711-rpi-cm4s.dtb
-rwxr-xr-x 1 root root   75445 Feb 23 16:55 bcm2712-rpi-5-b.dtb
-rwxr-xr-x 1 root root   75389 Feb 23 16:55 bcm2712-rpi-cm5-cm4io.dtb
-rwxr-xr-x 1 root root   75381 Feb 23 16:55 bcm2712-rpi-cm5-cm5io.dtb
-rwxr-xr-x 1 root root   75429 Feb 23 16:55 bcm2712d0-rpi-5-b.dtb
-rwxr-xr-x 1 root root   52476 Feb 23 16:55 bootcode.bin
-rwxr-xr-x 1 root root     170 Mar  8  2023 cmdline.txt
-rwxr-xr-x 1 root root     179 Sep 27  2022 config.txt
-rwxr-xr-x 1 root root    7277 Feb 23 16:55 fixup.dat
-rwxr-xr-x 1 root root    5412 Feb 23 16:55 fixup4.dat
-rwxr-xr-x 1 root root    3182 Feb 23 16:55 fixup4cd.dat
-rwxr-xr-x 1 root root    8401 Feb 23 16:55 fixup4db.dat
-rwxr-xr-x 1 root root    8401 Feb 23 16:55 fixup4x.dat
-rwxr-xr-x 1 root root    3182 Feb 23 16:55 fixup_cd.dat
-rwxr-xr-x 1 root root   10244 Feb 23 16:55 fixup_db.dat
-rwxr-xr-x 1 root root   10246 Feb 23 16:55 fixup_x.dat
-rwxr-xr-x 1 root root 7092888 Feb 23 16:55 kernel.img
-rwxr-xr-x 1 root root 7443384 Feb 23 16:55 kernel7.img
-rwxr-xr-x 1 root root 7864976 Feb 23 16:55 kernel7l.img
-rwxr-xr-x 1 root root 9307035 Feb 23 16:55 kernel8.img
-rwxr-xr-x 1 root root 9307497 Feb 23 16:55 kernel_2712.img
drwxr-xr-x 2 root root   32768 Feb 23 16:55 overlays
-rwxr-xr-x 1 root root 2979296 Feb 23 16:55 start.elf
-rwxr-xr-x 1 root root 2255072 Feb 23 16:55 start4.elf
-rwxr-xr-x 1 root root  808124 Feb 23 16:55 start4cd.elf
-rwxr-xr-x 1 root root 3751944 Feb 23 16:55 start4db.elf
-rwxr-xr-x 1 root root 3002696 Feb 23 16:55 start4x.elf
-rwxr-xr-x 1 root root  808124 Feb 23 16:55 start_cd.elf
-rwxr-xr-x 1 root root 4823848 Feb 23 16:55 start_db.elf
-rwxr-xr-x 1 root root 3726408 Feb 23 16:55 start_x.elf


I don't have a config.sys - do you mean config.txt?

Code:
core_freq=450
sdram_freq=450
over_voltage=6
dtparam=i2c1=on
dtparam=i2c_arm=on

[all]
dtoverlay=disable-wifi
dtoverlay=disable-bt


file /sbin/init:
Code:
/sbin/init: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, stripped


whole system works perfectly on a RPI4 with newest kernel from github:

Code:
# uname -srv
Linux 6.6.18-v8+ #1736 SMP PREEMPT Fri Feb 23 15:37:38 GMT 2024
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54258
Location: 56N 3W

PostPosted: Tue Feb 27, 2024 4:35 pm    Post subject: Reply with quote

tbc233,

A long time ago in as operating system, far, far, away (MSDOS) config.sys was one of its configure files.
I must have been having flashbacks :)

The difference between the Pi4 and Pi5 for you is
Code:
-rwxr-xr-x 1 root root 9307035 Feb 23 16:55 kernel8.img
-rwxr-xr-x 1 root root 9307497 Feb 23 16:55 kernel_2712.img

Where kernel_2712.img has all the Pi5 optimisations.

Two things to try.

1. add
Code:
kernel kernel8.img
to config.txt so it boots the older kernel.
That kernel may be missing the RP1 IO chip support on the Pi5.
If that fails to boot, the fix is to revert config.txt.

2. investigate kernel_2712.img for 32 bit support and fix itif its missing.

Be aware that kernel8.img and kernel_2712.img use different page sizes.
That breaks swap and other things that are page size dependent.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
tbc233
n00b
n00b


Joined: 03 May 2004
Posts: 11

PostPosted: Wed Feb 28, 2024 6:39 am    Post subject: Reply with quote

Thank you for taking time for me.

Quote:
A long time ago in as operating system, far, far, away (MSDOS) config.sys was one of its configure files.
I must have been having flashbacks :)


I remember indeed ;-)
It was one of my first support cases when someone managed to get a whole letter to his wife into this file ;-) Made system somehow unbootable.

Quote:
kernel kernel8.img


That made it up and running. Everything is working with that img, I can't see any problems. Out of curiosity i merged some packages and the speed is amazing compared to the Pi 4, just by the way.

May I ask, how does the Pi decide which img to boot, when there is no "kernel=" line? Would like to understand that Raspberry boot phase a bit more. And still I really don't have an idea why this new RPi 5 Kernel doesn't like my binaries...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54258
Location: 56N 3W

PostPosted: Wed Feb 28, 2024 7:08 pm    Post subject: Reply with quote

tbc233,

The code that runs on the GPU to read /boot/config.txt has useful built in defaults.

On the Pi5, the default kernel is kernel_2712.img as it has all the Pi5 optimisations.
The Pi4 uses kernel8.img in 64 bit mode.

Every time a new model is added the rules to choose the default kernel are amended/updated/changed.
config.txt says

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.


Bookmark that document, it's well worth a read.

I wonder why kernel8.img supports 32 bit code but kernel_2712.img does not?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Wed Feb 28, 2024 10:28 pm    Post subject: Reply with quote

NeddySeagoon wrote:

I wonder why kernel8.img supports 32 bit code but kernel_2712.img does not?


Maybe it has to do with the page size for some reason?
Back to top
View user's profile Send private message
tbc233
n00b
n00b


Joined: 03 May 2004
Posts: 11

PostPosted: Thu Feb 29, 2024 6:08 am    Post subject: Reply with quote

For the moment I will leave at like this as I can't notice any negative side effects and I don't have time to build everything new from scratch.

But thank you so much for your 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