Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49686 - in /trunk/bootloader/src: generic/Makefile.am generic/device_map_edit_widget.ycp grub/helps.ycp modules/BootCommon.ycp modules/BootGRUB.ycp routines/helps_i386.ycp
  • From: juhliarik@xxxxxxxxxxxxxxxx
  • Date: Tue, 05 Aug 2008 10:04:46 -0000
  • Message-id: <20080805100446.C640739C36@xxxxxxxxxxxxxxxx>
Author: juhliarik
Date: Tue Aug 5 12:04:46 2008
New Revision: 49686

URL: http://svn.opensuse.org/viewcvs/yast?rev=49686&view=rev
Log:
added/enabled support for manual ordering of disks in device.map fro
GRUB fate #303964


M bootloader/src/modules/BootCommon.ycp
* deleted using of Storage::UseLilo()
M bootloader/src/modules/BootGRUB.ycp
* enable ordering of disk
M bootloader/src/routines/helps_i386.ycp
* added new/old help text
M bootloader/src/generic/Makefile.am
A bootloader/src/generic/device_map_edit_widget.ycp
* created clone of dialog_i386.ycp
* there is dialog for ordering disks in device.map

Added:
trunk/bootloader/src/generic/device_map_edit_widget.ycp
Modified:
trunk/bootloader/src/generic/Makefile.am
trunk/bootloader/src/grub/helps.ycp
trunk/bootloader/src/modules/BootCommon.ycp
trunk/bootloader/src/modules/BootGRUB.ycp
trunk/bootloader/src/routines/helps_i386.ycp

Modified: trunk/bootloader/src/generic/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/generic/Makefile.am?rev=49686&r1=49685&r2=49686&view=diff
==============================================================================
--- trunk/bootloader/src/generic/Makefile.am (original)
+++ trunk/bootloader/src/generic/Makefile.am Tue Aug 5 12:04:46 2008
@@ -14,7 +14,8 @@
section_widgets.ycp \
sections_widget.ycp \
widget_funcs.ycp \
- wizards.ycp
+ wizards.ycp \
+ device_map_edit_widget.ycp

EXTRA_DIST = \
$(ynclude_DATA)

Added: trunk/bootloader/src/generic/device_map_edit_widget.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/generic/device_map_edit_widget.ycp?rev=49686&view=auto
==============================================================================
--- trunk/bootloader/src/generic/device_map_edit_widget.ycp (added)
+++ trunk/bootloader/src/generic/device_map_edit_widget.ycp Tue Aug 5 12:04:46
2008
@@ -0,0 +1,184 @@
+/**
+ * File:
+ * include/bootloader/routines/dialogs.ycp
+ *
+ * Module:
+ * Bootloader installation and configuration
+ *
+ * Summary:
+ * Dialogs for configuraion i386-specific functions
+ *
+ * Authors:
+ * Jiri Srain <jsrain@xxxxxxx>
+ *
+ * $Id: dialogs_i386.ycp 47885 2008-05-26 16:34:24Z juhliarik $
+ *
+ */
+
+
+{
+textdomain "bootloader";
+
+
+import "Label";
+import "Wizard";
+import "CWM";
+import "BootCommon";
+import "Stage";
+
+include "bootloader/routines/helps_i386.ycp";
+
+
+/**
+ * Run dialog to adjust installation on i386 and AMD64
+ * @return symbol for wizard sequencer
+ */
+symbol i386InstallDetailsDialog () {
+ term contents = `HBox (`HStretch (), `VBox (
+ `VStretch (),
+ // frame
+ `Frame (_("Disk Order"),
+ `HBox (`HSpacing (2), `VBox (
+ `VSpacing (1),
+ `SelectionBox (`id (`disks),
+ `opt (`notify, `immediate),
+ // selectionn box label
+ _("D&isks"), []),
+ Mode::config ()
+ ? `HBox (
+ `HStretch (),
+ `PushButton (`id (`add), `opt (`key_F3),
Label::AddButton ()),
+ `PushButton (`id (`delete), `opt(`key_F5),
Label::DeleteButton ()),
+ `HStretch ()
+ )
+ : `HBox (),
+ `VSpacing (1)
+ ),
+ `HSquash (
+ `VBox (
+ `VStretch (),
+ `PushButton (`id (`up), `opt (`hstretch), _("&Up")),
+ `PushButton (`id (`down), `opt (`hstretch), _("&Down")),
+ `VStretch ()
+ )
+ ),
+ `HSpacing (2)
+ )
+ ),
+ `VStretch ()
+
+ ), `HStretch ());
+
+ Wizard::SetContentsButtons (
+ // dialog caption
+ _("Boot Loader Device Map"),
+ contents,
+ i386DeviceMapEditHelp(),
+ Label::BackButton (),
+ Label::OKButton ());
+
+ list<string> disks_order = BootCommon::DisksOrder ();
+
+ UI::ChangeWidget (`id (`disks), `Items, disks_order);
+ UI::ChangeWidget (`id (`disks), `CurrentItem, disks_order[0]:"");
+
+ any ret = nil;
+ while (ret == nil)
+ {
+ string current = (string)UI::QueryWidget (`id (`disks), `CurrentItem);
+ integer pos = 0;
+ while (pos < size (disks_order) && disks_order[pos]:"" != current)
+ pos = pos + 1;
+ UI::ChangeWidget (`id (`up), `Enabled,
+ pos > 0 && pos < size (disks_order));
+ UI::ChangeWidget (`id (`down), `Enabled, pos < size (disks_order) - 1);
+
+ ret = UI::UserInput ();
+ boolean order_changed = false;
+
+ if (ret == `add)
+ {
+ term popup = `VBox (`VSpacing (1),
+ // textentry header
+ `InputField (`id (`devname), `opt (`hstretch), _("&Device")),
+ `VSpacing (1),
+ `HBox (`HStretch (),
+ `PushButton (`id (`ok), `opt (`key_F10, `default),
+ Label::OKButton ()),
+ `HStretch (),
+ `PushButton (`id (`cancel), `opt (`key_F8),
+ Label::CancelButton ()),
+ `HStretch ()
+ ),
+ `VSpacing (1)
+ );
+ UI::OpenDialog (popup);
+ symbol pushed = (symbol)UI::UserInput ();
+ string new_dev = (string)
+ UI::QueryWidget (`id (`devname), `Value);
+ UI::CloseDialog ();
+ if (pushed == `ok)
+ {
+ disks_order = add (disks_order, new_dev);
+ order_changed = true;
+ current = new_dev;
+ }
+ }
+ else if (ret == `delete)
+ {
+ disks_order = filter (string d, disks_order, {
+ return d != current;
+ });
+ order_changed = true;
+ current = disks_order[0]:nil;
+ }
+ else if (ret == `up)
+ {
+ disks_order = (list<string>)
+ BootCommon::swapItems (disks_order, pos, pos - 1);
+ order_changed = true;
+ }
+ else if (ret == `down)
+ {
+ disks_order = (list<string>)
+ BootCommon::swapItems (disks_order, pos, pos + 1);
+ order_changed = true;
+ }
+
+ if (ret == `cancel)
+ ret = `abort;
+ if (ret != `next && ret != `abort && ret != `back)
+ {
+ if (order_changed)
+ {
+ UI::ChangeWidget (`id (`disks), `Items, disks_order);
+ UI::ChangeWidget (`id (`disks), `CurrentItem, current);
+ }
+ ret = nil;
+ }
+ }
+ if (ret == `next)
+ {
+ integer index = 0;
+ BootCommon::device_mapping = filter (string k, string v,
+ BootCommon::device_mapping,
+ {
+ return substring (v, 0, 2) != "hd";
+ });
+ BootCommon::mbrDisk = disks_order[0]:"";
+ BootCommon::device_mapping = (map<string,string>)union (
+ BootCommon::device_mapping,
+ listmap (string d, disks_order, {
+ string hex_index = substring (tohexstring (index), 2);
+ index = index + 1;
+ return $[ d : sformat ("hd%1", hex_index) ];
+ })
+ );
+
+ }
+ return (symbol)ret;
+}
+
+
+
+} // EOF

Modified: trunk/bootloader/src/grub/helps.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub/helps.ycp?rev=49686&r1=49685&r2=49686&view=diff
==============================================================================
--- trunk/bootloader/src/grub/helps.ycp (original)
+++ trunk/bootloader/src/grub/helps.ycp Tue Aug 5 12:04:46 2008
@@ -126,7 +126,7 @@


global map<string,string> grub_descriptions = $[
- "boot" : _("Boot Loader Locations"),
+ "boot" : _("Boot Loader Locations"),
"activate" : _("Set active Flag in Partition Table for
Boot Partition"),
"timeout" : _("Timeout in Seconds"),
"default" : _("Default Boot Section"),

Modified: trunk/bootloader/src/modules/BootCommon.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootCommon.ycp?rev=49686&r1=49685&r2=49686&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootCommon.ycp (original)
+++ trunk/bootloader/src/modules/BootCommon.ycp Tue Aug 5 12:04:46 2008
@@ -1025,15 +1025,11 @@
y2milestone ("It is XEN domU and the bootloader should be installed");

}
- if (loader_type == "grub" && Storage::UseLilo())
+ if (loader_type == "grub")
{
- loader_type = "lilo";
prefer_lilo = true;
}
- else
- {
- prefer_lilo = false;
- }
+

loader_type = SupportedLoader (loader_type);
y2milestone ("Detected bootloader %1", loader_type);

Modified: trunk/bootloader/src/modules/BootGRUB.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB.ycp?rev=49686&r1=49685&r2=49686&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootGRUB.ycp (original)
+++ trunk/bootloader/src/modules/BootGRUB.ycp Tue Aug 5 12:04:46 2008
@@ -61,6 +61,7 @@
include "bootloader/grub/misc.ycp";
include "bootloader/routines/popups.ycp";
include "bootloader/grub/helps.ycp";
+include "bootloader/generic/device_map_edit_widget.ycp";
include "bootloader/generic/dialogs.ycp";


@@ -759,6 +760,7 @@

global map<string,symbol()> Dialogs () {
return $[
+ "installation" : i386InstallDetailsDialog,
"loader" : genericBootLoaderOptionsDialog,
];
}

Modified: trunk/bootloader/src/routines/helps_i386.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/helps_i386.ycp?rev=49686&r1=49685&r2=49686&view=diff
==============================================================================
--- trunk/bootloader/src/routines/helps_i386.ycp (original)
+++ trunk/bootloader/src/routines/helps_i386.ycp Tue Aug 5 12:04:46 2008
@@ -56,6 +56,20 @@
: "");
}

+string i386DeviceMapEditHelp ()
+{
+ // help text 1/5
+ return _("<p><big><b>Disks Order</b></big><br>
+To specify the order of the disks according to the order in BIOS, use
+the <b>Up</b> and <b>Down</b> buttons to reorder the disks.</p>")
+ + (Mode::config ()
+ // help text 2/5, optional (only for autoinstallation)
+ ? _("<p>To add a disk, push <b>Add</b>.
+ To remove a disk, push <b>Remove</b>.</p>")
+ : "");
+}
+
+
/**
* Get help
* @return string help text

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages