Skip to content

Commit a9a736a

Browse files
committed
dietpi-set_hardware: provide dummy ALSA device for software tests
1 parent 89c0b7c commit a9a736a

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

.build/images/dietpi-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ esac
212212
fsname='' afspackages=() afs_opts=() afsck=() aresize=() apackages=()
213213
case $FSTYPE in
214214
'ext4') afspackages+=('e2fsprogs') afs_opts=('-e' 'remount-ro' '-O' '^has_journal') afsck=('e2fsck' '-fyD') aresize=('resize2fs');;
215-
'f2fs') fsname='F2FS' afspackages+=('f2fs-tools') afsck=('fsck.f2fs' '-f') aresize=('resize.f2fs'); uname -r | grep -q '-azure$' && apackages+=("linux-modules-extra-$(uname -r)");;
215+
'f2fs') fsname='F2FS' afspackages+=('f2fs-tools') afsck=('fsck.f2fs' '-f') aresize=('resize.f2fs'); uname -r | grep -q '\-azure$' && apackages+=("linux-modules-extra-$(uname -r)");;
216216
'btrfs') fsname='Btrfs' afspackages+=('btrfs-progs') afsck=('btrfs' 'check' '--repair') aresize=('btrfs' 'filesystem' 'resize' 'max'); ((root_size*=5,root_size/=4));;
217217
*) Error_Exit "Invalid root filesystem type \"$FSTYPE\" passed";;
218218
esac

.github/workflows/dietpi-software.bash

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Process_Software()
117117
11) aCOMMANDS[i]='gzdoom -norun | grep '\''^GZDoom version '\';;
118118
12) aSERVICES[i]='rustdesksignal rustdeskrelay' aTCP[i]='21115 21116 21117 21118 21119' aUDP[i]='21116';;
119119
#16) aSERVICES[i]='microblog-pub' aTCP[i]='8007';; Service enters a CPU-intense internal error loop until it has been configured interactively via "microblog-pub configure", hence it is not enabled and started anymore after install but instead as part of "microblog-pub configure"
120-
17) aCOMMANDS[i]='git --version';; # from Bookworm on, the shorthand "-v" is supported
120+
17) aCOMMANDS[i]='git -v';;
121121
#22) QuiteRSS: has no CLI
122122
23) aCOMMANDS[i]='lxsession -h';;
123123
24) aCOMMANDS[i]='mate-session -h';;
@@ -132,7 +132,7 @@ Process_Software()
132132
33) (( $emulation )) || aSERVICES[i]='airsonic' aTCP[i]='8080' aDELAY[i]=60;; # Fails in QEMU-emulated containers, probably due to missing device access
133133
34) aCOMMANDS[i]='COMPOSER_ALLOW_SUPERUSER=1 composer -n -V';;
134134
35) aSERVICES[i]='lyrionmusicserver' aTCP[i]='9000';;
135-
36) aCOMMANDS[i]='squeezelite -t';; # Service listens on random high UDP port and exits if no audio device has been found, which does not exist on GitHub Actions runners, respectively within the containers
135+
36) aSERVICES[i]='squeezelite';; # Service listens on random high UDP port
136136
37) aSERVICES[i]='shairport-sync' aTCP[i]='5000';; # AirPlay 2 would be TCP port 7000
137137
38) aCOMMANDS[i]='/opt/FreshRSS/cli/user-info.php';;
138138
39) aSERVICES[i]='minidlna' aTCP[i]='8200';;
@@ -232,7 +232,7 @@ Process_Software()
232232
132) aSERVICES[i]='aria2' aTCP[i]='6800';; # aTCP[i]+=' 6881-6999';; # Listens on random port
233233
133) aSERVICES[i]='yacy' aTCP[i]='8090'; (( $emulation )) && aDELAY[i]=120;;
234234
134) aCOMMANDS[i]='docker compose version';;
235-
135) aSERVICES[i]='icecast2' aTCP[i]='8000' aCOMMANDS[i]='darkice -h | grep '\''^DarkIce'\';; # darkice service cannot start in container as is requires audio recording device access
235+
135) aSERVICES[i]='icecast2' aTCP[i]='8000' aCOMMANDS[i]='darkice -h | grep '\''^DarkIce'\';; # darkice service cannot start on GitHub runner as it requires a hardware capture device, and those runners do not provide the dummy audio kernel module
236236
136) aSERVICES[i]='motioneye' aTCP[i]='8765';;
237237
137) aCOMMANDS[i]='/opt/mjpg-streamer/mjpg_streamer -v';; # aSERVICES[i]='mjpg-streamer' aTCP[i]='8082' Service does not start without an actual video device
238238
138) aSERVICES[i]='virtualhere' aTCP[i]='7575';;
@@ -322,10 +322,10 @@ do
322322
case $i in
323323
205) Process_Software webserver;;
324324
27|56|63|64|107|132) Process_Software 89 webserver;;
325-
38|40|48|54|55|57|59|90|160|210) Process_Software 88 89 webserver;;
325+
38|48|54|55|57|59|90|160|210) Process_Software 88 89 webserver;;
326326
159) Process_Software 36 37 65 88 89 96 121 124 128 129 152 160 163 webserver;;
327327
47|114|168) Process_Software 88 89 91 webserver;;
328-
8|33|80|133|164|179|181|206) Process_Software 196;;
328+
8|80|133|164|179|181|206) Process_Software 196;;
329329
122) Process_Software 9;;
330330
53|131) Process_Software 9 196;;
331331
32|148|119) Process_Software 128;;
@@ -340,13 +340,17 @@ do
340340
188) Process_Software 17;;
341341
213) Process_Software 17 188;;
342342
183) Process_Software 87;;
343-
31|37|128|138|163|167|187) Process_Software 152;;
343+
138|187) Process_Software 152;;
344344
75) Process_Software 83 87 89;;
345345
76) Process_Software 83 88 89;;
346346
78) Process_Software 85 87 89;;
347347
79) Process_Software 85 88 89;;
348348
81) Process_Software 84 87 89;;
349349
82) Process_Software 84 88 89;;
350+
23|24|25|26|173|36|118|121|124|135|154|191|192|199|204|108|10|51|112|156|11|189|113|67) Process_Software 5;;
351+
31|37|128|163|167) Process_Software 5 152;;
352+
33) Process_Software 5 196;;
353+
40) Process_Software 5 88 89 webserver;;
350354
*) :;;
351355
esac
352356
Process_Software "$i"
@@ -423,6 +427,9 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsup
423427
# Enable automated setup
424428
G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt
425429

430+
# Apply dummy ALSA device
431+
G_CONFIG_INJECT 'CONFIG_SOUNDCARD=' 'CONFIG_SOUNDCARD=dummy' rootfs/boot/dietpi.txt
432+
426433
# ARMv6/7/RISC-V Trixie: Workaround failing chpasswd, which tries to access /proc/sys/vm/mmap_min_addr, but fails as of AppArmor on the host
427434
if (( ( $arch < 3 || $arch == 11 ) && $dist > 7 )) && systemctl -q is-active apparmor
428435
then

dietpi/func/dietpi-set_hardware

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,20 @@ _EOF_
20472047
esac
20482048

20492049
# - Apply asound.conf
2050-
if (( $ALSA_EQ_ENABLED ))
2050+
if [[ $INPUT_DEVICE_VALUE == 'dummy' ]]
2051+
then
2052+
G_AG_CHECK_INSTALL_PREREQ libasound2-plugin-equal
2053+
cat << _EOF_ > /etc/asound.conf
2054+
pcm.!default {
2055+
type null
2056+
}
2057+
2058+
ctl.!default {
2059+
type equal
2060+
controls "/tmp/alsa_ctl"
2061+
}
2062+
_EOF_
2063+
elif (( $ALSA_EQ_ENABLED ))
20512064
then
20522065
G_AG_CHECK_INSTALL_PREREQ libasound2-plugin-equal
20532066
# Pre-create config dir

0 commit comments

Comments
 (0)