MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.83k stars 494 forks source link

Image | Raspberry Pi 5: Testing and firmware migration script #6676

Open TDuffinNTU opened 12 months ago

TDuffinNTU commented 12 months ago

ADMIN EDIT

First Raspberry Pi 5 testing images are available now on our download page: https://dietpi.com/#download You can also find images with the new kernel/firmware package set for other RPi models here: https://dietpi.com/downloads/images/testing/ The ones with the new firmware have "RPi1", "RPi2" and "RPi234" (64-bit) in their names. To migrate an existing system, use the migration script:

bash <(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/dev/.meta/dietpi-rpi-firmware-migration')

WARNING: This is currently a one-way ticket. dietpi-backup cannot be used to restore the old system, since the boot partition mount point has changed. If you want to be able to revert, create an image of the whole SD card/drive. dietpi-imager can be used from another DietPi (or Debian/Ubuntu) system, to minimise partition and filesystem automatically, to have a small compressed backup image.


Is the SBC officially supported by the Debian installer?

Notes

Joulinar commented 9 months ago

Does anyone else gets this weird kernel version error?

Where did you see that message?

matttttttttttttt commented 9 months ago

Does anyone else gets this weird kernel version error? I am not the only one (https://www.reddit.com/r/raspberry_pi/comments/18ptik1/weird_kernel_version_error/) When trying to update the kernel version I got this message:

as i wrote it there. Update via "sudo rpi-update" will do the job.

This worked for me. Thank you!

matttttttttttttt commented 9 months ago

Does anyone else gets this weird kernel version error?

Where did you see that message?

This came after applying the last homebridge update.

Joulinar commented 9 months ago

what is current kernel version you are running?

uname -a
matttttttttttttt commented 9 months ago
Linux DietPi 6.1.69-v8-16k+ #1711 SMP PREEMPT Thu Dec 21 14:32:15 GMT 2023 aarch64 GNU/Linux
Just2Confuse commented 9 months ago

Thats what we get after rpi-update

Linux Pi5 6.1.69-v8-16k+ #1711 SMP PREEMPT Thu Dec 21 14:32:15 GMT 2023 aarch64 GNU/Linux
Revision        : c04170
Serial          : **********
Model           : Raspberry Pi 5 Model B Rev 1.0
Throttled flag  : throttled=0x0
Camera          : vc_gencmd_read_response returned -1 error=1 error_msg="Command not registered"
matttttttttttttt commented 9 months ago

what is current kernel version you are running?

uname -a

By the way, the new firmware seems to dramatically improve performance:

DietPi Benchmark went from 1.99 seconds down to 1.72 seconds (@ 3 Ghz)

Screenshot 2024-01-03 at 11 20 34

Joulinar commented 9 months ago

hmm ok not sure but rpi-update will bump you to latest kernel version available on RPi kernel Github repository https://github.com/raspberrypi/linux . Current version is 6.1.70, wich is even higher than the one you have installed.

On the other hand side, latest official kernel available via apt source is 6.1.63 https://archive.raspberrypi.org/debian/pool/main/l/linux/

Can be checked as well via apt show linux-image-rpi-v8

Soo there is a difference between RPi Github repository and RPI apt source. I doubt using rpi-update is a real solution as it bump to a different kernel version, compare to what is available on RPi package server.

Just2Confuse commented 9 months ago

what is current kernel version you are running?

uname -a

By the way, the new firmware seems to dramatically improve performance:

DietPi Benchmark went from 1.99 seconds down to 1.72 seconds (@ 3 Ghz)

Not sure if i like to switch - but how did you get DietPi run on a Pi5?

Joulinar commented 9 months ago

but how did you get DietPi run on a Pi5?

Link is within the first post https://github.com/MichaIng/DietPi/issues/6676#issuecomment-1856412915

MichaIng commented 9 months ago

rpi-update probably does not ship the same files like the new kernel/firmware packages, and I guess it does not require the new partitioning either. Definitely cleaner to stay with APT packages unless you want to test a particular fix shipped with more recent kernel versions.

Joulinar commented 9 months ago

btw RPi developer still working on the new RPI5 kernel, as we already see on the kernel name 🙄

Good news, fan speed can be adjusted soon. 😄 Already working with a special kernel version https://github.com/raspberrypi/linux/commit/2c085a1ff40521ab89d8f1894757aa83b59b4607

Just tested and my RPi5 is running on full speed with low temp 🤣

 Temperature  |     44 °C / 111 °F : Optimal temperature
 Fan Speed    |     9055
Just2Confuse commented 9 months ago

btw RPi developer still working on the new RPI5 kernel, as we already see on the kernel name 🙄

Good news, fan speed can be adjusted soon. 😄 Already working with a special kernel version raspberrypi/linux@2c085a1

Nice. I just kicked out that original Raspi5 Case and take an active Case bei GeekPi. It is, like the original active Cooler quiet, all the time. The fan ist superquiet....the red/white original CaseFan is not worth the money.

Net0o commented 9 months ago

btw RPi developer still working on the new RPI5 kernel, as we already see on the kernel name 🙄 Good news, fan speed can be adjusted soon. 😄 Already working with a special kernel version raspberrypi/linux@2c085a1

Nice. I just kicked out that original Raspi5 Case and take an active Case bei GeekPi. It is, like the original active Cooler quiet, all the time. The fan ist superquiet....the red/white original CaseFan is not worth the money.

The original one is really disappointing. Could you please share your avg temps with that GeekPi case, please?

I have to kick out the original one too. 🙄

Thanks.

Just2Confuse commented 9 months ago

btw RPi developer still working on the new RPI5 kernel, as we already see on the kernel name 🙄 Good news, fan speed can be adjusted soon. 😄 Already working with a special kernel version raspberrypi/linux@2c085a1

Nice. I just kicked out that original Raspi5 Case and take an active Case bei GeekPi. It is, like the original active Cooler quiet, all the time. The fan ist superquiet....the red/white original CaseFan is not worth the money.

The original one is really disappointing. Could you please share your avg temps with that GeekPi case, please?

I have to kick out the original one too. 🙄

Thanks.

Sure. That my case -> https://amzn.to/4aI16ZQ

!/bin/bash

clear for i in {1..10} do vcgencmd measure_temp sysbench cpu --cpu-max-prime=50000 --threads=4 --time=60 run >/dev/null 2>&1 done vcgencmd measure_temp

Original-Case with cover

temp=52.1'C temp=68.1'C temp=64.8'C temp=64.2'C temp=65.9'C temp=63.7'C temp=65.9'C temp=65.9'C temp=64.2'C temp=64.2'C temp=66.4'C

Original Case without Cover

temp=49.9'C temp=64.2'C temp=64.8'C temp=64.8'C temp=64.8'C temp=64.8'C temp=63.7'C temp=64.8'C temp=63.7'C temp=64.2'C temp=65.9'C

GeekPi Active -> https://amzn.to/4aI16ZQ

temp=39.5'C temp=48.8'C temp=48.8'C temp=49.9'C temp=52.1'C temp=52.1'C temp=52.1'C temp=53.2'C temp=53.2'C temp=53.8'C temp=54.9'C

and additional a long run. Only to test who high it goes.

temp=41.1'C 07:59:15 temp=51.6'C 08:02:15 temp=52.7'C 08:05:15 temp=53.8'C 08:08:15 temp=53.8'C 08:11:15 temp=55.4'C 08:14:15 temp=54.9'C 08:17:15 temp=55.4'C 08:20:15 temp=56.0'C 08:23:15 temp=57.1'C

Joulinar commented 9 months ago

Btw DietPi offer a CPU burn stress test already 😜

Just2Confuse commented 9 months ago

Btw DietPi offer a CPU burn stress test already 😜

I still use Bookworm because the image didn't exist or I didn't understand the changeover. It is also more comparable because the test itself is at least the same. Sorry

Joulinar commented 9 months ago

I still use Bookworm

Bookworm is a Debian Release and used by DietPi as well. I guess you use RPi OS?

Just2Confuse commented 9 months ago

I still use Bookworm

Bookworm is a Debian Release and used by DietPi as well. I guess you use RPi OS?

Yes, thats what i like to say :D ;) Sorry, im on native RaspiOS atm.

terminet85 commented 9 months ago

Stress test results:

- Start Time: Fri Jan  5 11:50:37 GMT 2024
- End Time  : Fri Jan  5 11:55:38 GMT 2024
- Duration  : 301 seconds
- Min Temp  : 40 °C
- Max Temp  : 65 °C

I've set this dtparam and I'm using the official Pi active cooler

dtparam=fan_temp0=40000,fan_temp0_speed=100 
dtparam=fan_temp1=50000,fan_temp1_speed=150
dtparam=fan_temp2=57500,fan_temp2_speed=200
dtparam=fan_temp3=65000,fan_temp3_speed=255 
taitep commented 9 months ago

Hello! I got an error running the script on my raspberry pi 4:

[  OK  ] dietpi-rpi-firmware-migration | Free space check: path=/ | available=51139 MiB | required=200 MiB
dietpi-rpi-firmware-migration: line 11: ((: > 128000000 : syntax error: operand expected (error token is "> 128000000 ")
[FAILED] dietpi-rpi-firmware-migration | You can run this script on a system with at least 128 MiB boot partition only!

How do i fix this?

MichaIng commented 9 months ago

Sorry my mistake, I just fixed it. Please retry.

taitep commented 9 months ago

Sorry my mistake, I just fixed it. Please retry.

Was the issue just a syntax error???

MichaIng commented 9 months ago

I adjusted the script so that it can be repeated on the same system, either in case it aborted somewhere in the middle, or to apply further changes, like the recent libraspberrypi* => raspi-utils migration. So each step now needs to work or be skipped gracefully if it was applied already.

The size of the FAT partition needs to be at least 128 MiB so that it can contain all the kernel and initramfs images. Very old RPi and DietPi images might still have a ~50 MiB FAT partition. I thought we could check its size with a single command, regardless whether it is mounted at /boot or already at /boot/firmware. But the way I though it would work does not work. df -T /boot/firmware does not print anything if the directory does not exist (yet). I changed it to df -T /boot now, which targets the rootfs if the FAT partition is not mounted anymore at /boot, but that is fine, since in case it is mounted at /boot/firmware already, the size check obviously succeeded previously.

Just2Confuse commented 9 months ago

Stress test results:

- Start Time: Fri Jan  5 11:50:37 GMT 2024
- End Time  : Fri Jan  5 11:55:38 GMT 2024
- Duration  : 301 seconds
- Min Temp  : 40 °C
- Max Temp  : 65 °C

I've set this dtparam and I'm using the official Pi active cooler

dtparam=fan_temp0=40000,fan_temp0_speed=100 
dtparam=fan_temp1=50000,fan_temp1_speed=150
dtparam=fan_temp2=57500,fan_temp2_speed=200
dtparam=fan_temp3=65000,fan_temp3_speed=255 

So i try it with DietPi Converter and so on. And let the Stress Test (CPU and Memory) run for 30min. (i have the GeeekPi Case (https://amzn.to/48mGbtS). I did not change anything ob the fan controll. Room temperatur around 22°C. Did not get it over 60°C

Sun Jan  7 13:15:43 GMT 2024 | 58 °C | 486 seconds remaining
Sun Jan  7 13:15:44 GMT 2024 | 58 °C | 485 seconds remaining
Sun Jan  7 13:15:45 GMT 2024 | 58 °C | 484 seconds remaining
Sun Jan  7 13:15:47 GMT 2024 | 57 °C | 482 seconds remaining
Sun Jan  7 13:15:48 GMT 2024 | 56 °C | 481 seconds remaining
Sun Jan  7 13:15:49 GMT 2024 | 58 °C | 480 seconds remaining
Sun Jan  7 13:15:50 GMT 2024 | 58 °C | 479 seconds remaining
Sun Jan  7 13:15:52 GMT 2024 | 58 °C | 477 seconds remaining
Sun Jan  7 13:15:53 GMT 2024 | 58 °C | 476 seconds remaining
Sun Jan  7 13:15:54 GMT 2024 | 58 °C | 475 seconds remaining
Sun Jan  7 13:15:55 GMT 2024 | 58 °C | 474 seconds remaining

Stress test results: │ │ - Start Time: Sun Jan 7 12:53:49 GMT 2024 │ │ - End Time : Sun Jan 7 13:23:50 GMT 2024 │ │ - Duration : 1801 seconds │ │ - Min Temp : 44 °C │ │ - Max Temp : 60 °C │ │ - Log : /root/dietpi-config_stress.log

Joulinar commented 9 months ago

The GeekPi case seems to be even better compared to the original active cooler 👍

bmentink commented 9 months ago

Hi, my rpi 5 just arrived, and I would like to try this. First how do I make sure I am on DietPi v8.25 Beta, and if I am not, how to upgrade ? I am on stock bookworm at the moment. Thanks

Just2Confuse commented 9 months ago

Hi, my rpi 5 just arrived, and I would like to try this. First how do I make sure I am on DietPi v8.25 Beta, and if I am not, how to upgrade ? I am on stock bookworm at the moment. Thanks

You need:

Then this -> https://github.com/MichaIng/DietPi/issues/6676#issuecomment-1856412915 After that you can plug your SD Card/USB Stick/Whatever in your Pi5 an boot. It works.

bmentink commented 9 months ago

I had to do https://github.com/MichaIng/DietPi/blob/master/BRANCH_SYSTEM.md. first. Finally found it. The script worked, my kernal is now: Linux KodiMedia 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

My RP4 system rebooted. However it booted to console, not Kodi as I had set it up to do, will I need to reset that up in /boot/dietpi.txt? EDIT: It is allready set !!!

I noticed this in dmesg:

[    7.502275] CIFS: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.
[    7.502291] CIFS: Attempting to mount \\192.168.178.164\Media
[    8.097297] scsi 0:0:0:0: CD-ROM            HL-DT-ST DVDRAM GP60NS50  1.00 PQ: 0 ANSI: 0
[    8.107044] scsi 0:0:0:0: Attached scsi generic sg0 type 5
[    8.119011] sr 0:0:0:0: Power-on or device reset occurred
[    8.124484] sr 0:0:0:0: [sr0] scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[    8.124501] cdrom: Uniform CD-ROM driver Revision: 3.20
[    8.133944] sr 0:0:0:0: Attached scsi CD-ROM sr0
[    9.687691] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   10.681290] CIFS: VFS: cifs_mount failed w/return code = -112

Looks like cifs is not working anymore .. I guess I will have to re-install that

Hmm cifs-utils is installed why does that not work?

So for now, un-commented that mount in /etc/fstab and rebooted.

No bad messages on dmesg now, but this is what I get on the console: /boot/dietpi/dietpi-login: line 43: /usr/games/opentyrian/run: No such file or directory I did not setup any games to install, so this is odd.

So two problems running on my RP4, any suggestions from dev's Thanks

Joulinar commented 9 months ago

Do you try to mount something?

No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later

And if yes, does the device offering the share supports this versions?

bmentink commented 9 months ago

No it does not mount. I plugged it into my RP5, it boots to console, but no HDMI and when I execute dmesg it crashes ..


dmesg 
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x414fd0b1]
[    0.000000] Linux version 6.1.0-rpi7-rpi-2712 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24)
[    0.000000] random: crng init done
[    0.000000] Machine model: Raspberry Pi 5 Model B Rev 1.0
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x000000003a000000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x00000000ffffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000007ffff]
[    0.000000]   node   0: [mem 0x0000000000080000-0x000000003f7fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] On node 0, zone DMA: 512 pages in unavailable ranges
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.```
MichaIng commented 9 months ago

Looks like a power/voltage issue. Which PSU do you use? And do you have some USB device(s) attached?

For the Samba/CIFS mount, try to remove and re-add it, e.g. via dietpi-drive_manager. If it still does not work (while the server is definitely up and reachable), something must have changed on the related kernel module and we'd need to check on the RPi kernel repository if others face the same issue, or report it.

/boot/dietpi/dietpi-login: line 43: /usr/games/opentyrian/run: No such file or directory

You accidentally changed to OpenTyrian autostart option instead of console, while it is obviously not installed. You can change it back or to Kodi via dietpi-autostart. However, as fallback you'll always land in the console, so no big issue.

The migration script btw brings you to dev branch automatically, so no need to manually fiddle with the update branches (anymore).

bmentink commented 9 months ago

You are right, I don't have a good power supply, will try again when the correct one arrives.

I had a look at autostart and it said option 1 (Kodi) so I left it ... very strange .. Have the program names versus number's changed? I certainly did not change it.

bmentink commented 9 months ago

Update:

For the Samba/CIFS mount, try to remove and re-add it, e.g. via dietpi-drive_manager. If it still does not work (while the server is definitely up and reachable), something must have changed on the related kernel module and we'd need to check on the RPi kernel repository if others face the same issue, or report it.

I used dietpi-drive_manager to (re)install the CIFS mount and it all works fine now.

bmentink commented 9 months ago

@MichaIng Any idea's why it is booting OpenTyrian , when clearly /boot/dietpi.txt is showing it should boot Kodi. According to /boot/dietpi/dietpi.login and this part of the script:

# OpenTyrian
        elif (( $auto_start_index == 4 )); then

            exec /usr/games/opentyrian/run

So somehow 4 is getting into auto_start_index even though/boot/dietpi.txt shows autostart as 1.

Joulinar commented 9 months ago

Use dietpi-autostart to set correct values.

bmentink commented 9 months ago

Why, it is already correct (1) Kodi. Did you even read my posts?

MichaIng commented 8 months ago

Please use the command we suggested. The effective autostart index is read from /boot/dietpi/.dietpi-autostart_index, the dietpi.txt setting is relevant for 1st boot only.

bmentink commented 8 months ago

Please use the command we suggested. The effective autostart index is read from /boot/dietpi/.dietpi-autostart_index, the dietpi.txt setting is relevant for 1st boot only.

Thanks understand now. I am a bit confused as I can change for example, the chromium resolutions in /boot/dietpi.txt and that works multiple boots. Maybe there needs to be some documentation on what settings in /boot/dietpi.txt are only for first boot, then that implies the rest can be adjusted.

Joulinar commented 8 months ago

well you are referring to AUTO_SETUP_AUTOSTART_TARGET_INDEX, right? The parament is in first section and starts with AUTO. Inside dietpi.txt there is comment in front of the whole AUTO section

https://github.com/MichaIng/DietPi/blob/7f8fe89f4e21921cc043f94cde3107e4ec682e2a/dietpi.txt#L5-L7

bmentink commented 8 months ago

So that section that is applied once ends here:

#------------------------------------------------------------------------------------------------------
##### Misc DietPi program settings #####
#------------------------------------------------------------------------------------------------------
MichaIng commented 8 months ago

Yes. Another identifier is the AUTO_SETUP_ prefix of the settings which are relevant for 1st boot only.

But there are also some others which on their own have no effect but are more used as flag by our scripts, while for the change to be effective another system config file or API needs to be used. So best in general is to use the scripts after 1st boot, which often have a CLI as well, or there are backend scripts which have no menu but CLI instead. E.g. to change the autostart index without menu to Kodi (index 1):

dietpi-autostart 1
bmentink commented 8 months ago

Followup: Kodi tries to start, but I get red text on terminal, which I can't read, as it only stays a second, then I am dumped to the terminal.

There is no kodi crashlog in my home directory. So something else is wrong. dmesg shows nothing.

Is there any other log I can check out?

Joulinar commented 8 months ago

What happened if you type kodi into command line

bmentink commented 8 months ago

Presume you mean kodi-standalone, typing that gives:

kodi-standalone  /usr/bin/kodi --standalone  has exited in an unclean state 3 times in the last 4 seconds.
xstrex commented 8 months ago

Been following this issue for quite a while, and just got my Pi 5 booted up with the instructions above, thanks everyone!

One quite note, for the life of me I can't get the official Raspberry Pi 7" Touchscreen working. Tried several fixes in the forums but nothing's working, just a black screen. installed Bookworm on another sd, and it used the screen out-of-the-box. I don't expect dietPi to behave the same way, though it's currently not working. Happy to post a working config.txt from bookworm with a working screen if there's interest.

Edit: after tinkering for a few hours, managed to get the screen working! Had to download & install rpi-update and run it to update the kernel/drivers. Also had to add this to the /boot/config.txt file dtoverlay=vc4-kms-dsi-7inch,dsi0. After both of those, and a reboot, the display turned and launched a console/X (X pre-configured). Even the touchscreen works!

MichaIng commented 8 months ago

I added the kernel choice dialogue to the migration script, and to dietpi-config advanced options, in case the migration has been done already: https://github.com/MichaIng/DietPi/commit/4573473

Currently, kernel headers are not automatically installed/migrated anymore. This would have been complicated to implement, but it is probably fine since only a few require them, and will then know how to install manually?

And before you wonder: This installs the new raspi-utils package as well and purges the old libraspberrypi* packages. This is part of the migration script as well since a while, but for those of you who ran the script earlier, this means some additional package installs and removals.

You can either rerun the script to test/use it, or update to the latest dev commit. I'll also push a new beta later tonight.

Would be good to know whether it is sufficiently clear to understand, or whether you have suggestions to enhance the text, and of course whether it works as expected for you.

MichaIng commented 8 months ago

@dirkhh One question: You posted your vcgencmd get_config int output a while ago, where a arm_freq_min of 1000 was shown, while in the official docs and on @Joulinar's RPi 5 it is 1500. Did you change this manually in dietpi-config or /boot/dietpi.txt? AFAIK there was no kernel update, but maybe I have overseen something.

dirkhh commented 8 months ago

@dirkhh One question: You posted your vcgencmd get_config int output a while ago, where a arm_freq_min of 1000 was shown, while in the official docs and on @Joulinar's RPi 5 it is 1500. Did you change this manually in dietpi-config or /boot/dietpi.txt? AFAIK there was no kernel update, but maybe I have overseen something.

nope, nothing changed. I installed the then-latest DietPi on my Pi4b, ran the script, booted the SDcard on the Pi5.

MichaIng commented 8 months ago

Hmm strange. Does it use the v8 kernel or the 2712 in your case?

uname -r

EDIT: Ah, and to be sure vcgencmd get_config arm_freq_min still reports 1500? In the meantime we had the idea that a recent bootloader (EEPROM) update may have changed it.