From: Kai Kang Date: Mon, 23 Mar 2020 02:24:14 +0000 (+0800) Subject: ifupdown: create file interfaces if not exist X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~11492 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e692daf66d2c9d51d418706e20f4527505dc0bd;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.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 53cb971d338..a8913e6e293 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"