home *** CD-ROM | disk | FTP | other *** search
- /**
- * File:
- * save_config_finish.ycp
- *
- * Module:
- * Step of base installation finish
- *
- * Authors:
- * Jiri Srain <jsrain@suse.cz>
- *
- * $Id: save_config_finish.ycp 33835 2006-10-30 12:02:22Z locilka $
- *
- */
-
- {
-
- textdomain "installation";
-
- import "Directory";
- import "Mode";
- import "Mouse";
- import "Timezone";
- import "Language";
- import "Keyboard";
- import "ProductFeatures";
- import "AutoInstall";
- import "Console";
- import "Product";
- import "Progress";
- import "SignatureCheckDialogs";
- import "Stage";
-
- 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_config_finish");
- y2debug("func=%1", func);
- y2debug("param=%1", param);
-
- if (func == "Info")
- {
- return (any)$[
- "steps" : Mode::autoinst () ? 8 : (Mode::update() ? 6 : 7),
- "when" : [ `installation, `update, `autoinst ],
- ];
- }
- else if (func == "Write")
- {
- // Bugzilla #209119
- // ProductFeatures::Save() moved here from inst_kickoff.ycp
- // (After the SCR is switched)
- if (Stage::initial ()) {
- y2milestone ("Saving ProductFeatures...");
- SCR::Execute (.target.bash, "/bin/mkdir -p '/etc/YaST2'");
- SCR::Execute (.target.bash, "touch '/etc/YaST2/ProductFeatures'");
- ProductFeatures::Save();
- }
-
- // progress step title
- Progress::Title (_("Saving mouse configuration..."));
- Mouse::Save();
- Progress::NextStep ();
- // progress step title
- Progress::Title (_("Saving time zone..."));
- Timezone::Save();
- Progress::NextStep ();
- if (!Mode::update ())
- {
- // progress step title
- Progress::Title (_("Saving language..."));
- Language::Save();
- Progress::NextStep ();
- }
- // save the update language for the second stage (F300572)
- else
- {
- string lang = Language::language;
- string file = Directory::vardir + "/language.ycp";
- y2milestone ("saving %1 to %2 for 2nd stage of update", lang, file);
- SCR::Write (.target.ycp, file, $[ "second_stage_language" : lang ]);
- }
- // progress step title
- Progress::Title (_("Saving keyboard configuration..."));
- Keyboard::Save(true);
- Progress::NextStep ();
- // progress step title
- Progress::Title (_("Saving product information..."));
- ProductFeatures::Save();
- if (Mode::autoinst ())
- {
- Progress::NextStep ();
- // progress step title
- Progress::Title (_("Saving automatical installation settings..."));
- AutoInstall::Save();
- }
- Progress::NextStep ();
- // progress step title
- Progress::Title (_("Saving console configuration..."));
- Console::Save();
-
- Progress::NextStep ();
- // progress step title
- Progress::Title (_("Configuring the superuser's environment..."));
- SCR::Write (.sysconfig.suseconfig.CWD_IN_USER_PATH,
- contains (Product::flags, "usercwd") ? "yes" : "no");
- SCR::Write (.sysconfig.suseconfig, nil);
-
- // FIXME text freeze: progress (update count in Info too)
- SCR::Write (.sysconfig.security.CHECK_SIGNATURES,
- SignatureCheckDialogs::CheckSignatures ());
- SCR::Write (.sysconfig.security, nil);
-
- }
- else
- {
- y2error ("unknown function: %1", func);
- ret = nil;
- }
-
- y2debug("ret=%1", ret);
- y2milestone("save_config_finish finished");
- return ret;
-
-
- } /* EOF */
-