Skip to content

Commit

Permalink
v8.24
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
MichaIng committed Oct 29, 2023
1 parent a406892 commit 125d612
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions .build/software/vaultwarden/container_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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;;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dietpi-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ defaults:
run:
working-directory: /dev/shm
shell: sh
env:
PY_COLORS: '1'
jobs:
prep:
outputs:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/dietpi-software.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dietpi-software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/vaultwarden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ defaults:
run:
shell: sh
working-directory: /dev/shm
env:
PY_COLORS: '1'
jobs:
prep:
outputs:
Expand Down

0 comments on commit 125d612

Please sign in to comment.