Skip to content

Commit

Permalink
Beta v9.6.0 (#7111)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng authored Jul 2, 2024
2 parents 99eb8b2 + c0bd77d commit 0ba8261
Show file tree
Hide file tree
Showing 24 changed files with 844 additions and 652 deletions.
4 changes: 4 additions & 0 deletions .build/images/Quartz64/quartz64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_SHA3_ARM64=m
CONFIG_CRYPTO_SHA512_ARM64_CE=m
CONFIG_CRYPTO_SM3_ARM64_CE=m
CONFIG_CRYPTO_USER_API_HASH=m
CONFIG_CRYPTO_USER_API_RNG=m
CONFIG_CUSE=m
CONFIG_DEBUG_FS=y
Expand Down Expand Up @@ -209,6 +210,7 @@ CONFIG_ENERGY_MODEL=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_EXTCON_ADC_JACK=y
CONFIG_EXTCON_GPIO=y
CONFIG_EXTCON_USB_GPIO=y
Expand Down Expand Up @@ -544,6 +546,7 @@ CONFIG_NET_ACT_GACT=m
CONFIG_NET_ACT_GATE=m
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_CLS_BPF=m
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_FLOWER=m
CONFIG_NET_DSA=m
Expand Down Expand Up @@ -843,6 +846,7 @@ CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_SATA_MV=y
CONFIG_SATA_SIL24=y
CONFIG_SCHEDSTATS=y
CONFIG_SCHED_AUTOGROUP=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_SCHED_MC=y
Expand Down
78 changes: 48 additions & 30 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ else
'13.'*|'trixie/sid') G_DISTRO=8;;
*) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;;
esac
# Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower.
grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--))
(( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; }
fi
case $G_HW_ARCH_NAME in
'armv6l') export G_HW_ARCH=1;;
Expand Down Expand Up @@ -91,29 +94,29 @@ case $HW_MODEL in
4) iname='RPi234' HW_ARCH=3 boot_size=128 root_size=895;;
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;;
11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=800;;
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=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;;
42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=1100;;
43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=1100;;
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;;
46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=1100;;
47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=1100;;
48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=800;;
'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=1148;;
55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1008;;
55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1100;;
56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=1100;;
57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=1000;;
58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=1008;;
58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=1100;;
59) iname='ZeroPi' HW_ARCH=2 partition_start=4 root_size=800;;
60) iname='NanoPiNEO' HW_ARCH=2 partition_start=4 root_size=800;;
61) iname='NanoPiM2' HW_ARCH=2 partition_start=4 boot_size=64 root_size=700 boot_fstype='ext4';;
Expand All @@ -125,30 +128,30 @@ case $HW_MODEL in
'65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=1020;;
66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=800;;
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;;
'68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=1100;;
'68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=1100;;
'68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=1100;;
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;;
'72.1') iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=1100;;
'72.2') iname='ROCK4SE' HW_ARCH=3 partition_start=16 root_size=1100;;
'72.3') iname='ROCK4CPlus' HW_ARCH=3 partition_start=16 root_size=1100;;
73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1100;;
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=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;;
78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
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;;
82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
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;;
85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1100;;
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=1000;;
Expand Down Expand Up @@ -223,15 +226,28 @@ fi
(( $efi_size )) || [[ $boot_size -gt 0 && $boot_fstype == 'fat'* ]] && apackages+=('dosfstools')

# Emulation support in case of incompatible architecture
(( ( $G_HW_ARCH < 10 && $G_HW_ARCH < $HW_ARCH ) || ( ( $G_HW_ARCH == 10 || $G_HW_ARCH == 11 ) && $G_HW_ARCH != $HW_ARCH ) )) && apackages+=('qemu-user-static')
emulation=0
(( $G_HW_ARCH == $HW_ARCH || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $HW_ARCH ) )) || emulation=1

# Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: <arch> can neither be executed natively nor via qemu user emulation with binfmt_misc"
(( $emulation )) && { apackages+=('qemu-user-static'); (( $G_DISTRO < 7 )) && apackages+=('binfmt-support'); }

# Virtual machine disk conversion
[[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils')

G_AG_CHECK_INSTALL_PREREQ parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}"
G_AG_CHECK_INSTALL_PREREQ --no-install-recommends parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}"

# Register QEMU binfmt configs
dpkg-query -s 'qemu-user-static' &> /dev/null && G_EXEC systemctl restart systemd-binfmt
if (( $emulation ))
then
if (( $G_DISTRO < 7 ))
then
G_EXEC systemctl disable --now systemd-binfmt
G_EXEC systemctl restart binfmt-support
else
G_EXEC systemctl restart systemd-binfmt
fi
fi

# Bootstrap archive keyring if missing
if [[ ! -f $keyring ]]
Expand Down Expand Up @@ -395,7 +411,9 @@ packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gpg,htop,ipu
(( $DISTRO > 7 )) && packages+='7zip,' || packages+='p7zip,'
[[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils'
# - "--skip=check/empty" to ignore /etc/fstab, boot and tmpfs mounts we added above
G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --skip=check/empty --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo"
# - "--skip=check/qemu" to skip arch test, which requires the "arch-test" package. We however assure emulation support out end.
# - Bullseye/Jammy host mmdebstrap does not support "--skip=check/empty,check/qemu".
G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --mode=root --format=dir --skip=check/empty --skip=check/qemu --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 All @@ -413,15 +431,15 @@ _EOF_
cat << _EOF_ >> rootfs/etc/rc.local
export GITOWNER='$GITOWNER' GITBRANCH='$GITBRANCH' HW_MODEL='$HW_MODEL' IMAGE_CREATOR=0 PREIMAGE_INFO=0 WIFI_REQUIRED=1 DISTRO_TARGET=$DISTRO TEST_KERNEL=$TEST_KERNEL TEST_UBOOT=$TEST_UBOOT
echo '[ INFO ] Running DietPi-Installer for $G_GITOWNER/$G_GITBRANCH'
bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-installer')" || poweroff
bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-installer')" || { echo '[FAILED] DietPi-Installer failed, shutting down ...'; journalctl -n 25; df -h; free -h; poweroff; exit 1; }
_EOF_

# - VM: Generate tiny-initramfs with explicit kernel modules, as auto-detection doesn't work correctly within container and loop devices
[[ $HW_MODEL == 20 ]] && cat << _EOF_ >> rootfs/etc/rc.local
echo '[ INFO ] Rebuilding virtual machine initramfs to support all virtualizers...'
version=\$(dpkg --get-selections | mawk '\$1~/^linux-image-.*-$parch\$/{print \$1;exit}') || poweroff
version=\$(dpkg --get-selections | mawk '\$1~/^linux-image-.*-$parch\$/{print \$1;exit}') || { echo '[FAILED] Obtaining kernel version failed, shutting down ...'; journalctl -n 25; df -h; free -h; poweroff; exit 1; }
version=\${version#linux-image-}
mktirfs -m no -M no --include-modules='ahci,sd_mod,vmw_pvscsi,hv_storvsc,virtio_scsi,virtio_pci,BusLogic,$FSTYPE' -o "/boot/initrd.img-\$version" "\$version" || poweroff
mktirfs -m no -M no --include-modules='ahci,sd_mod,vmw_pvscsi,hv_storvsc,virtio_scsi,virtio_pci,BusLogic,$FSTYPE' -o "/boot/initrd.img-\$version" "\$version" || { echo '[FAILED] Generating initramfs failed, shutting down ...'; journalctl -n 25; df -h; free -h; poweroff; exit 1; }
_EOF_

cat << '_EOF_' >> rootfs/etc/rc.local
Expand All @@ -441,9 +459,9 @@ then
abind=("--bind=$FP_LOOP" '--bind=/dev/disk')
for i in "${FP_LOOP}p"*; do abind+=("--bind=$i"); done
fi
systemd-nspawn -bD rootfs "${abind[@]}" || exit 1
systemd-nspawn -bD rootfs "${abind[@]}" || { G_DIETPI-NOTIFY 1 'systemd-nspawn failed, aborting ...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; }

[[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting...'; exit 1; }
[[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting ...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; }
G_EXEC rm rootfs/success
G_EXEC rm -Rf rootfs/{dev,proc,run,sys,tmp,var/log}/{,.??,.[^.]}* # Failsafe: /var/log/journal was found despite tmpfs mount!
G_EXEC sync
Expand Down
3 changes: 3 additions & 0 deletions .build/images/dietpi-imager
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
'13.'*|'trixie/sid') G_DISTRO=8;;
*) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;;
esac
# Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower.
grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--))
(( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; }
fi
readonly G_PROGRAM_NAME='DietPi-Imager'
G_CHECK_ROOT_USER
Expand Down
Loading

0 comments on commit 0ba8261

Please sign in to comment.