Skip to content

Commit

Permalink
Release v9.4 (#7063)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng authored May 12, 2024
2 parents 566d468 + 545b752 commit 0f3cd53
Show file tree
Hide file tree
Showing 25 changed files with 801 additions and 536 deletions.
87 changes: 19 additions & 68 deletions .build/images/OdroidXU4/boot.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
44 changes: 24 additions & 20 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ 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;;
'49.1') iname='Quartz64A' HW_ARCH=3 partition_start=16 root_size=752;;
'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;;
Expand All @@ -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

Expand Down Expand Up @@ -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 ]]
Expand Down Expand Up @@ -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

##########################################
Expand Down Expand Up @@ -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"
Expand Down
59 changes: 35 additions & 24 deletions .build/images/dietpi-imager
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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[*]}"; }
Expand Down
Loading

0 comments on commit 0f3cd53

Please sign in to comment.