From a602e7c37b3d7cc4bab833655a12944766e58d75 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 29 Oct 2023 15:12:03 +0100 Subject: [PATCH] v8.24 - CI | Amiberry: Add workaround for skipped autologin on QEMU-emulated Trixie containers - CI | Apply workaround for skipped autologin on QEMU-emulated Trixie containers only if an actual emulation is done --- .build/images/dietpi-build | 2 +- .build/software/Amiberry/container_build.bash | 18 ++++++++++++++++++ .../software/vaultwarden/container_build.bash | 2 +- .github/workflows/dietpi-software.bash | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 074d196079..2b56577cf3 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -572,7 +572,7 @@ then # Install Allo GUI via automated first run setup right here G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 - if [[ $DISTRO == 'trixie' ]] + if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $HW_ARCH && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $HW_ARCH ) )) then cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service [Unit] diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index ce925bfb94..34787fecb0 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -84,6 +84,24 @@ G_EXEC mount "${FP_LOOP}p1" rootfs # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt +# - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 +if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) +then + cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service +[Unit] +Description=DietPi-Automation +After=dietpi-postboot.service + +[Service] +Type=idle +StandardOutput=tty +ExecStart=/boot/dietpi/dietpi-login + +[Install] +WantedBy=multi-user.target +_EOF_ + G_EXEC ln -s /etc/systemd/system/dietpi-automation.service /etc/systemd/system/multi-user.target.wants/ +fi # Avoid DietPi-Survey uploads to not mess with the statistics G_EXEC rm rootfs/root/.ssh/known_hosts diff --git a/.build/software/vaultwarden/container_build.bash b/.build/software/vaultwarden/container_build.bash index a5ba0abae3..a22e662c33 100755 --- a/.build/software/vaultwarden/container_build.bash +++ b/.build/software/vaultwarden/container_build.bash @@ -90,7 +90,7 @@ export PY_COLORS=1 # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 -if [[ $DISTRO == 'trixie' ]] +if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) then cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service [Unit] diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 232ebc605c..324cb7c66b 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -307,7 +307,7 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsup # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 -if [[ $DISTRO == 'trixie' ]] +if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) then cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service [Unit]