Author: juhliarik
Date: Wed Oct 8 10:38:52 2008
New Revision: 51956
URL: http://svn.opensuse.org/viewcvs/yast?rev=51956&view=rev
Log:
added fix for checking if boot device is on raid0
added fix for adding section (wrong label)
Modified:
trunk/bootloader/src/clients/bootloader_proposal.ycp
trunk/bootloader/src/modules/BootCommon.ycp
trunk/bootloader/src/modules/BootELILO.ycp
trunk/bootloader/src/modules/BootGRUB.ycp
trunk/bootloader/src/modules/BootLILO.ycp
trunk/bootloader/src/modules/BootPOWERLILO.ycp
trunk/bootloader/src/modules/BootSupportCheck.ycp
trunk/bootloader/src/modules/Bootloader.ycp
trunk/bootloader/src/routines/lib_iface.ycp
Modified: trunk/bootloader/src/clients/bootloader_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/clients/bootloader_proposal.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/clients/bootloader_proposal.ycp (original)
+++ trunk/bootloader/src/clients/bootloader_proposal.ycp Wed Oct 8 10:38:52 2008
@@ -17,6 +17,7 @@
import "Bootloader";
import "Storage";
import "Mode";
+ import "BootSupportCheck";
include "bootloader/routines/wizards.ycp";
@@ -90,7 +91,7 @@
BootGRUB::merge_level = `main;
Bootloader::Propose ();
-
+
BootGRUB::merge_level = `none;
}
else
@@ -120,6 +121,8 @@
);
return ret;
}
+
+
}
//F#300779 - Install diskless client (NFS-root)
@@ -200,6 +203,18 @@
}
}
+ if (!BootSupportCheck::SystemSupported())
+ {
+ ret = (map)
+ union(ret,
+ $[
+ "warning_level" : `error,
+ "warning" : BootSupportCheck::StringProblems(),
+ "raw_proposal" : Bootloader::Summary (),
+ ]);
+
+ }
+
// cache the values
Bootloader::cached_settings = Bootloader::Export();
Bootloader::cached_settings_base_data_change_time = Storage::GetTargetChangeTime();
Modified: trunk/bootloader/src/modules/BootCommon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootCommon.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootCommon.ycp (original)
+++ trunk/bootloader/src/modules/BootCommon.ycp Wed Oct 8 10:38:52 2008
@@ -485,7 +485,7 @@
"original_name" : title,
"type" : "image",
"__auto" : true,
- "__changed" : false,
+ "__changed" : true,
];
if (title == "memtest86") {
Modified: trunk/bootloader/src/modules/BootELILO.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootELILO.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootELILO.ycp (original)
+++ trunk/bootloader/src/modules/BootELILO.ycp Wed Oct 8 10:38:52 2008
@@ -38,6 +38,7 @@
import "Stage";
import "Storage";
import "String";
+import "Arch";
include "bootloader/elilo/helps.ycp";
include "bootloader/routines/popups.ycp";
@@ -173,6 +174,10 @@
"read-only" : "true",
"relocatable" : "true"
];
+ // added fix because option relocatable is only for ia32/64
+ if ((Arch::ia64()) && (haskey(BootCommon::globals, "relocatable")))
+ BootCommon::globals = remove(BootCommon::globals, "relocatable");
+
}
Modified: trunk/bootloader/src/modules/BootGRUB.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootGRUB.ycp (original)
+++ trunk/bootloader/src/modules/BootGRUB.ycp Wed Oct 8 10:38:52 2008
@@ -338,7 +338,7 @@
// set up the new section entry
map new_sect = $[
"root" : BootCommon::Dev2MountByDev(dev),
- "__changed" : false,
+ "__changed" : true,
"__auto" : true,
"__devs" : [dev]
];
@@ -422,7 +422,7 @@
"type" : "other",
"original_name" : label,
"chainloader" : BootCommon::Dev2MountByDev(dev),
- "__changed" : false,
+ "__changed" : true,
"__auto" : true,
"__devs" : [dev],
];
@@ -440,7 +440,7 @@
"original_name" : "hard_disk",
"type" : "other",
"chainloader" : BootCommon::Dev2MountByDev(BootCommon::mbrDisk),
- "__changed" : false,
+ "__changed" : true,
"__auto" : true,
"__devs" : [],
]);
@@ -452,7 +452,7 @@
"original_name" : "floppy",
"type" : "other",
"chainloader" : "/dev/fd0",
- "__changed" : false,
+ "__changed" : true,
"__auto" : true,
"__devs" : [],
]);
Modified: trunk/bootloader/src/modules/BootLILO.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootLILO.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootLILO.ycp (original)
+++ trunk/bootloader/src/modules/BootLILO.ycp Wed Oct 8 10:38:52 2008
@@ -92,7 +92,7 @@
"type" : "chainloader",
"chainloader" : dev,
"__auto" : true,
- "__changed" : false,
+ "__changed" : true,
"__devs" : [dev],
];
out = add (out, m);
Modified: trunk/bootloader/src/modules/BootPOWERLILO.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootPOWERLILO.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootPOWERLILO.ycp (original)
+++ trunk/bootloader/src/modules/BootPOWERLILO.ycp Wed Oct 8 10:38:52 2008
@@ -468,7 +468,7 @@
// "": do not include resume parameter on ppc
"append" : BootArch::DefaultKernelParams (""),
"__auto" : true,
- "__changed" : false,
+ "__changed" : true,
"__devs" : [BootCommon::BootPartitionDevice, BootCommon::RootPartitionDevice],
];
return ret;
Modified: trunk/bootloader/src/modules/BootSupportCheck.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootSupportCheck.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootSupportCheck.ycp (original)
+++ trunk/bootloader/src/modules/BootSupportCheck.ycp Wed Oct 8 10:38:52 2008
@@ -46,6 +46,27 @@
return detected_problems;
}
+
+/**
+ * Formated string of detected problems
+ * Always run SystemSupported before calling this function
+ * @return boolean a list of problems, empty if no was found
+ */
+global string StringProblems () {
+
+ string ret = "";
+ if (size(detected_problems) > 0)
+ {
+ foreach(string s, detected_problems,
+ {
+ ret = ret + s + "\n";
+ });
+ }
+
+ return ret;
+}
+
+
/**
* Check that bootloader is known and supported
*/
@@ -115,6 +136,61 @@
return true;
}
+
+/**
+ * Check if boot partition exist
+ * check if not on raid0
+ *
+ * @return boolean true on success
+ */
+
+
+boolean check_BootDevice()
+{
+ boolean result = true;
+ string boot_device = "";
+
+ map devices = (map)Storage::GetTargetMap();
+
+
+ boot_device = BootCommon::getBootPartition();
+
+ // if (BootCommon::BootPartitionDevice == BootCommon::RootPartitionDevice)
+ // AddNewProblem (_("Doesn't exist separete /boot partition"));
+
+ boolean found_boot = false;
+ // check if boot device is on raid0
+ if (boot_device != "")
+ {
+ foreach (string k, map v, devices,
+ {
+ foreach (map p, (list<map>)(v["partitions"]:[]),
+ {
+ if (p["device"]:"" == boot_device)
+ {
+ if (p["raid_type"]:"" == "raid0")
+ {
+ AddNewProblem (_("The boot device is on raid0."));
+ y2error("The boot device: %1 is on raid0", boot_device);
+ result = false;
+ break;
+ } else {
+ found_boot = true;
+ y2milestone("The boot device: %1 is not on raid0", boot_device);
+ break;
+ }
+ }
+ });
+ if ((!result) || (found_boot))
+ break;
+ });
+ }
+ return result;
+}
+
+
+
+
/**
* Check that the root partition is reachable
*/
@@ -125,8 +201,10 @@
/**
* GRUB-related check
*/
-boolean GRUB () {
+global boolean GRUB () {
boolean ret = GptPartitionTable ();
+ if (ret)
+ ret = check_BootDevice();
return ret;
}
Modified: trunk/bootloader/src/modules/Bootloader.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/Bootloader.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/modules/Bootloader.ycp (original)
+++ trunk/bootloader/src/modules/Bootloader.ycp Wed Oct 8 10:38:52 2008
@@ -1156,6 +1156,8 @@
if (value != "false")
{
BootCommon::sections[sectnum, key] = value;
+ // added flag that section was modified bnc #432651
+ BootCommon::sections[sectnum, "__changed"] = true;
}
else
{
@@ -1168,6 +1170,8 @@
string line = BootCommon::sections [sectnum, "append"]:"";
line = BootCommon::setKernelParamToLine (line, key, value);
BootCommon::sections [sectnum, "append"] = line;
+ // added flag that section was modified bnc #432651
+ BootCommon::sections[sectnum, "__changed"] = true;
}
BootCommon::changed = true;
boolean ret = true;
Modified: trunk/bootloader/src/routines/lib_iface.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/lib_iface.ycp?rev=51956&r1=51955&r2=51956&view=diff
==============================================================================
--- trunk/bootloader/src/routines/lib_iface.ycp (original)
+++ trunk/bootloader/src/routines/lib_iface.ycp Wed Oct 8 10:38:52 2008
@@ -157,7 +157,7 @@
sections = maplist (map s, sections, {
if (Mode::normal())
{
- if (s["__changed"]:false)
+ if ((s["__changed"]:false) || (s["__auto"]:false))
s["__modified"] = "1";
} else {
s["__modified"] = "1";
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org