* [Buildroot] [PATCH v4 0/2] Add runtime test for mpd @ 2026-09-05 4:02 Andreas Ziegler 2026-09-05 4:02 ` [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items Andreas Ziegler 2026-09-05 4:02 ` [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd Andreas Ziegler 0 siblings, 2 replies; 7+ messages in thread From: Andreas Ziegler @ 2026-09-05 4:02 UTC (permalink / raw) To: buildroot; +Cc: Thomas Petazzoni, Marcus Hoffmann, Andreas Ziegler Unused presets have been removed from the mpd configuration: Config.in: libmad, libalsa, mpd.mk: Creation of directories. The configuration file contains a minimum of presets to be able to start mpd. Andreas Ziegler (2): package/mpd: remove defaults, add minimum configuration support/testing: add runtime test for mpd DEVELOPERS | 2 + package/mpd/Config.in | 2 - package/mpd/mpd.conf | 31 +++--------- package/mpd/mpd.mk | 2 - support/testing/tests/package/test_mpd.py | 49 +++++++++++++++++++ .../tests/package/test_mpd/busybox.fragment | 4 ++ .../test_mpd/rootfs-overlay/root/test_mpd.sh | 35 +++++++++++++ 7 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 support/testing/tests/package/test_mpd.py create mode 100644 support/testing/tests/package/test_mpd/busybox.fragment create mode 100755 support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh -- 2.53.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items 2026-09-05 4:02 [Buildroot] [PATCH v4 0/2] Add runtime test for mpd Andreas Ziegler @ 2026-09-05 4:02 ` Andreas Ziegler 2026-09-05 14:14 ` Thomas Petazzoni via buildroot 2026-09-05 4:02 ` [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd Andreas Ziegler 1 sibling, 1 reply; 7+ messages in thread From: Andreas Ziegler @ 2026-09-05 4:02 UTC (permalink / raw) To: buildroot; +Cc: Thomas Petazzoni, Marcus Hoffmann, Andreas Ziegler The configuration file supplied by Buildroot is only a sample; it will not start MPD on a default installation. In a production build, a custom mpd.conf has to be supplied via rootfs overlay or on the target system. Supply the necessary configuration items to start mpd in a default build, and discard unused customizations. Signed-off-by: Andreas Ziegler <br025@umbiko.net> --- Changes v2 -> v3: reintroduce Buildroot mpd.conf as fragment file Changes v3 -> v4: drop deployment of upstream config file package/mpd/Config.in | 2 -- package/mpd/mpd.conf | 31 ++++++++----------------------- package/mpd/mpd.mk | 2 -- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/package/mpd/Config.in b/package/mpd/Config.in index 1b6815e904..bbd6fc16e5 100644 --- a/package/mpd/Config.in +++ b/package/mpd/Config.in @@ -119,7 +119,6 @@ config BR2_PACKAGE_MPD_LIBSNDFILE config BR2_PACKAGE_MPD_MAD bool "mad" - default y select BR2_PACKAGE_MPD_ID3TAG select BR2_PACKAGE_LIBMAD help @@ -244,7 +243,6 @@ comment "Output plugins" config BR2_PACKAGE_MPD_ALSA bool "alsa" - default y select BR2_PACKAGE_ALSA_LIB select BR2_PACKAGE_ALSA_LIB_PCM select BR2_PACKAGE_ALSA_LIB_MIXER diff --git a/package/mpd/mpd.conf b/package/mpd/mpd.conf index 5956b75e24..b9fba3179a 100644 --- a/package/mpd/mpd.conf +++ b/package/mpd/mpd.conf @@ -1,32 +1,17 @@ # -# Sample configuration file for mpd -# This is a minimal configuration, see the manpage for more options +# Buildroot mpd configuration +# Example file: doc/mpdconf.example in the build directory +# Documentation: http://mpd.readthedocs.io/latest/user.html # -# Directory where the music is stored -music_directory "/var/lib/mpd/music" - -# Directory where user-made playlists are stored (RW) -playlist_directory "/var/lib/mpd/playlists" - -# Database file (RW) -db_file "/var/lib/mpd/database" - # Log file (RW) log_file "/var/log/mpd.log" # Process ID file (RW) pid_file "/var/run/mpd.pid" -# State file (RW) -state_file "/var/lib/mpd/state" - -# User id to run the daemon as -#user "nobody" - -# TCP socket binding -bind_to_address "any" -#bind_to_address "localhost" - -# Unix socket to listen on -bind_to_address "/var/lib/mpd/socket" +# One output has to be defined +audio_output { + type "null" + name "/dev/null" +} diff --git a/package/mpd/mpd.mk b/package/mpd/mpd.mk index 4db0aee7cb..5852bbe73f 100644 --- a/package/mpd/mpd.mk +++ b/package/mpd/mpd.mk @@ -347,8 +347,6 @@ endif define MPD_INSTALL_EXTRA_FILES $(INSTALL) -m 0644 -D package/mpd/mpd.conf $(TARGET_DIR)/etc/mpd.conf - mkdir -p $(TARGET_DIR)/var/lib/mpd/music - mkdir -p $(TARGET_DIR)/var/lib/mpd/playlists endef MPD_POST_INSTALL_TARGET_HOOKS += MPD_INSTALL_EXTRA_FILES -- 2.53.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items 2026-09-05 4:02 ` [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items Andreas Ziegler @ 2026-09-05 14:14 ` Thomas Petazzoni via buildroot 2026-09-06 4:34 ` Andreas Ziegler 0 siblings, 1 reply; 7+ messages in thread From: Thomas Petazzoni via buildroot @ 2026-09-05 14:14 UTC (permalink / raw) To: Andreas Ziegler; +Cc: buildroot, Marcus Hoffmann Hello Andreas, On Sat, Sep 05, 2026 at 06:02:52AM +0200, Andreas Ziegler wrote: > The configuration file supplied by Buildroot is only a sample; it will > not start MPD on a default installation. In a production build, a custom > mpd.conf has to be supplied via rootfs overlay or on the target system. > > Supply the necessary configuration items to start mpd in a default build, > and discard unused customizations. > > Signed-off-by: Andreas Ziegler <br025@umbiko.net> Thanks for the new iteration. > diff --git a/package/mpd/Config.in b/package/mpd/Config.in > index 1b6815e904..bbd6fc16e5 100644 > --- a/package/mpd/Config.in > +++ b/package/mpd/Config.in > @@ -119,7 +119,6 @@ config BR2_PACKAGE_MPD_LIBSNDFILE > > config BR2_PACKAGE_MPD_MAD > bool "mad" > - default y Why? > select BR2_PACKAGE_MPD_ID3TAG > select BR2_PACKAGE_LIBMAD > help > @@ -244,7 +243,6 @@ comment "Output plugins" > > config BR2_PACKAGE_MPD_ALSA > bool "alsa" > - default y Why? These changes are not really explained in your commit message. Also this change will break existing defconfigs that assume those options "default y". Is it important to change this? (Even though I agree they should not have been "default y" in the first place). > diff --git a/package/mpd/mpd.mk b/package/mpd/mpd.mk > index 4db0aee7cb..5852bbe73f 100644 > --- a/package/mpd/mpd.mk > +++ b/package/mpd/mpd.mk > @@ -347,8 +347,6 @@ endif > > define MPD_INSTALL_EXTRA_FILES > $(INSTALL) -m 0644 -D package/mpd/mpd.conf $(TARGET_DIR)/etc/mpd.conf > - mkdir -p $(TARGET_DIR)/var/lib/mpd/music > - mkdir -p $(TARGET_DIR)/var/lib/mpd/playlists Why is that no longer needed? Because of the configuration file change? Or because it was bogus/useless anyway? Thanks! Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items 2026-09-05 14:14 ` Thomas Petazzoni via buildroot @ 2026-09-06 4:34 ` Andreas Ziegler 0 siblings, 0 replies; 7+ messages in thread From: Andreas Ziegler @ 2026-09-06 4:34 UTC (permalink / raw) To: Thomas Petazzoni; +Cc: buildroot, Marcus Hoffmann Hi Thomas, On 2026-09-05 14:14, Thomas Petazzoni wrote: > Hello Andreas, > > On Sat, Sep 05, 2026 at 06:02:52AM +0200, Andreas Ziegler wrote: >> The configuration file supplied by Buildroot is only a sample; it will >> not start MPD on a default installation. In a production build, a >> custom >> mpd.conf has to be supplied via rootfs overlay or on the target >> system. >> >> Supply the necessary configuration items to start mpd in a default >> build, >> and discard unused customizations. >> >> Signed-off-by: Andreas Ziegler <br025@umbiko.net> > > Thanks for the new iteration. > >> diff --git a/package/mpd/Config.in b/package/mpd/Config.in >> index 1b6815e904..bbd6fc16e5 100644 >> --- a/package/mpd/Config.in >> +++ b/package/mpd/Config.in >> @@ -119,7 +119,6 @@ config BR2_PACKAGE_MPD_LIBSNDFILE >> >> config BR2_PACKAGE_MPD_MAD >> bool "mad" >> - default y > > Why? This is an optional component. It was never used by any Buildroot, in a user configuration it is also optional. I was always wondering why I was never able to get rid of this library ... It was also never used by the Buildroot configuration. > >> select BR2_PACKAGE_MPD_ID3TAG >> select BR2_PACKAGE_LIBMAD >> help >> @@ -244,7 +243,6 @@ comment "Output plugins" >> >> config BR2_PACKAGE_MPD_ALSA >> bool "alsa" >> - default y > > Why? Also optional, a MPD server or a streaming setup will never use local output. Also, other output options might be selected. The buildroot configuration never contained an output section, so this was unused. > > These changes are not really explained in your commit message. Also > this change will break existing defconfigs that assume those options > "default y". Is it important to change this? (Even though I agree they > should not have been "default y" in the first place). It may break a few, but also fix other configurations; I always have to check my own configs after running make defconfig. It will remove some of the complexity from Buildroot's mpd setup (and it handles only ~50% of available options). >> diff --git a/package/mpd/mpd.mk b/package/mpd/mpd.mk >> index 4db0aee7cb..5852bbe73f 100644 >> --- a/package/mpd/mpd.mk >> +++ b/package/mpd/mpd.mk >> @@ -347,8 +347,6 @@ endif >> >> define MPD_INSTALL_EXTRA_FILES >> $(INSTALL) -m 0644 -D package/mpd/mpd.conf >> $(TARGET_DIR)/etc/mpd.conf >> - mkdir -p $(TARGET_DIR)/var/lib/mpd/music >> - mkdir -p $(TARGET_DIR)/var/lib/mpd/playlists > > Why is that no longer needed? Because of the configuration file > change? Or because it was bogus/useless anyway? /var/lib/mpd was the standard place where MPD used to place its files. But /var/lib is part of the root mount, you should not put music data there. The MPD manual itself advises to check and change this setting. Stored playlists are an optional component, and not every setup uses them. The full set of directories might have been necessary in the beginning, but became obsolete when MPD added remote database access in version 0.21. > Thanks! > > Thomas > -- > Thomas Petazzoni, co-owner and CEO, Bootlin > Embedded Linux and Kernel engineering and training > https://bootlin.com Kind regards, Andreas _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd 2026-09-05 4:02 [Buildroot] [PATCH v4 0/2] Add runtime test for mpd Andreas Ziegler 2026-09-05 4:02 ` [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items Andreas Ziegler @ 2026-09-05 4:02 ` Andreas Ziegler 2026-09-05 14:17 ` Thomas Petazzoni via buildroot 1 sibling, 1 reply; 7+ messages in thread From: Andreas Ziegler @ 2026-09-05 4:02 UTC (permalink / raw) To: buildroot; +Cc: Thomas Petazzoni, Marcus Hoffmann, Andreas Ziegler The test determines if mpd was started by the init system by querying mpd status via the built-in protocol and evaluating the result. Signed-off-by: Andreas Ziegler <br025@umbiko.net> --- Changes v2 -> v3: simplify test to be used without test data remove mpd.conf rootfs overlay DEVELOPERS | 2 + support/testing/tests/package/test_mpd.py | 49 +++++++++++++++++++ .../tests/package/test_mpd/busybox.fragment | 4 ++ .../test_mpd/rootfs-overlay/root/test_mpd.sh | 35 +++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 support/testing/tests/package/test_mpd.py create mode 100644 support/testing/tests/package/test_mpd/busybox.fragment create mode 100755 support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh diff --git a/DEVELOPERS b/DEVELOPERS index 53104cc60b..409e8fcaaa 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -205,6 +205,8 @@ F: package/qt6/qt6opcua/ N: Andreas Ziegler <br025@umbiko.net> F: package/mpd/ +F: support/testing/tests/package/test_mpd +F: support/testing/tests/package/test_mpd.py N: Andrey Smirnov <andrew.smirnov@gmail.com> F: package/python-decorator/ diff --git a/support/testing/tests/package/test_mpd.py b/support/testing/tests/package/test_mpd.py new file mode 100644 index 0000000000..4ce297c2b8 --- /dev/null +++ b/support/testing/tests/package/test_mpd.py @@ -0,0 +1,49 @@ +#!/bin/python + +import os +import infra.basetest + +class TestMpd(infra.basetest.BRTest): + + rootfs_overlay = \ + infra.filepath("tests/package/test_mpd/rootfs-overlay") + busybox_fragment = \ + infra.filepath("tests/package/test_mpd/busybox.fragment") + + # use a custom configuration + config = \ + """ + BR2_x86_64=y + BR2_x86_x86_64_v2=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_X86_64_GLIBC_BLEEDING_EDGE=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" + BR2_ROOTFS_OVERLAY="{}" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_LATEST_VERSION=y + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config" + BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y + BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="{}" + BR2_PACKAGE_MPD=y + BR2_TARGET_ROOTFS_INITRAMFS=y + # BR2_TARGET_ROOTFS_TAR is not set + """.format(rootfs_overlay, busybox_fragment) + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + kern = os.path.join(self.builddir, "images", "bzImage") + self.emulator.boot(arch="x86_64", + kernel=kern, + kernel_cmdline=["console=ttyS0"], + options=[ + "-M", "q35", + "-cpu", "Westmere", + "-smp", "2", + "-initrd", cpio_file, + ]) + + self.emulator.login() + + self.assertRunOk("/root/test_mpd.sh", timeout=30) diff --git a/support/testing/tests/package/test_mpd/busybox.fragment b/support/testing/tests/package/test_mpd/busybox.fragment new file mode 100644 index 0000000000..0c92d86c49 --- /dev/null +++ b/support/testing/tests/package/test_mpd/busybox.fragment @@ -0,0 +1,4 @@ +# +# Networking Utilities +# +CONFIG_NC=y diff --git a/support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh b/support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh new file mode 100755 index 0000000000..4cc6895602 --- /dev/null +++ b/support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +mpd_command() { + mpd_result="" + mpd_state="" + printf "Execute %s" "$1" + while IFS= read -r line; do + case $line in + OK) mpd_result=$line ;; + OK\ MPD*) mpd_protocol=${line##* } ;; + state:*) mpd_state=${line##*: } ;; + ACK\ \[[0-9]*@[0-9]*\]*) mpd_error=${line##*\} } ;; + esac + done <<- EOF + $( ( echo "$1"; echo "close" ) | nc localhost 6600 ) +EOF + + if [ "$mpd_result" != "OK" ]; then + printf "\nmpd protocol error: %s\n" "$mpd_error" + return 1 + else + printf " [OK]\n" + fi + + export mpd_protocol + export mpd_state +} + +test_mpd() { + mpd_command "status" || return 1 + printf "MPD protocol version: %s\n" "$mpd_protocol" +} + +# run main function if invoked from a subshell +[ "$0" = "-sh" ] || test_mpd -- 2.53.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd 2026-09-05 4:02 ` [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd Andreas Ziegler @ 2026-09-05 14:17 ` Thomas Petazzoni via buildroot 2026-09-06 4:54 ` Andreas Ziegler 0 siblings, 1 reply; 7+ messages in thread From: Thomas Petazzoni via buildroot @ 2026-09-05 14:17 UTC (permalink / raw) To: Andreas Ziegler; +Cc: buildroot, Marcus Hoffmann Hello Andreas, On Sat, Sep 05, 2026 at 06:02:53AM +0200, Andreas Ziegler wrote: > The test determines if mpd was started by the init system by querying > mpd status via the built-in protocol and evaluating the result. > > Signed-off-by: Andreas Ziegler <br025@umbiko.net> Thanks for this new iteration! > new file mode 100755 > index 0000000000..4cc6895602 > --- /dev/null > +++ b/support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh > @@ -0,0 +1,35 @@ > +#!/bin/sh > + > +mpd_command() { > + mpd_result="" > + mpd_state="" > + printf "Execute %s" "$1" > + while IFS= read -r line; do > + case $line in > + OK) mpd_result=$line ;; > + OK\ MPD*) mpd_protocol=${line##* } ;; > + state:*) mpd_state=${line##*: } ;; > + ACK\ \[[0-9]*@[0-9]*\]*) mpd_error=${line##*\} } ;; > + esac > + done <<- EOF Why are we "hacking" a minimal mpd client here instead of adding mpd-mpc to the image and using it to test mpd? > + export mpd_protocol > + export mpd_state Why does this needs to be exported? Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd 2026-09-05 14:17 ` Thomas Petazzoni via buildroot @ 2026-09-06 4:54 ` Andreas Ziegler 0 siblings, 0 replies; 7+ messages in thread From: Andreas Ziegler @ 2026-09-06 4:54 UTC (permalink / raw) To: Thomas Petazzoni; +Cc: buildroot, Marcus Hoffmann Hi Thomas, On 2026-09-05 14:17, Thomas Petazzoni wrote: > Hello Andreas, > > On Sat, Sep 05, 2026 at 06:02:53AM +0200, Andreas Ziegler wrote: >> The test determines if mpd was started by the init system by querying >> mpd status via the built-in protocol and evaluating the result. >> >> Signed-off-by: Andreas Ziegler <br025@umbiko.net> > > Thanks for this new iteration! > >> new file mode 100755 >> index 0000000000..4cc6895602 >> --- /dev/null >> +++ >> b/support/testing/tests/package/test_mpd/rootfs-overlay/root/test_mpd.sh >> @@ -0,0 +1,35 @@ >> +#!/bin/sh >> + >> +mpd_command() { >> + mpd_result="" >> + mpd_state="" >> + printf "Execute %s" "$1" >> + while IFS= read -r line; do >> + case $line in >> + OK) mpd_result=$line ;; >> + OK\ MPD*) mpd_protocol=${line##* } ;; >> + state:*) mpd_state=${line##*: } ;; >> + ACK\ \[[0-9]*@[0-9]*\]*) mpd_error=${line##*\} } ;; >> + esac >> + done <<- EOF > > Why are we "hacking" a minimal mpd client here instead of adding > mpd-mpc to the image and using it to test mpd? Hacking? The MPD command protocol is the official way to connect to the MPD server: https://mpd.readthedocs.io/en/latest/protocol.html. Every client uses it, including mpc. I use CLI one-liners regularly for debugging issues and a more complete version in a Python script for checking libraries. Why add yet another program for checking a protocol output? > >> + export mpd_protocol >> + export mpd_state > > Why does this needs to be exported? Variable scope is not clearly defined within shells. In POSIX, all variable declarations are global; Busybox's ash should not know about scope, but tolerates 'local' definitions; bash has a basic understanding of scope and treats function variables as local. Since I switch shells often (by running scripts on different machines) I usually export variables in functions that need visibility in the caller. It is also a good reminder that the function "returns" more than one value. > > Thomas > -- > Thomas Petazzoni, co-owner and CEO, Bootlin > Embedded Linux and Kernel engineering and training > https://bootlin.com Kind regards, Andreas _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-09-06 4:55 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-05 4:02 [Buildroot] [PATCH v4 0/2] Add runtime test for mpd Andreas Ziegler 2026-09-05 4:02 ` [Buildroot] [PATCH v4 1/2] package/mpd: remove unused, add mandatory configuration items Andreas Ziegler 2026-09-05 14:14 ` Thomas Petazzoni via buildroot 2026-09-06 4:34 ` Andreas Ziegler 2026-09-05 4:02 ` [Buildroot] [PATCH v4 2/2] support/testing: add runtime test for mpd Andreas Ziegler 2026-09-05 14:17 ` Thomas Petazzoni via buildroot 2026-09-06 4:54 ` Andreas Ziegler
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox