Skip to content

Commit 73ebc90

Browse files
authored
Merge pull request #7806 from MichaIng/beta
Release v9.19
2 parents 7b8588c + c689bcf commit 73ebc90

35 files changed

Lines changed: 1071 additions & 620 deletions

.build/images/dietpi-build

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ EDITION=
5555
SUFFIX=
5656
SKIP_ARCHIVE=0
5757
UPLOAD_SCRIPT=
58-
ADD_DOS_PART=1
58+
ADD_FAT_PART=1
5959
SIGN_PASS=
6060
TEST_KERNEL=0
6161
TEST_UBOOT=0
@@ -78,7 +78,7 @@ do
7878
'-s'|'--suffix') shift; SUFFIX=$1;;
7979
'--skip-archive') SKIP_ARCHIVE=1;;
8080
'--upload-script') shift; UPLOAD_SCRIPT=$1;;
81-
'--no-dos-part') ADD_DOS_PART=0;;
81+
'--no-fat-part') ADD_FAT_PART=0;;
8282
'--sign') shift; SIGN_PASS=$1;;
8383
'--test-kernel') TEST_KERNEL=1;;
8484
'--test-uboot') TEST_UBOOT=1;;
@@ -231,7 +231,7 @@ G_CHECK_URL "https://github.com/$GITOWNER/DietPi/tree/$GITBRANCH" || Error_Exit
231231

232232
# Generate image name and define CLONING_TOOL for dietpi-installer
233233
OUTPUT_IMG_NAME="DietPi_$iname-$iarch-${distro^}"
234-
[[ $RK35XX_MAINLINE == 1 && $HW_MODEL =~ ^(78|79'.'[1-3]|80|82|85|90|91|92|93|94|95)$ ]] && OUTPUT_IMG_NAME+='_mainline'
234+
[[ $RK35XX_MAINLINE == 1 && $HW_MODEL =~ ^(78|79'.'[1-3]|80|82|85|90|91|92|93|94|95|102|103)$ ]] && OUTPUT_IMG_NAME+='_mainline'
235235
[[ $fsname ]] && OUTPUT_IMG_NAME+="_$fsname"
236236
CLONING_TOOL='dd'
237237
if [[ $VARIANT == 'iso' ]]
@@ -504,8 +504,6 @@ done
504504
[[ -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; }
505505
G_EXEC rm rootfs/success
506506
G_EXEC rm -Rf rootfs/{dev,proc,run,sys,tmp,var/log}/{,.??,.[^.]}* # Failsafe: /var/log/journal was found despite tmpfs mount!
507-
G_EXEC sync
508-
G_EXEC sleep 1
509507
G_EXEC umount -R rootfs
510508
G_EXEC rmdir rootfs
511509
G_EXEC losetup -d "$FP_LOOP"
@@ -516,12 +514,12 @@ G_EXEC losetup -d "$FP_LOOP"
516514
# Do not pack and upload raw VM image if not explicitly requested
517515
[[ $VARIANT =~ ^(|iso|all)$ ]] || SKIP_ARCHIVE=1 UPLOAD_SCRIPT=''
518516
# Do not add trailing FAT partition for VM, container and ISO installer images, and if there is a boot FAT partition already
519-
[[ $HW_MODEL =~ ^(20|75)$ || $VARIANT == 'iso' || ( $boot_size -gt 0 && $boot_fstype == 'vfat' ) ]] && ADD_DOS_PART=0
517+
[[ $HW_MODEL =~ ^(20|75)$ || $VARIANT == 'iso' || ( $boot_size -gt 0 && $boot_fstype == 'vfat' ) ]] && ADD_FAT_PART=0
520518
export FP_ROOT_DEV CLONING_TOOL OUTPUT_IMG_NAME MOUNT_IT='Off' SKIP_FIRSTBOOT_RESIZE=1
521519
IMAGER_ARGS=("$OUTPUT_IMG_NAME.img")
522520
(( $SKIP_ARCHIVE )) && IMAGER_ARGS+=('--skip-archive')
523521
[[ $UPLOAD_SCRIPT ]] && IMAGER_ARGS+=('--upload-script' "$UPLOAD_SCRIPT")
524-
(( $ADD_DOS_PART )) && IMAGER_ARGS+=('--add-dos-part')
522+
(( $ADD_FAT_PART )) && IMAGER_ARGS+=('--add-fat-part')
525523
(( $HW_MODEL < 10 && $G_DISTRO > 6 )) && IMAGER_ARGS+=('--configs-to-boot')
526524
[[ $SIGN_PASS ]] && IMAGER_ARGS+=('--sign' "$SIGN_PASS")
527525

@@ -532,7 +530,7 @@ then
532530
# Raspberry Pi Imager info
533531
[[ $HW_MODEL == [1-5] && $DISTRO == 8 && $OUTPUT_IMG_NAME == *'-Trixie' ]] && IMAGER_ARGS+=('--raw-hash-size')
534532
G_DIETPI-NOTIFY 2 "Running DietPi-Imager from $G_GITOWNER/$G_GITBRANCH to generate $OUTPUT_IMG_NAME.$ext"
535-
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1
533+
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || { journalctl -n 25; exit 1; }
536534
# Raspberry Pi Imager info: add for standard image only
537535
[[ ${IMAGER_ARGS[-1]} == '--raw-hash-size' ]] && unset 'IMAGER_ARGS[-1]'
538536
fi
@@ -542,7 +540,7 @@ if [[ $HW_ARCH == 10 && $VARIANT == 'all' ]]
542540
then
543541
CLONING_TOOL='Clonezilla' OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME}_Installer"
544542
G_DIETPI-NOTIFY 2 "Running DietPi-Imager from $G_GITOWNER/$G_GITBRANCH to generate $OUTPUT_IMG_NAME.iso"
545-
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1
543+
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || { journalctl -n 25; exit 1; }
546544
CLONING_TOOL='dd' OUTPUT_IMG_NAME=${OUTPUT_IMG_NAME%_Installer}
547545
fi
548546

@@ -558,15 +556,6 @@ then
558556
FP_LOOP=$(losetup -f)
559557
G_EXEC losetup -P "$FP_LOOP" "$OUTPUT_IMG_NAME.img"
560558

561-
# Remove added DOS partition, it will be re-added by DietPi-Imager
562-
if (( $ADD_DOS_PART )) && [[ $(lsblk -nrbo FSTYPE,LABEL "$FP_LOOP" | tail -1) == 'vfat DIETPISETUP' ]]
563-
then
564-
SETUP_PART=$(sfdisk -lqo DEVICE "$FP_LOOP" | tail -1)
565-
G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread --no-tell-kernel --delete "$FP_LOOP" "${SETUP_PART: -1}"
566-
G_EXEC partprobe "$FP_LOOP"
567-
G_EXEC partx -u "$FP_LOOP"
568-
fi
569-
570559
# Mount filesystems
571560
G_EXEC mkdir rootfs
572561
if (( $HW_MODEL < 10 && $G_DISTRO > 6 ))
@@ -590,14 +579,12 @@ then
590579
# RPi: Enable onboard audio so that it can be detected and configured on first boot
591580
[[ -f 'rootfs/boot/config.txt' ]] && G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' rootfs/boot/config.txt
592581

593-
G_EXEC sync
594-
G_EXEC sleep 1
595582
G_EXEC umount -R rootfs
596583
G_EXEC rmdir rootfs
597584
G_EXEC losetup -d "$FP_LOOP"
598585

599586
G_DIETPI-NOTIFY 2 "Running DietPi-Imager from $G_GITOWNER/$G_GITBRANCH to generate $OUTPUT_IMG_NAME.img"
600-
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1
587+
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || { journalctl -n 25; exit 1; }
601588
fi
602589

603590
####### AlloGUI ##########################
@@ -613,19 +600,12 @@ then
613600
FP_LOOP=$(losetup -f)
614601
G_EXEC losetup -P "$FP_LOOP" "$OUTPUT_IMG_NAME.img"
615602

616-
# Remove added DOS partition, it will be re-added by DietPi-Imager
617-
if (( $ADD_DOS_PART )) && [[ $(lsblk -nrbo FSTYPE,LABEL "$FP_LOOP" | tail -1) == 'vfat DIETPISETUP' ]]
618-
then
619-
SETUP_PART=$(sfdisk -lqo DEVICE "$FP_LOOP" | tail -1)
620-
G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread --no-tell-kernel --delete "$FP_LOOP" "${SETUP_PART: -1}"
621-
G_EXEC partprobe "$FP_LOOP"
622-
G_EXEC partx -u "$FP_LOOP"
623-
fi
603+
# Remove added FAT partition, it will be re-added by DietPi-Imager
604+
SETUP_PART=$(sfdisk -lqo Device "$FP_LOOP" | tail -1)
605+
[[ $(blkid -s LABEL -o value "$SETUP_PART") == 'DIETPISETUP' ]] && G_EXEC_OUTPUT=1 G_EXEC sfdisk --delete "$FP_LOOP" "${SETUP_PART: -1}"
624606

625607
# Raise partition and filesystem sizes as well, since partprobe cannot inform the host kernel about the changed size from within the container
626-
G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN2 '$FP_LOOP' <<< ',+'"
627-
G_EXEC partprobe "$FP_LOOP"
628-
G_EXEC partx -u "$FP_LOOP"
608+
G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -N2 '$FP_LOOP' <<< ',+'"
629609
G_EXEC_OUTPUT=1 G_EXEC "${afsck[@]}" "${FP_LOOP}p2"
630610
G_EXEC_OUTPUT=1 G_EXEC "${aresize[@]}" "${FP_LOOP}p2"
631611

@@ -735,15 +715,9 @@ _EOF_
735715
G_EXEC sed --follow-symlinks -i 's|Prompt_on_Failure$|{ journalctl -n 50; ss -tulpn; df -h; free -h; systemctl start poweroff.target; }|' rootfs/boot/dietpi/dietpi-login
736716

737717
# Start container
738-
# - Bind mounts required to allow container reading its own drive info, /dev/disk for GRUB and probably other tools to detect UUIDs
739-
# - Skip for container images
740-
abind=()
741-
if [[ $HW_MODEL != 75 ]]
742-
then
743-
abind=("--bind=$FP_LOOP" '--bind=/dev/disk')
744-
for i in "${FP_LOOP}p"*; do abind+=("--bind=$i"); done
745-
fi
746-
systemd-nspawn -bD rootfs "${abind[@]}" || { G_DIETPI-NOTIFY 1 'systemd-nspawn failed, aborting ...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; }
718+
systemd-nspawn -bD rootfs || { G_DIETPI-NOTIFY 1 'systemd-nspawn failed, aborting ...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; }
719+
[[ -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; }
720+
G_EXEC rm rootfs/success
747721

748722
# Reset IPv4 network connectivity check setting
749723
G_CONFIG_INJECT 'CONFIG_CHECK_CONNECTION_IP=' 'CONFIG_CHECK_CONNECTION_IP=9.9.9.9' rootfs/boot/dietpi.txt
@@ -756,17 +730,14 @@ _EOF_
756730
G_EXEC rm "$i"
757731
G_EXEC rmdir --ignore-fail-on-non-empty "${i%/dietpi-no-credentials.conf}"
758732
done
733+
G_EXEC sed --follow-symlinks -i 's|{ journalctl -n 50; ss -tulpn; df -h; free -h; systemctl start poweroff.target; }|Prompt_on_Failure|' rootfs/boot/dietpi/dietpi-login
759734

760-
[[ -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; }
761-
G_EXEC rm rootfs/success
762-
G_EXEC sync
763-
G_EXEC sleep 1
764735
G_EXEC umount -R rootfs
765736
G_EXEC rmdir rootfs
766737
G_EXEC losetup -d "$FP_LOOP"
767738

768739
G_DIETPI-NOTIFY 2 "Running DietPi-Imager from $G_GITOWNER/$G_GITBRANCH to generate $OUTPUT_IMG_NAME.img"
769-
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1
740+
bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || { journalctl -n 25; exit 1; }
770741
fi
771742

772743
[[ $HW_MODEL == 20 && ! $VARIANT =~ ^(|iso)$ ]] || exit 0

0 commit comments

Comments
 (0)