home *** CD-ROM | disk | FTP | other *** search
- /**
- * File:
- * save_hw_status_finish.ycp
- *
- * Module:
- * Step of base installation finish
- *
- * Authors:
- * Jiri Srain <jsrain@suse.cz>
- *
- * $Id: save_hw_status_finish.ycp 33076 2006-09-25 08:59:36Z jsrain $
- *
- */
-
- {
-
- textdomain "installation";
-
- import "Mode";
- import "HwStatus";
- import "HWConfig";
-
- 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 save_hw_status_finish");
- y2debug("func=%1", func);
- y2debug("param=%1", param);
-
- if (func == "Info")
- {
- return (any)$[
- "steps" : 1,
- // progress step title
- "title" : _("Saving hardware configuration..."),
- "when" : [ `installation, `update, `autoinst ],
- ];
- }
- else if (func == "Write")
- {
- // FIXME this agent needn't be installed
- list<string> parports = (list<string>)SCR::Read (.proc.parport.devices);
- if (parports != nil && size (parports) > 0)
- {
- HWConfig::SetValue ("static-printer", "STARTMODE", "auto");
- HWConfig::SetValue ("static-printer", "MODULE", "lp");
- }
- // PS/2 mouse on PPC
- map out = (map)SCR::Execute (.target.bash_output,
- "#!/bin/sh
- set -e
- if test -f /etc/sysconfig/hardware/hwcfg-static-psmouse
- then
- exit 0
- fi
- if test -d /proc/device-tree
- then
- cd /proc/device-tree
- if find * -name name -print0 | xargs -0 grep -qw 8042
- then
- cat > /etc/sysconfig/hardware/hwcfg-static-psmouse <<EOF
- MODULE='psmouse'
- EOF
- fi
- fi
- ");
- if ((integer) out["exit"]:0 != 0) {
- y2error ("Error saving PS/2 mouse: %1", out);
- } else {
- y2milestone ("PS/2 mouse saving process returnes: %1", out);
- }
-
- y2milestone ("PS/2 mouse saving process returnes: %1", out);
- if (Mode::update ())
- {
- // ensure "no" status for all pci and isapnp devices
- HwStatus::Update();
- }
-
- // write "yes" status for known devices (mouse, keyboard, storage, etc.)
- HwStatus::Save();
- }
- else
- {
- y2error ("unknown function: %1", func);
- ret = nil;
- }
-
- y2debug("ret=%1", ret);
- y2milestone("save_hw_status_finish finished");
- return ret;
-
-
- } /* EOF */
-