home *** CD-ROM | disk | FTP | other *** search
- /**
- * File:
- * network_finish.ycp
- *
- * Module:
- * Step of base installation finish
- *
- * Authors:
- * Jiri Srain <jsrain@suse.cz>
- *
- * $Id: network_finish.ycp 33360 2006-10-12 14:45:22Z locilka $
- *
- */
-
- {
-
- textdomain "installation";
-
- import "Installation";
- import "ModulesConf";
- import "Arch";
- import "Linuxrc";
- import "String";
-
- any ret = nil;
- string func = "";
- map param = $[];
-
- /* Check arguments */
- if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
- func = (string)WFM::Args(0);
- if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
- param = (map)WFM::Args(1);
- }
-
- y2milestone ("starting network_finish");
- y2debug("func=%1", func);
- y2debug("param=%1", param);
-
- if (func == "Info")
- {
- return (any)$[
- "steps" : 1,
- // progress step title
- "title" : _("Saving network configuration..."),
- "when" : [ `installation, `update, `autoinst ]
- ];
- }
- else if (func == "Write")
- {
- if (Linuxrc::display_ip () || Linuxrc::vnc () || Linuxrc::usessh ())
- {
- y2milestone("Creating network interface");
- WFM::Execute (.local.bash,
- "/sbin/create_interface '" + String::Quote (Installation::destdir) + "'");
- ModulesConf::RunDepmod (false);
- }
- // --------------------------------------------------------------
- // Copy DHCP client cache so that we can request the same IP (#43974).
- WFM::Execute (.local.bash, sformat (
- "mkdir -p '%2%1'; /bin/cp -p %1/dhcpcd-*.cache '%2%1'",
- "/var/lib/dhcpcd",
- String::Quote (Installation::destdir)));
- }
- else
- {
- y2error ("unknown function: %1", func);
- ret = nil;
- }
-
- y2debug("ret=%1", ret);
- y2milestone("network_finish finished");
- return ret;
-
-
- } /* EOF */
-