View previous topic :: View next topic |
Author |
Message |
ROGA Tux's lil' helper


Joined: 17 Feb 2018 Posts: 110 Location: Zurich, Switzerland
|
Posted: Fri Dec 27, 2019 3:42 pm Post subject: [SOLVED] Raspberry Pi4 how to Kernel upgrade |
|
|
Hi,
I could successful install Gentoo on a Raspberry Pi 4 with this guide and this guide.
For my first installation I Fetched the Kernel Version rspi-4.19.y from the Git-Hub Repository and cross-compiled it. All worked well and my Pi could afterwards boot successfully.
Later I saw that there are other branch version of the kernel so I would tried to upgrade the kernel to the version rpi-4.20.y.
I did following on my pc:
Code: | root@gentoo ~/RaspberryPi/linux # git checkout rpi-4.20.y
Checking out files: 100% (12834/12834), done.
Switched to a new branch 'rpi-4.20.y'
|
then I updated the .config file
Code: | root@gentoo ~/RaspberryPi/linux # ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make olddefconfig |
after that I compiled and installed the new kernel
Code: | root@gentoo ~/RaspberryPi/linux # ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make -j9
root@gentoo ~/RaspberryPi/linux # cp ~/RaspberryPi/linux/arch/arm64/boot/Image /mnt/gentoo/boot/kernel8.img |
and installed the associated kernel-modules.
Code: | root@gentoo ~/RaspberryPi/linux # ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make modules_install INSTALL_MOD_PATH=/mnt/gentoo |
I then put the microSD in my raspberry pi 4 and booted it but it doesn't boot anymore.
Does this branch version not work? Or do I had made a wrong step?
I am very grateful for any information. _________________ regards,
Roland
Last edited by ROGA on Fri Dec 27, 2019 5:15 pm; edited 1 time in total |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47163 Location: 56N 3W
|
Posted: Fri Dec 27, 2019 3:52 pm Post subject: |
|
|
ROGA,
When you checked out rpi-4.20.y, it came with a new bcm2711_defconfig. You should use that as your starting point.
I don't know what Code: | ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make olddefconfig | does inside a git checkout.
If you copy the old .config outside of git, do the checkout, then move the old .config back to the kernel, I would be more confident that make olddefconfig would do what you were expecting.
There is a working rpi-5.4.y branch now too, so its time to migrate to that. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
ROGA Tux's lil' helper


Joined: 17 Feb 2018 Posts: 110 Location: Zurich, Switzerland
|
Posted: Fri Dec 27, 2019 4:35 pm Post subject: |
|
|
NeddySeagoon,
I did what you recommended and also migrate to the newest branch version 5.4.y and really it works now!
Thank you very much!!!!! _________________ regards,
Roland |
|
Back to top |
|
 |
ROGA Tux's lil' helper


Joined: 17 Feb 2018 Posts: 110 Location: Zurich, Switzerland
|
Posted: Fri Dec 27, 2019 6:45 pm Post subject: |
|
|
Hi NeddySeagoon,
it sems that the new branch kernel version 5.4.y has a problem with the onboard nic. I couldn't see a nic anymore after migration.
I don't have any Idea, how I could solve this problem
lspci and lsusb don't show me a nic-card, stange! _________________ regards,
Roland |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47163 Location: 56N 3W
|
Posted: Fri Dec 27, 2019 6:57 pm Post subject: |
|
|
ROGA,
It works here. Did you use the correct .dtb?
Only the USB3 is on a PCIe lane. The LAN is on its own Broadcom link.
My Pi4 kernel binary is on my server.
bcm2711-rpi-4-b.dtb_64 is the 64 bit device tree.
kernel-5.4.3-v8+ is the kernel binary.
config.txt sets up things the way I like and loads the above files by name
5.4.3-v8+.tbz2 is a tarball of the kernel modules.
It needs to be untarred to /lib/modules/ on the Pi. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
ROGA Tux's lil' helper


Joined: 17 Feb 2018 Posts: 110 Location: Zurich, Switzerland
|
Posted: Fri Dec 27, 2019 8:50 pm Post subject: |
|
|
NeddySeagoon,
Good to hear that, I remain confident
Quote: | Did you use the correct .dtb? |
Ohh, I used the same .dtb file as with kernel 4.19.y. I didn't realize that the new kernel version brings a new .dtb file. I did think that this could be the same file for all kernel versions.
That was my problem, thanks for this hint.
Now I have kernel 5.4.y and it works with network. But I had to install the branch kernel 5.4.y from the scratch.
What I need to know is the exact procedure to migrate to newer kernel without losing my old .config
btw: your config.txt file is a great example! That's a good way to handle with multiple kernel version and .dtb files. _________________ regards,
Roland |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47163 Location: 56N 3W
|
Posted: Fri Dec 27, 2019 9:02 pm Post subject: |
|
|
ROGA,
I start with the bcm2711_defconfig for every kernel as I only make one or two changes.
If you make lots of changes, then in worth preserving your .config outside of git.
Do the git pull or git checkout to update your copy of the repo.
Restore the .config inside the repo
Then Code: | ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make oldconfig | to update the .config for the new kernel.
The dtb does not change much but the Pi4 is still new so its important to keep a matching kernel/dtb set.
Mostly, the old dtb will be fine but not always :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
ROGA Tux's lil' helper


Joined: 17 Feb 2018 Posts: 110 Location: Zurich, Switzerland
|
Posted: Fri Dec 27, 2019 9:24 pm Post subject: |
|
|
Thank's NeddySeagoon,
I will try your suggestions the next time, when a new version will be released. For safety I wrote down the steps in my wiki
In the meantime, I now will build my Raspberry Pi 3+ with gentoo. Hopefully it will work too  _________________ regards,
Roland |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47163 Location: 56N 3W
|
Posted: Fri Dec 27, 2019 9:31 pm Post subject: |
|
|
ROGA,
The same userland works on both Pi3s and the Pi4
You need a different kernel and dtb depending on the version.
config.txt understands some filers. bootcode.bin can determine what Pi its running on, so you can make one SD card that will boot on any Pi.
That is left as an exercise for the reader :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
ROGA Tux's lil' helper


Joined: 17 Feb 2018 Posts: 110 Location: Zurich, Switzerland
|
Posted: Fri Dec 27, 2019 9:57 pm Post subject: |
|
|
NeddySeagoon,
Quote: | so you can make one SD card that will boot on any Pi |
hey, that sounds great! I will take on this challenge.  _________________ regards,
Roland |
|
Back to top |
|
 |
|