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
/
include
/
hwinfo
/
system_settings_dialogs.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
7KB
|
219 lines
/**
* File:
* system_settings.ycp
*
* Summary:
* Configuration of System Settings. PCI ID, Kernel parameters,
* Bootloader parameters etc.
*
* Authors:
* Lukas Ocilka <locilka@suse.cz>
*
* $Id: system_settings_dialogs.ycp 33530 2006-10-20 11:08:26Z lslezak $
*
*/
{
import "CWM";
import "CWMTab";
import "Label";
import "Arch";
textdomain "tune";
term contents = `VBox ( "tab" );
map tabs_descr = $[
"pci_id" : $[
"header" : NewPCIIDDialogCaption(),
"contents" : `HBox (
`HSpacing(1),
`VBox (
`VSpacing(0.3),
"pci_id_table_and_buttons",
`VSpacing(0.3)
),
`HSpacing(1)
),
"widget_names" : ["pci_id_table_and_buttons"],
],
"kernel_settings" : $[
"header" : _("Kernel Settings"),
"contents" : `HBox (
`HSpacing(1),
`VBox (
`VSpacing(0.3),
`Left( "elevator" ),
`VSpacing(1),
`Left( "sysrq" ),
// FIXME: temporary hack - disable serial console config
// `VSpacing(1),
// `Left ( "serial_console" ),
`VStretch()
),
`HSpacing (1)
),
"widget_names" : ["elevator", "sysrq", "serial_console"],
],
];
string initial_tab = "pci_id";
list <string> widget_names = ["tab"];
map <string, map <string, any> > widget_descr = $[
"pci_id_table_and_buttons" : $[
"widget" : `custom,
"custom_widget" : NewPCIIDDialogContent(),
"help" : NewPCIIDDialogHelp(),
"init" : InitNewPCIIDDialog,
"handle" : HandleNewPCIIDDialog,
],
/* /usr/src/linux/Documentation/kernel-parameters.txt
* http://www.redhat.com/magazine/008jun05/features/schedulers/
*
* elevator= [IOSCHED]
* Format: {"as"|"cfq"|"deadline"|"noop"}
* See Documentation/block/as-iosched.txt
* and Documentation/block/deadline-iosched.txt for details.
*
* *'deadline' => Deadline. Database servers, especially those using "TCQ" disks should
* investigate performance with the 'deadline' IO scheduler. Any system with high
* disk performance requirements should do so, in fact.
* *'as' => Anticipatory (the default one)
* *'noop' => NOOP
* 'cfq' => Completely Fair Queuing
*/
"elevator" : $[
"widget" : `custom,
// combo box label
"custom_widget" : `ComboBox (`id("elevator"), _("Global &I/O Scheduler"), [
// combo box item - I/O scheduler
`item( `id(""), _("Not Configured")),
// combo box item - I/O scheduler, do not translate the abbreviation in brackets
`item( `id("as"), _("Anticipatory [as]")),
// combo box item - I/O scheduler, do not translate the abbreviation in brackets
`item( `id("cfq"), _("Completely Fair Queuing [cfq]")),
// combo box item - I/O scheduler, do not translate the abbreviation in brackets
`item( `id("noop"), _("NOOP [noop]")),
// combo box item - I/O scheduler, do not translate the abbreviation in brackets
`item( `id("deadline"), _("Deadline [deadline]"))
]),
"handle" : HandleElevatorSettings,
"init" : InitElevatorSettings,
"store" : StoreElevatorSettings,
// help text for the scheduler widget, do not translate 'cfg'
"help" : _("<p><b><big>Global I/O Scheduler</big></b><br>
It's possible to select the algorithm which orders and sends commands to disk
devices. This is a global option, it will be used for all disk devices in the
system. If the option is not configured the default (usually 'cfq') scheduler
will be used. See the documetation in /usr/src/linux/Documentation/block
directory (package kernel-source) for more information.</p>"),
],
// .sysconfig.sysctl
"sysrq" : $[
"widget" : `checkbox,
"label" : _("Enable &SysRq Keys"),
"store" : StoreSysRqSettings,
"init" : InitSysRqSettings,
// TRANSLATORS: Help text - over taken from /etc/sysconfig/sysctl file
"help" : _("<p><b><big>Enable SysRq Keys</big></b><br>
If you enable SysRq keys, you will have some control over the system even if it
crashes (such as during kernel debugging). If it's enabled the key combination
Alt-SysRq-<command_key> will start the respective command (e.g. reboot the
computer, dump kernel information). For further information, see
<tt>/usr/src/linux/Documentation/sysrq.txt</tt> (package kernel-source).</p>")
],
// http://www.vanemery.com/Linux/Serial/serial-console.html
// http://www.mikrotik.com/Documentation/manual_2.7/System/Serial.html
// http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html
// http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-boot-loader-lilo.html
// http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-boot-loader-grub.html
/*
* LILO:
* serial=<serial_port>[,<speed>[<parity n|e|o>[<data>]]]
* syntax <serial_port> ::= 0 | 1| ... | 3 (/dev/tty0 -> 0)
* console=<serial device (ttyS0)>,<speed>
*
* GRUB
* serial --unit=0 --speed=<speed> --word=8 --parity=[no|even|odd] --stop=1
* terminal --timeout=0 [--dumb] serial console / terminal serial
*/
"serial_console" : $[
// FIXME: serial line has to have funkcionality defined more precisely
"widget" : `custom,
"custom_widget" : `Frame( _("Serial Console"),
`VBox (
`Left( `CheckBox (_("&Enable the Serial Console"))),
`Left( `ComboBox (`opt(`editable), _("Serial Line &Baud Rate"), [
"110", "300", "1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200"
])),
`Left( `ComboBox (`opt(`editable), _("Serial &Device"), [
"/dev/ttyS0", "/dev/ttyS1"
]))
)
),
"handle" : HandleSerialConsoleSettings,
"help" : _("<p><b><big>Serial Console</big></b><br>
help for the Serial console settings</p>"),
],
];
// FIXME: temporary hack - disable serial line configuration
widget_descr = remove(widget_descr, "serial_console");
define symbol SystemSettingsDialog () {
list<string> tab_order = ["kernel_settings"];
// do not show PCI ID tab on s390
if (!Arch::s390())
{
tab_order = prepend(tab_order, "pci_id");
}
else
{
// remove the PCI ID tab definition
tabs_descr = remove(tabs_descr, "pci_id");
// set focus to kernel_settings tab
initial_tab = "kernel_settings";
}
widget_descr["tab"] = CWMTab::CreateWidget($[
"tab_order": tab_order,
"tabs": tabs_descr,
"widget_descr": widget_descr,
"initial_tab" : initial_tab,
]);
// explicitly set no help (otherwise CWM logs an error)
widget_descr["tab","help"] = "";
string caption = _("System Settings");
Wizard::SetContentsButtons("", `VBox (), "",
Label::BackButton(), Label::NextButton());
Wizard::SetDesktopIcon("powertweak");
symbol ret = CWM::ShowAndRun ($[
"widget_descr" : widget_descr,
"widget_names" : widget_names,
"contents" : contents,
"caption" : caption,
"back_button" : "",
"abort_button" : Label::AbortButton (),
"next_button" : Label::FinishButton (),
]);
if (ret != `back && ret != `abort && ret != `cancel) {
initial_tab = CWMTab::CurrentTab ();
}
y2milestone("Returning %1", ret);
return ret;
}
}