home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
boot
/
i386
/
root
/
usr
/
share
/
YaST2
/
clients
/
inst_dirinstall_finish.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
4KB
|
132 lines
/**
* File:
* clients/inst_dirinstall_finish.ycp
*
* Summary:
* Close dir installation
*
* Authors:
* Anas Nashif <nashif@suse.de>
*
* $Id: inst_dirinstall_finish.ycp 33515 2006-10-19 11:04:46Z lslezak $
*
*/
{
textdomain "packager";
import "DirInstall";
import "Installation";
import "Directory";
import "Progress";
import "Mouse";
import "Keyboard";
import "Language";
import "Timezone";
import "Console";
import "RunlevelEd";
import "String";
list<string> progress_stages =
[
// progress stages
_("Finalize system configuration"),
// progress stages
_("Prepare system for initial boot")
];
integer progress_length = 2;
if (DirInstall::makeimage)
{
// progress stage
progress_stages=add(progress_stages, _("Create image file"));
progress_length = progress_length + 1;
}
list<string> progress_descriptions =
[];
// help text
string help_text = _("<p>Please wait while the system is being configured.</p>");
Progress::New(
// Headline for last dialog of base installation: Install LILO etc.
_("Finishing Directory Installation"),
"", // Initial progress bar label - not empty (reserve space!)
progress_length, // progress bar length
progress_stages,
progress_descriptions,
help_text );
Progress::NextStage ();
// progress title
Progress::Title(_("Configuring installed system"));
Progress::NextStage ();
y2milestone ("Re-starting SCR on %1", Installation::destdir);
Installation::scr_handle = WFM::SCROpen ("chroot="+Installation::destdir+":scr", false);
Installation::scr_destdir = "/";
WFM::SCRSetDefault (Installation::scr_handle);
// re-init tmpdir from new SCR !
Directory::ResetTmpDir();
string tmpdir = Directory::tmpdir;
if (DirInstall::runme_at_boot)
{
string runme_at_boot = Directory::vardir + "/runme_at_boot";
if (!SCR::Write (.target.string, runme_at_boot, ""))
{
y2error ("Couldn't create target %1", runme_at_boot );
}
}
if (SCR::Execute (.target.bash, "/sbin/ldconfig") != 0)
y2error ("ldconfig failed\n");
SCR::Execute (.target.mkdir, Installation::sourcedir);
Mouse::Save();
Timezone::Save();
Language::Save();
Keyboard::Save(true);
Console::Save();
integer runlevel = RunlevelEd::default_runlevel == ""?
3 : tointeger (RunlevelEd::default_runlevel);
y2milestone ("setting default runlevel to %1", runlevel);
SCR::Write (.etc.inittab.id, sformat ("%1:initdefault:", runlevel));
SCR::Write (.etc.inittab, nil);
Pkg::SourceCacheCopyTo (Installation::destdir);
// disable some services - they are useless and usually failing in UML/Xen VM
list<string> disable_services = ["kbd", "acpid"];
foreach(string s, disable_services, {
integer disabled = (integer) SCR::Execute(.target.bash, sformat("/sbin/insserv -r %1", s));
y2milestone("insserv - service %1 exit status: %2", s, disabled);
}
);
// Stop SCR on target
WFM::SCRClose (Installation::scr_handle);
// umount /proc and /sys before creating image (otherwise tar may fail)
DirInstall::UmountFilesystems ();
if (DirInstall::makeimage &&
DirInstall::image_dir != "" &&
DirInstall::image_name != "")
{
Progress::NextStage();
string cmd = sformat("cd '%1' && tar -zcf '%2' . && cd - ",
String::Quote (DirInstall::target),
String::Quote (DirInstall::image_dir + "/" + DirInstall::image_name + ".tgz"));
y2debug("cmd: %1", cmd);
// progress title
Progress::Title(_("Building directory image..."));
WFM::Execute(.local.bash, cmd);
}
Progress::Finish();
return `next;
}