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
/
modules
/
BootArch.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
3KB
|
139 lines
/**
* File:
* modules/BootArch.ycp
*
* Module:
* Bootloader installation and configuration
*
* Summary:
* Module containing specific data for differnt architecturese
* (as some architectures support multiple bootloaders, some bootloaders
* support multiple architectures)
*
* Authors:
* Jiri Srain <jsrain@suse.cz>
*
* $Id: BootArch.ycp 34489 2006-11-20 14:32:44Z jplack $
*
*/
{
module "BootArch";
textdomain "bootloader";
import "Arch";
import "Kernel";
import "Linuxrc";
import "ProductFeatures";
import "Stage";
/**
* Get the file holding the initd imahe
* @return string the initrd image
*/
global string InitrdImage () {
return "/boot/initrd";
}
/**
* Get parameters for the failsafe kernel
* @return string parameters for failsafe kernel
*/
global string FailsafeKernelParams () {
string ret = "";
if (Arch::i386 ())
{
ret = "showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off";
}
else if (Arch::x86_64 ())
{
ret = "showopts ide=nodma apm=off acpi=off noresume edd=off";
}
else if (Arch::ia64 ())
{
ret = "ide=nodma nohalt noresume";
}
else
{
y2warning ("Parameters for Failsafe boot option not defined");
}
if (Stage::initial ())
{
if (Linuxrc::InstallInf ("NOPCMCIA") == "1")
ret = ret + " NOPCMCIA";
}
else
{
map<string,any> saved_params = (map<string,any>)SCR::Read (
.target.ycp, "/var/lib/YaST2/bootloader.ycp");
ret = ret + " " + saved_params["additional_failsafe_params"]:"";
}
ret = ret + " 3";
return ret;
}
/**
* Get parameters for the default kernel
* @param resume string device to resume from (or empty not to set it)
* @return string parameters for default kernel
*/
global string DefaultKernelParams (string resume) {
string features =
ProductFeatures::GetStringFeature (
"globals",
"additional_kernel_parameters");
string kernel_cmdline = Kernel::GetCmdLine ();
if (Arch::i386 () || Arch::x86_64 ())
{
string ret = (kernel_cmdline != "") ? kernel_cmdline + " " : "";
if (resume != "")
ret = ret + sformat ("resume=%1 ", resume);
if (features != "")
ret = ret + features + " ";
if (regexpmatch (ret, "^(.* )?splash=[[:lower:]]+( .*)?$"))
ret = regexpsub (ret, "^((.* ))?splash=[[:lower:]]+(( .*)?)$", "\\1 \\3");
ret = ret + "splash=silent showopts";
return ret;
}
else if (Arch::ia64 ())
{
string ret = (kernel_cmdline != "") ? kernel_cmdline + " " : "";
if (features != "")
ret = ret + features + " ";
ret = ret + "splash=silent";
// on SGI Altix change kernel default hash tables sizes
if (SCR::Read (.target.stat, "/proc/sgi_sn") != $[])
{
ret = ret + " thash_entries=2097152";
}
return ret;
}
else
{
y2warning ("Default kernel parameters not defined");
return kernel_cmdline;
}
}
/**
* Is VGA parameter setting available
* @return true if vga= can be set
*/
global boolean VgaAvailable () {
return (Arch::i386 () || Arch::x86_64 () || Arch::ia64 ());
}
/**
* Is Suspend to Disk available?
* @return true if STD is available
*/
global boolean ResumeAvailable () {
return (Arch::i386 () || Arch::x86_64 () || Arch::ia64 ());
}
} // EOF