systemd-conf: Allow systemd to manage QEMU wired networks
PATCH 1/1 systemd-conf: Allow systemd to manage QEMU wired networks
Allows systemd to manage wired network interfaces just like on actual hardware. Systemd seems to be smart enough to not enable DHCP if the interface was assigned a IP address in the kernel (e.g. by runqemu), so the existing use cases should continue to work.
--- meta/recipes-core/systemd/systemd-conf_247.2.bb | 3 --- 1 file changed, 3 deletions(-)
meta/recipes-core/systemd/systemd-conf_247.2.bb +0 -3
@@ -29,9 +29,6 @@ do_install() { # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 do_install_append_qemuall() { install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf - - # Do not install wired.network for qemu bsps - rm -rf ${D}${systemd_unitdir}/network } PACKAGE_ARCH = "${MACHINE_ARCH}"
Signature · 1 line
2.30.0
Quoted 21 lines · Joshua Watt
Allows systemd to manage wired network interfaces just like on actual hardware. Systemd seems to be smart enough to not enable DHCP if the interface was assigned a IP address in the kernel (e.g. by runqemu), so the existing use cases should continue to work.
Signed-off-by Joshua Watt <[email protected]>---
meta/recipes-core/systemd/systemd-conf_247.2.bb | 3 ---1 file changed, 3 deletions(-)meta/recipes-core/systemd/systemd-conf_247.2.bb +0
-0@@ -29,9 +29,6 @@ do_install() { # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 do_install_append_qemuall() {install -D -m0644 ${WORKDIR}/system.conf-qemuall
${D}${systemd_unitdir}/system.conf.d/01-${PN}.confmeta/recipes-core/systemd/systemd-conf_247.2.bb +0
-3- - # Do not install wired.network for qemu bsps - rm -rf ${D}${systemd_unitdir}/network
Quoted 1 line
}
We did this for a reason. In testing we're seeing:
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/1831
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/1830
which I suspect could be related to this.
Cheers,
Richard
Hello Richard.
Quoted 26 lines · Richard Purdie
Quoted 15 lines · Joshua Watt
Allows systemd to manage wired network interfaces just like on actual hardware. Systemd seems to be smart enough to not enable DHCP if the interface was assigned a IP address in the kernel (e.g. by runqemu), so the existing use cases should continue to work.
Signed-off-by Joshua Watt <[email protected]>--- meta/recipes-core/systemd/systemd-conf_247.2.bb | 3 --- 1 file changed, 3 deletions(-)meta/recipes-core/systemd/systemd-conf_247.2.bb +0
-0meta/recipes-core/systemd/systemd-conf_247.2.bb do_install() { · line 32
Quoted 7 lines
meta/recipes-core/systemd/systemd-conf_247.2.bb +0
-3@@ -29,9 +29,6 @@ do_install() { # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 do_install_append_qemuall() { install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf - - # Do not install wired.network for qemu bsps - rm -rf ${D}${systemd_unitdir}/network }We did this for a reason. In testing we're seeing:
Quoted 4 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/1831
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/1830which I suspect could be related to this.
I looked into this a bit more. We started to use the network unit file for qemu as well, because we have a use case where it uses DHCP. That indeed broke the runqemu static IP configuration from the kernel commandline.
What we do here to cover both use cases is to skip the unit if we find the IP to be configured on the kernel commandline. The following in the match section does the trick for us:
KernelCommandLine=!ip
Joshua, do you want to update the unit file accordingly or me to send a patch superseding yours with this change integrated?
regards
Stefan Schmidt
Hello.
Quoted 34 lines · Stefan Schmidt
Hello Richard.
Quoted 26 lines · Richard Purdie
Quoted 17 lines · Joshua Watt
Allows systemd to manage wired network interfaces just like on actual hardware. Systemd seems to be smart enough to not enable DHCP if the interface was assigned a IP address in the kernel (e.g. by runqemu), so the existing use cases should continue to work.
Signed-off-by Joshua Watt <[email protected]>---
meta/recipes-core/systemd/systemd-conf_247.2.bb | 3 ---1 file changed, 3 deletions(-)meta/recipes-core/systemd/systemd-conf_247.2.bb +0
-0@@ -29,9 +29,6 @@ do_install() { # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 do_install_append_qemuall() {Quoted 5 lines
install -D -m0644 ${WORKDIR}/system.conf-qemuall
${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf-
- # Do not install wired.network for qemu bsps
- rm -rf ${D}${systemd_unitdir}/network
}We did this for a reason. In testing we're seeing:
Quoted 4 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/1831
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/1830which I suspect could be related to this.
Quoted 7 lines
I looked into this a bit more. We started to use the network unit file for qemu as well, because we have a use case where it uses DHCP. That indeed broke the runqemu static IP configuration from the kernel commandline.
What we do here to cover both use cases is to skip the unit if we find the IP to be configured on the kernel commandline. The following in the match section does the trick for us:
KernelCommandLine=!ip
Joshua, do you want to update the unit file accordingly or me to send a patch superseding yours with this change integrated?
I went ahead and posted a patch that has the two changes and matches (sic) what we have in place in our layers.
I would expect this to pass the yocto autobuilder now, but if not I would need to get access to the test files to figure out what wen wrong.
regards
Stefan Schmidt