Author: juhliarik
Date: Mon Mar 9 18:47:44 2009
New Revision: 56030
URL: http://svn.opensuse.org/viewcvs/yast?rev=56030&view=rev
Log:
added help text and filter for custom boot option in GRUB
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/misc.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/misc.ycp?rev=56030&r1=56029&r2=56030&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/misc.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/misc.ycp Mon Mar 9 18:47:44 2009
@@ -788,10 +788,18 @@
*/
global define list<string> getPartitionList(symbol type) ``{
y2milestone ("getPartitionList: %1", type);
+ string bl = getLoaderType(false);
map devices = (map)Storage::GetTargetMap();
list<map> partitions = [];
foreach (string k, map v, devices, ``{
- partitions = (list<map>)merge (partitions, (list<map>)(v["partitions"]:[]));
+ if ((type == `boot) && (bl == "grub"))
+ {
+ // check if device is in device map
+ if (haskey(device_mapping, k) || (haskey(device_mapping, Dev2MountByDev(k))))
+ partitions = (list<map>)merge (partitions, (list<map>)(v["partitions"]:[]));
+ } else {
+ partitions = (list<map>)merge (partitions, (list<map>)(v["partitions"]:[]));
+ }
});
list<string> floppies = getFloppyDevices ();
@@ -800,10 +808,18 @@
if (type == `boot || type == `boot_other)
{
- devices = filter (string k, map v, devices,
- ``(v["type"]:`CT_UNKNOWN == `CT_DISK));
+ devices = filter (string k, map v, devices, {
+ if ((v["type"]:`CT_UNKNOWN == `CT_DISK) ||
+ (v["type"]:`CT_UNKNOWN == `CT_DMRAID))
+ return true;
+ });
}
- list<string> all_disks = (list<string>) maplist (string k, map v, devices, ``(k));
+ list<string> all_disks = (list<string>) maplist (string k, map v, devices,
+ {
+ return k;
+ });
+
+
if (type == `deleted)
return maplist (map x, filter (map p, partitions, ``(p["delete"]:false)),
@@ -820,6 +836,12 @@
});
}
partitions = filter (map p, partitions, ``(! p["delete"]:false));
+ // filter out disk which are not in device map
+ if ((bl == "grub") && (type == `boot))
+ all_disks = (list<string>) filter(string k, all_disks, {
+ if (haskey(device_mapping, k) || (haskey(device_mapping, Dev2MountByDev(k))))
+ return true;
+ });
list<string> ret = all_disks;
if (type == `boot_other || type == `root || type == `parts_old
|| type == `kept)
@@ -831,7 +853,8 @@
``(p["type"]:`primary == `primary
|| p["type"]:`primary == `extended
|| p["type"]:`primary == `logical
- || p["type"]:`primary == `sw_raid));
+ || p["type"]:`primary == `sw_raid)
+ );
// FIXME this checking is performed on 3 places, one function should
// be developed for it
partitions = filter (map p, partitions, {
@@ -867,7 +890,8 @@
``(p["fstype"]:"" == "Linux native"
|| p["fstype"]:"" == "Extended"
|| p["fstype"]:"" == "Linux RAID"
- || p["fstype"]:"" == "MD Raid"));
+ || p["fstype"]:"" == "MD Raid"
+ || p["fstype"]:"" == "DM RAID"));
}
list<string>partition_names
= maplist (map p, partitions, ``((string)(p["device"]:"")));
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp?rev=56030&r1=56029&r2=56030&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp Mon Mar 9 18:47:44 2009
@@ -22,6 +22,7 @@
include "bootloader/routines/helps.ycp";
include "bootloader/routines/popups.ycp";
+include "bootloader/grub/helps.ycp";
/**
* Init function of widget
@@ -359,6 +360,26 @@
BootCommon::globals["boot_custom"]= (string)UI::QueryWidget(`id("boot_custom_list"), `Value);
}
+/** FIXME: merge help text to one for BootLoaderLocationWidget
+ * Function merge help text from ../grub/helps.ycp
+ *
+ * @return string help text for widget BootLoaderLocationWidget
+ */
+string HelpBootLoaderLocationWidget()
+{
+ string ret = "";
+ ret = grub_help_messages["boot_mbr"]:"";
+ ret = ret + "\n";
+ ret = ret + grub_help_messages["boot_root"]:"";
+ ret = ret + "\n";
+ ret = ret + grub_help_messages["boot_boot"]:"";
+ ret = ret + "\n";
+ ret = ret + grub_help_messages["boot_extended"]:"";
+ ret = ret + "\n";
+ ret = ret + grub_help_messages["boot_custom"]:"";
+ return ret;
+}
+
map grubBootLoaderLocationWidget ()
{
term contents = `VBox (
@@ -382,7 +403,7 @@
"init" : InitBootLoaderLocationWidget,
"handle" : HandleBootLoaderLocationWidget,
"store" : StoreBootLoaderLocationWidget,
- "help" : "",
+ "help" : HelpBootLoaderLocationWidget(),
];
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org