Skip to content

Commit 0f3cd53

Browse files
authored
Release v9.4 (#7063)
2 parents 566d468 + 545b752 commit 0f3cd53

25 files changed

Lines changed: 801 additions & 536 deletions

.build/images/OdroidXU4/boot.ini

Lines changed: 19 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ ODROIDXU-UBOOT-CONFIG
44
setenv initrd_high "0xffffffff"
55
setenv fdt_high "0xffffffff"
66

7-
# MAC address configuration
8-
setenv macaddr "00:1e:06:61:7a:72"
9-
107
# Kernel command-line parameters
118
setenv bootrootfs "root=/dev/mmcblk0p1 rootfstype=ext4 rootwait ro console=ttySAC2,115200n8 console=tty1 consoleblank=0 net.ifnames=0"
129

13-
# HDMI/DVI selection: "hdmi" or "dvi"
14-
# - DVI mode disables HDMI sound
15-
setenv vout "hdmi"
16-
17-
# HDMI Hot Plug Detect
18-
# - "false" disables auto-detection and forces HDMI output.
19-
# - "true" enables HDMI detection based on cable connection.
20-
setenv HPD "true"
21-
2210
# HDMI CEC: "false" or "true", defaults to "true"
2311
#setenv cecenable "true"
2412

13+
# Disable ODROID-VU7 touchscreen support: "false" or "true", defaults to "true"
14+
#setenv disable_vu7 "true"
15+
16+
# ODROID CloudShell 2 TFT LCD and FAN control via I2C bus: "false" or "true", defaults to "false"
17+
#setenv cs2enable "false"
18+
19+
# Device tree overlays
20+
# - See /boot/dtb/overlays or /boot/dtb for available overlays (*.dtbo files): defaults to empty string ""
21+
#setenv overlays "i2c0"
22+
23+
# DDR frequency [MHz]: "633", "728", "825" or "933", defaults to "825"
24+
#setenv ddr_freq "825"
25+
2526
# HDMI resolution
2627
# - Uncomment only ONE line! Leave all commented for automatic selection.
2728
# - Uncomment only the setenv line!
@@ -123,71 +124,21 @@ setenv HPD "true"
123124
#setenv videoconfig "drm_kms_helper.edid_firmware=edid/480x800.bin"
124125
# -----------------------------------------------
125126

126-
# Disable ODROID-VU7 touchscreen support: "false" or "true", defaults to "true"
127-
#setenv disable_vu7 "true"
128-
129-
# ODROID CloudShell 2 TFT LCD and FAN control via I2C bus: "false" or "true", defaults to "false"
130-
#setenv cs2enable "false"
131-
132-
# Device tree overlays
133-
# - See /boot/dtb/overlays for available overlays: defaults to empty string ""
134-
#setenv overlays "i2c0"
135-
136-
# CPU governor
137-
# - DietPi will override this setting to user configured in dietpi-config > Performance Options > CPU governor
138-
setenv governor "performance"
139-
140-
# DDR frequency [MHz]: "633", "728", "825" or "933", defaults to "825"
141-
#setenv ddr_freq "825"
142-
143-
# TMDS data amplitude control.
144-
# - 1LSB corresponds to 20 mVdiff amplitude level
145-
# - tx_amp_lvl : 0 = 760 mVdiff(Min), 31 = 1380 mVdiff(Max)
146-
# - Hardkernel default: hdmi_tx_amp_lvl = 31(1380 mVdiff)
147-
setenv hdmi_tx_amp_lvl "31"
148-
149-
# TMDS data amplitude fine control for each channel
150-
# - 1LSB corresponds to 20 mVdiff amplitude level
151-
# - tx_lvl : 0 = 0 mVdiff(Min), 3 = 60 mVdiff(Max)
152-
# - Hardkernel default: hdmi_tx_lvl_ch0=hdmi_tx_lvl_ch1=hdmi_tx_lvl_ch2 = 3
153-
setenv hdmi_tx_lvl_ch0 "3"
154-
setenv hdmi_tx_lvl_ch1 "3"
155-
setenv hdmi_tx_lvl_ch2 "3"
156-
157-
# TMDS data pre-emphasis level control
158-
# - 1LSB corresponds to -0.45dB emphasis level except for 1
159-
# - tx_emp_lvl : 0 = 0 db(Min), 1 = -0.25 db, 2 = 0.7 db, 15 = -7.45 db(Max)
160-
# - Hardkernel default: hdmi_tx_emp_lvl = 6 (-2.50 db)
161-
setenv hdmi_tx_emp_lvl "6"
162-
163-
# TMDS clock amplitude control
164-
# - 1LSB corresponds to 20 mVdiff amplitude level.
165-
# - clk_amp_lvl : 0 = 790 mVdiff(Min), 31 = 1410 mVdiff(Max)
166-
# - Hardkernel default hdmi_clk_amp_lvl = 31 (1410 mVdiff)
167-
setenv hdmi_clk_amp_lvl "31"
168-
169-
# TMDS data source termination resistor control
170-
# - tx_res : 0 = Source Termination OFF(Min), 1 = 200 ohm, 2 = 300 ohm, 3 = 120 ohm(Max)
171-
# - Hardkernel default hdmi_tx_res = 0 (Source Termination OFF)
172-
setenv hdmi_tx_res "0"
173-
174127
### DO NOT EDIT ANYTHING BELOW THIS LINE ###
175128

176-
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}"
177-
178129
# Load kernel, initrd and dtb in that sequence
179-
ext4load mmc 0:1 0x40008000 /boot/zImage || fatload mmc 0:1 0x40008000 zImage || ext4load mmc 0:1 0x40008000 zImage
180-
ext4load mmc 0:1 0x42000000 /boot/uInitrd || fatload mmc 0:1 0x42000000 uInitrd || ext4load mmc 0:1 0x42000000 uInitrd
130+
load mmc 0:1 0x40008000 /boot/zImage || load mmc 0:1 0x40008000 zImage
131+
load mmc 0:1 0x42000000 /boot/uInitrd || load mmc 0:1 0x42000000 uInitrd
181132
if test "${board_name}" = "xu4"; then setenv fdtfile "exynos5422-odroidxu4.dtb"; fi
182133
if test "${board_name}" = "xu3"; then setenv fdtfile "exynos5422-odroidxu3.dtb"; fi
183134
if test "${board_name}" = "xu3l"; then setenv fdtfile "exynos5422-odroidxu3-lite.dtb"; fi
184135
if test "${board_name}" = "hc1"; then setenv fdtfile "exynos5422-odroidhc1.dtb"; fi
185-
ext4load mmc 0:1 0x44000000 /boot/dtb/${fdtfile} || fatload mmc 0:1 0x44000000 dtb/${fdtfile} || ext4load mmc 0:1 0x44000000 dtb/${fdtfile}
136+
load mmc 0:1 0x44000000 /boot/dtb/${fdtfile} || load mmc 0:1 0x44000000 dtb/${fdtfile}
186137

187138
# Set FDT address
188139
fdt addr 0x44000000
189140

190-
if test "${cecenable}" = "false"; then fdt rm /cec@101B0000; fi
141+
if test "${cecenable}" = "false"; then fdt rm /soc/cec@101b0000; fi
191142
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
192143

193144
# Add overlays for CloudShell
@@ -205,7 +156,7 @@ fi
205156
if test "x${overlays}" != "x"; then
206157
fdt resize 8192
207158
for overlay in ${overlays}; do
208-
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
159+
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
209160
fdt apply 0x60000000
210161
done
211162
fi
@@ -214,7 +165,7 @@ fi
214165
if test "x${ddr_freq}" != "x"; then dmc "${ddr_freq}"; fi
215166

216167
# Final boot args (DRM debugging: drm.debug=0xff)
217-
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} ${hid_quirks}"
168+
setenv bootargs "${bootrootfs} ${videoconfig} ${hid_quirks}"
218169

219170
# Boot the board
220171
bootz 0x40008000 0x42000000 0x44000000

.build/images/dietpi-build

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,24 @@ case $HW_MODEL in
8383
5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=895;;
8484
10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';;
8585
11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;;
86-
12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1020;;
87-
15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=1020;;
88-
16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=1020;;
86+
12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1148;;
87+
15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=1148;;
88+
16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=1148;;
8989
20) iname='VM' HW_ARCH=${HW_ARCH:-10} VMTYPE=${VMTYPE:-raw};;
9090
21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1663;;
91-
40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=892;;
91+
40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=1020;;
9292
42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=1008;;
9393
43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=1008;;
94-
44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=892;;
95-
45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=892;;
94+
44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=1020;;
95+
45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=1020;;
9696
46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=1008;;
9797
47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=1008;;
9898
48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=764;;
9999
'49.1') iname='Quartz64A' HW_ARCH=3 partition_start=16 root_size=752;;
100100
'49.2') iname='Quartz64B' HW_ARCH=3 partition_start=16 root_size=752;;
101101
'49.3') iname='SOQuartz' HW_ARCH=3 partition_start=16 root_size=752;;
102102
52) iname='ASUSTB' HW_ARCH=2 partition_start=4 root_size=764;;
103-
54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=1020;;
103+
54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=1148;;
104104
55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1008;;
105105
56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=1008;;
106106
57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=892;;
@@ -112,35 +112,38 @@ case $HW_MODEL in
112112
'62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=700;;
113113
63) iname='NanoPiM1' HW_ARCH=2 partition_start=4 root_size=764;;
114114
64) iname='NanoPiNEOAir' HW_ARCH=2 partition_start=4 root_size=764;;
115-
'65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=892;;
116-
'65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=892;;
115+
'65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=1020;;
116+
'65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=1020;;
117117
66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=764;;
118-
67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=892;;
118+
67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=1020;;
119119
'68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=1008;;
120120
'68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=1008;;
121121
'68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=1008;;
122122
70) iname='SparkySBC' HW_ARCH=2 partition_start=8 boot_size=48 root_size=712 boot_fstype='fat16';;
123123
'72.1') iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=1008;;
124124
'72.2') iname='ROCK4SE' HW_ARCH=3 partition_start=16 root_size=1008;;
125+
'72.3') iname='ROCK4CPlus' HW_ARCH=3 partition_start=16 root_size=1008;;
125126
73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1008;;
126-
74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1020;;
127+
74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1148;;
127128
75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=575;;
128129
'76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
129130
'76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
130-
77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
131+
77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
131132
78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
132133
'79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
133134
'79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
134135
'79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
135-
80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
136+
80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
136137
81) iname='VisionFive2' HW_ARCH=11 root_size=639;;
137138
82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
138-
'83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;;
139-
'83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=1148;;
139+
83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;;
140140
84) iname='Star64' HW_ARCH=11 root_size=639;;
141141
85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
142142
86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1008;;
143-
87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;;
143+
87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
144+
88) iname='OrangePiZero2W' HW_ARCH=3 partition_start=4 root_size=1148;;
145+
89) iname='OrangePi3LTS' HW_ARCH=3 partition_start=4 root_size=892;;
146+
90) iname='RadxaZERO3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
144147
*) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;;
145148
esac
146149

@@ -216,7 +219,7 @@ fi
216219
# Virtual machine disk conversion
217220
[[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils')
218221

219-
G_AG_CHECK_INSTALL_PREREQ parted debootstrap dbus systemd-container xz-utils "${apackages[@]}"
222+
G_AG_CHECK_INSTALL_PREREQ parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}"
220223

221224
# Bootstrap archive keyring if missing
222225
if [[ ! -f $keyring ]]
@@ -378,8 +381,8 @@ G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/lib/apt/lists
378381
G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/log
379382
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,'
380383
[[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils'
381-
G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat rootfs/debootstrap/debootstrap.log; }
382-
G_EXEC_OUTPUT=1 G_EXEC debootstrap --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo"
384+
#G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat rootfs/debootstrap/debootstrap.log; }
385+
G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --skip=check/empty --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo"
383386
G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log
384387

385388
##########################################
@@ -507,7 +510,8 @@ then
507510
fi
508511

509512
# AlloGUI edition: Pre-install Allo GUI with all managed audiophile software
510-
if [[ $EDITION == 'AlloGUI' || ( $EDITION == 'all' && $HW_MODEL =~ ^(0|70)$ ) ]]
513+
# - 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.
514+
if [[ $EDITION == 'AlloGUI' || ( $EDITION == 'all' && $HW_MODEL =~ ^(0|70)$ && $DISTRO != 8 ) ]]
511515
then
512516
G_EXEC mv "$OUTPUT_IMG_NAME.img" "${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI.img"
513517
OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI"

.build/images/dietpi-imager

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
[[ $SKIP_FIRSTBOOT_RESIZE == 1 ]] || SKIP_FIRSTBOOT_RESIZE=0
6262
[[ $SHRINK_ONLY == 1 ]] || SHRINK_ONLY=0
6363
[[ $SKIP_ARCHIVE == 1 ]] || SKIP_ARCHIVE=0
64-
ADD_DOS_PART=0
65-
CONFIGS_TO_BOOT=0
64+
ADD_DOS_PART=0 # trailing FAT partition for first boot config files, automatically imported and partition removed on first boot
65+
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
6666
SIGN_PASS=
6767
while (( $# ))
6868
do
@@ -336,10 +336,7 @@
336336
# Move GPT backup partition table to end of drive
337337
elif [[ $PART_TABLE_TYPE == 'gpt' ]]
338338
then
339-
G_DIETPI-NOTIFY 2 'GPT partition table detected, moving GPT backup partition table to end of drive...'
340-
G_AG_CHECK_INSTALL_PREREQ gdisk
341-
G_EXEC_OUTPUT=1 G_EXEC sgdisk -e "$FP_SOURCE"
342-
G_SLEEP 0.5 # Give the root filesystem a little time to be detected
339+
G_DIETPI-NOTIFY 2 'GPT partition table detected'
343340
else
344341
Error_Exit "Unknown partition table type ($PART_TABLE_TYPE), aborting..."
345342
fi
@@ -512,9 +509,16 @@
512509
# - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well)
513510
local last_part_end=$(sfdisk -qlo End "$FP_SOURCE" | tail -1) # 512 byte sectors
514511
IMAGE_SIZE=$last_part_end
515-
# Add 34 sectors for GPT backup partition table and 1 sector for MBR
516-
# shellcheck disable=SC2015
517-
[[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=34)) || ((IMAGE_SIZE++))
512+
# Add space for GPT backup partition table, or 1 sector for MBR
513+
if [[ $PART_TABLE_TYPE == 'gpt' ]]
514+
then
515+
# 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
516+
local gpt_size=$(sgdisk -p "$FP_SOURCE" 2>&1 | mawk -F[\ ,] '/^First usable sector/{print $5}')
517+
# shellcheck disable=SC2015
518+
(( $gpt_size )) && ((IMAGE_SIZE+=$gpt_size)) || ((IMAGE_SIZE+=34))
519+
else
520+
((IMAGE_SIZE++))
521+
fi
518522
((IMAGE_SIZE*=512)) # 512 byte sectors => bytes
519523

520524
# RPi: Move configs to boot FAT partition to allow easier edit from Windows/macOS
@@ -525,9 +529,12 @@
525529
G_EXEC mount "${FP_ROOT_DEV::-1}1" "$fat_mountpoint"
526530
G_EXEC mount "$FP_ROOT_DEV" "$root_mountpoint"
527531
G_DIETPI-NOTIFY 2 'Copying dietpi.txt and other config files to the DIETPISETUP partition'
528-
for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh'
532+
for f in 'dietpi.txt' 'dietpi-wifi.txt' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' 'unattended_pivpn.conf'
529533
do
530-
[[ -f $root_mountpoint/boot/$f ]] && G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/"
534+
[[ -f $root_mountpoint/boot/$f ]] || continue
535+
G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/"
536+
TZ=UTC G_EXEC touch -t '197001010000' "$fat_mountpoint/$f"
537+
TZ=UTC G_EXEC touch -t '197001010001' "$root_mountpoint/boot/$f"
531538
done
532539
G_EXEC umount "$root_mountpoint" "$fat_mountpoint"
533540
G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint"
@@ -554,22 +561,26 @@
554561
G_EXEC mount "$new_dos_part" "$fat_mountpoint"
555562
G_EXEC mount "$FP_ROOT_DEV" "$root_mountpoint"
556563
G_DIETPI-NOTIFY 2 'Copying dietpi.txt and other config files to the DIETPISETUP partition'
557-
for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh'
564+
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'
558565
do
559-
[[ -f $root_mountpoint/boot/$f ]] && G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/"
566+
[[ -f $root_mountpoint/boot/$f ]] || continue
567+
G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/"
568+
TZ=UTC G_EXEC touch -t '202101010001' "$fat_mountpoint/${f#extlinux/}"
569+
TZ=UTC G_EXEC touch -t '202101010002' "$root_mountpoint/boot/$f"
560570
done
561-
cat << '_EOF_' > "$fat_mountpoint/Readme-DietPi-Config.txt"
562-
DietPi pre-boot configuration
571+
cat << '_EOF_' > "$fat_mountpoint/README.txt"
572+
DietPi config partition
563573
564-
You can edit the files in this folder to setup some configuration options
565-
or even a completely automated install. Please check the documentation and
566-
dietpi.txt for details: https://dietpi.com/docs/install/
574+
This FAT partition is a place for relevant configuration files to pre-configure and automate your DietPi setup.
575+
Those files will be copied into the root filesystem on first boot, if modified, to become effective, and the partition will be removed.
567576
568-
This folder also supports the following additional files. Please ensure that
569-
they have UNIX style LF line endings:
570-
- unattended_pivpn.conf
577+
Apart of editing the existing files, you can also create the following for further automation:
571578
- Automation_Custom_PreScript.sh
572579
- Automation_Custom_Script.sh
580+
- unattended_pivpn.conf
581+
582+
For details, please check our documentation and dietpi.txt itself:
583+
https://dietpi.com/docs/usage/#how-to-do-an-automatic-base-installation-at-first-boot-dietpi-automation
573584
_EOF_
574585
G_EXEC umount "$root_mountpoint" "$fat_mountpoint"
575586
G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint"
@@ -742,10 +753,10 @@ _EOF_
742753

743754
# Generate xz archive
744755
# 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.
745-
local limit_threads=()
746-
(( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-T2')
756+
local threads=0
757+
(( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && threads=2
747758
[[ -f $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz ]] && G_EXEC rm "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"
748-
G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e -k "${limit_threads[@]}" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT"
759+
G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e -k "-T$threads" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT"
749760
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'"
750761
local signature=() sig_text=''
751762
[[ $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[*]}"; }

0 commit comments

Comments
 (0)