ifupdown: create file interfaces if not exist
PATCH 1/1 ifupdown: create file interfaces if not exist
From: Kai Kang <[email protected]>
It fails to run ifup if /etc/network/interfaces doesn't exist:
| ifup: couldn't open interfaces file "/etc/network/interfaces": No such
| file or directory
Create the config file if not exist.
Signed-off-by Kai Kang <[email protected]>
--- meta/recipes-core/ifupdown/ifupdown_0.8.35.bb | 7 +++++++ 1 file changed, 7 insertions(+)
meta/recipes-core/ifupdown/ifupdown_0.8.35.bb +7 -0
@@ -48,6 +48,13 @@ do_install_ptest () { cp -r ${S}/tests/linux ${D}${PTEST_PATH}/tests/ } +pkg_postinst_ontarget_${PN} () { + if [ ! -f /etc/network/interfaces ]; then + mkdir -p /etc/network + touch /etc/network/interfaces + fi +} + ALTERNATIVE_PRIORITY = "100" ALTERNATIVE_${PN} = "ifup ifdown"
Signature · 1 line
2.17.1