diff --git a/.build/images/OdroidXU4/boot.ini b/.build/images/OdroidXU4/boot.ini index efcbd66771..e86febe9f7 100644 --- a/.build/images/OdroidXU4/boot.ini +++ b/.build/images/OdroidXU4/boot.ini @@ -4,24 +4,25 @@ ODROIDXU-UBOOT-CONFIG setenv initrd_high "0xffffffff" setenv fdt_high "0xffffffff" -# MAC address configuration -setenv macaddr "00:1e:06:61:7a:72" - # Kernel command-line parameters setenv bootrootfs "root=/dev/mmcblk0p1 rootfstype=ext4 rootwait ro console=ttySAC2,115200n8 console=tty1 consoleblank=0 net.ifnames=0" -# HDMI/DVI selection: "hdmi" or "dvi" -# - DVI mode disables HDMI sound -setenv vout "hdmi" - -# HDMI Hot Plug Detect -# - "false" disables auto-detection and forces HDMI output. -# - "true" enables HDMI detection based on cable connection. -setenv HPD "true" - # HDMI CEC: "false" or "true", defaults to "true" #setenv cecenable "true" +# Disable ODROID-VU7 touchscreen support: "false" or "true", defaults to "true" +#setenv disable_vu7 "true" + +# ODROID CloudShell 2 TFT LCD and FAN control via I2C bus: "false" or "true", defaults to "false" +#setenv cs2enable "false" + +# Device tree overlays +# - See /boot/dtb/overlays or /boot/dtb for available overlays (*.dtbo files): defaults to empty string "" +#setenv overlays "i2c0" + +# DDR frequency [MHz]: "633", "728", "825" or "933", defaults to "825" +#setenv ddr_freq "825" + # HDMI resolution # - Uncomment only ONE line! Leave all commented for automatic selection. # - Uncomment only the setenv line! @@ -123,71 +124,21 @@ setenv HPD "true" #setenv videoconfig "drm_kms_helper.edid_firmware=edid/480x800.bin" # ----------------------------------------------- -# Disable ODROID-VU7 touchscreen support: "false" or "true", defaults to "true" -#setenv disable_vu7 "true" - -# ODROID CloudShell 2 TFT LCD and FAN control via I2C bus: "false" or "true", defaults to "false" -#setenv cs2enable "false" - -# Device tree overlays -# - See /boot/dtb/overlays for available overlays: defaults to empty string "" -#setenv overlays "i2c0" - -# CPU governor -# - DietPi will override this setting to user configured in dietpi-config > Performance Options > CPU governor -setenv governor "performance" - -# DDR frequency [MHz]: "633", "728", "825" or "933", defaults to "825" -#setenv ddr_freq "825" - -# TMDS data amplitude control. -# - 1LSB corresponds to 20 mVdiff amplitude level -# - tx_amp_lvl : 0 = 760 mVdiff(Min), 31 = 1380 mVdiff(Max) -# - Hardkernel default: hdmi_tx_amp_lvl = 31(1380 mVdiff) -setenv hdmi_tx_amp_lvl "31" - -# TMDS data amplitude fine control for each channel -# - 1LSB corresponds to 20 mVdiff amplitude level -# - tx_lvl : 0 = 0 mVdiff(Min), 3 = 60 mVdiff(Max) -# - Hardkernel default: hdmi_tx_lvl_ch0=hdmi_tx_lvl_ch1=hdmi_tx_lvl_ch2 = 3 -setenv hdmi_tx_lvl_ch0 "3" -setenv hdmi_tx_lvl_ch1 "3" -setenv hdmi_tx_lvl_ch2 "3" - -# TMDS data pre-emphasis level control -# - 1LSB corresponds to -0.45dB emphasis level except for 1 -# - tx_emp_lvl : 0 = 0 db(Min), 1 = -0.25 db, 2 = 0.7 db, 15 = -7.45 db(Max) -# - Hardkernel default: hdmi_tx_emp_lvl = 6 (-2.50 db) -setenv hdmi_tx_emp_lvl "6" - -# TMDS clock amplitude control -# - 1LSB corresponds to 20 mVdiff amplitude level. -# - clk_amp_lvl : 0 = 790 mVdiff(Min), 31 = 1410 mVdiff(Max) -# - Hardkernel default hdmi_clk_amp_lvl = 31 (1410 mVdiff) -setenv hdmi_clk_amp_lvl "31" - -# TMDS data source termination resistor control -# - tx_res : 0 = Source Termination OFF(Min), 1 = 200 ohm, 2 = 300 ohm, 3 = 120 ohm(Max) -# - Hardkernel default hdmi_tx_res = 0 (Source Termination OFF) -setenv hdmi_tx_res "0" - ### DO NOT EDIT ANYTHING BELOW THIS LINE ### -setenv hdmi_phy_control "hdmi_tx_amp_lvl=${hdmi_tx_amp_lvl} hdmi_tx_lvl_ch0=${hdmi_tx_lvl_ch0} hdmi_tx_lvl_ch1=${hdmi_tx_lvl_ch1} hdmi_tx_lvl_ch2=${hdmi_tx_lvl_ch2} hdmi_tx_emp_lvl=${hdmi_tx_emp_lvl} hdmi_clk_amp_lvl=${hdmi_clk_amp_lvl} hdmi_tx_res=${hdmi_tx_res} HPD=${HPD} vout=${vout}" - # Load kernel, initrd and dtb in that sequence -ext4load mmc 0:1 0x40008000 /boot/zImage || fatload mmc 0:1 0x40008000 zImage || ext4load mmc 0:1 0x40008000 zImage -ext4load mmc 0:1 0x42000000 /boot/uInitrd || fatload mmc 0:1 0x42000000 uInitrd || ext4load mmc 0:1 0x42000000 uInitrd +load mmc 0:1 0x40008000 /boot/zImage || load mmc 0:1 0x40008000 zImage +load mmc 0:1 0x42000000 /boot/uInitrd || load mmc 0:1 0x42000000 uInitrd if test "${board_name}" = "xu4"; then setenv fdtfile "exynos5422-odroidxu4.dtb"; fi if test "${board_name}" = "xu3"; then setenv fdtfile "exynos5422-odroidxu3.dtb"; fi if test "${board_name}" = "xu3l"; then setenv fdtfile "exynos5422-odroidxu3-lite.dtb"; fi if test "${board_name}" = "hc1"; then setenv fdtfile "exynos5422-odroidhc1.dtb"; fi -ext4load mmc 0:1 0x44000000 /boot/dtb/${fdtfile} || fatload mmc 0:1 0x44000000 dtb/${fdtfile} || ext4load mmc 0:1 0x44000000 dtb/${fdtfile} +load mmc 0:1 0x44000000 /boot/dtb/${fdtfile} || load mmc 0:1 0x44000000 dtb/${fdtfile} # Set FDT address fdt addr 0x44000000 -if test "${cecenable}" = "false"; then fdt rm /cec@101B0000; fi +if test "${cecenable}" = "false"; then fdt rm /soc/cec@101b0000; fi if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi # Add overlays for CloudShell @@ -205,7 +156,7 @@ fi if test "x${overlays}" != "x"; then fdt resize 8192 for overlay in ${overlays}; do - ext4load mmc 0:1 0x60000000 /boot/dtb/overlays/${overlay}.dtbo || fatload mmc 0:1 0x60000000 dtb/overlays/${overlay}.dtbo || ext4load mmc 0:1 0x60000000 dtb/overlays/${overlay}.dtbo + load mmc 0:1 0x60000000 /boot/dtb/${overlay}.dtbo || load mmc 0:1 0x60000000 /boot/dtb/overlays/${overlay}.dtbo || load mmc 0:1 0x60000000 dtb/${overlay}.dtbo || load mmc 0:1 0x60000000 dtb/overlays/${overlay}.dtbo fdt apply 0x60000000 done fi @@ -214,7 +165,7 @@ fi if test "x${ddr_freq}" != "x"; then dmc "${ddr_freq}"; fi # Final boot args (DRM debugging: drm.debug=0xff) -setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} ${hid_quirks}" +setenv bootargs "${bootrootfs} ${videoconfig} ${hid_quirks}" # Boot the board bootz 0x40008000 0x42000000 0x44000000 diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 2464c916d4..c13fbf7041 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -83,16 +83,16 @@ case $HW_MODEL in 5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=895;; 10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';; 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;; - 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1020;; - 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=1020;; - 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=1020;; + 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1148;; + 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=1148;; + 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=1148;; 20) iname='VM' HW_ARCH=${HW_ARCH:-10} VMTYPE=${VMTYPE:-raw};; 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1663;; - 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=892;; + 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=1020;; 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=1008;; 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=1008;; - 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=892;; - 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=892;; + 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=1020;; + 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=1020;; 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=1008;; 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=1008;; 48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=764;; @@ -100,7 +100,7 @@ case $HW_MODEL in '49.2') iname='Quartz64B' HW_ARCH=3 partition_start=16 root_size=752;; '49.3') iname='SOQuartz' HW_ARCH=3 partition_start=16 root_size=752;; 52) iname='ASUSTB' HW_ARCH=2 partition_start=4 root_size=764;; - 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=1020;; + 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=1148;; 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1008;; 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=1008;; 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=892;; @@ -112,35 +112,38 @@ case $HW_MODEL in '62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=700;; 63) iname='NanoPiM1' HW_ARCH=2 partition_start=4 root_size=764;; 64) iname='NanoPiNEOAir' HW_ARCH=2 partition_start=4 root_size=764;; - '65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=892;; - '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=892;; + '65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=1020;; + '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=1020;; 66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=764;; - 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=892;; + 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=1020;; '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=1008;; '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=1008;; '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=1008;; 70) iname='SparkySBC' HW_ARCH=2 partition_start=8 boot_size=48 root_size=712 boot_fstype='fat16';; '72.1') iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=1008;; '72.2') iname='ROCK4SE' HW_ARCH=3 partition_start=16 root_size=1008;; + '72.3') iname='ROCK4CPlus' HW_ARCH=3 partition_start=16 root_size=1008;; 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1008;; - 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1020;; + 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1148;; 75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=575;; '76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; '76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; - 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; '79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; '79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; '79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;; - '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=1148;; + 83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;; 84) iname='Star64' HW_ARCH=11 root_size=639;; 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1008;; - 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; + 88) iname='OrangePiZero2W' HW_ARCH=3 partition_start=4 root_size=1148;; + 89) iname='OrangePi3LTS' HW_ARCH=3 partition_start=4 root_size=892;; + 90) iname='RadxaZERO3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; *) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;; esac @@ -216,7 +219,7 @@ fi # Virtual machine disk conversion [[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils') -G_AG_CHECK_INSTALL_PREREQ parted debootstrap dbus systemd-container xz-utils "${apackages[@]}" +G_AG_CHECK_INSTALL_PREREQ parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}" # Bootstrap archive keyring if missing if [[ ! -f $keyring ]] @@ -378,8 +381,8 @@ G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/lib/apt/lists G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/log packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gnupg,htop,iputils-ping,locales,nano,p7zip,parted,procps,psmisc,sudo,systemd-sysv,tzdata,udev,unzip,wget,whiptail,' [[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils' -G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat rootfs/debootstrap/debootstrap.log; } -G_EXEC_OUTPUT=1 G_EXEC debootstrap --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" +#G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat rootfs/debootstrap/debootstrap.log; } +G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --skip=check/empty --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log ########################################## @@ -507,7 +510,8 @@ then fi # AlloGUI edition: Pre-install Allo GUI with all managed audiophile software -if [[ $EDITION == 'AlloGUI' || ( $EDITION == 'all' && $HW_MODEL =~ ^(0|70)$ ) ]] +# - Temporarily skip Trixie AlloGUI builds: The netdata package is currently not available (only on Raspbian, not Debian) and systemd-logind fails to start within the container as of a new change/bug, to investigate. +if [[ $EDITION == 'AlloGUI' || ( $EDITION == 'all' && $HW_MODEL =~ ^(0|70)$ && $DISTRO != 8 ) ]] then G_EXEC mv "$OUTPUT_IMG_NAME.img" "${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI.img" OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI" diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 47412ad2e1..f4a4aaff46 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -61,8 +61,8 @@ [[ $SKIP_FIRSTBOOT_RESIZE == 1 ]] || SKIP_FIRSTBOOT_RESIZE=0 [[ $SHRINK_ONLY == 1 ]] || SHRINK_ONLY=0 [[ $SKIP_ARCHIVE == 1 ]] || SKIP_ARCHIVE=0 - ADD_DOS_PART=0 - CONFIGS_TO_BOOT=0 + ADD_DOS_PART=0 # trailing FAT partition for first boot config files, automatically imported and partition removed on first boot + CONFIGS_TO_BOOT=0 # for new RPi kernel/firmware stack where a boot FAT partition exists, but is mounted to /boot/firmware instead of /boot SIGN_PASS= while (( $# )) do @@ -336,10 +336,7 @@ # Move GPT backup partition table to end of drive elif [[ $PART_TABLE_TYPE == 'gpt' ]] then - G_DIETPI-NOTIFY 2 'GPT partition table detected, moving GPT backup partition table to end of drive...' - G_AG_CHECK_INSTALL_PREREQ gdisk - G_EXEC_OUTPUT=1 G_EXEC sgdisk -e "$FP_SOURCE" - G_SLEEP 0.5 # Give the root filesystem a little time to be detected + G_DIETPI-NOTIFY 2 'GPT partition table detected' else Error_Exit "Unknown partition table type ($PART_TABLE_TYPE), aborting..." fi @@ -512,9 +509,16 @@ # - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well) local last_part_end=$(sfdisk -qlo End "$FP_SOURCE" | tail -1) # 512 byte sectors IMAGE_SIZE=$last_part_end - # Add 34 sectors for GPT backup partition table and 1 sector for MBR - # shellcheck disable=SC2015 - [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=34)) || ((IMAGE_SIZE++)) + # Add space for GPT backup partition table, or 1 sector for MBR + if [[ $PART_TABLE_TYPE == 'gpt' ]] + then + # Obtain first usable LBA, which defines the size of the GPT backup, else use 34 sectors as default: https://github.com/MichaIng/DietPi/issues/7024 + local gpt_size=$(sgdisk -p "$FP_SOURCE" 2>&1 | mawk -F[\ ,] '/^First usable sector/{print $5}') + # shellcheck disable=SC2015 + (( $gpt_size )) && ((IMAGE_SIZE+=$gpt_size)) || ((IMAGE_SIZE+=34)) + else + ((IMAGE_SIZE++)) + fi ((IMAGE_SIZE*=512)) # 512 byte sectors => bytes # RPi: Move configs to boot FAT partition to allow easier edit from Windows/macOS @@ -525,9 +529,12 @@ G_EXEC mount "${FP_ROOT_DEV::-1}1" "$fat_mountpoint" G_EXEC mount "$FP_ROOT_DEV" "$root_mountpoint" G_DIETPI-NOTIFY 2 'Copying dietpi.txt and other config files to the DIETPISETUP partition' - for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' 'unattended_pivpn.conf' do - [[ -f $root_mountpoint/boot/$f ]] && G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/" + [[ -f $root_mountpoint/boot/$f ]] || continue + G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/" + TZ=UTC G_EXEC touch -t '197001010000' "$fat_mountpoint/$f" + TZ=UTC G_EXEC touch -t '197001010001' "$root_mountpoint/boot/$f" done G_EXEC umount "$root_mountpoint" "$fat_mountpoint" G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" @@ -554,22 +561,26 @@ G_EXEC mount "$new_dos_part" "$fat_mountpoint" G_EXEC mount "$FP_ROOT_DEV" "$root_mountpoint" G_DIETPI-NOTIFY 2 'Copying dietpi.txt and other config files to the DIETPISETUP partition' - for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'boot.ini' 'extlinux/extlinux.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' 'unattended_pivpn.conf' do - [[ -f $root_mountpoint/boot/$f ]] && G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/" + [[ -f $root_mountpoint/boot/$f ]] || continue + G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/" + TZ=UTC G_EXEC touch -t '202101010001' "$fat_mountpoint/${f#extlinux/}" + TZ=UTC G_EXEC touch -t '202101010002' "$root_mountpoint/boot/$f" done - cat << '_EOF_' > "$fat_mountpoint/Readme-DietPi-Config.txt" -DietPi pre-boot configuration + cat << '_EOF_' > "$fat_mountpoint/README.txt" +DietPi config partition -You can edit the files in this folder to setup some configuration options -or even a completely automated install. Please check the documentation and -dietpi.txt for details: https://dietpi.com/docs/install/ +This FAT partition is a place for relevant configuration files to pre-configure and automate your DietPi setup. +Those files will be copied into the root filesystem on first boot, if modified, to become effective, and the partition will be removed. -This folder also supports the following additional files. Please ensure that -they have UNIX style LF line endings: -- unattended_pivpn.conf +Apart of editing the existing files, you can also create the following for further automation: - Automation_Custom_PreScript.sh - Automation_Custom_Script.sh +- unattended_pivpn.conf + +For details, please check our documentation and dietpi.txt itself: +https://dietpi.com/docs/usage/#how-to-do-an-automatic-base-installation-at-first-boot-dietpi-automation _EOF_ G_EXEC umount "$root_mountpoint" "$fat_mountpoint" G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" @@ -742,10 +753,10 @@ _EOF_ # Generate xz archive # NB: LZMA2 ultra compression requires much memory per thread. 1 GiB is not sufficient for >2 threads, hence use "-T2" to limit used CPU threads to "2" on 1 GiB devices with more than two cores. - local limit_threads=() - (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-T2') + local threads=0 + (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && threads=2 [[ -f $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz ]] && G_EXEC rm "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" - G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e -k "${limit_threads[@]}" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" + G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e -k "-T$threads" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz' > '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256'" local signature=() sig_text='' [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" || exit 1; signature=("$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.asc") sig_text="\nSignature: $PWD/${signature[*]}"; } diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 66fc2b9bee..440f046afd 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -412,16 +412,19 @@ _EOF_ '79.3' ': NanoPC T6' '72.1' ': ROCK 4 (all other variants)' '72.2' ': ROCK 4 SE' + '72.3' ': ROCK 4C Plus' '73' ': ROCK Pi S' '74' ': Radxa Zero' + '90' ': Radxa ZERO 3' '77' ': ROCK 3A' '78' ': ROCK 5B' '85' ': ROCK 5A' '87' ': Orange Pi 3B' + '89' ': Orange Pi 3 LTS' '80' ': Orange Pi 5' '82' ': Orange Pi 5 Plus' - '83.1' ': Orange Pi Zero 3' - '83.2' ': Orange Pi Zero 3 (1.5 GB RAM)' + '83' ': Orange Pi Zero 3' + '88' ': Orange Pi Zero 2W' '86' ': ASUS Tinker Board 2' '23' ': Generic Rockchip RK3328' '24' ': Generic Rockchip RK3399' @@ -618,7 +621,7 @@ _EOF_ G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" /etc/initramfs/post-update.d/99-dietpi-uboot G_EXEC sed --follow-symlinks -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot - elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|76|77|78|79|80|82|83|85|86|87)$ ]] + elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|76|77|78|79|80|82|83|85|86|87|88|89|90)$ ]] then armbian_repo=1 G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/boot.cmd" /boot/boot.cmd @@ -659,7 +662,7 @@ setenv rootuuid "true"' /boot/boot.cmd (( $G_HW_MODEL == 15 )) && G_EXEC eval 'echo '\''meson_rng'\'' > /etc/modules-load.d/dietpi-hwrng.conf' # Rockchip 64-bit (configs work with Amlogic OOTB) - elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|76|77|78|79|80|82|85|86|87)$ ]] + elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|76|77|78|79|80|82|85|86|87|90)$ ]] then G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x9000000"' /boot/boot.cmd @@ -673,13 +676,20 @@ setenv rootuuid "true"' /boot/boot.cmd 46) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3399-pinebook-pro.dtb' /boot/dietpiEnv.txt;; 55) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3328-nanopi-r2-rev00.dtb' /boot/dietpiEnv.txt;; # Not necessarily needed as rk3328-nanopi-r2s.dtb is automatically chosen, but provides more consistent /sys/class/leds/{wan,lan}_led interface and blinking instead of steady lid power LED 56) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3328-nanopi-neo3-rev02.dtb' /boot/dietpiEnv.txt;; # Loads rk3328-nanopi-r2s.dtb by default - 72) (( $HW_VARIANT == 2 )) && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3399-rock-4se.dtb' /boot/dietpiEnv.txt;; + 72) + case $HW_VARIANT in + 2) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3399-rock-4se.dtb' /boot/dietpiEnv.txt;; + 3) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3399-rock-4c-plus.dtb' /boot/dietpiEnv.txt;; + *) :;; + esac + ;; 73) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3308-rock-pi-s.dtb' /boot/dietpiEnv.txt;; # U-Boot does not pass any ${fdtfile} 77) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3568-rock-3a.dtb' /boot/dietpiEnv.txt;; 78) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588-rock-5b.dtb' /boot/dietpiEnv.txt;; 79) (( $HW_VARIANT == 2 )) && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-nanopi-r6c.dtb' /boot/dietpiEnv.txt;; 85) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-rock-5a.dtb' /boot/dietpiEnv.txt;; 87) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3566-orangepi-3b.dtb' /boot/dietpiEnv.txt;; + 90) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3566-radxa-zero3.dtb' /boot/dietpiEnv.txt;; *) :;; esac case $G_HW_MODEL in @@ -705,30 +715,32 @@ setenv rootuuid "true"' /boot/boot.cmd G_EXEC sed --follow-symlinks -i -e 's/ttyAML0/ttyS2/' -e '/^extraargs=/s/$/ systemd.unified_cgroup_hierarchy=0/' /boot/dietpiEnv.txt # Allwinner 64-bit - elif [[ $G_HW_MODEL =~ ^(40|44|45|57|65|67|83)$ ]] + elif [[ $G_HW_MODEL =~ ^(40|44|45|57|65|67|83|88|89)$ ]] then G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x45000000"' /boot/boot.cmd G_CONFIG_INJECT 'overlay_path=' 'overlay_path=allwinner' /boot/dietpiEnv.txt + # Device tree case $G_HW_MODEL in 45) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=allwinner/sun50i-h6-pine-h64-model-b.dtb' /boot/dietpiEnv.txt;; + 88) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=allwinner/sun50i-h618-orangepi-zero2w.dtb' /boot/dietpiEnv.txt;; *) :;; esac + # Overlay prefix case $G_HW_MODEL in 40|44) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-a64' /boot/dietpiEnv.txt;; 45) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h6' /boot/dietpiEnv.txt;; 57|65|67) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h5' /boot/dietpiEnv.txt;; - 83) - G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h616' /boot/dietpiEnv.txt - (( $HW_VARIANT == 2 )) && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=allwinner/sun50i-h618-orangepi-zero3.dtb' /boot/dietpiEnv.txt - ;; + 83|88) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h616' /boot/dietpiEnv.txt;; *) :;; esac + # Overlays case $G_HW_MODEL in 57|65) G_CONFIG_INJECT 'overlays=' 'overlays=usbhost1 usbhost2' /boot/dietpiEnv.txt;; 67) G_CONFIG_INJECT 'overlays=' 'overlays=analog-codec' /boot/dietpiEnv.txt;; *) :;; esac + # Console args case $G_HW_MODEL in 57|65) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,115200' /boot/dietpiEnv.txt;; # headless *) G_EXEC sed --follow-symlinks -i 's/ttyAML0/ttyS0/' /boot/dietpiEnv.txt;; @@ -995,7 +1007,7 @@ setenv rootuuid "true"' /boot/boot.cmd fi # Skip creating kernel symlinks and remove existing ones - G_DIETPI-NOTIFY 2 'Preventing obsolete kernel and initramfs symlink generation' + G_DIETPI-NOTIFY 2 'Preventing needless kernel and initramfs symlink generation' G_EXEC eval 'echo '\''do_symlinks=0'\'' > /etc/kernel-img.conf' G_EXEC rm -f /{,boot/}{initrd.img,vmlinuz}{,.old} @@ -1035,15 +1047,15 @@ _EOF_ [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' # Remove obsolete lists - G_EXEC rm -Rf /etc/apt/sources.list.d/* + find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + # Add Armbian repository G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" # Update APT lists G_AGUP # Install kernel, device tree, U-Boot, firmware and initramfs packages - local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() dietpi_com=0 + local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() dietpi_uboot=0 dietpi_kernel=0 case $G_HW_MODEL in - 10) model='odroidc1' kernel='meson' arch='arm' dietpi_com=1;; + 10) model='odroidc1' kernel='meson' arch='arm';; 11) model='odroidxu4' kernel='odroidxu4' arch='arm';; 12) model='odroidc2';; 16) model='odroidc4';; @@ -1068,14 +1080,14 @@ _EOF_ 2) model='nanopifire3';; *) model='nanopim3';; esac;; - 63) model='nanopim1' kernel='sunxi' arch='arm' dietpi_com=1;; + 63) model='nanopim1' kernel='sunxi' arch='arm';; 64) model='nanopiair' kernel='sunxi' arch='arm';; 65) kernel='sunxi64' case $HW_VARIANT in 2) model='nanopineo2black';; *) model='nanopineo2';; esac;; - 66) model='nanopim1plus' kernel='sunxi' arch='arm' dietpi_com=1;; + 66) model='nanopim1plus' kernel='sunxi' arch='arm';; 67) model='nanopik1plus' kernel='sunxi64';; 68) kernel='rockchip64' case $HW_VARIANT in @@ -1086,6 +1098,7 @@ _EOF_ 72) kernel='rockchip64' case $HW_VARIANT in 2) model='rock-4se';; + 3) model='rockpi-4cplus';; *) model='rockpi-4b';; esac;; 73) model='rockpi-s' kernel='rockchip64';; @@ -1108,16 +1121,11 @@ _EOF_ 85) model='rock-5a' kernel='rk35xx' branch='legacy';; 86) model='tinkerboard-2' kernel='rockchip64';; 87) model='orangepi3b' kernel='rockchip64' branch='edge';; + 88) model='orangepizero2w' kernel='sunxi64';; + 89) model='orangepi3-lts' kernel='sunxi64';; + 90) model='radxa-zero3' kernel='rk35xx' branch='legacy';; *) :;; esac - # Download and pre-install U-Boot hosted on dietpi.com where it has not been ported to the Armbian Bookworm repo or has been removed completely - if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 )) - then - G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb - aPACKAGES_REQUIRED_INSTALL+=("linux-u-boot-$model-$branch") - fi # Odroid C1: https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 if (( $G_HW_MODEL == 10 )) @@ -1143,33 +1151,32 @@ blacklist rockchip_vdec _EOF_ fi # Install initramfs-tools first to have an initramfs generated on kernel install, and configure it to use zstd if supported for better compression and faster decompression + if (( $dietpi_kernel )) + then + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb + G_EXEC rm package.deb + fi [[ $kernel == 'rockchip64' || $kernel == 'rk35xx' || $kernel == 'meson64' || $kernel == 'sunxi64' || $kernel == 'sunxi' || $kernel == 'rockchip' ]] && zstd=('zstd') - # - Download and pre-install a more recent armbian-firmware package from our server - #G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' - #G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - #G_EXEC rm package.deb G_AGI initramfs-tools u-boot-tools armbian-firmware "${zstd[@]}" [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf - # Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version - if (( $G_HW_MODEL == 83 )) + # Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version or is not available + if (( $dietpi_kernel )) then G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" - G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' - local uboot=() - #(( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 1 )) && { G_EXEC_OUTPUT=1 G_EXEC curl -fo package4.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb"; uboot=('package4.deb'); } - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb package3.deb "${uboot[@]}" - G_EXEC rm package1.deb package2.deb package3.deb "${uboot[@]}" + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package[12].deb + G_EXEC rm package[12].deb fi - # Orange Pi Zero 3 1.5G RAM variant: Install original Orange Pi bootloader - if (( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 2 )) + # Download and pre-install U-Boot hosted on dietpi.com where the Armbian APT repo provides a too old version or is not available + if (( $dietpi_uboot )) then - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next_1.5G.deb' - G_AGI linux-{image,dtb}-"$branch-$kernel" ./package.deb + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb" + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb G_EXEC rm package.deb - else - G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch" fi + # Install kernel and bootloader + G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch" # Cleanup [[ $G_HW_MODEL != 10 && -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next @@ -1179,10 +1186,7 @@ _EOF_ # Compile U-Boot script [[ -f '/boot/boot.cmd' ]] && G_EXEC mkimage -C none -A "$arch" -T script -d /boot/boot.cmd /boot/boot.scr # Flash U-Boot - # shellcheck disable=SC1091 - . /usr/lib/u-boot/platform_install.sh - # shellcheck disable=SC2154 - write_uboot_platform "$DIR" "$BOOT_DEVICE" + /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc "$BOOT_DEVICE" # Odroid C1 cleanup: https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 if (( $G_HW_MODEL == 10 )) @@ -1233,7 +1237,7 @@ _EOF_ # Skip creating kernel symlinks and remove existing ones if [[ -L '/vmlinuz' ]] then - G_DIETPI-NOTIFY 2 'Preventing obsolete kernel and initramfs symlink generation' + G_DIETPI-NOTIFY 2 'Preventing needless kernel and initramfs symlink generation' G_EXEC eval 'echo '\''do_symlinks=0'\'' > /etc/kernel-img.conf' G_EXEC rm -f /{initrd.img,vmlinuz}{,.old} fi @@ -1244,10 +1248,11 @@ _EOF_ # ARMv6/7: Add raspi-copies-and-fills local a32bit=() (( $G_HW_ARCH == 3 )) || a32bit=('raspi-copies-and-fills') - # Install our own raspberrypi-sys-mods - G_EXEC curl -sSfO 'https://dietpi.com/downloads/binaries/raspberrypi-sys-mods.deb' if findmnt -M /boot/firmware &> /dev/null then + G_DIETPI-NOTIFY 2 'Preventing needless kernel and initramfs symlink generation' + G_EXEC eval 'echo '\''do_symlinks=0'\'' > /etc/kernel-img.conf' + G_EXEC rm -f /{initrd.img,vmlinuz}{,.old} local kernel=() case $G_HW_MODEL in 0) @@ -1270,11 +1275,15 @@ _EOF_ 5) kernel=('linux-image-rpi-2712');; *) { G_DIETPI-NOTIFY 1 "Unexpected hardware model passed: \"$G_HW_MODEL\". Aborting ..."; exit 1; };; esac - G_AGI raspi-firmware "${kernel[@]}" raspi-utils ./raspberrypi-sys-mods.deb raspberrypi-archive-keyring "${a32bit[@]}" + # tiny-initramfs to satisfy dependency: https://github.com/RPi-Distro/repo/issues/358 + G_AGI raspi-firmware + G_CONFIG_INJECT 'SKIP_INITRAMFS_GEN=' 'SKIP_INITRAMFS_GEN=yes' /etc/default/raspi-firmware + G_AGI "${kernel[@]}" raspi-utils raspberrypi-sys-mods raspberrypi-archive-keyring "${a32bit[@]}" tiny-initramfs + G_EXEC apt-mark auto tiny-initramfs + G_EXEC rm -f /boot/initrd.img-* /boot/firmware/initramfs* else - G_AGI raspberrypi-bootloader raspberrypi-kernel libraspberrypi0 libraspberrypi-bin ./raspberrypi-sys-mods.deb raspberrypi-archive-keyring "${a32bit[@]}" + G_AGI raspberrypi-bootloader raspberrypi-kernel libraspberrypi0 libraspberrypi-bin raspberrypi-sys-mods raspberrypi-archive-keyring "${a32bit[@]}" fi - G_EXEC rm raspberrypi-sys-mods.deb # https://github.com/RPi-Distro/raspberrypi-sys-mods/pull/60 [[ -f '/etc/apt/trusted.gpg.d/microsoft.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/microsoft.gpg @@ -1285,14 +1294,6 @@ _EOF_ [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' - # Skip creating kernel symlinks and remove existing ones - if [[ -L '/vmlinuz' ]] - then - G_DIETPI-NOTIFY 2 'Preventing obsolete kernel and initramfs symlink generation' - G_EXEC eval 'echo '\''do_symlinks=0'\'' > /etc/kernel-img.conf' - G_EXEC rm -f /{initrd.img,vmlinuz}{,.old} - fi - # Quartz64 elif [[ $G_HW_MODEL == 49 && $(findmnt -Ufnro TARGET -T /boot) == '/' ]] then @@ -1301,55 +1302,31 @@ _EOF_ 3) variant='soquartz';; *) variant='quartz64a';; esac - G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/firmware-$variant.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb - aPACKAGES_REQUIRED_INSTALL+=("firmware-$variant") + G_AGI "firmware-$variant" # NanoPi M2/T2/Fire2 Linux 4.4: Requires dedicated boot partition, starting at 4 MiB for U-Boot, with ext4 filesystem elif [[ $G_HW_MODEL == 61 && $(findmnt -Ufnro FSTYPE -M /boot) == 'ext4' ]] && (( $(sfdisk -qlo Start "$BOOT_DEVICE" | mawk 'NR==2') >= 8192 )) then - G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-nanopi2.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb - aPACKAGES_REQUIRED_INSTALL+=('firmware-nanopi2') + G_AGI firmware-nanopi2 # VisionFive 2 elif (( $G_HW_MODEL == 81 )) then - G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' - dpkg-deb -I linux-image-visionfive2.deb conffiles | while read -r line - do - [[ -f $line ]] && G_EXEC rm "$line" - done - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb + G_AGI linux-image-visionfive2 libubootenv-tool G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf - aPACKAGES_REQUIRED_INSTALL+=('linux-image-visionfive2' 'libubootenv-tool') # Star64 elif (( $G_HW_MODEL == 84 )) then - G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/linux-image-star64.deb' - dpkg-deb -I linux-image-star64.deb conffiles | while read -r line - do - [[ -f $line ]] && G_EXEC rm "$line" - done - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb + G_AGI linux-image-star64 libubootenv-tool G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf - aPACKAGES_REQUIRED_INSTALL+=('linux-image-star64' 'libubootenv-tool') # Sparky SBC elif (( $G_HW_MODEL == 70 )) then - G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-sparkysbc.deb' - [[ -f '/boot/uenv.txt' ]] && G_EXEC rm /boot/uenv.txt - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb - aPACKAGES_REQUIRED_INSTALL+=('firmware-sparkysbc') + G_AGI firmware-sparkysbc G_EXEC curl -sSfo u-boot.gz 'https://dietpi.com/downloads/binaries/u-boot-sparkysbc.img.gz' G_EXEC gzip -d u-boot.gz @@ -1447,13 +1424,13 @@ _EOF_ [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' # Remove obsolete components from Armbian list and connect via HTTPS - G_EXEC rm -Rf /etc/apt/sources.list.d/{,.??,.[^.]}* - G_EXEC eval "echo 'deb https://apt.armbian.com $DISTRO_TARGET_NAME main' > /etc/apt/sources.list.d/dietpi-armbian.list" + find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + + G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" # Skip creating kernel symlinks and remove existing ones if [[ -L '/vmlinuz' ]] then - G_DIETPI-NOTIFY 2 'Preventing obsolete kernel and initramfs symlink generation' + G_DIETPI-NOTIFY 2 'Preventing needless kernel and initramfs symlink generation' G_EXEC eval 'echo '\''do_symlinks=0'\'' > /etc/kernel-img.conf' G_EXEC rm -f /{initrd.img,vmlinuz}{,.old} fi @@ -1610,7 +1587,7 @@ _EOF_ [[ -d '/usr/share/calendar' ]] && G_EXEC rm -R /usr/share/calendar # - Unused DEB package config files - find /etc \( -name '?*\.dpkg-dist' -o -name '?*\.dpkg-old' -o -name '?*\.dpkg-new' -o -name '?*\.dpkg-bak' -o -name '?*\.dpkg-del' -o -name '?*\.ucf-dist' -o -name '?*\.ucf-old' -o -name '?*\.ucf-new' \) -exec rm -v {} + + find / \( -name '*?.dpkg-dist' -o -name '*?.dpkg-old' -o -name '*?.dpkg-new' -o -name '*?.dpkg-bak' -o -name '*?.dpkg-del' -o -name '*?.ucf-dist' -o -name '*?.ucf-old' -o -name '*?.ucf-new' \) -exec rm -v {} + # - Fonts [[ -d '/usr/share/fonts' ]] && G_EXEC rm -R /usr/share/fonts @@ -1753,7 +1730,7 @@ _EOF_ # - Enable /etc/bashrc.d/ support for custom interactive non-login shell scripts: sed --follow-symlinks -i '\#/etc/bashrc\.d/#d' /etc/bash.bashrc # shellcheck disable=SC2016 - echo 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . $i; done; unset -v i' >> /etc/bash.bashrc + echo 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . "$i"; done; unset -v i' >> /etc/bash.bashrc # - Enable bash-completion for non-login shells: # - NB: It is called twice on login shells then, but exits directly if called once already. G_EXEC ln -sf /etc/profile.d/bash_completion.sh /etc/bashrc.d/dietpi-bash_completion.sh @@ -1973,8 +1950,8 @@ _EOF_' then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS2 - # PINE A64, Pinebook, PINE H64, NenoPi NEO Plus2, ZeroPi, NanoPi NEO, NanoPi M1, NanoPi NEO Air, NenoPi NEO2, NanoPi M1 Plus, NanoPi K1 Plus, ROCK Pi S, VisionFive 2, Orange Pi Zero 3, Star64 - elif [[ $G_HW_MODEL =~ ^(40|44|45|57|59|60|63|64|65|66|67|73|81|83|84)$ ]] + # PINE A64, Pinebook, PINE H64, NenoPi NEO Plus2, ZeroPi, NanoPi NEO, NanoPi M1, NanoPi NEO Air, NenoPi NEO2, NanoPi M1 Plus, NanoPi K1 Plus, ROCK Pi S, VisionFive 2, Orange Pi Zero 3, Star64, Orange Pi Zero 2W, Orange Pi 3 LTS + elif [[ $G_HW_MODEL =~ ^(40|44|45|57|59|60|63|64|65|66|67|73|81|83|84|88|89)$ ]] then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS0 @@ -1983,8 +1960,8 @@ _EOF_' then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS1 - # RK3588: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A - elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85)$ ]] + # Rockchip vendor: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A, Radxa ZERO 3 + elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85|90)$ ]] then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyFIQ0 @@ -2195,8 +2172,17 @@ SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATT SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" SUBSYSTEM=="leds", KERNEL=="user_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="wlan0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev wlan0", RUN+="/bin/ip l s down dev wlan0" _EOF_ - # Orange Pi 3B/Zero 3: Module does not load automatically, but we want it loaded on first boot in case firstrun setup is done via WiFi - elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] + # Orange Pi 5 Plus + elif (( $G_HW_MODEL == 82 )) + then + G_DIETPI-NOTIFY 2 'Assuring persistent classic Ethernet interface names: /etc/udev/rules.d/99-dietpi-orangepi5plus.rules' + cat << '_EOF_' > /etc/udev/rules.d/99-dietpi-orangepi5plus.rules +SUBSYSTEM=="net", KERNEL=="eth0", KERNELS=="0004:41:00.0", RUN:="/bin/true" +SUBSYSTEM=="net", KERNEL=="eth1", KERNELS=="0003:31:00.0", NAME="to_eth0", RUN:="/bin/true" +SUBSYSTEM=="net", KERNEL=="to_eth0", RUN="/bin/ip l s dev eth0 name eth1", RUN+="/bin/ip l s dev to_eth0 name eth0", RUN+="/bin/udevadm trigger -c add /sys/class/net/eth0 /sys/class/net/eth1" +_EOF_ + # Orange Pi 3B/Zero 3/Zero 2W: Module does not load automatically, but we want it loaded on first boot in case firstrun setup is done via WiFi + elif [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] then G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index ec02d67c2c..ef5063d4a9 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -116,6 +116,9 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsup # Workaround for failing IPv4 network connectivity check as GitHub Actions runners do not receive external ICMP echo replies G_CONFIG_INJECT 'CONFIG_CHECK_CONNECTION_IP=' 'CONFIG_CHECK_CONNECTION_IP=127.0.0.1' rootfs/boot/dietpi.txt +# Shutdown on failures before the custom script is executed +G_EXEC sed --follow-symlinks -i 's|Prompt_on_Failure$|{ journalctl -n 50; ss -tulpn; df -h; free -h; poweroff; }|' rootfs/boot/dietpi/dietpi-login + # Avoid DietPi-Survey uploads to not mess with the statistics G_EXEC rm rootfs/root/.ssh/known_hosts @@ -134,6 +137,9 @@ Pin-Priority: -1 _EOF_ fi +# ARMv6/7 Trixie: Temporarily prevent dist-upgrade on Trixie, as it fails due to 64-bit time_t transition causing dependency conflicts across the repo. +(( $arch < 3 )) && [[ $DISTRO == 'trixie' ]] && G_EXEC touch rootfs/boot/dietpi/.skip_distro_upgrade + # Automated build cat << _EOF_ >> rootfs/boot/Automation_Custom_Script.sh || Error_Exit 'Failed to generate Automation_Custom_Script.sh' echo '[ INFO ] Running Amiberry build script ...' diff --git a/.build/software/dietpi-software-build.bash b/.build/software/dietpi-software-build.bash index b29492cb9c..922283360b 100644 --- a/.build/software/dietpi-software-build.bash +++ b/.build/software/dietpi-software-build.bash @@ -129,6 +129,9 @@ G_EXEC sed --follow-symlinks -i 's|Prompt_on_Failure$|{ journalctl -n 50; ss -tu # Avoid DietPi-Survey uploads to not mess with the statistics G_EXEC rm rootfs/root/.ssh/known_hosts +# ARMv6/7 Trixie: Temporarily prevent dist-upgrade on Trixie, as it fails due to 64-bit time_t transition causing dependency conflicts across the repo. +(( $arch < 3 )) && [[ $DISTRO == 'trixie' ]] && G_EXEC touch rootfs/boot/dietpi/.skip_distro_upgrade + # Automated build cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || Error_Exit 'Failed to generate Automation_Custom_Script.sh' #!/bin/dash diff --git a/.github/workflows/armbian.yml b/.github/workflows/armbian.yml index 1872a37956..ab86ec4f0c 100644 --- a/.github/workflows/armbian.yml +++ b/.github/workflows/armbian.yml @@ -11,7 +11,7 @@ on: branch: description: 'Branch' type: choice - options: [legacy, current, edge] + options: [legacy, current, edge, vendor, vendor-boogie-panthor, collabora] default: current required: true board: @@ -21,6 +21,10 @@ on: description: 'Override Git owner of Armbian repo' gitbranch: description: 'Override Git branch of Armbian repo' + rebase: + description: 'Rebase onto latest armbian/main' + type: boolean + default: true concurrency: group: ${{ github.workflow }}-${{ github.event.inputs.asset }}-${{ github.event.inputs.branch }}-${{ github.event.inputs.board }} cancel-in-progress: true @@ -33,10 +37,61 @@ jobs: - name: Clone Armbian repo run: | owner='${{ github.event.inputs.gitowner }}' - [ "$owner" ] || owner='armbian' + [ "$owner" ] || owner='MichaIng' branch='${{ github.event.inputs.gitbranch }}' - [ "$branch" ] || branch='main' - git clone -b "$branch" --depth=1 "https://github.com/$owner/build" + [ "$branch" ] || branch='dietpi' + git clone -b "$branch" "https://github.com/$owner/build" + [ '${{ github.event.inputs.rebase }}' == 'false' ] && exit 0 || : + cd build + git config user.name "$GITHUB_REPOSITORY_OWNER" + git config user.email '${{ github.repository.owner.email }}' + if [ "$owner" != 'MichaIng' ] + then + git remote add dietpi https://github.com/MichaIng/build + git fetch dietpi dietpi + git rebase dietpi/dietpi + elif [ "$branch" != 'dietpi' ] + then + git fetch origin dietpi + git rebase origin/dietpi + fi + if [ "$owner" != 'armbian' ] + then + git remote add upstream https://github.com/armbian/build + git fetch upstream main + git rebase upstream/main + elif [ "$branch" != 'main' ] + then + git fetch origin main + git rebase origin/main + fi + - name: Obtain version suffix + run: | + cd build + read -r version < VERSION + case '${{ github.event.inputs.asset }}' in + firmware) package='armbian-firmware';; + uboot) package='linux-uboot-${{ github.event.inputs.board }}-${{ github.event.inputs.board }}';; + kernel) + family=$(. 'config/boards/${{ github.event.inputs.board }}.'* &> /dev/null; echo "$BOARDFAMILY") + echo "Board family is: $family" + family=$(BRANCH='${{ github.event.inputs.branch }}'; . "config/sources/families/$family.conf" &> /dev/null; echo "$LINUXFAMILY") + echo "Linux family is: $family" + package="linux-image-${{ github.event.inputs.branch }}-$family" + ;; + *) echo 'ERROR: Invalid asset "${{ github.event.inputs.asset }}"'; exit 1;; + esac + if curl -fO "https://dietpi.com/downloads/binaries/$package.deb" + then + cur_version=$(dpkg-deb -f "$package.deb" Version) + rm "$package.deb" + cur_suffix=${cur_version#*-dietpi} + echo "Current package version is: $cur_version" + fi + echo "New Armbian version is: $version" + [ "$version-dietpi$cur_suffix" = "$cur_version" ] && version="$version-dietpi$((cur_suffix+1))" || version="$version-dietpi1" + echo "New package version will be: $version" + echo "$version" > VERSION - name: Build asset run: | cd build diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index cb92edee03..273bc1a334 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -70,6 +70,7 @@ jobs: '"-m 70 -d 6 -e all", '\ '"-m 72.1 -d 6", "-m 72.1 -d 7", "-m 72.1 -d 8", '\ '"-m 72.2 -d 6", "-m 72.2 -d 7", "-m 72.2 -d 8", '\ + '"-m 72.3 -d 6", "-m 72.3 -d 7", "-m 72.3 -d 8", '\ '"-m 73 -d 6", "-m 73 -d 7", "-m 73 -d 8", '\ '"-m 74 -d 6", "-m 74 -d 7", "-m 74 -d 8", '\ '"-m 75 -a 1 -d 6", "-m 75 -a 2 -d 6", "-m 75 -a 3 -d 6", "-m 75 -a 10 -d 6", '\ @@ -85,12 +86,14 @@ jobs: '"-m 80 -d 6", "-m 80 -d 7", "-m 80 -d 8", '\ '"-m 81 -d 8", '\ '"-m 82 -d 6", "-m 82 -d 7", "-m 82 -d 8", '\ - '"-m 83.1 -d 6", "-m 83.1 -d 7", "-m 83.1 -d 8", '\ - '"-m 83.2 -d 6", "-m 83.2 -d 7", "-m 83.2 -d 8", '\ + '"-m 83 -d 6", "-m 83 -d 7", "-m 83 -d 8", '\ '"-m 84 -d 8", '\ '"-m 85 -d 6", "-m 85 -d 7", "-m 85 -d 8", '\ '"-m 86 -d 6", "-m 86 -d 7", "-m 86 -d 8", '\ - '"-m 87 -d 6", "-m 87 -d 7", "-m 87 -d 8"]' >> "$GITHUB_OUTPUT" + '"-m 87 -d 6", "-m 87 -d 7", "-m 87 -d 8", '\ + '"-m 88 -d 6", "-m 88 -d 7", "-m 88 -d 8", '\ + '"-m 89 -d 6", "-m 89 -d 7", "-m 89 -d 8", '\ + '"-m 90 -d 6", "-m 90 -d 7", "-m 90 -d 8"]' >> "$GITHUB_OUTPUT" elif [ "${{ github.event.inputs.buildargs }}" = 'quartz64' ] then echo buildargs=[\ @@ -130,4 +133,4 @@ jobs: ${{ secrets.GPG_KEY }} _EOF_ - name: Run DietPi-Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=${GITHUB_REF#refs/heads/}; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/images/dietpi-build")" 'DietPi-Build' ${{ matrix.buildargs }} --sign '${{ secrets.GPG_PASS }}' + run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/images/dietpi-build")" 'DietPi-Build' ${{ matrix.buildargs }} --sign '${{ secrets.GPG_PASS }}' diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index f10f4e2687..397e94220d 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -181,7 +181,7 @@ Process_Software() 152) aSERVICES[i]='avahi-daemon' aUDP[i]='5353';; 153) aSERVICES[i]='octoprint' aTCP[i]='5001'; (( $arch == 10 )) || aDELAY[i]=60;; 154) aSERVICES[i]='roonserver';; # Listens on a variety of different port ranges - 155) aSERVICES[i]='htpc-manager' aTCP[i]='8085';; + 155) aSERVICES[i]='htpc-manager' aTCP[i]='8085'; (( $arch == 10 )) || aDELAY[i]=30; [[ $arch == 3 && $DISTRO == 'trixie' ]] && aDELAY[i]=60;; 157) aSERVICES[i]='home-assistant' aTCP[i]='8123'; (( $arch == 10 )) && aDELAY[i]=60 || aDELAY[i]=900;; 158) aSERVICES[i]='minio' aTCP[i]='9001 9004';; 161) aSERVICES[i]='bdd' aTCP[i]='80 443';; @@ -368,6 +368,9 @@ G_EXEC eval 'echo -e '\''[Service]\nAmbientCapabilities='\'' > rootfs/etc/system # Workaround for sysctl: permission denied on key "net.core.rmem_max" in containers G_EXEC sed --follow-symlinks -i '/# Start DietPi-Software/a\sed -i '\''/G_EXEC sysctl -w net\.core\.rmem_max/d'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login +# ARMv6/7 Trixie: Temporarily prevent dist-upgrade on Trixie, as it fails due to 64-bit time_t transition causing dependency conflicts across the repo. +(( $arch < 3 )) && [[ $DISTRO == 'trixie' ]] && G_EXEC touch rootfs/boot/dietpi/.skip_distro_upgrade + # Check for service status, ports and commands # shellcheck disable=SC2016 # - Start all services diff --git a/.github/workflows/raspberrypi-sys-mods.yml b/.github/workflows/raspberrypi-sys-mods.yml index ea4e845776..675e3af75e 100644 --- a/.github/workflows/raspberrypi-sys-mods.yml +++ b/.github/workflows/raspberrypi-sys-mods.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Build - run: sudo bash -c "$(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/software/raspberrypi-sys-mods/build.bash")" + run: sudo bash -c "$(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/raspberrypi-sys-mods/build.bash")" - name: Upload run: | # SSH server and client keys diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index c601631b40..cb2c6a5599 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -92,6 +92,9 @@ shopt -s extglob [85]='ROCK 5A' [86]='ASUS Tinker Board 2' [87]='Orange Pi 3B' + [88]='Orange Pi Zero 2W' + [89]='Orange Pi 3 LTS' + [90]='Radxa ZERO 3' ) ## Benchmark data arrays: aBENCH_XX[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}] @@ -713,10 +716,11 @@ shopt -s extglob aSOFTWARE_NAME9_1[i]=${aSOFTWARE_NAME9_0[i]} aSOFTWARE_NAME9_2[i]=${aSOFTWARE_NAME9_1[i]} aSOFTWARE_NAME9_3[i]=${aSOFTWARE_NAME9_2[i]} + aSOFTWARE_NAME9_4[i]=${aSOFTWARE_NAME9_3[i]} done # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME9_3[@]}" + for i in "${aSOFTWARE_NAME9_4[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index d4bcc7f4e8..b3ddc055e3 100755 --- a/.update/patches +++ b/.update/patches @@ -1231,14 +1231,6 @@ Patch_8_19() # Mopidy: Bullseye suite now available in official APT repo [[ -f '/etc/apt/sources.list.d/mopidy.list' ]] && grep -q buster /etc/apt/sources.list.d/mopidy.list && G_EXEC sed --follow-symlinks -i 's/buster/bullseye/' /etc/apt/sources.list.d/mopidy.list - # GMediaRender - grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' gmediarender 2> /dev/null)" lt 0.1-dietpi1 && G_WHIP_MSG '[ INFO ] GMediaRender update available -\nAn update to GMediaRender 0.1 is available. -Release notes: https://github.com/hzeller/gmrender-resurrect/releases -\nDo you want to apply the update now? -\nYou can manually apply it any time via: -# dietpi-software reinstall 163' && echo 163 >> /var/tmp/dietpi/dietpi-update_reinstalls - # ympd if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[32\]=2' /boot/dietpi/.installed then @@ -1554,6 +1546,7 @@ Patch_9_2() fi } +PATCH_9_3_RAN=0 Patch_9_3() { # Purge ancient vmtouch which prevents /boot from being unmounted e.g. for RPi firmware migration: https://github.com/MichaIng/DietPi/issues/6819, https://github.com/MichaIng/DietPi/issues/6976 @@ -1561,9 +1554,79 @@ Patch_9_3() # Add DietPi APT repo /boot/dietpi/func/dietpi-set_software apt-mirror dietpi - G_AGUP -v - # shellcheck disable=SC2154 - (( $G_AGUP_COUNT )) && G_AGUG + G_AGUP + G_AGUG + PATCH_9_3_RAN=1 +} + +Patch_9_4() +{ + # Update DietPi APT list for several SBCs we added components to our repo for + if [[ $PATCH_9_3_RAN == 0 && $G_HW_MODEL =~ ^(11|40|44|45|48|56|57|59|60|64|65|67|76|78|79|80|82|83|85|88|89|90)$ ]] + then + /boot/dietpi/func/dietpi-set_software apt-mirror dietpi + G_AGUP + G_AGUG + fi + + # Odroid XU4 + if (( $G_HW_MODEL == 11 )) + then + G_DIETPI-NOTIFY 2 'Migrating boot.ini to support new Linux 6.6 device tree overlay locations' + /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc + # shellcheck disable=SC2016 + G_EXEC sed --follow-symlinks -i '\|/boot/dtb/overlays/${overlay}.dtbo|c\ load mmc 0:1 0x60000000 /boot/dtb/${overlay}.dtbo || load mmc 0:1 0x60000000 /boot/dtb/overlays/${overlay}.dtbo || load mmc 0:1 0x60000000 dtb/${overlay}.dtbo || load mmc 0:1 0x60000000 dtb/overlays/${overlay}.dtbo' /boot/boot.ini + G_DIETPI-NOTIFY 2 'Fixing CEC toggle in boot.ini' + G_EXEC sed --follow-symlinks -i 's|rm /cec@101B0000;|rm /soc/cec@101b0000;|' /boot/boot.ini + G_DIETPI-NOTIFY 2 'Cleaning up obsolete configs' + [[ -f '/etc/modprobe.d/odroid-cloudshell.conf' ]] && G_EXEC rm /etc/modprobe.d/odroid-cloudshell.conf + G_EXEC sed --follow-symlinks -Ei '/^[[:blank:]]*(gpioplug-ir-recv|fbtft_device)[[:blank:]]*$/d' /etc/modules + + # Orange Pi 5 Plus + elif (( $G_HW_MODEL == 82 )) + then + G_DIETPI-NOTIFY 2 'Assuring persistent classic Ethernet interface names: /etc/udev/rules.d/99-dietpi-orangepi5plus.rules' + G_WHIP_MSG '[ WARN ] Persistent eth0/eth1 interface names will be applied +\nSince classic interface names are randomly applied among the two onboard Ethernet adapters, we install a udev rule, which assures they remain the same on each (re)boot: +- /etc/udev/rules.d/99-dietpi-orangepi5plus.rules +\nIf you applied an own workaround via /etc/network/interfaces or similar, this will not be affected. But if you created own udev rules to mitigate the issue, please check whether those conflict with ours. Of course you can remove or rename above file to maintain status quo.' + cat << '_EOF_' > /etc/udev/rules.d/99-dietpi-orangepi5plus.rules +SUBSYSTEM=="net", KERNEL=="eth0", KERNELS=="0004:41:00.0", RUN:="/bin/true" +SUBSYSTEM=="net", KERNEL=="eth1", KERNELS=="0003:31:00.0", NAME="to_eth0", RUN:="/bin/true" +SUBSYSTEM=="net", KERNEL=="to_eth0", RUN="/bin/ip l s dev eth0 name eth1", RUN+="/bin/ip l s dev to_eth0 name eth0", RUN+="/bin/udevadm trigger -c add /sys/class/net/eth0 /sys/class/net/eth1" +_EOF_ + # Orange Pi Zero 3 1.5 GiB RAM: Fix lost Ethernet adapter on reboot: https://github.com/MichaIng/DietPi/issues/6938 + elif (( $G_HW_MODEL == 83 )) && dpkg-query -s 'linux-u-boot-orangepizero3-next' &> /dev/null + then + G_DIETPI-NOTIFY 2 'Switching to new U-Boot build which fixes lost Ethernet adapter on reboot ...' + G_AGP linux-u-boot-orangepizero3-next + G_AGI linux-u-boot-orangepizero3-current + /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc + fi + + if [[ -f '/boot/dietpi/.installed' ]] + then + # GMediaRender + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && ! dpkg-query -s 'gmediarender' &> /dev/null + then + # Pre-v8.10 + G_DIETPI-NOTIFY 2 'Updateing GMediaRender ...' + [[ -f '/etc/systemd/system/gmediarender.service' ]] && G_EXEC rm /etc/systemd/system/gmediarender.service + [[ -d '/etc/systemd/system/gmediarender.service.d' ]] && grep -Rq '/usr/local/bin/gmediarender' /etc/systemd/system/gmediarender.service.d && G_EXEC rm -R /etc/systemd/system/gmediarender.service.d + getent passwd gmrender > /dev/null && G_EXEC userdel gmrender + getent group gmrender > /dev/null && G_EXEC groupdel gmrender + [[ -f '/usr/local/bin/gmediarender' ]] && G_EXEC rm /usr/local/bin/gmediarender + [[ -d '/usr/local/share/gmediarender' ]] && G_EXEC rm -R /usr/local/share/gmediarender + G_AGI gmediarender + fi + + # Shairport Sync + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[37\]=2' /boot/dietpi/.installed + then + [[ -f '/usr/local/share/man/man7/shairport-sync.7.gz' ]] && G_EXEC rm /usr/local/share/man/man7/shairport-sync.7.gz + [[ -d '/usr/local/share/man/man7' ]] && G_EXEC rmdir -p --ignore-fail-on-non-empty /usr/local/share/man/man7 + fi + fi } # v6.35 => v7 migration diff --git a/.update/pre-patches b/.update/pre-patches index e650adb30e..11fbb5afe4 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -412,5 +412,19 @@ _EOF_ fi fi +# v9.4 +if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 4 ) )) +then + if (( $G_HW_MODEL < 10 && $G_DISTRO > 6 )) && dpkg-query -s 'raspi-firmware' &> /dev/null && ! apt-mark showmanual | grep -E '^(initramfs-tools|dracut|tiny-initramfs)(-core)?$' + then + G_DIETPI-NOTIFY 2 'Satisfying initramfs package dependency of raspi-firmware with tiny-initramfs' # https://github.com/RPi-Distro/repo/issues/358 + G_CONFIG_INJECT 'SKIP_INITRAMFS_GEN=' 'SKIP_INITRAMFS_GEN=yes' /etc/default/raspi-firmware + G_AGI tiny-initramfs + G_EXEC apt-mark auto tiny-initramfs + G_AGP initramfs-tools + G_EXEC rm -f /boot/initrd.img-* /boot/firmware/initramfs* + fi +fi + exit 0 } diff --git a/.update/version b/.update/version index a54ce2d4d0..9e903dac26 100644 --- a/.update/version +++ b/.update/version @@ -2,8 +2,8 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=9 -G_REMOTE_VERSION_SUB=3 -G_REMOTE_VERSION_RC=0 +G_REMOTE_VERSION_SUB=4 +G_REMOTE_VERSION_RC=2 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=7 G_MIN_VERSION_SUB=0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 11a2610a26..e6e8a1cdfc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,9 +1,42 @@ +v9.4 +(2024-05-12) + +New images: +- ROCK 4C Plus | Since our Radxa ROCK 4 image has become incompatible with the ROCK 4C Plus, we provide a new image for this particular variant. Many thanks to @lfiorini and @arpegius5555 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6593, https://github.com/MichaIng/DietPi/issues/6935 +- Orange Pi 3 LTS | Added support for this Allwinner H6 based SBC. +- Radxa ZERO 3 | Added support for this Rockchip RK3566 based SBC, the 3E variant with Ethernet as well as the 3W variant with onboard WiFi. +- Orange Pi Zero 2W | Support for this small form factor SBC with Allwinner H618 SoC was added. + +Enhancements: +- General | Our scripts do now internally enforce the default umask 0022. Many config and install options rely on this, hence it can cause issues when e.g. 0027 (deny read access for "other" users) has been applied on the parent shell. This affects only the (sub)shell of our scripts, while the current and default umask of parent and of shells/consoles remains untouched. +- NanoPi R5C | New images, or when flashing the new bootloader binary via dietpi-config > Advanced Options > Update MMC bootloader, support M.2 WiFi modules. +- Orange Pi 3B | Added an option for updating the SPI bootloader via dietpi-config > Advanced Options > Update SPI bootloader. +- Odroid XU4 | The kernel will be upgraded to Linux 6.6. +- DietPi-CloudShell | On Odroid XU4, when using the CloudShell 2 LCD, during configured auto screen off times, the backlight power of the LCD will be disabled as well, to safe energy and avoid still visible black display content. Many thanks to @smac for suggesting this enhancement: https://dietpi.com/forum/t/15331/55 +- DietPi-Config | Added an option to the LCD display menu to toggle the Odroid XU4 CloudShell 2 LCD. +- DietPi-Software | Snapcast: 64-bit ARM and Debian Bookworm + Trixie will have the now available packages from Snapcast installed, instead of those from the Debian repository. + +Bug fixes: +- NanoPi NEO3 | Resolved an issue where the Ethernet adapter was not available after reboots. Many thanks to @murraythegoz for reporting this issue: https://github.com/MichaIng/DietPi/issues/6987 +- Orange Pi Zero 3 | Resolved an issue on the 1.5 GiB RAM variant, where the Ethernet adapter was not available anymore after soft/warm reboots. +- Orange Pi 5 Plus | Resolved an issue where the Ethernet interface names eth0/eth1 could swap on (re)boot. We add a udev rule which assures they are named persistently based on the PCI bus identifier. In case you created own udev rules to mitigate the issue, please check whether they conflict and decide whether to use ours or your solution. The DietPi update will also inform you about this change with a prompt. Many thanks to @dirkhh and many others for reporting this issue: https://github.com/MichaIng/DietPi/issues/6592 +- DietPi-VPN | Resolved an issue where installing the IPVanish config failed, due to a changed URL, and startup failed on Bookworm systems since their configs contain a deprecated option. Many thanks to @DreamPhreak and @Michael-Robson for reporting this issue: https://github.com/MichaIng/DietPi/issues/7043 +- DietPi-Imager | Resolved an issue where the imager could have failed on GPT partitioned images, if either the source image size did not leave space for the GPT backup partition table, or the first usable LBA/sector was above 34. The GPT backup partition table is now created only at the end of the image generation, not anymore additionally at the start, and the required size it takes is correctly obtained. Many thanks to @SelfhostedPro and @disablewong for reporting this issue: https://github.com/MichaIng/DietPi/issues/7024, https://dietpi.com/forum/t/18035 +- DietPi-Config | Resolved a visual-only failure message on non-RPi systems, when enabling Bluetooth, and an actual failure doing so on Orange Pi Zero 3, Orange Pi 3B and Orange Pi Zero 2W, since the required kernel module "sprdbt_tty" was not loaded. Many thanks to @b9AcE for reporting this issue: https://dietpi.com/forum/t/19929/45 +- DietPi-Software | Snapcast: Resolved an issue where version 0.27.0 was installed, because since version 0.28.0, Snapcast is provided with client and server packages wrapped into one archive, instead having individual downloads for each package. +- DietPi-Software | OctoPrint: Resolved an issue where the installation failed on RISC-V and ARMv6/7 Bullseye systems, due to changed dependencies. +- DietPi-Software | X.Org X Server: Resolved an issue where an important config file might have been missing on RPi 5 and potentially Amlogic S905 SBCs, if the config directory /etc/X11/xorg.conf.d did not exist and was not created as part of the related APT packages. Many thanks to @rmscode for reporting this issue: https://dietpi.com/forum/t/19963 + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/7063 + +----------------------------------------------------------------------------------------------------------- + v9.3 (2024-04-14) Enhancements: -- General | We added an own APT repository at https://dietpi.com/apt for own software and kernel/firmware builds. This simplifies updates for software packages like Squeezelite, vaultwarden and Amiberry, as well as allows us to provide own up-to-date kernel and bootloader packages, applied via regular "apt upgrade". A goal is also to become independent of some 3rd party repositories, which are regularly affected by network errors or provide packages updates too infrequently. -- DietPi-Config | Removed the 3.5mm audio option on Raspberry Pi 5, as it does not have a 3.5mm jack. Additionally, the KMS graphics driver is enabled OOTB when HDMI audio is selected, as the snd_bcm2835 driver does not work on Raspberry Pi 5. Many thanks to @JRK0469 for making us aware of this: https://dietpi.com/forum/t/19760 +- General | We added an own APT repository at https://dietpi.com/apt for own software and kernel/firmware builds. This simplifies updates for software packages like Squeezelite, vaultwarden and Amiberry, as well as allows us to provide own up-to-date kernel and bootloader packages, applied via regular "apt upgrade". A goal is also to become independent of some 3rd party repositories, which are regularly affected by network errors or provide package updates too infrequently. +- DietPi-Config | Removed the 3.5mm audio option on Raspberry Pi 5, as it does not have a 3.5mm jack. Additionally, the KMS graphics driver is enabled OOTB when HDMI audio is selected, as the snd_bcm2835 driver does not work on Raspberry Pi 5. Many thanks to @denguido for making us aware of this: https://dietpi.com/forum/t/19760 - DietPi-Software | Mosquitto: The official APT repository added support for 64-bit ARM on Bookworm, which is now used for our installation. - DietPi-Software | UnRAR: Debian added unrar packages for RISC-V, which are now used for our installation. diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index d5927cee6c..3d2e91e048 100755 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -39,27 +39,26 @@ BLANK_SCREEN_TIME_HOUR_END=0 # This will only work if dietpi-cloudshell was started via dietpi-autostart/dietpi-login, as the setterm power options can only be applied when the command originates from the same terminal without redirects. - RUN_BLANK_SCREEN_AT_SPECIFIC_TIME(){ - + RUN_BLANK_SCREEN_AT_SPECIFIC_TIME() + { local current_hour=$(date '+%-H') # Turn screen off - if (( ! $BLANK_SCREEN_ACTIVE )); then - - (( $BLANK_SCREEN_TIME_HOUR_START == $current_hour )) || return - + if (( ! $BLANK_SCREEN_ACTIVE && $BLANK_SCREEN_TIME_HOUR_START == $current_hour )) + then clear echo -e '\n\nScreen will be powered down in under 1 minute\n' setterm --blank 1 --powersave on # Blank after 1 minute as force requires a poke to bring it back up BLANK_SCREEN_ACTIVE=1 - # Turn screen on - elif (( $BLANK_SCREEN_TIME_HOUR_END == $current_hour )); then + # Odroid XU4 CloudShell 2 backlight + [[ $G_HW_MODEL == 11 && -f '/sys/class/backlight/fb_hktft32/bl_power' ]] && echo 0 > /sys/class/backlight/fb_hktft32/bl_power + # Turn screen on + elif (( $BLANK_SCREEN_ACTIVE && $BLANK_SCREEN_TIME_HOUR_END == $current_hour )) + then Disable_Screen_Blanking - fi - } Disable_Screen_Blanking(){ @@ -68,6 +67,8 @@ setterm --blank 0 --powersave off BLANK_SCREEN_ACTIVE=0 + # Odroid XU4 CloudShell 2 backlight + [[ $G_HW_MODEL == 11 && -f '/sys/class/backlight/fb_hktft32/bl_power' ]] && echo 1 > /sys/class/backlight/fb_hktft32/bl_power } # Converts a byte int to string, in human readable byte format. @@ -1499,8 +1500,7 @@ _EOF_ if [[ $G_WHIP_RETURNED_VALUE == 'Toggle' ]];then - ((BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED++)) - (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED > 1 )) && BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED=0 + BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED=$(( ! $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )) elif [[ $G_WHIP_RETURNED_VALUE == 'Start time' ]];then diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 549a17b264..f97fc96d59 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -216,11 +216,10 @@ # Remote local odroid_remote_text='Off' local odroid_remote_enabled=0 - if [[ -f '/etc/systemd/system/odroid-remote.service' ]]; then - + if grep -Eq '^[[:blank:]]*(gpio-ir-recv|meson_ir)[[:blank:]]*$' /etc/modules || systemctl -q is-enabled lircd 2> /dev/null + then odroid_remote_text='On' odroid_remote_enabled=1 - fi G_WHIP_MENU_ARRAY+=('10' ": Odroid remote : [$odroid_remote_text]") @@ -260,7 +259,7 @@ else G_WHIP_MENU_ARRAY+=('odroid-lcd35' ': 480x320 panel with touch input') - (( $G_HW_MODEL == 11 )) && G_WHIP_MENU_ARRAY+=('odroid-cloudshell' ': 320x240 panel') + (( $G_HW_MODEL == 11 )) && G_WHIP_MENU_ARRAY+=('odroid-cloudshell' ': 320x240 panel' 'odroid-cloudshell2' ': Odroid XU4 CloudShell 2 LCD') fi @@ -330,7 +329,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin /boot/dietpi/func/dietpi-set_hardware remoteir none && REBOOT_REQUIRED=1 - elif G_WHIP_YESNO 'This will enable the IR modules, setup Lirc and the Odroid Remote for Odroid C1, C2 and XU4 Cloudshell. + elif G_WHIP_YESNO 'This will enable the IR modules, setup Lirc and the Odroid Remote for Odroid C1, C2 and XU4 CloudShell. \nNB: Other remotes can be configured by running "irrecord" and applying the codes to "/etc/lirc/lircd.conf"\n\nDo you wish to continue?'; then /boot/dietpi/func/dietpi-set_hardware remoteir odroid_remote && REBOOT_REQUIRED=1 @@ -1050,8 +1049,8 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the # Armbian U-Boot update if [[ -f '/usr/lib/u-boot/platform_install.sh' ]] then - local rootdev=$(lsblk -npo PKNAME "$G_ROOTFS_DEV") - G_WHIP_MENU_ARRAY+=('Update MMC bootloader' ": Flash current U-Boot to $rootdev") + local bootdev=$(lsblk -npo PKNAME "$(findmnt -Ufnro SOURCE -T /boot)") + G_WHIP_MENU_ARRAY+=('Update MMC bootloader' ": Flash current U-Boot to $bootdev") fi # RPi 4/5 EEPROM update: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md @@ -1068,11 +1067,17 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_MENU_ARRAY+=('Update RPi EEPROM firmware' ': Install rpi-eeprom APT package') fi - # 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)$ ]] + # ROCK 4, ROCK 5B, Orange Pi 5 (Plus) and Orange Pi 3B: https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 + elif [[ $G_HW_MODEL =~ ^(72|78|80|82|87)$ ]] then # 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') + local spidev='/dev/mtdblock0' + (( $G_HW_MODEL == 72 )) || { + [[ -f '/usr/lib/u-boot/platform_install.sh' ]] && { + { [[ -e '/dev/mtd0' ]] && grep -q '/dev/mtd0' /usr/lib/u-boot/platform_install.sh && spidev='/dev/mtd0'; } || + { [[ -b '/dev/mtdblock0' ]] && grep -q 'rksd_loader.img' /usr/lib/u-boot/platform_install.sh; } + } + } && G_WHIP_MENU_ARRAY+=("Update SPI bootloader' ': Flash current U-Boot to $spidev") # VisionFive 2/Star64: https://doc-en.rvspace.org/VisionFive2/PDF/VisionFive2_QSG.pdf elif (( $G_HW_MODEL == 81 || $G_HW_MODEL == 84 )) @@ -1088,8 +1093,8 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && bluetooth_state=0 bluetooth_state_text='Off' G_WHIP_MENU_ARRAY+=('Bluetooth' ": [$bluetooth_state_text]") - # Orange Pi Zero 3 specific - if (( $G_HW_MODEL == 83 )) + # Orange Pi Zero 3/Zero 2W specific + if (( $G_HW_MODEL == 83 || $G_HW_MODEL == 88 )) then # SPI state local spi_enabled=$(grep -Ecm1 '^[[:blank:]]*overlays=(.*[[:blank:]])?spi1-cs1-spidev([[:blank:]]|$)' /boot/dietpiEnv.txt) @@ -1208,14 +1213,9 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr elif [[ $G_WHIP_RETURNED_VALUE == 'Update MMC bootloader' ]]; then G_WHIP_YESNO "[ INFO ] MMC bootloader update -\nThis will flash the U-Boot image of the installed linux-u-boot-* package to the MMC device $rootdev. +\nThis will flash the U-Boot image of the installed linux-u-boot-* package to the MMC device $bootdev. \nDo you want to continue?" || return 0 - # shellcheck disable=SC1091 - . /usr/lib/u-boot/platform_install.sh - # Do not mute progress and error messages - eval "$(declare -f write_uboot_platform | sed -e 's| > /dev/null 2>&1||g' -e 's|status=none|status=progress|g')" - # shellcheck disable=SC2154 - write_uboot_platform "$DIR" "$rootdev" + /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc "$bootdev" elif [[ $G_WHIP_RETURNED_VALUE == 'Update SPI bootloader' ]]; then @@ -1238,17 +1238,28 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr G_CONFIG_INJECT 'overlays=' "overlays=${overlays[*]}" /boot/dietpiEnv.txt G_CONFIG_INJECT 'param_spinor_spi_bus=' 'param_spinor_spi_bus=1' /boot/dietpiEnv.txt REBOOT_REQUIRED=1 - return 0 fi - fi - G_WHIP_YESNO '[ INFO ] SPI bootloader update + + elif [[ $spidev == '/dev/mtd0' ]] + then + 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/mtd0. +\nDo you want to continue?' || return 0 + G_AG_CHECK_INSTALL_PREREQ mtd-utils + # shellcheck disable=SC1091 + . /usr/lib/u-boot/platform_install.sh + write_uboot_platform_mtd + else + 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 + # shellcheck disable=SC1091 + . /usr/lib/u-boot/platform_install.sh + # shellcheck disable=SC2154 + [[ -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 + fi elif [[ $G_WHIP_RETURNED_VALUE == 'Update bootloader' ]]; then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bf9a3d068c..7a315c4a76 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2654,9 +2654,12 @@ _EOF_ if To_Install 6 # X.Org X Server then - # Generic X server + Mesa OpenGL libraries and utilities + # Generic X server and utilities aDEPS=('xserver-xorg-core' 'xserver-xorg-input-libinput' 'xinit' 'dbus-user-session' 'xfonts-base' 'x11-xserver-utils' 'x11-utils') + # Pre-create config dir: https://dietpi.com/forum/t/19963 + G_EXEC mkdir -p /etc/X11/xorg.conf.d + # RPi if (( $G_HW_MODEL < 10 )) then @@ -3332,7 +3335,7 @@ _EOF_ esac # Download binary - local fallback_url="https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-$arch.tar.gz" + local fallback_url="https://github.com/prometheus/node_exporter/releases/download/v1.8.0/node_exporter-1.8.0.linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/prometheus/node_exporter/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/node_exporter-.*\.linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC mkdir -p /opt/node_exporter G_EXEC cp --preserve=mode node_exporter*/node_exporter /opt/node_exporter/ @@ -3881,20 +3884,20 @@ _EOF_ then # APT deps for Synapse with PostgreSQL case $G_HW_ARCH in - [12]|11) - if (( $G_DISTRO < 7 )) - then - G_AGI libtiff5 libopenjp2-7 libxcb1 # ARMv6/7: Runtime libs for Pillow from piwheels (libtiff5 pulls libjpeg62-turbo) - else - # Bookworm: Most wheels need to be compiled: gcc and libffi-dev for cffi, Rust for cryptography and matrix-synapse, libpq-dev for psycopg2, make for PyNaCl, libjpeg62-turbo-dev for Pillow, libssl-dev and pkg-config for cryptography - G_AGI gcc libffi-dev libpq-dev make libjpeg62-turbo-dev libssl-dev pkg-config - G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh - G_EXEC chmod +x rustup-init.sh - # RPi with 64-bit kernel on 32-bit image: Enforce 32-bit toolchain: https://github.com/MichaIng/DietPi/issues/6306 - G_EXEC_OUTPUT=1 G_EXEC ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} - G_EXEC rm rustup-init.sh - export PATH="/root/.cargo/bin:$PATH" - fi + 1|2) + local libtiff='libtiff6' + (( $G_DISTRO < 7 )) && libtiff='libtiff5' + G_AGI "$libtiff" libopenjp2-7 libxcb1 # ARMv6/7: Runtime libs for Pillow from piwheels (libtiff pulls libjpeg62-turbo) + ;; + 11) + # gcc and libffi-dev for cffi, Rust for cryptography and matrix-synapse, libpq-dev for psycopg2, make for PyNaCl, libjpeg62-turbo-dev for Pillow, libssl-dev and pkg-config for cryptography + G_AGI gcc libffi-dev libpq-dev make libjpeg62-turbo-dev libssl-dev pkg-config + G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh + G_EXEC chmod +x rustup-init.sh + # RPi with 64-bit kernel on 32-bit image: Enforce 32-bit toolchain: https://github.com/MichaIng/DietPi/issues/6306 + G_EXEC_OUTPUT=1 G_EXEC ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} + G_EXEC rm rustup-init.sh + export PATH="/root/.cargo/bin:$PATH" ;; *) G_AGI gcc libpq-dev;; # ARMv8/x86_64: psycopg2 needs to be compiled esac @@ -4895,7 +4898,7 @@ The install script will now exit. After applying one of the the above, rerun die if To_Install 32 ympd # ympd then - Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/ympd_$G_HW_ARCH_NAME.deb" + G_AGI ympd G_EXEC systemctl stop ympd fi @@ -6206,7 +6209,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/navidrome/navidrome/releases/download/v0.51.1/navidrome_0.51.1_linux_$arch.tar.gz" + local fallback_url="https://github.com/navidrome/navidrome/releases/download/v0.52.0/navidrome_0.52.0_linux_$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/navidrome/navidrome/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/navidrome_[0-9.]*_linux_$arch\.tar\.gz\"$/{print \$4}")" /opt/navidrome # Data dir @@ -6302,7 +6305,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.8.0/kavita-linux-$arch.tar.gz" + local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.8.1/kavita-linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC chmod +x Kavita/Kavita @@ -6368,7 +6371,7 @@ _EOF_ G_WHIP_MSG "[ INFO ] The installation of Remote.It is complete. \nThe final step is to register your claim code with your desktop application. See the manual below for instructions on how to do this. -\nhttps://docs.remote.it/software/device-package/installation#3.-claim-and-register-the-device +\nhttps://docs.remote.it/software/device-package/installation#id-3.-claim-and-register-the-device \nYour claim code: $(mawk -F\" '/claim/{print $4}' /etc/remoteit/config.json) \nThen this DietPi device will be online as your Remote.It device and you can start using it." @@ -6506,11 +6509,11 @@ _EOF_ 3) local arch='arm64';; 10) local arch='amd64';; 11) local arch='riscv64';; - *) local arch='arm';; + *) local arch='arm_hf';; esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.57.0/frp_0.57.0_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.58.0/frp_0.58.0_linux_$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/fatedier/frp/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/frp_[0-9.]*_linux_$arch\.tar\.gz\"/{print \$4}")" G_EXEC cd frp_* @@ -6691,7 +6694,7 @@ _EOF_ if (( $G_DISTRO < 8 )) && [[ $G_HW_ARCH == 2 || $G_HW_ARCH == 10 || ( $G_HW_ARCH == 3 && $G_DISTRO == 7 ) ]] then # APT key - local url='https://repo.mosquitto.org/debian/mosquitto-repo.gpg.key' + local url='https://repo.mosquitto.org/debian/mosquitto-repo.gpg' G_CHECK_URL "$url" G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-mosquitto.gpg --yes" @@ -7434,7 +7437,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.10.4/komga-1.10.4.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.11.1/komga-1.11.1.jar' Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/komga-[^"\/]*\.jar"$/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi @@ -7530,7 +7533,7 @@ _EOF_ local json=() [[ $PHP_VERSION == 8* ]] || aDEPS+=("php$PHP_VERSION-json") json=('json') - local fallback_url="https://github.com/ampache/ampache/releases/download/6.3.1/ampache-6.3.1_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.4.0/ampache-6.4.0_all_php$PHP_VERSION.zip" Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache # Reinstall: Preserve configs from old and new paths @@ -8034,7 +8037,7 @@ _EOF_ airplay2= fi - Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/shairport-sync${airplay2}_$G_HW_ARCH_NAME.deb" + G_AGI shairport-sync G_EXEC systemctl stop shairport-sync fi @@ -8120,7 +8123,7 @@ _EOF_ if To_Install 36 squeezelite # Squeezelite then - Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/squeezelite_$G_HW_ARCH_NAME.deb" + G_AGI squeezelite G_EXEC systemctl stop squeezelite fi @@ -8914,7 +8917,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.6/syncthing-linux-$arch-v1.27.6.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.7/syncthing-linux-$arch-v1.27.7.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/syncthing-linux-$arch-[^\"\/]*\.tar\.gz\"/{print \$4}")" G_EXEC mv syncthing-* /opt/syncthing fi @@ -9261,7 +9264,7 @@ _EOF_ if To_Install 183 vaultwarden # vaultwarden then - Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vaultwarden_$G_HW_ARCH_NAME.deb" + G_AGI vaultwarden G_EXEC systemctl stop vaultwarden fi @@ -9509,7 +9512,7 @@ _EOF_ esac url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") - local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.4.6.8723/Radarr.master.5.4.6.8723.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.5.3.8819/Radarr.master.5.5.3.8819.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -9666,8 +9669,7 @@ _EOF_ # APT deps if (( $G_HW_ARCH < 3 )) then - aDEPS=('g++' 'libopenblas-dev' 'pkg-config') # g++, libopenblas-dev and pkg-config for numpy until wheels have been built on piwheels. Afterwards install libopenblas0 runtime library instead: https://piwheels.org/project/numpy/ - (( $G_DISTRO < 7 )) || aDEPS+=('libxslt1-dev') # Bookworm: libxslt1-dev and gcc for lxml until wheels have been built on piwheels: https://piwheels.org/project/lxml/ + aDEPS=('libopenblas0-pthread') # libopenblas0-pthread runtime library for piwheels wheel: https://piwheels.org/project/numpy/ (( $G_HW_ARCH == 1 )) && aDEPS+=('unar') # ARMv6 does not support unrar-nonfree and Bazarr does not support unrar-free, so we need to use "unar": https://github.com/morpheus65535/bazarr/issues/2172 fi @@ -9873,7 +9875,7 @@ _EOF_ local reinstall=0 [[ -f '/mnt/dietpi_userdata/nzbget/nzbget.conf' ]] && reinstall=1 - local fallback_url='https://github.com/nzbgetcom/nzbget/releases/download/v22.0/nzbget-22.0-bin-linux.run' + local fallback_url='https://github.com/nzbgetcom/nzbget/releases/download/v24.0/nzbget-24.0-bin-linux.run' Download_Install "$(curl -sSfL 'https://api.github.com/repos/nzbgetcom/nzbget/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/nzbget-[^"/]*-bin-linux.run"$/{print $4}')" nzbget.run G_EXEC mkdir -p /mnt/dietpi_userdata/nzbget G_EXEC_OUTPUT=1 G_EXEC dash nzbget.run --destdir /mnt/dietpi_userdata/nzbget @@ -9953,7 +9955,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.15.0.4361/Prowlarr.master.1.15.0.4361.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.17.2.4511/Prowlarr.master.1.17.2.4511.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Prowlarr/Prowlarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC mv Prowlarr /opt/prowlarr fi @@ -10028,7 +10030,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.23.2506/Readarr.develop.0.3.23.2506.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.25.2515/Readarr.develop.0.3.25.2515.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Readarr/Readarr/releases' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}" | head -1)" G_EXEC mv Readarr /opt/readarr fi @@ -10085,22 +10087,22 @@ _EOF_ # APT deps case $G_HW_ARCH in - [12]|11) - if (( $G_DISTRO < 7 )) - then - G_AGI libtiff5 libopenjp2-7 libxcb1 # ARMv6/7: Runtime libs for Pillow from piwheels (libtiff5 pulls libjpeg62-turbo) - else - # Bookworm: Most wheels need to be compiled: gcc and libffi-dev for cffi, libssl-dev and Rust for cryptography and bcrypt, make for PyNaCl, libjpeg62-turbo-dev for Pillow, pkg-config for cryptography - G_AGI gcc libffi-dev libssl-dev make libjpeg62-turbo-dev pkg-config - G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh - G_EXEC chmod +x rustup-init.sh - # RPi with 64-bit kernel on 32-bit image: Enforce 32-bit toolchain: https://github.com/MichaIng/DietPi/issues/6306 - G_EXEC_OUTPUT=1 G_EXEC ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} - G_EXEC rm rustup-init.sh - export PATH="/root/.cargo/bin:$PATH" - fi + 1|2) + local libtiff='libtiff6' + (( $G_DISTRO < 7 )) && libtiff='libtiff5' + G_AGI "$libtiff" libopenjp2-7 libxcb1 # ARMv6/7: Runtime libs for Pillow from piwheels (libtiff pulls libjpeg62-turbo) ;; 3) G_AGI gcc;; # gcc for psutil + 11) + # gcc and libffi-dev for cffi, libssl-dev and Rust for cryptography and bcrypt, make for PyNaCl, libjpeg62-turbo-dev for Pillow, pkg-config for cryptography + G_AGI gcc libffi-dev libssl-dev make libjpeg62-turbo-dev pkg-config + G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh + G_EXEC chmod +x rustup-init.sh + # RPi with 64-bit kernel on 32-bit image: Enforce 32-bit toolchain: https://github.com/MichaIng/DietPi/issues/6306 + G_EXEC_OUTPUT=1 G_EXEC ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} + G_EXEC rm rustup-init.sh + export PATH="/root/.cargo/bin:$PATH" + ;; *) :;; esac @@ -10142,29 +10144,34 @@ _EOF_ if To_Install 153 octoprint # OctoPrint then + # Pre-create user and its home directory to allow user-level (Rust and) Python instance + Create_User -G dialout,tty,video -d /mnt/dietpi_userdata/octoprint octoprint + G_EXEC mkdir -p /mnt/dietpi_userdata/octoprint + G_EXEC chown -R octoprint:octoprint /mnt/dietpi_userdata/octoprint + # Deps - # - RISC-V and ARMv6/7 Bookworm: gcc and libffi-dev for cffi - if (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && $G_DISTRO > 6 ) )) + # - RISC-V: gcc and libffi-dev for cffi, Rust for maturin + local aPATH=() + if (( $G_HW_ARCH == 11 )) then - G_AGI gcc libffi-dev + aDEPS=('gcc' 'libffi-dev') + G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh + G_EXEC chmod +x rustup-init.sh + G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint ./rustup-init.sh -y --profile minimal + G_EXEC rm rustup-init.sh + aPATH=("PATH='/mnt/dietpi_userdata/octoprint/.cargo/bin:$PATH'") - # - ARMv8:: gcc for netifaces and psutil - # - Bookworm: gcc for netifaces - elif (( $G_HW_ARCH == 3 || $G_DISTRO > 6 )) + # - ARMv8: gcc for psutil + elif (( $G_HW_ARCH == 3 )) then G_AGI gcc fi - # Pre-create user and its home directory to allow user-level Python instance - Create_User -G dialout,tty,video -d /mnt/dietpi_userdata/octoprint octoprint - G_EXEC mkdir -p /mnt/dietpi_userdata/octoprint - G_EXEC chown -R octoprint:octoprint /mnt/dietpi_userdata/octoprint - # Clear pip cache in case it got somehow created [[ -d '/mnt/dietpi_userdata/octoprint/.cache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/octoprint/.cache # Install OctoPrint - G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint pip3 install -U --user --no-warn-script-location octoprint + G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint "${aPATH[@]}" pip3 install -U --user --no-warn-script-location octoprint # Service: https://github.com/OctoPrint/OctoPrint/blob/master/scripts/octoprint.service cat << '_EOF_' > /etc/systemd/system/octoprint.service @@ -10592,7 +10599,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.10/gitea-1.21.10-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.11/gitea-1.21.11-linux-$arch.xz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/go-gitea/gitea/releases/latest' | mawk -F\" "/\"browser_download_url\": \".*\/gitea-[^\"\/]*-linux-$arch\.xz\"/{print \$4}")" /mnt/dietpi_userdata/gitea/gitea # User @@ -10633,14 +10640,7 @@ _EOF_ if To_Install 163 gmediarender # GMediaRender then - # Pre-v8.10 - [[ -f '/etc/systemd/system/gmediarender.service' ]] && G_EXEC rm /etc/systemd/system/gmediarender.service - [[ -d '/etc/systemd/system/gmediarender.service.d' ]] && grep -Rq '/usr/local/bin/gmediarender' /etc/systemd/system/gmediarender.service.d && G_EXEC rm -R /etc/systemd/system/gmediarender.service.d - getent passwd gmrender > /dev/null && G_EXEC userdel gmrender - getent group gmrender > /dev/null && G_EXEC groupdel gmrender - [[ -f '/usr/local/bin/gmediarender' ]] && G_EXEC rm /usr/local/bin/gmediarender - [[ -d '/usr/local/share/gmediarender' ]] && G_EXEC rm -R /usr/local/share/gmediarender - Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/gmediarender_$G_HW_ARCH_NAME.deb" + G_AGI gmediarender G_EXEC systemctl stop gmediarender fi @@ -11132,7 +11132,7 @@ _EOF_ # v3 drops PHP 7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v3.0.0 if (( $G_DISTRO > 6 )) then - local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v4.0.2/tasmoadmin_v4.0.2.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v4.1.0/tasmoadmin_v4.1.0.tar.gz' Download_Install "$(curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}')" else Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v2.4.2/tasmoadmin_v2.4.2.tar.gz' @@ -11504,20 +11504,19 @@ _EOF_ if To_Install 191 snapserver # Snapcast Server then - # ARMv6/7/x86_64: Install package from GitHub repo (no Bookworm as package depends on libflac8) - if (( $G_DISTRO < 7 )) && [[ $G_HW_ARCH =~ ^(1|2|10)$ ]] + # RISC-V: Install from Debian repo: https://github.com/badaix/snapcast/releases + if (( $G_HW_ARCH == 11 )) then - local arch='armhf' - (( $G_HW_ARCH == 10 )) && arch='amd64' - local fallback_url="https://github.com/badaix/snapcast/releases/download/v0.27.0/snapserver_0.27.0-1_$arch.deb" - Download_Install "$(curl -sSfL 'https://api.github.com/repos/badaix/snapcast/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/snapserver_[^\"\/]*_$arch.deb\"/{print \$4}")" - - # Else install from Debian repo - else G_AGI snapserver # Enable web UI to align with upstream package G_CONFIG_INJECT 'doc_root[[:blank:]=]' 'doc_root = /usr/share/snapserver/snapweb' /etc/snapserver.conf '\[http\]' + else + local arch=$(dpkg --print-architecture) dist=${G_DISTRO_NAME/trixie/bookworm} + local fallback_url="https://github.com/badaix/snapcast/releases/download/v0.28.0/snapcast_0.28.0_$arch-debian-$dist.zip" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/badaix/snapcast/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/snapcast_[^\"\/]*_$arch-debian-$dist.zip\"/{print \$4}")" + G_AGI ./snapserver_*_"$arch.deb" + G_EXEC rm snap*.deb fi G_EXEC systemctl stop snapserver @@ -11527,17 +11526,16 @@ _EOF_ if To_Install 192 snapclient # Snapcast Client then - # ARMv6/7/x86_64: Install package from GitHub repo (no Bookworm as package depends on libflac8) - if (( $G_DISTRO < 7 )) && [[ $G_HW_ARCH =~ ^(1|2|10)$ ]] + # RISC-V: Install from Debian repo: https://github.com/badaix/snapcast/releases + if (( $G_HW_ARCH == 11 )) then - local arch='armhf' - (( $G_HW_ARCH == 10 )) && arch='amd64' - local fallback_url="https://github.com/badaix/snapcast/releases/download/v0.27.0/snapclient_0.27.0-1_without-pulse_$arch.deb" - Download_Install "$(curl -sSfL 'https://api.github.com/repos/badaix/snapcast/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/snapclient_[^\"\/]*_without-pulse_$arch.deb\"$/{print \$4}")" - - # Else install from Debian repo - else G_AGI snapclient + else + local arch=$(dpkg --print-architecture) dist=${G_DISTRO_NAME/trixie/bookworm} + local fallback_url="https://github.com/badaix/snapcast/releases/download/v0.28.0/snapcast_0.28.0_$arch-debian-$dist.zip" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/badaix/snapcast/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/snapcast_[^\"\/]*_$arch-debian-$dist.zip\"/{print \$4}")" + G_AGI ./snapclient_*_without-pulse_"$arch.deb" + G_EXEC rm snap*.deb fi G_EXEC systemctl stop snapclient @@ -11712,7 +11710,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.28.0/linux-$arch-filebrowser.tar.gz" + local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.29.0/linux-$arch-filebrowser.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/filebrowser/filebrowser/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/linux-$arch-filebrowser\.tar\.gz\"$/{print \$4}")" ./filebrowser/ # Reinstall @@ -12816,10 +12814,6 @@ If no WireGuard (auto)start is included, but you require it, please do the follo if To_Uninstall 37 # Shairport Sync then G_AGP shairport-sync - # Pre-v6.29 - Remove_Service shairport-sync - [[ -f '/lib/systemd/system/shairport-sync.service' ]] && G_EXEC rm /lib/systemd/system/shairport-sync.service - G_EXEC rm -f /usr/local/bin/shairport-sync /usr/local/etc/shairport-sync.conf* /usr/local/share/man/man7/shairport-sync.7.gz fi if To_Uninstall 152 # Avahi-Daemon @@ -13702,10 +13696,6 @@ _EOF_ if To_Uninstall 163 # GMediaRender then G_AGP gmediarender - # Pre-v8.10 - Remove_Service gmediarender gmrender gmrender - [[ -f '/usr/local/bin/gmediarender' ]] && G_EXEC rm /usr/local/bin/gmediarender - [[ -d '/usr/local/share/gmediarender' ]] && G_EXEC rm -R /usr/local/share/gmediarender fi if To_Uninstall 67 # Firefox @@ -15022,13 +15012,13 @@ We allow it to take up to 30 minutes, it's process can be followed, please be pa # Add option to use Unbound as upstream DNS server if (( ${aSOFTWARE_INSTALL_STATE[182]} == 0 )) then - G_WHIP_YESNO 'Would you like to use Unbound, a tiny recursive DNS server hosted on your device, as your upstream DNS server? + G_WHIP_BUTTON_CANCEL_TEXT='Skip' G_WHIP_YESNO 'Would you like to use Unbound, a tiny recursive DNS server hosted on your device, as your upstream DNS server? \nThis will increase privacy, because you will not be sending data to Google etc. \nHowever, the downside is that some websites may load slower the first time you visit them.' && aSOFTWARE_INSTALL_STATE[182]=1 fi # Prompt for static IP - if G_WHIP_YESNO 'A static IP address is essential for a DNS server installations. DietPi-Config can be used to quickly setup your static IP address. + if G_WHIP_BUTTON_CANCEL_TEXT='Skip' G_WHIP_YESNO 'A static IP address is essential for a DNS server installation. DietPi-Config can be used to quickly setup your static IP address. \nIf you have already setup your static IP, please ignore this message.\n\nWould you like to setup your static IP address now?' then G_WHIP_MSG 'DietPi-Config will now be launched. Simply select your Ethernet or Wifi connection from the menu to access the IP address settings. diff --git a/dietpi/dietpi-vpn b/dietpi/dietpi-vpn index 9c052ca47a..38cc32967d 100755 --- a/dietpi/dietpi-vpn +++ b/dietpi/dietpi-vpn @@ -124,7 +124,7 @@ Available commands: then [[ $1 != '-f' && -d $FP_IPVANISH ]] && return 0 [[ $1 != '-f' ]] || G_WHIP_YESNO 'This will remove all IPVanish server files and perform a fresh download of IPVanish server configurations. Once completed, you will need to reselect a IPVanish server from the new list.\n\nDo you want to continue?' || return 0 - G_EXEC curl -sSfLO 'https://www.ipvanish.com/software/configs/configs.zip' + G_EXEC curl -sSfLO 'https://configs.ipvanish.com/configs/configs.zip' VPN_SERVER= [[ -d $FP_IPVANISH ]] && G_EXEC_DESC='Removing old IPVanish server configs' G_EXEC rm -R "$FP_IPVANISH" G_EXEC mkdir -p "$FP_IPVANISH" @@ -233,6 +233,8 @@ _EOF_ # Set protocol and port: UDP port 443 is default, but TCP 1194 and UDP 1194 are supported as well. G_CONFIG_INJECT 'proto[[:blank:]]' "proto $PROTOCOL" "$FP_CLIENT_OVPN" G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*remote[[:blank:]]/s/[[:blank:]][0-9][0-9]*$/ 1194/' "$FP_CLIENT_OVPN" + # Bookworm: Remove "keysize" option, which has been removed with OpenVPN 2.6 + (( $G_DISTRO > 6 )) && G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*keysize[[:blank:]]/d' "$FP_CLIENT_OVPN" elif [[ $VPN_PROVIDER == 'PIA' ]] then diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 3f3cf3a3a1..d3bda29db1 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -54,8 +54,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=3 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=4 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch @@ -80,6 +80,9 @@ G_GITOWNER='$G_GITOWNER'" > /boot/dietpi/.version # Set PATH to expected default to rule out issues due to broken environment, e.g. in combination with "su" or "sudo -E" export LC_ALL='C.UTF-8' LANG='C.UTF-8' PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' + # Enforce default umask: https://github.com/MichaIng/DietPi/issues/7022 + umask 0022 + # Set G_PROGRAM_NAME to originating script file (or shell executable) name if it was not set by originating script [[ $G_PROGRAM_NAME ]] || readonly G_PROGRAM_NAME=${0##*/} @@ -1569,6 +1572,9 @@ Press any key to continue...' # Clean cache before every update, which can corrupt and gets fully rewritten anyway G_EXEC_PRE_FUNC(){ apt-get clean; } + # Workaround for Armbian mirrors being out of sync regularly or throwing 5xx errors + [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC_POST_FUNC(){ [[ $exit_code != 0 ]] && grep -q '^E: Failed to fetch .*armbian' "$fp_log" && G_EXEC_RETRIES=2 && unset -f G_EXEC_POST_FUNC; } + G_EXEC_DESC='\e[0mAPT update' G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y -eany update local exit_code=$? diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index 9a0c8748ef..030bf3cceb 100755 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -12,6 +12,9 @@ # - Generates /boot/dietpi/.hw_model # - Called from /boot/dietpi/preboot, called by /etc/systemd/system/dietpi-preboot.service # + # G_HW_MODEL 90 Radxa ZERO 3 + # G_HW_MODEL 89 Orange Pi 3 LTS + # G_HW_MODEL 88 Orange Pi Zero 2W # G_HW_MODEL 87 Orange Pi 3B # G_HW_MODEL 86 ASUS Tinker Board 2 # G_HW_MODEL 85 ROCK 5A @@ -303,6 +306,10 @@ fi G_HW_MANUFACTURER='Embest' + elif (( $G_HW_ARCH > 1 )) + then + # In case of ARMv7/8 architecture, if no model was detected, fall back to RPi 2. + G_HW_MODEL=2 fi } @@ -311,12 +318,69 @@ # NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc) Obtain_HW_Info(){ + # Get distro ID + local distro=$(] Flash U-Boot binary to eMMC/SD card, taking device path as optional argument, else flashes to /boot drive $FP_SCRIPT gpudriver none|intel|nvidia|amd|custom $FP_SCRIPT qemu-guest-agent|qga enable/disable " #//////////////////////////////////// @@ -215,7 +216,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// RPi_EEPROM() { - (( $G_HW_MODEL > 3 )) || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi 4/5 + (( $G_HW_MODEL > 3 && $G_HW_MODEL < 10 )) || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi 4/5 # Install required APT package G_AG_CHECK_INSTALL_PREREQ rpi-eeprom @@ -243,6 +244,22 @@ _EOF_ G_EXEC rm u-boot-spl.bin.normal.out visionfive2_fw_payload.img } + #///////////////////////////////////////////////////////////////////////////////////// + # flash-u-boot-mmc + #///////////////////////////////////////////////////////////////////////////////////// + Flash_U-Boot_MMC() + { + [[ -f '/usr/lib/u-boot/platform_install.sh' ]] || { G_DIETPI-NOTIFY 1 'Flash script /usr/lib/u-boot/platform_install.sh not found. Aborting ...'; return 1; } + [[ $INPUT_DEVICE_VALUE ]] || INPUT_DEVICE_VALUE=$(lsblk -npo PKNAME "$(findmnt -Ufnro SOURCE -T /boot)") + [[ -b $INPUT_DEVICE_VALUE ]] || { G_DIETPI-NOTIFY 1 "Block device \"$INPUT_DEVICE_VALUE\" not found. Aborting ..."; return 1; } + # shellcheck disable=SC1091 + . /usr/lib/u-boot/platform_install.sh || return 1 + # Do not mute progress and error messages + eval "$(declare -f write_uboot_platform | sed -e 's| > /dev/null 2>&1||g' -e 's|status=none|status=progress|g')" + # shellcheck disable=SC2154 + write_uboot_platform "$DIR" "$INPUT_DEVICE_VALUE" + } + #///////////////////////////////////////////////////////////////////////////////////// # gpumemsplit #///////////////////////////////////////////////////////////////////////////////////// @@ -315,65 +332,52 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # remoteir #///////////////////////////////////////////////////////////////////////////////////// - RemoteIR_Prereqs(){ G_AG_CHECK_INSTALL_PREREQ lirc; } - - RemoteIR_Reset(){ - + RemoteIR_Reset() + { # Disable JustBoom - if (( $G_HW_MODEL < 10 )); then - - if [[ -f '/etc/systemd/system/justboom-ir-mpd.service' ]]; then - + if (( $G_HW_MODEL < 10 )) + then + if [[ -f '/etc/systemd/system/justboom-ir-mpd.service' ]] + then G_EXEC systemctl disable --now justboom-ir-mpd G_EXEC rm /etc/systemd/system/justboom-ir-mpd.service - fi [[ -d '/etc/systemd/system/justboom-ir-mpd.service.d' ]] && G_EXEC rm -R /etc/systemd/system/justboom-ir-mpd.service.d - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*dtoverlay=gpio-ir/d' /boot/config.txt # Disable Odroids - elif (( $G_HW_MODEL < 20 )); then - - if [[ -f '/etc/systemd/system/odroid-remote.service' ]]; then - - G_EXEC systemctl disable --now odroid-remote - G_EXEC rm /etc/systemd/system/odroid-remote.service - + elif (( $G_HW_MODEL < 20 )) + then + if systemctl -q is-active lircd || systemctl -q is-enabled lircd 2> /dev/null + then + G_EXEC systemctl disable --now lircd fi - [[ -d '/etc/systemd/system/odroid-remote.service.d' ]] && G_EXEC rm -R /etc/systemd/system/odroid-remote.service.d - + G_EXEC sed --follow-symlinks -Ei '/^[[:blank:]]*(gpio-ir-recv|meson_ir)[[:blank:]]*$/d' /etc/modules fi - } - RemoteIR_Main(){ - + RemoteIR_Main() + { (( $G_HW_MODEL > 19 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-Odroid/non-RPi RemoteIR_Reset - if [[ $INPUT_DEVICE_VALUE == 'odroid_remote' ]]; then - + if [[ $INPUT_DEVICE_VALUE == 'odroid_remote' ]] + then (( $G_HW_MODEL > 9 )) || { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid - RemoteIR_Prereqs - - # XU4 Cloudshell - if (( $G_HW_MODEL == 11 )); then + G_AG_CHECK_INSTALL_PREREQ lirc - # Modules - local string='options gpioplug_ir_recv gpio_nr=24 active_low=1' - G_CONFIG_INJECT "$string" "$string" /etc/modprobe.d/odroid-cloudshell.conf + # Kernel modules + # - XU4 CloudShell + if (( $G_HW_MODEL == 11 )) + then G_CONFIG_INJECT 'gpio-ir-recv' 'gpio-ir-recv' /etc/modules - G_CONFIG_INJECT 'gpioplug-ir-recv' 'gpioplug-ir-recv' /etc/modules - # C2 - elif (( $G_HW_MODEL == 12 )); then - - # Module + # - C2 + elif (( $G_HW_MODEL == 12 )) + then G_CONFIG_INJECT 'meson_ir' 'meson_ir' /etc/modules - fi # Config @@ -416,12 +420,13 @@ _EOF_ # Service G_EXEC systemctl enable --now lircd - elif [[ $INPUT_DEVICE_VALUE == 'justboom_ir_remote' ]]; then - + elif [[ $INPUT_DEVICE_VALUE == 'justboom_ir_remote' ]] + then (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Mode; return 1; } # Exit path for non-RPi - RemoteIR_Prereqs + G_AG_CHECK_INSTALL_PREREQ lirc mpc + # Device tree overlay G_CONFIG_INJECT 'dtoverlay=gpio-ir' 'dtoverlay=gpio-ir,gpio_pin=25' /boot/config.txt # Config @@ -473,9 +478,6 @@ begin remote end remote _EOF_ - # MPD control - G_AG_CHECK_INSTALL_PREREQ mpc - cat << '_EOF_' > /root/.lircrc begin prog = irexec @@ -538,12 +540,10 @@ _EOF_ G_EXEC systemctl daemon-reload G_EXEC systemctl enable --now justboom-ir-mpd - elif [[ $INPUT_DEVICE_VALUE != 'none' ]]; then - + elif [[ $INPUT_DEVICE_VALUE != 'none' ]] + then Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// @@ -639,23 +639,25 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// Lcd_Panel_Main() { + (( $G_HW_MODEL > 19 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi/non-Odroid + + # Reset all LCDs + Lcd_Panel_Waveshare32_Disable + Lcd_Panel_Odroidcloudshell_Disable + Lcd_Panel_Odroidcloudshell2_Disable + Lcd_Panel_OdroidLCD35_Disable + Lcd_Panel_ESP01215E_Disable + OLED_Allo_Boss2_Disable + case $INPUT_DEVICE_VALUE in - 'odroid-lcd35') Lcd_Panel_OdroidLCD35_Enable;; - 'waveshare32') Lcd_Panel_Waveshare32_Enable;; - 'odroid-cloudshell') Lcd_Panel_Odroidcloudshell_Enable;; - 'esp01215e') Lcd_Panel_ESP01215E_Enable;; - 'allo-boss2-oled') OLED_Allo_Boss2_Enable;; - 'none') - Lcd_Panel_Waveshare32_Disable - Lcd_Panel_Odroidcloudshell_Disable - Lcd_Panel_OdroidLCD35_Disable - Lcd_Panel_ESP01215E_Disable - OLED_Allo_Boss2_Disable - ;; - *) - Unknown_Input_Mode - return 1 - ;; + 'odroid-lcd35') Lcd_Panel_OdroidLCD35_Enable || return 1;; + 'waveshare32') Lcd_Panel_Waveshare32_Enable || return 1;; + 'odroid-cloudshell') Lcd_Panel_Odroidcloudshell_Enable || return 1;; + 'odroid-cloudshell2') Lcd_Panel_Odroidcloudshell2_Enable || return 1;; + 'esp01215e') Lcd_Panel_ESP01215E_Enable || return 1;; + 'allo-boss2-oled') OLED_Allo_Boss2_Enable || return 1;; + 'none') :;; + *) Unknown_Input_Mode; return 1;; esac # Update dietpi.txt entry @@ -664,6 +666,8 @@ _EOF_ Lcd_Panel_ESP01215E_Enable(){ + (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Mode; return 1; } # Exit path for non-RPi + G_CONFIG_INJECT 'framebuffer_width=' 'framebuffer_width=1024' /boot/config.txt G_CONFIG_INJECT 'framebuffer_height=' 'framebuffer_height=600' /boot/config.txt G_CONFIG_INJECT 'SOFTWARE_CHROMIUM_RES_X=' "SOFTWARE_CHROMIUM_RES_X=1024" /boot/dietpi.txt @@ -713,8 +717,6 @@ _EOF_ Lcd_Panel_Waveshare32_Enable(){ - (( $G_HW_MODEL > 19 )) && { Unsupported_Input_Mode; return 1; } # Exit path for non-RPi/non-Odroid - # Disable 1st to reset any existing installations Lcd_Panel_Waveshare32_Disable @@ -803,7 +805,6 @@ _EOF_ [[ -f '/boot/overlays/waveshare32b.dtbo' ]] && G_EXEC rm /boot/overlays/waveshare32b.dtbo G_EXEC sed --follow-symlinks -i 's/ fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo//' /boot/cmdline.txt - G_EXEC sed --follow-symlinks -i '/Waveshare 32 LCD/d' /boot/config.txt G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*dtoverlay=waveshare32b/d' /boot/config.txt G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*dtoverlay=ads7846,cs=1,penirq=17/d' /boot/config.txt G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1/d' /boot/config.txt @@ -832,29 +833,42 @@ _EOF_ } - # Odroid CloudShell - Lcd_Panel_Odroidcloudshell_Enable(){ - - echo 'options fbtft_device name=hktft9340 busnum=1 rotate=270' > /etc/modprobe.d/odroid-cloudshell.conf - + # Odroid CloudShell: ToDo: Broken after fbtft_device kernel module does not exist anymore with Linux 5.4/6.1/6.6... + Lcd_Panel_Odroidcloudshell_Enable() + { + (( $G_HW_MODEL == 11 )) || { Unsupported_Input_Mode; return 1; } # Odroid XU4 only G_CONFIG_INJECT 'spi_s3c64xx' 'spi_s3c64xx' /etc/modules - G_CONFIG_INJECT 'fbtft_device' 'fbtft_device' /etc/modules - echo 'fbtft_device' >> /etc/modules # XU4 4.9 workaround: https://github.com/MichaIng/DietPi/issues/926#issuecomment-299480918 - } - Lcd_Panel_Odroidcloudshell_Disable(){ + Lcd_Panel_Odroidcloudshell_Disable() + { + (( $G_HW_MODEL == 11 )) || return 0 + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*spi_s3c64xx[[:blank:]]*/d' /etc/modules + } - [[ -f '/etc/modprobe.d/odroid-cloudshell.conf' ]] && G_EXEC rm /etc/modprobe.d/odroid-cloudshell.conf - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*spi_s3c64xx/d' /etc/modules - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*fbtft_device/d' /etc/modules + # Odroid CloudShell 2 + Lcd_Panel_Odroidcloudshell2_Enable() + { + (( $G_HW_MODEL == 11 )) || { Unsupported_Input_Mode; return 1; } # Odroid XU4 only + # Device tree overlay + G_CONFIG_INJECT 'setenv[[:blank:]]+cs2enable[[:blank:]]' 'setenv cs2enable "true"' /boot/boot.ini 'ODROIDXU-UBOOT-CONFIG' + # udev rule to enable backlight power + G_EXEC eval 'echo '\''SUBSYSTEM=="backlight", KERNEL=="fb_hktft32", ACTION=="add", ATTR{bl_power}="1"'\'' > /etc/udev/rules.d/dietpi-odroid-cloudshell2.rules' + } + Lcd_Panel_Odroidcloudshell2_Disable() + { + (( $G_HW_MODEL == 11 )) || return 0 + # udev rule to enable backlight power + [[ -f '/etc/udev/rules.d/dietpi-odroid-cloudshell2.rules' ]] && G_EXEC rm /etc/udev/rules.d/dietpi-odroid-cloudshell2.rules + # Device tree overlay + G_CONFIG_INJECT 'setenv[[:blank:]]+cs2enable[[:blank:]]' '#setenv cs2enable "false"' /boot/boot.ini 'ODROIDXU-UBOOT-CONFIG' } # Odroid LCD 3.5 Lcd_Panel_OdroidLCD35_Enable(){ - (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )) || { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid + (( $G_HW_MODEL > 9 )) || { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid # Reset to disabled Lcd_Panel_OdroidLCD35_Disable @@ -958,7 +972,9 @@ EndSection _EOF_ } - Lcd_Panel_OdroidLCD35_Disable(){ + Lcd_Panel_OdroidLCD35_Disable() + { + (( $G_HW_MODEL > 9 )) || return 0 # Skip on non-Odroid [[ -f '/etc/X11/xorg.conf.d/99-calibration.conf' ]] && G_EXEC rm /etc/X11/xorg.conf.d/99-calibration.conf [[ -f '/etc/modprobe.d/odroid-lcd35.conf' ]] && G_EXEC rm /etc/modprobe.d/odroid-lcd35.conf @@ -969,7 +985,6 @@ _EOF_ fi [[ -d '/etc/systemd/system/odroid-lcd35.service.d' ]] && G_EXEC rm -R /etc/systemd/system/odroid-lcd35.service.d [[ -f '/etc/X11/xorg.conf.d/99-odroid-lcd35.conf' ]] && G_EXEC rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf - } OLED_Allo_Boss2_Enable(){ @@ -1113,8 +1128,8 @@ _EOF_ Unknown_Input_Mode fi - # Orange Pi Zero 3 - elif (( $G_HW_MODEL == 83 )) + # Orange Pi Zero 3/Zero 2W + elif (( $G_HW_MODEL == 83 || $G_HW_MODEL == 88 )) then if [[ $INPUT_DEVICE_VALUE == 'enable' ]] then @@ -1149,7 +1164,7 @@ _EOF_ 'hci_uart' ) - [[ $G_HW_MODEL =~ ^(83|87)$ ]] && aBLUETOOTH_MODULES+=('sprdbt_tty') # Orange Pi 3B/Zero 3 + [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] && aBLUETOOTH_MODULES+=('sprdbt_tty') # Orange Pi 3B/Zero 3/Zero 2W if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then @@ -1241,12 +1256,12 @@ Do you want to continue and disable the serial login console?' || return 1 G_EXEC systemctl enable --now bluetooth # RPi - if (( $G_HW_MODEL > 9 )) + if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )) then - (( $G_HW_ONBOARD_WIFI )) && G_EXEC systemctl enable hciuart + G_EXEC systemctl enable hciuart - # Orange Pi 3B/Zero 3: Module does not load automatically - elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] + # Orange Pi 3B/Zero 3/Zero 2W: Module does not load automatically + elif [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] then modprobe -n sprdbt_tty 2> /dev/null && G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' fi @@ -1341,8 +1356,8 @@ Do you want to continue and disable the serial login console?' || return 1 then aWIFI_MODULES+=('bcmdhd') - # + Orange Pi 3B/Zero 3 - elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] + # + Orange Pi 3B/Zero 3/Zero 2W + elif [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] then aWIFI_MODULES+=('sprdwl_ng') fi @@ -1388,8 +1403,8 @@ Do you want to continue and disable the serial login console?' || return 1 then G_EXEC eval 'echo -e '\''options wlan_8192eu rtw_power_mgnt=0\noptions wlan_8812au rtw_power_mgnt=0'\'' > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' - # - Orange Pi 3B/Zero 3: Module does not load automatically - elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] + # - Orange Pi 3B/Zero 3/Zero 2W: Module does not load automatically + elif [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] then modprobe -n sprdwl_ng 2> /dev/null && G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi @@ -1520,7 +1535,7 @@ Do you want to continue and disable the serial login console?' || return 1 elif (( $DIETPIENV || $G_HW_MODEL == 49 || $G_HW_MODEL == 76 || $G_HW_MODEL == 79 )) then local baudrate='115200' - if [[ $G_HW_MODEL =~ ^(42|43|46|47|49|55|56|58|68|72|76|77|87)$ && $INPUT_ADDITIONAL == 'ttyS2' ]] || [[ $G_HW_MODEL == 73 && $INPUT_ADDITIONAL == 'ttyS'[012] ]] || [[ $G_HW_MODEL =~ ^(76|78|79|80|82|85)$ && $INPUT_ADDITIONAL == 'ttyFIQ0' ]] + if [[ $G_HW_MODEL =~ ^(42|43|46|47|49|55|56|58|68|72|76|77|78|79|80|82|85|87|90)$ && $INPUT_ADDITIONAL =~ ^('ttyS2'|'ttyFIQ0')$ ]] || [[ $G_HW_MODEL == 73 && $INPUT_ADDITIONAL == 'ttyS'[012] ]] then baudrate='1500000' [[ -d /etc/systemd/system/serial-getty@$INPUT_ADDITIONAL.service.d ]] || G_EXEC mkdir "/etc/systemd/system/serial-getty@$INPUT_ADDITIONAL.service.d" @@ -2372,7 +2387,7 @@ _EOF_ 'wificountrycode') Wifi_Countrycode_Main;; 'i2c') I2c_Main;; 'spi') SPI_Main;; - 'lcdpanel') Lcd_Panel_Main;; + 'lcdpanel') Lcd_Panel_Main || EXIT_CODE=1;; 'rpi-opengl') RPi_OpenGL_Main;; 'eth-forcespeed') Eth_Force_Speed_Main;; 'remoteir') RemoteIR_Main;; @@ -2382,6 +2397,7 @@ _EOF_ 'rpi3_usb_boot') RPi_USB_Boot_Main;; 'rpi-eeprom') RPi_EEPROM;; 'vf2-spi-update') VF2_SPI_Update;; + 'flash-u-boot-mmc') Flash_U-Boot_MMC || EXIT_CODE=1;; 'headless') Headless_Main;; 'gpudriver') GPUDriver_Main;; 'qemu-guest-agent'|'qga') QEMU_Guest_Agent_Main;; diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index b6f4c3cde9..0b6631f002 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -123,6 +123,11 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R case $G_HW_MODEL in [0-9]) all_components='rpi';; 10) all_components='odroidc1';; + 11) all_components='odroidxu4';; + 40) all_components='pinea64';; + 44) all_components='pinebook';; + 45) all_components='pineh64';; + 48) all_components='nanopir1';; 49) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed kernel/firmware package # shellcheck disable=SC2154 @@ -141,6 +146,10 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; esac ;; + 56) all_components='nanopineo3';; + 57) all_components='nanopineoplus2';; + 59) all_components='zeropi';; + 60) all_components='nanopineo';; 61) all_components='nanopi2';; 62) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package @@ -160,10 +169,73 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R esac ;; 63) all_components='nanopim1';; + 64) all_components='nanopineoair';; + 65) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1) all_components='nanopineo2';; + 2) all_components='nanopineo2black';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + [[ $all_components ]] || for i in nanopineo2{,black} + do + dpkg-query -s "linux-u-boot-$i-legacy" &> /dev/null || continue + all_components=$i + break + done + ;; + esac + ;; 66) all_components='nanopim1plus';; + 67) all_components='nanopik1plus';; 70) all_components='sparkysbc';; + 76) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1) all_components='';; # no R5S component is available yet + 2) all_components='nanopir5c';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + # shellcheck disable=SC2043 + [[ $all_components ]] || for i in nanopi-r5c + do + dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue + all_components=${i/-//} + break + done + ;; + esac + ;; + 78) all_components='rock5b';; + 79) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1|2) all_components='nanopir6s';; # R6C shares R6S component (and bootloader) for now + 3) all_components='nanopct6';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + # shellcheck disable=SC2043 + [[ $all_components ]] || for i in nano{pi-r6s,pct6} + do + dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue + all_components=${i/-//} + break + done + ;; + esac + ;; + 80) all_components='orangepi5';; 81) all_components='visionfive2';; + 82) all_components='orangepi5plus';; + 83) all_components='orangepizero3';; 84) all_components='star64';; + 85) all_components='rock5a';; + 88) all_components='orangepizero2w';; + 89) all_components='orangepi3lts';; + 90) all_components='radxazero3';; *) :;; esac G_EXEC eval "echo 'deb https://dietpi.com/apt $G_DISTRO_NAME $components' > /etc/apt/sources.list.d/dietpi.list" @@ -753,7 +825,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt \n- $optional for ${models[$optional]}" && to_install=("$optional") || to_remove=("$optional") fi - G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils + G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils tiny-initramfs G_AGP "${to_remove[@]}" raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 } diff --git a/dietpi/func/dietpi-wifidb b/dietpi/func/dietpi-wifidb index 8b5c168dcb..661652c9a3 100755 --- a/dietpi/func/dietpi-wifidb +++ b/dietpi/func/dietpi-wifidb @@ -207,27 +207,26 @@ _EOF_ # Menus #///////////////////////////////////////////////////////////////////////////////////// - Scan_Wifi(){ - + Scan_Wifi() + { local wifi_iface=$(G_GET_NET -t wlan iface) # Return if no WiFi adapter is detected - [[ ! $wifi_iface ]] && G_WHIP_MSG 'No WiFi adapter was detected on your device. Scanning for interfaces cannot be done.' && return 1 + [[ $wifi_iface ]] || { G_WHIP_MSG 'No WiFi adapter was detected on your device. Scanning for interfaces cannot be done.'; return 1; } + + G_DIETPI-NOTIFY 0 'Scanning for WiFi SSIDs, please wait....' # Assure WiFi adapter is up to allow SSID scanning # - Compared to "ifup", this method does not imply DHCP scanning, which times out when no SSID has been configured yet. ip l set dev "$wifi_iface" up - # Get all SSIDs - G_DIETPI-NOTIFY 0 'Scanning for WiFi SSIDs, please wait....' - # ToDo: We would love to use modern 'iw dev "$wifi_iface" scan' here, but on NanoPi Fire3 with modern USB WiFi adapter this command runs forever without showing any output. Probably the old vendor kernel has something to do with it. G_WHIP_MENU_ARRAY=() while read -r line do G_WHIP_MENU_ARRAY+=("$line" '') - done < <(iwlist "$wifi_iface" scan | sed -n '/^[[:blank:]]*ESSID:/s/^[[:blank:]]*ESSID:"\(.*\)"/\1/p') + done < <(iwlist "$wifi_iface" scan | sed -n 's/^[[:blank:]]*ESSID:"\(.*\)"/\1/p') [[ ${G_WHIP_MENU_ARRAY[0]} ]] || { G_WHIP_MSG 'No WiFi SSID has been found in your area.'; return 1; } @@ -235,7 +234,6 @@ _EOF_ aWIFI_SSID[$WIFI_SSID_INDEX]=$G_WHIP_RETURNED_VALUE Change_WifiKey - } Change_WifiSsid(){ diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index 5640c5142e..f99f7d913f 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -2,6 +2,7 @@ { # Error out on command failures set -e + EXIT_CODE=0 Reboot_to_load_Partition_table() { @@ -41,6 +42,7 @@ echo "[ INFO ] Detected root drive $ROOT_DRIVE with root partition $ROOT_PART" # Check if the last partition contains a FAT filesystem with DIETPISETUP label + REBOOT=0 LAST_PART=$(lsblk -nrbo FSTYPE,LABEL "$ROOT_DRIVE" | tail -1) if [[ $LAST_PART == 'vfat DIETPISETUP' ]] then @@ -49,9 +51,20 @@ # Mount it and copy files if present and newer TMP_MOUNT=$(mktemp -d) mount -v "$SETUP_PART" "$TMP_MOUNT" - for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'boot.ini' 'extlinux.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' 'unattended_pivpn.conf' do - [[ -f $TMP_MOUNT/$f ]] && cp -uv "$TMP_MOUNT/$f" /boot/ + [[ -f $TMP_MOUNT/$f ]] || continue + if [[ $f == 'extlinux.conf' ]] + then + mkdir -pv /boot/extlinux + [[ -f '/boot/extlinux/extlinux.conf' ]] && mtime=$(date -r '/boot/extlinux/extlinux.conf' '+%s') || mtime=0 + cp -uv "$TMP_MOUNT/$f" /boot/extlinux/ + (( $(date -r '/boot/extlinux/extlinux.conf' '+%s') > $mtime )) && REBOOT=1 + else + [[ ( $f == 'dietpiEnv.txt' || $f == 'boot.ini' ) && -f /boot/$f ]] && mtime=$(date -r "/boot/$f" '+%s') || mtime=0 + cp -uv "$TMP_MOUNT/$f" /boot/ + [[ $f == 'dietpiEnv.txt' || $f == 'boot.ini' ]] && (( $(date -r "/boot/$f" '+%s') > $mtime )) && REBOOT=1 + fi done umount -v "$SETUP_PART" rmdir -v "$TMP_MOUNT" @@ -65,7 +78,7 @@ # Mount it and copy files if present and newer TMP_MOUNT=$(mktemp -d) mount -v "$BOOT_PART" "$TMP_MOUNT" - for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' 'unattended_pivpn.conf' do [[ -f $TMP_MOUNT/$f ]] && cp -uv "$TMP_MOUNT/$f" /boot/ done @@ -113,9 +126,12 @@ 'btrfs') btrfs filesystem resize max /;; *) echo "[FAILED] Unsupported root filesystem type ($ROOT_FSTYPE). Aborting..." - exit 1 + EXIT_CODE=1 ;; esac - exit 0 + # Reboot if needed + (( $REBOOT )) && reboot + + exit "$EXIT_CODE" }