From 125d612921d9d5cf1ef76f11c2326cbc242b7d1f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 29 Oct 2023 14:45:53 +0100 Subject: [PATCH] v8.24 - CI | Apply Trixie automation workaround to more workflows, but using an own service instead of rc.local - CI | Try to enable color output for GitHub Actions runner shell --- .build/images/dietpi-build | 21 ++++++++++++++++++ .../software/vaultwarden/container_build.bash | 22 +++++++++++++++++++ .github/workflows/dietpi-build.yml | 2 ++ .github/workflows/dietpi-software.bash | 18 +++++++++++---- .github/workflows/dietpi-software.yml | 2 ++ .github/workflows/vaultwarden.yml | 2 ++ 6 files changed, 63 insertions(+), 4 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 19a6c5e9c3..074d196079 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -571,6 +571,24 @@ 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' ]] + 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 G_CONFIG_INJECT 'AUTO_SETUP_INSTALL_SOFTWARE_ID=' 'AUTO_SETUP_INSTALL_SOFTWARE_ID=159' rootfs/boot/dietpi.txt # Revert autostart option, in case Amiberry image was generated before G_CONFIG_INJECT 'AUTO_SETUP_AUTOSTART_TARGET_INDEX=' 'AUTO_SETUP_AUTOSTART_TARGET_INDEX=0' rootfs/boot/dietpi.txt @@ -652,6 +670,9 @@ _EOF_ # Reset IPv4 network connectivity check setting G_CONFIG_INJECT 'CONFIG_CHECK_CONNECTION_IP=' 'CONFIG_CHECK_CONNECTION_IP=9.9.9.9' rootfs/boot/dietpi.txt + # Revert workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 + [[ $DISTRO == 'trixie' ]] && G_EXEC rm rootfs/etc/systemd/system/{multi-user.target.wants/,}dietpi-automation.service + [[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting...'; exit 1; } G_EXEC rm rootfs/success G_EXEC sync diff --git a/.build/software/vaultwarden/container_build.bash b/.build/software/vaultwarden/container_build.bash index 4f1a6fc0b6..a5ba0abae3 100755 --- a/.build/software/vaultwarden/container_build.bash +++ b/.build/software/vaultwarden/container_build.bash @@ -44,6 +44,7 @@ do shift done [[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } +[[ $ARCH == 'riscv64' && $DISTRO != 'trixie' ]] && { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" for arch \"$ARCH\" passed, only \"trixie\" is supported, aborting..."; exit 1; } case $ARCH in 'armv6l') image="ARMv6-${DISTRO^}" arch=1;; 'armv7l') image="ARMv7-${DISTRO^}" arch=2;; @@ -83,8 +84,29 @@ G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" G_EXEC mkdir rootfs G_EXEC mount "${FP_LOOP}p1" rootfs +# Test +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' ]] +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 # Force ARMv6 arch on Raspbian (( $arch == 1 )) && echo 'sed -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 5f1bd0a0bc..d7baabf311 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -13,6 +13,8 @@ defaults: run: working-directory: /dev/shm shell: sh +env: + PY_COLORS: '1' jobs: prep: outputs: diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 37acdaf608..232ebc605c 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -309,10 +309,20 @@ G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/die # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 if [[ $DISTRO == 'trixie' ]] then - G_EXEC mkdir rootfs/etc/systemd/system/rc-local.service.d - G_EXEC eval 'echo -e '\''[Unit]\nAfter=dietpi-postboot.service'\'' > rootfs/etc/systemd/system/rc-local.service.d/dietpi.conf' - G_EXEC eval 'echo -e '\''#!/bin/dash\nexec /boot/dietpi/dietpi-login'\'' > rootfs/etc/rc.local' - G_EXEC chmod +x rootfs/etc/rc.local + 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 # Workaround for failing IPv4 network connectivity check as GitHub Actions runners do not receive external ICMP echo replies. diff --git a/.github/workflows/dietpi-software.yml b/.github/workflows/dietpi-software.yml index 3be30f25f9..8d8588ca59 100644 --- a/.github/workflows/dietpi-software.yml +++ b/.github/workflows/dietpi-software.yml @@ -33,6 +33,8 @@ defaults: run: #working-directory: /dev/shm # uses too much RAM which can lead to OOM kills shell: sh +env: + PY_COLORS: '1' jobs: prep: # https://github.com/actions/runner-images diff --git a/.github/workflows/vaultwarden.yml b/.github/workflows/vaultwarden.yml index eddb693d35..e0e8889309 100644 --- a/.github/workflows/vaultwarden.yml +++ b/.github/workflows/vaultwarden.yml @@ -22,6 +22,8 @@ defaults: run: shell: sh working-directory: /dev/shm +env: + PY_COLORS: '1' jobs: prep: outputs: