From 9e22e871de6e69026c8eebb1d966fa1f0c2edfcc Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 11 Feb 2020 04:57:46 -0600 Subject: hscript: Turn on network interfaces in Install Env when network is true --- hscript/script_e.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'hscript/script_e.cc') diff --git a/hscript/script_e.cc b/hscript/script_e.cc index 2ae48d0..402eb88 100644 --- a/hscript/script_e.cc +++ b/hscript/script_e.cc @@ -21,6 +21,7 @@ #include "script.hh" #include "script_i.hh" +#include "util.hh" #include "util/filesystem.hh" namespace Horizon { @@ -395,6 +396,17 @@ bool Script::execute() const { EXECUTE_FAILURE("network"); return false; } + for(auto &iface : ifaces) { + fs::create_symlink("/etc/init.d/net.lo", + "/etc/init.d/net." + iface, ec); + if(ec) { + output_error("internal", "could not use networking on " + + iface, ec.message()); + EXECUTE_FAILURE("network"); + } else { + run_command("service", {"net." + iface, "start"}); + } + } if(!internal->nses.empty()) { if(dhcp) { fs::copy_file("/target/etc/resolv.conf.head", @@ -498,7 +510,7 @@ bool Script::execute() const { iface, ec); if(ec) { output_error("internal", "could not auto-start " - "networking on" + iface, ec.message()); + "networking on " + iface, ec.message()); } } } -- cgit v1.2.3-70-g09d2