From: Jo Zzsi Date: Sun, 10 Aug 2025 12:20:09 +0000 (-0400) Subject: feat(configure): autoconfigure configprofile X-Git-Tag: 109~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eada0fb;p=thirdparty%2Fdracut-ng.git feat(configure): autoconfigure configprofile The original motivation of this PR was to set the openSUSE config inside the openSUSE CI container. This commit will autoconfigure those configprofiles that are maintained upstream for fedora, debian and opensuse based distro's. One notable change from this commit is that it would now allow testing hostonly_cmdline=yes configuration which is currently untested on the CI. --- diff --git a/configure b/configure index e7560a7ce..b01b5fae3 100755 --- a/configure +++ b/configure @@ -22,8 +22,27 @@ fi CC="${CC:-cc}" PKG_CONFIG="${PKG_CONFIG:-pkg-config}" -# set hostonly by default -configprofile="${configprofile:-hostonly}" +# set configprofile based on ID and ID_LIKE from os-release +if [[ -f /etc/os-release ]]; then + . /etc/os-release +elif [[ -f /usr/lib/os-release ]]; then + . /usr/lib/os-release +fi + +case " $ID $ID_LIKE " in + *" debian "*) + configprofile=debian + ;; + *" fedora "*) + configprofile=fedora + ;; + *" suse "*) + configprofile=opensuse + ;; + *) + configprofile=hostonly + ;; +esac # Little helper function for reading args from the commandline. # it automatically handles -a b and -a=b variants, and returns 1 if