]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(network-manager): allow override network manager version
authorZoltán Böszörményi <zboszor@pr.hu>
Mon, 8 Feb 2021 16:50:19 +0000 (17:50 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 9 Feb 2021 07:09:28 +0000 (07:09 +0000)
With dracutsysrootdir set and foreign binaries in sysroot,
running NetworkManager --version is not possible and it may be
different than the one installed on the host.
NM_VERSION can be used to override it.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
dracut.8.asc
modules.d/35network-manager/module-setup.sh

index 9110b4e0d23d1a30315d152710ff9fb1f44c89ec..dcbfe5976eeec85aebf758a5aaf848ef4e47ab40 100644 (file)
@@ -599,6 +599,9 @@ _SYSTEMD_VERSION_::
 _SYSTEMCTL_::
     overrides the systemctl binary. Used for **--sysroot**.
 
+_NM_VERSION_::
+    overrides the NetworkManager version. Used for **--sysroot**.
+
 _DRACUT_INSTALL_PATH_::
     overrides **PATH** environment for **dracut-install** to look for
     binaries relative to **--sysroot**. In a cross-compiled environment
index ed2f399e279eb092d5aafef32fb723399df8d230..92ea7b08f33791b4e764b8469beb04c75e03c6b3 100755 (executable)
@@ -24,7 +24,7 @@ installkernel() {
 install() {
     local _nm_version
 
-    _nm_version=$(NetworkManager --version)
+    _nm_version=${NM_VERSION:-$(NetworkManager --version)}
 
     # We don't need `ip` but having it is *really* useful for people debugging
     # in an emergency shell.