Hello community,
here is the log from the commit of package yast2-bootloader for openSUSE:Factory
checked in at Tue Aug 4 22:31:10 CEST 2009.
--------
--- yast2-bootloader/yast2-bootloader.changes 2009-07-31 11:58:54.000000000 +0200
+++ yast2-bootloader/yast2-bootloader.changes 2009-08-04 18:46:13.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Aug 4 16:52:57 CEST 2009 - juhliarik@suse.cz
+
+- added support for redundancy md array (fate#305008)
+- 2.18.13
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-bootloader-2.18.12.tar.bz2
New:
----
yast2-bootloader-2.18.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.CiCS45/_old 2009-08-04 22:30:51.000000000 +0200
+++ /var/tmp/diff_new_pack.CiCS45/_new 2009-08-04 22:30:51.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-bootloader (Version 2.18.12)
+# spec file for package yast2-bootloader (Version 2.18.13)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,10 +19,10 @@
Name: yast2-bootloader
-Version: 2.18.12
+Version: 2.18.13
Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-bootloader-2.18.12.tar.bz2
+Source0: yast2-bootloader-2.18.13.tar.bz2
Prefix: /usr
Group: System/YaST
License: GPL v2 or later
@@ -34,7 +34,7 @@
Requires: yast2 >= 2.18.14
Requires: yast2-packager >= 2.17.24
Requires: yast2-pkg-bindings >= 2.17.25
-Requires: perl-Bootloader >= 0.5.0
+Requires: perl-Bootloader >= 0.5.4
Requires: yast2-core >= 2.18.7
Requires: yast2-storage >= 2.18.18 parted perl-Compress-Zlib limal-perl
BuildRequires: yast2 >= 2.18.14
@@ -61,7 +61,7 @@
This package contains the YaST2 component for bootloader configuration.
%prep
-%setup -n yast2-bootloader-2.18.12
+%setup -n yast2-bootloader-2.18.13
%build
%{prefix}/bin/y2tool y2autoconf
@@ -107,5 +107,4 @@
/usr/share/YaST2/scrconf/*.scr
/var/adm/fillup-templates/*
/usr/share/YaST2/schema/autoyast/rnc/bootloader.rnc
-
%changelog
++++++ yast2-bootloader-2.18.12.tar.bz2 -> yast2-bootloader-2.18.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/VERSION new/yast2-bootloader-2.18.13/VERSION
--- old/yast2-bootloader-2.18.12/VERSION 2009-07-31 11:56:01.000000000 +0200
+++ new/yast2-bootloader-2.18.13/VERSION 2009-08-04 17:59:52.000000000 +0200
@@ -1 +1 @@
-2.18.12
+2.18.13
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/configure new/yast2-bootloader-2.18.13/configure
--- old/yast2-bootloader-2.18.12/configure 2009-07-31 11:58:24.000000000 +0200
+++ new/yast2-bootloader-2.18.13/configure 2009-07-08 16:56:57.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for yast2-bootloader 2.18.12.
+# Generated by GNU Autoconf 2.63 for yast2-bootloader 2.18.8.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -745,8 +745,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-bootloader'
PACKAGE_TARNAME='yast2-bootloader'
-PACKAGE_VERSION='2.18.12'
-PACKAGE_STRING='yast2-bootloader 2.18.12'
+PACKAGE_VERSION='2.18.8'
+PACKAGE_STRING='yast2-bootloader 2.18.8'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1537,7 +1537,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-bootloader 2.18.12 to adapt to many kinds of systems.
+\`configure' configures yast2-bootloader 2.18.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1609,7 +1609,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-bootloader 2.18.12:";;
+ short | recursive ) echo "Configuration of yast2-bootloader 2.18.8:";;
esac
cat <<\_ACEOF
@@ -1719,7 +1719,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-bootloader configure 2.18.12
+yast2-bootloader configure 2.18.8
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1733,7 +1733,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-bootloader $as_me 2.18.12, which was
+It was created by yast2-bootloader $as_me 2.18.8, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2580,7 +2580,7 @@
# Define the identity of the package.
PACKAGE='yast2-bootloader'
- VERSION='2.18.12'
+ VERSION='2.18.8'
cat >>confdefs.h <<_ACEOF
@@ -2804,7 +2804,7 @@
-VERSION="2.18.12"
+VERSION="2.18.8"
RPMNAME="yast2-bootloader"
MAINTAINER="Jozef Uhliarik "
@@ -17247,7 +17247,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-bootloader $as_me 2.18.12, which was
+This file was extended by yast2-bootloader $as_me 2.18.8, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17310,7 +17310,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-yast2-bootloader config.status 2.18.12
+yast2-bootloader config.status 2.18.8
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/configure.in new/yast2-bootloader-2.18.13/configure.in
--- old/yast2-bootloader-2.18.12/configure.in 2009-07-31 11:58:15.000000000 +0200
+++ new/yast2-bootloader-2.18.13/configure.in 2009-07-08 16:56:37.000000000 +0200
@@ -1,9 +1,9 @@
dnl configure.in for yast2-bootloader
dnl
-dnl -- This file is generated by y2autoconf 2.18.9 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.18.5 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-bootloader, 2.18.12, http://bugs.opensuse.org/, yast2-bootloader)
+AC_INIT(yast2-bootloader, 2.18.8, http://bugs.opensuse.org/, yast2-bootloader)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.18.12"
+VERSION="2.18.8"
RPMNAME="yast2-bootloader"
MAINTAINER="Jozef Uhliarik "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/src/grub/helps.ycp new/yast2-bootloader-2.18.13/src/grub/helps.ycp
--- old/yast2-bootloader-2.18.12/src/grub/helps.ycp 2009-07-27 17:59:49.000000000 +0200
+++ new/yast2-bootloader-2.18.13/src/grub/helps.ycp 2009-08-04 18:01:52.000000000 +0200
@@ -11,7 +11,7 @@
* Authors:
* Joachim Plack
*
- * $Id: helps.ycp 58175 2009-07-27 14:52:21Z juhliarik $
+ * $Id: helps.ycp 58279 2009-08-04 16:01:51Z juhliarik $
*
*/
@@ -62,6 +62,11 @@
"boot_custom" :
_("<p><b>Custom Boot Partition</b> lets you choose a partition to boot from.</p>"),
+
+ "enable_redundancy" :
+ _("<p>MD array is build from 2 disks. <b>Enable Redundancy for MD Array</b>
+enable to write GRUB to MBR of both disks.</p>"),
+
"serial" :
_("<p><b>Use Serial Console</b> lets you define the parameters to use
for a serial console. Please see the grub documentation (<code>info grub</code>) for details.</p>"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/src/grub/misc.ycp new/yast2-bootloader-2.18.13/src/grub/misc.ycp
--- old/yast2-bootloader-2.18.12/src/grub/misc.ycp 2009-07-22 15:41:42.000000000 +0200
+++ new/yast2-bootloader-2.18.13/src/grub/misc.ycp 2009-08-04 18:01:52.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain
* Olaf Dabrunz
*
- * $Id: misc.ycp 58126 2009-07-22 11:39:44Z juhliarik $
+ * $Id: misc.ycp 58279 2009-08-04 16:01:51Z juhliarik $
*
*/
@@ -891,6 +891,7 @@
y2milestone("globals: %1", BootCommon::globals);
y2milestone("Mode::autoinst: %1", Mode::autoinst());
y2milestone("haskey( BootCommon::globals, boot_boot ): %1", haskey( BootCommon::globals, "boot_boot" ));
+ string md_mbr = "";
if (! BootCommon::was_proposed ||
// During autoinstall, the autoyast profile must contain a bootloader
// device specification (we currently really only support system
@@ -926,6 +927,9 @@
map out = (map)SCR::Execute (.target.bash_output, command);
y2milestone ("Command output: %1", out);
}
+ md_mbr = BootStorage::addMDSettingsToGlobals();
+ if (md_mbr != "")
+ BootCommon::globals["boot_md_mbr"] = md_mbr;
}
y2milestone("(2) globals: %1", BootCommon::globals);
@@ -935,6 +939,9 @@
|| (BootCommon::cached_settings_base_data_change_time != Storage::GetTargetChangeTime()))
{
BootStorage::ProposeDeviceMap();
+ md_mbr = BootStorage::addMDSettingsToGlobals();
+ if (md_mbr != "")
+ BootCommon::globals["boot_md_mbr"] = md_mbr;
BootCommon::InitializeLibrary (true, "grub");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/src/grub/options.ycp new/yast2-bootloader-2.18.13/src/grub/options.ycp
--- old/yast2-bootloader-2.18.12/src/grub/options.ycp 2009-07-28 11:51:17.000000000 +0200
+++ new/yast2-bootloader-2.18.13/src/grub/options.ycp 2009-08-04 13:21:58.000000000 +0200
@@ -468,21 +468,43 @@
];
}
-
/**
* Init function of a widget
* @param widget string widget key
*/
void InitBootLoaderLocationWidget(string widget) {
list<string> boot_devices = BootStorage::getPartitionList(`boot, "grub");
- list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
- foreach(string key, list_global_target_keys,
+ string value = "";
+ if (BootCommon::VerifyMDArray ())
{
- string value = BootCommon::globals[key]:nil;
- if (value != nil)
- UI::ChangeWidget (`id (key), `Value, (value == "true")? true: false);
- });
- UI::ChangeWidget (`id ("boot_custom_list"),`Items, boot_devices);
+ if ((BootCommon::enable_md_array_redundancy == nil) || (BootCommon::enable_md_array_redundancy))
+ UI::ChangeWidget (`id ("enable_redundancy"), `Value, true);
+ else
+ UI::ChangeWidget (`id ("enable_redundancy"), `Value, false);
+
+ value = BootCommon::globals["boot_mbr"]:nil;
+ UI::ChangeWidget (`id ("boot_mbr"), `Value, (value == "true")? true: false);
+ } else {
+ list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
+ foreach(string key, list_global_target_keys,
+ {
+ value = BootCommon::globals[key]:nil;
+ if (value != nil)
+ UI::ChangeWidget (`id (key), `Value, (value == "true")? true: false);
+ });
+ UI::ChangeWidget (`id ("boot_custom_list"),`Items, boot_devices);
+
+ if (BootStorage::BootPartitionDevice == BootStorage::RootPartitionDevice)
+ UI::ChangeWidget (`id ("boot_boot"), `Enabled, false);
+ else
+ UI::ChangeWidget (`id ("boot_boot"), `Enabled, true);
+
+ if (BootStorage::ExtendedPartitionDevice != nil)
+ UI::ChangeWidget (`id ("boot_extended"), `Enabled, true);
+ else
+ UI::ChangeWidget (`id ("boot_extended"), `Enabled, false);
+ }
+
if ((!haskey(BootCommon::globals,"boot_custom")) &&
(BootCommon::globals["boot_custom"]:"" == ""))
{
@@ -492,17 +514,6 @@
UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, true);
UI::ChangeWidget (`id ("boot_custom_list"),`Value, BootCommon::globals["boot_custom"]:"");
}
-
- if (BootStorage::BootPartitionDevice == BootStorage::RootPartitionDevice)
- UI::ChangeWidget (`id ("boot_boot"), `Enabled, false);
- else
- UI::ChangeWidget (`id ("boot_boot"), `Enabled, true);
-
- if (BootStorage::ExtendedPartitionDevice != nil)
- UI::ChangeWidget (`id ("boot_extended"), `Enabled, true);
- else
- UI::ChangeWidget (`id ("boot_extended"), `Enabled, false);
-
}
/**
* handle function of a widget
@@ -530,12 +541,18 @@
*/
void StoreBootLoaderLocationWidget (string widget, map event) {
- list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
- foreach(string key, list_global_target_keys,
+ if (BootCommon::VerifyMDArray ())
{
- string value = ((boolean)UI::QueryWidget(`id(key), `Value))?"true":"false";
- BootCommon::globals[key]= value;
- });
+ BootCommon::enable_md_array_redundancy = (boolean)UI::QueryWidget(`id("enable_redundancy"), `Value);
+ BootCommon::globals["boot_mbr"]= ((boolean)UI::QueryWidget(`id("boot_mbr"), `Value))?"true":"false";
+ } else {
+ list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
+ foreach(string key, list_global_target_keys,
+ {
+ string value = ((boolean)UI::QueryWidget(`id(key), `Value))?"true":"false";
+ BootCommon::globals[key]= value;
+ });
+ }
if ((boolean)UI::QueryWidget(`id("boot_custom"), `Value))
BootCommon::globals["boot_custom"]= (string)UI::QueryWidget(`id("boot_custom_list"), `Value);
}
@@ -550,13 +567,18 @@
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"]:"";
+ ret = ret + "\n";
+ if (BootCommon::VerifyMDArray ())
+ {
+ ret = ret + grub_help_messages["enable_redundancy"]:"";
+ } else {
+ 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"]:"";
+ }
return ret;
}
@@ -583,6 +605,21 @@
`VStretch()
);
+ if (BootCommon::VerifyMDArray ())
+ {
+ contents = `VBox (
+ `Frame (_("Boot Loader Location"),
+ `VBox (`HBox(`HSpacing(1),`VBox(
+ `Left(`CheckBox( `id("boot_mbr"), _("Boot from &Master Boot Record"))),
+ `Left(`CheckBox( `id("enable_redundancy"), _("Enable Red&undancy for MD Array"))),
+ `Left(`CheckBox( `id("boot_custom"), `opt(`notify), _("C&ustom Boot Partition"))),
+ `Left(`ComboBox( `id("boot_custom_list"), `opt (`editable, `hstretch),"", [])),
+ `VStretch()
+ )))
+ ),
+ `VStretch()
+ );
+ }
return $[
"widget" : `custom,
"custom_widget" : contents,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/src/modules/BootCommon.ycp new/yast2-bootloader-2.18.13/src/modules/BootCommon.ycp
--- old/yast2-bootloader-2.18.12/src/modules/BootCommon.ycp 2009-07-27 10:28:46.000000000 +0200
+++ new/yast2-bootloader-2.18.13/src/modules/BootCommon.ycp 2009-08-04 18:01:52.000000000 +0200
@@ -15,7 +15,7 @@
* Joachim Plack
* Olaf Dabrunz
*
- * $Id: BootCommon.ycp 58153 2009-07-24 15:05:51Z juhliarik $
+ * $Id: BootCommon.ycp 58279 2009-08-04 16:01:51Z juhliarik $
*
*/
@@ -297,6 +297,11 @@
global list<string> bootloaders = ["lilo", "grub", "elilo",
"zipl", "ppc"];
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * if true enable redundancy for md array
+ */
+global boolean enable_md_array_redundancy = nil;
+
global define string getLoaderType (boolean recheck);
global define list<string> getBootloaders ();
@@ -305,7 +310,7 @@
global string UpdateSerialConsole (string append, string console);
global string examineMBR (string device);
global boolean ThinkPadMBR (string disk);
-
+global boolean VerifyMDArray ();
/*
* help message and dscription definitions
*/
@@ -829,7 +834,17 @@
// convert XEN section to linux section id running in domU
// bnc #436899
ConvertXENinDomU ();
+ if (VerifyMDArray())
+ {
+ if ((enable_md_array_redundancy == false) && (haskey(my_globals, "boot_md_mbr")))
+ my_globals = remove(my_globals, "boot_md_mbr");
+ if ((enable_md_array_redundancy) && (!haskey(my_globals, "boot_md_mbr")))
+ my_globals["boot_md_mbr"] = BootStorage::addMDSettingsToGlobals();
+ } else {
+ if (haskey(globals, "boot_md_mbr"))
+ my_globals = remove(my_globals, "boot_md_mbr");
+ }
// add check if there is memtest and delete from memtest section
// keys like append, initrd etc...
checkMemtest ();
@@ -1165,6 +1180,29 @@
return sectnum;
}
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * Verify if proposal includes md array with 2 diferent disks
+ *
+ * @return boolean true if there is md array based on 2 disks
+ */
+global boolean VerifyMDArray ()
+{
+ boolean ret = false;
+ if (haskey(globals, "boot_md_mbr"))
+ {
+ string md_array = globals["boot_md_mbr"]:"";
+ list<string> disks = splitstring(md_array,",");
+ disks = filter(string v, disks, {return (v !="");});
+ if (size(disks) == 2)
+ {
+ y2milestone("boot_md_mbr includes 2 disks: %1", disks);
+ ret = true;
+ }
+
+ }
+ return ret;
+}
+
}
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/src/modules/BootGRUB.ycp new/yast2-bootloader-2.18.13/src/modules/BootGRUB.ycp
--- old/yast2-bootloader-2.18.12/src/modules/BootGRUB.ycp 2009-07-27 17:59:49.000000000 +0200
+++ new/yast2-bootloader-2.18.13/src/modules/BootGRUB.ycp 2009-08-04 18:01:52.000000000 +0200
@@ -15,7 +15,7 @@
* Olaf Dabrunz
* Philipp Thomas
*
- * $Id: BootGRUB.ycp 58175 2009-07-27 14:52:21Z juhliarik $
+ * $Id: BootGRUB.ycp 58279 2009-08-04 16:01:51Z juhliarik $
*
*/
@@ -507,7 +507,31 @@
// FATE#305403: Bootloader beep configuration
// read status of acoustic signals
if (Mode::normal())
- GfxMenu::ReadStatusAcousticSignal();
+ {
+ GfxMenu::ReadStatusAcousticSignal();
+ string md_value = BootStorage::addMDSettingsToGlobals();
+ string pB_md_value = BootCommon::globals["boot_md_mbr"]:"";
+ if (md_value != pB_md_value)
+ {
+ if (pB_md_value != "")
+ {
+ list <string> disks = splitstring(pB_md_value,",");
+ disks = filter(string v, disks, {return (v != "");});
+ if (size(disks) == 2)
+ {
+ BootCommon::enable_md_array_redundancy = true;
+ md_value = "";
+ }
+ y2milestone("disks from md array (perl Bootloader): %1", disks);
+ }
+ if (md_value != "")
+ {
+ BootCommon::enable_md_array_redundancy = false;
+ BootCommon::globals["boot_md_mbr"] = md_value;
+ y2milestone("Add md array to globals: %1", BootCommon::globals);
+ }
+ }
+ }
return ret;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-2.18.12/src/modules/BootStorage.ycp new/yast2-bootloader-2.18.13/src/modules/BootStorage.ycp
--- old/yast2-bootloader-2.18.12/src/modules/BootStorage.ycp 2009-07-21 16:36:57.000000000 +0200
+++ new/yast2-bootloader-2.18.13/src/modules/BootStorage.ycp 2009-08-04 12:10:52.000000000 +0200
@@ -135,6 +135,14 @@
*/
global list<string> floppy_devices = nil;
+
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * list <string> includes physical disks used for md raid
+ */
+
+global list <string> md_physical_disks = [];
+
+
/** FATE #302219 - Use and choose persistent device names for disk devices
* Function prepare maps with mapping disks and partitions by uuid, id, path
* and label.
@@ -1047,7 +1055,7 @@
``(p["fstype"]:"" == "Linux native"
|| p["fstype"]:"" == "Extended"
|| p["fstype"]:"" == "Linux RAID"
- || p["fstype"]:"" == "MD Raid"
+ || tolower(p["fstype"]:"") == "md raid"
|| p["fstype"]:"" == "DM RAID"));
}
list<string>partition_names
@@ -1059,7 +1067,153 @@
return (list<string>)ret;
}
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * Check if devices has same partition number and if they are from different disks
+ *
+ * @param list <string> list of devices
+ * @return boolean true on success
+ */
+boolean checkDifferentDisks (list <string> devices)
+{
+ boolean ret = false;
+ list <string> disks = [];
+ string no_partition = "";
+ foreach(string dev, devices,
+ {
+ map p_dev = Storage::GetDiskPartition (dev);
+ if (!contains(disks, p_dev["disk"]:""))
+ disks=add(disks,p_dev["disk"]:"");
+ else
+ {
+ y2milestone("Same disk for md array -> disable synchronize md arrays");
+ break;
+ }
+ // add disk from partition to md_physical_disks
+ if (!contains(md_physical_disks, p_dev["disk"]:""))
+ md_physical_disks = add(md_physical_disks,p_dev["disk"]:"");
+
+ string no_p = p_dev["nr"]:"";
+ if (no_p == "")
+ {
+ y2error("Wrong number of partition: %1 from Storage::GetDiskPartition: %2", dev, p_dev);
+ break;
+ }
+ if (no_partition == "")
+ no_partition = no_p;
+ else
+ if (no_partition == no_p)
+ ret = true;
+ else
+ y2milestone("Different number of partitions -> disable synchronize md arrays");
+
+ });
+
+ y2milestone("checkDifferentDisks for devices: %1 return: %2",devices, ret);
+
+ return ret;
+}
+
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * Check if device are build from 2 partitions with same number but from different disks
+ *
+ * @param map tm taregte map from storage
+ * @param string device (md device)
+ * @return true if device is from 2 partisions with same number and different disks
+ */
+boolean checkMDDevices(map tm, string device)
+{
+ boolean ret = false;
+ map tm_dm = (map) tm["/dev/md"]:$[];
+
+ md_physical_disks = [];
+ // find partitions in target map
+ foreach(map p, tm_dm["partitions"]:[],
+ {
+ if (p["device"]:"" == device)
+ {
+ if (p["raid_type"]:"" == "raid1")
+ {
+ list <string> p_devices = p["devices"]:[];
+ if (size(p_devices) == 2)
+ ret = checkDifferentDisks(p_devices);
+ else
+ y2milestone("Device: %1 doesn't contain 2 partitions: %2", device, p_devices);
+ } else {
+ y2milestone ("Device: %1 is not on raid1: %2",device, p["raid_type"]:"");
+ }
+ }
+ });
+
+ if ((size(md_physical_disks) != 2) || (contains(md_physical_disks, "")))
+ y2milestone("device: %1 is based on md_physical_disks: %2 is not valid for enable redundancy",
+ device, md_physical_disks);
+
+ if (ret)
+ y2milestone("device: %1 is based on md_physical_disks: %2 is valid for enable redundancy",
+ device, md_physical_disks);
+
+ return ret;
+}
+
+
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * Function check partitions and set redundancy available if
+ * partitioning of disk allows it.
+ * It means if md array is based on 2 partitions with same number but 2 different disks
+ * E.g. /dev/md0 is from /dev/sda1 and /dev/sb1 and /dev/md0 is "/"
+ * There is possible only boot from MBR (GRUB not generic boot code)
+ *
+ * @return boolean true on success
+ */
+
+global boolean checkMDSettings ()
+{
+ boolean ret = false;
+ map tm = (map)Storage::GetTargetMap();
+
+ if (!haskey(tm, "/dev/md"))
+ {
+ y2milestone("Doesn't include md raid");
+ return ret;
+ }
+ list<string> boot_devices = [];
+ if ((BootPartitionDevice != "") && (BootPartitionDevice != nil))
+ boot_devices = add(boot_devices, BootPartitionDevice);
+ if ((BootPartitionDevice != RootPartitionDevice) && (RootPartitionDevice != "")
+ && (BootPartitionDevice != nil))
+ boot_devices = add(boot_devices, RootPartitionDevice);
+ if ((ExtendedPartitionDevice != "")&& (ExtendedPartitionDevice != nil))
+ boot_devices = add(boot_devices, ExtendedPartitionDevice);
+
+ y2milestone("Devices for analyse of redundacy md array: %1", boot_devices);
+ foreach(string dev, boot_devices,
+ {
+ ret = checkMDDevices(tm, dev);
+ if (!ret)
+ {
+ y2milestone("Skip enable redundancy of md arrays");
+ break;
+ }
+ });
+
+ return ret;
+}
+
+/** FATE#305008: Failover boot configurations for md arrays with redundancy
+ * Function prapare disks for synchronizing of md array
+ *
+ * @return string includes disks separatet by ","
+ */
+
+global string addMDSettingsToGlobals()
+{
+ string ret = "";
+
+ if (checkMDSettings())
+ ret = mergestring(md_physical_disks,",");
+ return ret;
+}
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org