From: Kai Kang Date: Mon, 23 Mar 2020 02:24:14 +0000 (+0800) Subject: ifupdown: create file interfaces if not exist X-Git-Tag: 2020-04-dunfell~131 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=4e692daf66d2c9d51d418706e20f4527505dc0bd;p=openembedded-core.git ifupdown: create file interfaces if not exist 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 Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/ifupdown/ifupdown_0.8.35.bb b/meta/recipes-core/ifupdown/ifupdown_0.8.35.bb index 53cb971d33..a8913e6e29 100644 --- a/meta/recipes-core/ifupdown/ifupdown_0.8.35.bb +++ b/meta/recipes-core/ifupdown/ifupdown_0.8.35.bb @@ -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"