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
/
dom0_setup.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
4KB
|
149 lines
/**
* Module: dom0_setup.ycp
*
* Authors: Ladislav Slezak <lslezak@suse.cz>
*
* Purpose: Configure domain0 (Xen management domain)
*
* $Id: dom0_setup.ycp 31030 2006-05-18 21:59:22Z mgfritch $
*/
{
import "Package";
import "Progress";
import "Report";
import "Popup";
import "Wizard";
import "VM_XEN";
textdomain "vm";
list <string> progress_stages = [
// progress stage
_("Install Packages"),
// progress stage
_("Firewall Configuration")
];
list progress_descriptions = [];
integer progress_length = size(progress_stages);
// Headline for management domain installation
string headline = _("Configuring the VM Server (domain 0)");
// xen domain0 installation help text - 1/4
string help_text = _("<p><big><b>VM Server Configuration</b></big></p><p>Configuration
of the VM Server (domain 0) has two parts.</p>
") +
// xen domain0 installation help text - 2/4
_("<p>The required packages are installed into the system first. Then the
boot loader is switched to GRUB if it is not already used and the Xen section is
added to the boot loader menu if it is missing.</p>
") +
// xen domain0 installation help text - 3/4
_("<p>GRUB is needed because it supports the multiboot standard required
to boot Xen and Linux kernel.</p>
") +
// xen domain0 installation help text - 4/4
_("<p>When the configuration is successfully finished, it is possible to boot the VM Server from the boot loader menu.</p>");
// error popup
string error = _("An error occurred during installation.");
// error popup
string abortmsg = _("The installation will be aborted.");
Wizard::OpenNextBackDialog();
// enable progress
boolean progress = Progress::set(true);
// Headline for virtual machine installation
Progress::New(headline, "", progress_length,
progress_stages, progress_descriptions, help_text);
// package stage
Progress::NextStage();
// Decide if dom0 should use the pae kernel (#175117)
string kernel_pkg = "kernel-xen";
if (VM_XEN::isPAEKernel())
kernel_pkg = "kernel-xenpae";
list<string> packages = ["xen", "xen-libs", "xen-tools", "xen-tools-ioemu"];
packages = add(packages, kernel_pkg);
boolean success = true;
boolean bootloader_modified = false;
// progressbar title - check whether Xen packages are installed
Progress::Title(_("Checking packages..."));
if (!Package::InstalledAll(packages))
{
// progressbar title - install the required packages
Progress::Title(_("Installing packages..."));
success = Package::InstallAll(packages);
}
if (!success)
{
// error popup
Report::Error(_("Cannot install required packages.") + "\n" + abortmsg);
return `abort;
}
// firewall stage - modify the firewall setting, add the xen bridge to FW_FORWARD_ALWAYS_INOUT_DEV
Progress::NextStage();
// check whether the firewall option exists
if (contains(SCR::Dir(.sysconfig.SuSEfirewall2), "FW_FORWARD_ALWAYS_INOUT_DEV"))
{
string xen_bridge = "xenbr0";
// read the current value
string forward = (string) SCR::Read(.sysconfig.SuSEfirewall2.FW_FORWARD_ALWAYS_INOUT_DEV);
// add xenbr0 if it's not already there
if (!contains(splitstring(forward, " "), xen_bridge))
{
if (size(forward) > 0)
{
// add a space
forward = forward + " ";
}
forward = forward + xen_bridge;
// write the new value
SCR::Write(.sysconfig.SuSEfirewall2.FW_FORWARD_ALWAYS_INOUT_DEV, forward);
// flush the cache
SCR::Write(.sysconfig.SuSEfirewall2, nil);
y2milestone("Modified firewall option FW_FORWARD_ALWAYS_INOUT_DEV: '%1'", forward);
}
else
{
y2milestone("FW_FORWARD_ALWAYS_INOUT_DEV: '%1', not modified", forward);
}
}
else
{
y2milestone("Firewall option FW_FORWARD_ALWAYS_INOUT_DEV is not defined, firewall is not modified.");
}
Progress::Finish();
// popup message - ask user to reboot the machine into Xen kernel
Popup::LongMessage(_("The machine is ready to start the VM Server.
Reboot the machine and select the Xen section in the boot loader menu to start it.
"));
Wizard::CloseDialog();
return `next;
}