Skip to content

Commit

Permalink
v8.23
Browse files Browse the repository at this point in the history
- ROCK 4 | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables USB and in case NVMe boot for DietPi images. Note that not all ROCK 4 models ship with an onboard SPI storage. DietPi-Config will check for it, in case apply a related device tree overlay and suggests a reboot. If after the reboot an SPI device has still not been found, your board seems to have none. Report back if this is definitely wrong. Many thanks to @andreagdipaolo for doing this request: #6688
  • Loading branch information
MichaIng committed Oct 18, 2023
1 parent a93f4fd commit 18d660a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 36 deletions.
26 changes: 10 additions & 16 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1474,15 +1474,12 @@ Patch_8_23()
then
G_DIETPI-NOTIFY 2 'A revision detected, applying device tree overlay to fix Ethernet ...'
read -ra overlays < <(mawk '$1=="fdtoverlays"{$1="";print}' /boot/extlinux/extlinux.conf)
local add=1
for i in "${overlays[@]}"
do
[[ $i == '/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/ethernet-A12.dtbo' ]] || continue
G_DIETPI-NOTIFY 2 'A revision Ethernet overlay was applied already ...'
add=0
done
if (( $add ))
local i=
for i in "${overlays[@]}"; do [[ $i == *'/ethernet-A12.dtbo' ]] && break; done
if [[ $i == *'/ethernet-A12.dtbo' ]]
then
G_DIETPI-NOTIFY 2 'A revision Ethernet overlay was applied already ...'
else
overlays+=('/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/ethernet-A12.dtbo')
G_CONFIG_INJECT 'fdtoverlays[[:blank:]]' "fdtoverlays ${overlays[*]}" /boot/extlinux/extlinux.conf
fi
Expand All @@ -1491,15 +1488,12 @@ Patch_8_23()
then
G_DIETPI-NOTIFY 2 '8 GB RAM model detected, applying device tree overlay to make all 8 GB available to the system ...'
read -ra overlays < <(mawk '$1=="fdtoverlays"{$1="";print}' /boot/extlinux/extlinux.conf)
local add=1
for i in "${overlays[@]}"
do
[[ $i == '/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/8GB.dtbo' ]] || continue
G_DIETPI-NOTIFY 2 '8 GB RAM overlay was applied already ...'
add=0
done
if (( $add ))
local i=
for i in "${overlays[@]}"; do [[ $i == *'/8GB.dtbo' ]] && break; done
if [[ $i == *'/8GB.dtbo' ]]
then
G_DIETPI-NOTIFY 2 '8 GB RAM overlay was applied already ...'
else
overlays+=('/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/8GB.dtbo')
G_CONFIG_INJECT 'fdtoverlays[[:blank:]]' "fdtoverlays ${overlays[*]}" /boot/extlinux/extlinux.conf
fi
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ v8.23

Enhancements:
- RPi | On Debian Bookworm and above, the RPi APT repository will be migrated to its new Bookworm suite. This solves issues and should enhance performance with FFmpeg, Kodi and some other A/V software, where we used the Debian packages with less hardware support before. The packages should be upgraded automatically on DietPi update. Please report back if you experience any issues during this process.
- ROCK 5B | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables NVMe boot for DietPi images.
- ROCK 5B | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables USB and NVMe boot for DietPi images.
- ROCK 4 | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables USB and in case NVMe boot for DietPi images. Note that not all ROCK 4 models ship with an onboard SPI storage. DietPi-Config will check for it, in case apply a related device tree overlay and suggests a reboot. If after the reboot an SPI device has still not been found, your board seems to have none. Report back if this is definitely wrong. Many thanks to @andreagdipaolo for doing this request: https://github.com/MichaIng/DietPi/issues/6688
- DietPi-Software | Firefox: Enabled the software option for RISC-V, since Debian provides packages now. But do not expect good performance, as GPU-acceleration is missing.
- DietPi-Software | ADS-B Feeder: The uninstall has been hardened to rule out the removal of unused Docker images which were not created by ADS-B Feeder. Furthermore, beta tags are now correctly shown in the version string. Many thanks to @andreagdipaolo for reporting a related issue and @dirkhh for implementing the enhancement: https://github.com/MichaIng/DietPi/pull/6587#issuecomment-1743744008
- DietPi-Software | DietPi-Dashboard: Experimental support for RISC-V has been added. Note that this will be an alpha build with alpha versions of certain dependencies, required to compile on RISC-V. Hence this is not suitable for production usage, which basically applies for RISC-V and the VisionFive 2 in general.
Expand Down
29 changes: 26 additions & 3 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -1068,10 +1068,11 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the
G_WHIP_MENU_ARRAY+=('Update RPi4 EEPROM firmware' ': Install rpi-eeprom APT package')
fi

# ROCK 5B and Orange Pi 5 (Plus): https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457
elif [[ $G_HW_MODEL =~ ^(78|80|82)$ ]]
# ROCK 4, ROCK 5B and Orange Pi 5 (Plus): https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457
elif [[ $G_HW_MODEL =~ ^(72|78|80|82)$ ]]
then
[[ -b '/dev/mtdblock0' && -f '/usr/lib/u-boot/platform_install.sh' ]] && G_WHIP_MENU_ARRAY+=('Update SPI bootloader' ': Flash current U-Boot to /dev/mtdblock0')
# ROCK 4: Device tree overlay required
(( $G_HW_MODEL == 72 )) || [[ -b '/dev/mtdblock0' && -f '/usr/lib/u-boot/platform_install.sh' ]] && G_WHIP_MENU_ARRAY+=('Update SPI bootloader' ': Flash current U-Boot to /dev/mtdblock0')

# VisionFive 2: https://doc-en.rvspace.org/VisionFive2/PDF/VisionFive2_QSG.pdf
elif (( $G_HW_MODEL == 81 ))
Expand Down Expand Up @@ -1208,11 +1209,33 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr

elif [[ $G_WHIP_RETURNED_VALUE == 'Update SPI bootloader' ]]; then

if [[ $G_HW_MODEL == 72 && ! -b '/dev/mtdblock0' ]]
then
local overlays=() i=
read -ra overlays < <(mawk -F= '$1=="overlays"{$1="";print}' /boot/dietpiEnv.txt)
for i in "${overlays[@]}"; do [[ $i == 'spi-jedec-nor' ]] && break; fi
if [[ $i == 'spi-jedec-nor' ]]
then
G_WHIP_MSG '[FAILED] No MTD device found
\nThe expected MTD device /dev/mtdblock0 was not found on your ROCK 4 system, despite the fact that the related device tree overlay has been applied already. You may either have a model which has no onboard SPI storage, or you did not reboot yet for the change to take effect.
\nIn case reboot the system before selecting this menu option again, otherwise check back whether your ROCK 4 variant is really supposed to have an SPI storge.'
return 1
else
G_WHIP_YESNO '[ INFO ] No MTD device found
\nThe expected MTD device /dev/mtdblock0 was not found on your ROCK 4 system. You may either have a model which has no onboard SPI storage, or a device tree overlay may be required to make the MTD device available.
\nShall we add the overlay for you? A reboot will be required for the change to take effect, after which you can reselect this menu option.' || return 0
overlays+=('spi-jedec-nor')
G_CONFIG_INJECT 'overlays=' "overlays=${overlays[*]}" /boot/dietpiEnv.txt
REBOOT_REQUIRED=1
return 0
fi
fi
G_WHIP_YESNO '[ INFO ] SPI bootloader update
\nThis will flash the U-Boot image of the installed linux-u-boot-* package to the SPI device /dev/mtdblock0.
\nDo you want to continue?' || return 0
# shellcheck disable=SC1091
. /usr/lib/u-boot/platform_install.sh
[[ -f $DIR/rkspi_loader.img ]] || { G_WHIP_MSG "[FAILED] SPI U-Boot image missing\n\nThe expected U-Boot image at $DIR/rkspi_loader.img could not be found. Please report this to our GitHub or forum, so we can check back and in case update this dietpi-config option."; return 1; }
# shellcheck disable=SC2154
G_EXEC_OUTPUT=1 G_EXEC dd if="$DIR/rkspi_loader.img" of=/dev/mtdblock0 oflag=direct conv=notrunc status=progress

Expand Down
26 changes: 10 additions & 16 deletions rootfs/var/lib/dietpi/services/dietpi-firstboot.bash
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,12 @@ _EOF_
then
G_DIETPI-NOTIFY 2 'A revision detected, applying device tree overlay to fix Ethernet ...'
read -ra overlays < <(mawk '$1=="fdtoverlays"{$1="";print}' /boot/extlinux/extlinux.conf)
local add=1
for i in "${overlays[@]}"
do
[[ $i == '/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/ethernet-A12.dtbo' ]] || continue
G_DIETPI-NOTIFY 2 'A revision Ethernet overlay was applied already ...'
add=0
done
if (( $add ))
local i=
for i in "${overlays[@]}"; do [[ $i == *'/ethernet-A12.dtbo' ]] && break; done
if [[ $i == *'/ethernet-A12.dtbo' ]]
then
G_DIETPI-NOTIFY 2 'A revision Ethernet overlay was applied already ...'
else
overlays+=('/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/ethernet-A12.dtbo')
G_CONFIG_INJECT 'fdtoverlays[[:blank:]]' "fdtoverlays ${overlays[*]}" /boot/extlinux/extlinux.conf
fi
Expand All @@ -141,15 +138,12 @@ _EOF_
then
G_DIETPI-NOTIFY 2 '8 GB RAM model detected, applying device tree overlay to make all 8 GB available to the system ...'
read -ra overlays < <(mawk '$1=="fdtoverlays"{$1="";print}' /boot/extlinux/extlinux.conf)
local add=1
for i in "${overlays[@]}"
do
[[ $i == '/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/8GB.dtbo' ]] || continue
G_DIETPI-NOTIFY 2 '8 GB RAM overlay was applied already ...'
add=0
done
if (( $add ))
local i=
for i in "${overlays[@]}"; do [[ $i == *'/8GB.dtbo' ]] && break; done
if [[ $i == *'/8GB.dtbo' ]]
then
G_DIETPI-NOTIFY 2 '8 GB RAM overlay was applied already ...'
else
overlays+=('/usr/lib/linux-image-visionfive2/starfive/vf2-overlay/8GB.dtbo')
G_CONFIG_INJECT 'fdtoverlays[[:blank:]]' "fdtoverlays ${overlays[*]}" /boot/extlinux/extlinux.conf
fi
Expand Down

0 comments on commit 18d660a

Please sign in to comment.