Mailinglist Archive: opensuse-commit (1192 mails)

< Previous Next >
commit yast2-bootloader
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Mon, 04 Aug 2008 14:22:17 +0200
  • Message-id: <20080804122217.77BAC678178@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package yast2-bootloader
checked in at Mon Aug 4 14:22:17 CEST 2008.


--------
--- yast2-bootloader/yast2-bootloader.changes 2008-07-23 15:26:46.000000000
+0200
+++ /mounts/work_src_done/STABLE/yast2-bootloader/yast2-bootloader.changes
2008-08-04 14:04:20.000000000 +0200
@@ -1,0 +2,26 @@
+Mon Aug 4 13:29:01 CEST 2008 - juhliarik@xxxxxxx
+
+- added support for reducing devices from device.map to 8 devices
+ (fate #303548)
+- 2.17.8
+
+-------------------------------------------------------------------
+Thu Jul 31 10:27:42 CEST 2008 - juhliarik@xxxxxxx
+
+- added support for remaping windows chainloader boot section
+ (fate #301994)
+- 2.17.7
+
+-------------------------------------------------------------------
+Tue Jul 29 18:18:38 CEST 2008 - juhliarik@xxxxxxx
+
+- update solution for saving kernel args to
+ /etc/sysconfig/bootloader (fate #302245)
+- 2.17.6
+
+------------------------------------------------------------------
+Sun Jul 27 17:52:58 CEST 2008 - juhliarik@xxxxxxx
+
+- added powersaved=off to boot section for failsave (bnc #153345)
+
+-------------------------------------------------------------------



Old:
----
yast2-bootloader-2.17.5.tar.bz2

New:
----
yast2-bootloader-2.17.8.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.r27983/_old 2008-08-04 14:21:55.000000000 +0200
+++ /var/tmp/diff_new_pack.r27983/_new 2008-08-04 14:21:55.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-bootloader (Version 2.17.5)
+# spec file for package yast2-bootloader (Version 2.17.8)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,12 +12,12 @@


Name: yast2-bootloader
-Version: 2.17.5
+Version: 2.17.8
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-bootloader-2.17.5.tar.bz2
+Source0: yast2-bootloader-2.17.8.tar.bz2
Prefix: /usr
BuildRequires: docbook-xsl-stylesheets doxygen gcc-c++ libxslt limal-perl
perl-Bootloader perl-XML-Writer perl-gettext sgml-skel swig update-alternatives
update-desktop-files yast2-devtools yast2-installation yast2-perl-bindings
yast2-storage yast2-testsuite
# to eliminate a cyclic dependency in autobuild:
@@ -54,7 +54,7 @@
Daniel Fiser

%prep
-%setup -n yast2-bootloader-2.17.5
+%setup -n yast2-bootloader-2.17.8

%build
%{prefix}/bin/y2tool y2autoconf
@@ -99,6 +99,20 @@
/var/adm/fillup-templates/*
/usr/share/YaST2/schema/autoyast/rnc/bootloader.rnc
%changelog
+* Mon Aug 04 2008 juhliarik@xxxxxxx
+- added support for reducing devices from device.map to 8 devices
+ (fate #303548)
+- 2.17.8
+* Thu Jul 31 2008 juhliarik@xxxxxxx
+- added support for remaping windows chainloader boot section
+ (fate #301994)
+- 2.17.7
+* Tue Jul 29 2008 juhliarik@xxxxxxx
+- update solution for saving kernel args to
+ /etc/sysconfig/bootloader (fate #302245)
+- 2.17.6
+* Sun Jul 27 2008 juhliarik@xxxxxxx
+- added powersaved=off to boot section for failsave (bnc #153345)
* Wed Jul 23 2008 juhliarik@xxxxxxx
- added support for persistent device names (fate #302219)
- 2.17.5

++++++ yast2-bootloader-2.17.5.tar.bz2 -> yast2-bootloader-2.17.8.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore
old/yast2-bootloader-2.17.5/src/clients/bootloader_proposal.ycp
new/yast2-bootloader-2.17.8/src/clients/bootloader_proposal.ycp
--- old/yast2-bootloader-2.17.5/src/clients/bootloader_proposal.ycp
2008-07-21 16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/clients/bootloader_proposal.ycp
2008-08-01 17:20:31.000000000 +0200
@@ -1,7 +1,7 @@
/**
* Module: bootloader_proposal.ycp
*
- * $Id: bootloader_proposal.ycp 46947 2008-04-22 11:09:42Z juhliarik $
+ * $Id: bootloader_proposal.ycp 49588 2008-08-01 15:20:30Z juhliarik $
*
* Author: Klaus Kaempf <kkaempf@xxxxxxx>
*
@@ -89,6 +89,8 @@
// into our configuration
BootGRUB::merge_level = `main;
Bootloader::Propose ();
+
+
BootGRUB::merge_level = `none;
}
else
@@ -100,6 +102,26 @@

ret = $[ "raw_proposal" : Bootloader::Summary ()];

+
+ if (Bootloader::getLoaderType () == "grub")
+ {
+ import "BootGRUB";
+ if (BootGRUB::CheckDeviceMap())
+ {
+ ret = (map<string,any>) union (ret,
+ $[
+ "warning_level" : `blocker,
+ "warning" :
+ ret["warning"]:"" +
+ _("Configure a valid boot loader location before
continuing.<br>
+The device map includes more than 8 devices and the boot device is out of
range.
+The range is the first 8 devices by BIOS."),
+ ]
+ );
+ return ret;
+ }
+ }
+
//F#300779 - Install diskless client (NFS-root)
//kokso: bootloader will not be installed

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore
old/yast2-bootloader-2.17.5/src/clients/inst_bootloader.ycp
new/yast2-bootloader-2.17.8/src/clients/inst_bootloader.ycp
--- old/yast2-bootloader-2.17.5/src/clients/inst_bootloader.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/clients/inst_bootloader.ycp 2008-07-30
14:00:40.000000000 +0200
@@ -52,76 +52,8 @@
});
}

-string lt = Bootloader::getLoaderType ();
-
-y2milestone ("Saving /etc/sysconfig/bootloader for %1", lt);
-
-// save some sysconfig variables
-// register new agent pointing into the mounted filesystem
-WFM::Execute(.local.mkdir, Installation::destdir + "/etc/sysconfig");
-WFM::Write(.local.bash, sformat ("touch %1/etc/sysconfig/bootloader",
Installation::destdir));
-string target_sysconfig_path = Installation::destdir +
"/etc/sysconfig/bootloader";
-SCR::RegisterAgent (.target.sysconfig.bootloader, `ag_ini(
- `SysConfigFile(target_sysconfig_path)));
-
-if (Mode::installation())
- SCR::Write (.target.sysconfig.bootloader.LOADER_TYPE, lt);
-
-// get the default and failsafe append + vga parameters; if section with
-// appropriate original name not found, just use any Linux section
-// doing so during update may be questionable, however, the variables need to
-// be initialized in any case
-string default_vga = "";
-string default_append = "";
-boolean default_set = false;
-string failsafe_vga = "";
-string failsafe_append = "";
-boolean failsafe_set = false;
-string xen_vga = "";
-string xen_append = "";
-boolean xen_set = false;
-foreach (map<string,any>s, BootCommon::sections, {
- if (s["original_name"]:"" == "linux")
- {
- default_set = true;
- default_vga = s["vgamode"]:"";
- default_append = s["append"]:"";
- }
- if (s["original_name"]:"" == "xen")
- {
- xen_set = true;
- xen_vga = s["vgamode"]:"";
- xen_append = s["append"]:"";
- }
- else if (s["original_name"]:"" == "failsafe")
- {
- failsafe_set = true;
- failsafe_vga = s["vgamode"]:"";
- failsafe_append = s["append"]:"";
- }
- if (s["type"]:"" == "image" && ! default_set)
- {
- default_vga = s["vgamode"]:"";
- default_append = s["append"]:"";
- }
- if (s["type"]:"" == "image" && ! failsafe_set)
- {
- failsafe_vga = s["vgamode"]:"";
- failsafe_append = s["append"]:"";
- }
-});
-if (! xen_set)
-{
- xen_append = default_append;
- xen_vga = default_vga;
-}
-SCR::Write (.target.sysconfig.bootloader.DEFAULT_APPEND, default_append);
-SCR::Write (.target.sysconfig.bootloader.DEFAULT_VGA, default_vga);
-SCR::Write (.target.sysconfig.bootloader.FAILSAFE_APPEND, failsafe_append);
-SCR::Write (.target.sysconfig.bootloader.FAILSAFE_VGA, failsafe_vga);
-SCR::Write (.target.sysconfig.bootloader.XEN_APPEND, xen_append);
-SCR::Write (.target.sysconfig.bootloader.XEN_VGA, xen_vga);
-SCR::Write (.target.sysconfig.bootloader, nil);
+// FATE #302245 save kernel args etc to /etc/sysconfig/bootloader
+BootCommon::WriteToSysconf(true);

y2milestone ("finish inst_bootloader");

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/grub/misc.ycp
new/yast2-bootloader-2.17.8/src/grub/misc.ycp
--- old/yast2-bootloader-2.17.5/src/grub/misc.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/grub/misc.ycp 2008-08-04
13:34:56.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain <jsrain@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: misc.ycp 48549 2008-06-26 14:50:07Z juhliarik $
+ * $Id: misc.ycp 49630 2008-08-04 11:34:56Z juhliarik $
*
*/

@@ -23,6 +23,7 @@
import "Mode";
import "BootCommon";
import "PackageSystem";
+ import "Map";


// --------------------------------------------------------------
@@ -1038,8 +1039,195 @@
string ret = devpth[0]:"" + devpth[1]:"";
return ret;
}
+
+
+/** FATE #301994 - Correct device mapping in case windows is installed on the
second HD
+ * Check if chainloader section with windows is on the first disk
+ *
+ * @param map<string,any> section from BootCommon::sections
+ * @return boolean true if it is necessary remap section
+ */
+define boolean isWidnowsOnBootDisk(map<string,any> section)
+{
+ // check if it is windows chainloader
+ if ((search(tolower(section["name"]:""), "windows") != nil)
+ || (search(tolower(section["original_name"]:""), "windows") != nil))
+ {
+ map p_dev = Storage::GetDiskPartition
(section["chainloader"]:"");
+
+ string disk_dev = p_dev["disk"]:"";
+ if (disk_dev == "")
+ {
+ y2error("trying find disk for windows chainloader
failed");
+ return false;
+ }
+ // find grub id in device map for chainloader device
+ string grub_id = BootCommon::device_mapping[disk_dev]:"";
+ y2milestone("Disk from windows chainloader: %1 grub id from
device map: %2", disk_dev, grub_id);
+
+ // check if disk is the first in order...
+ if (grub_id != "hd0")
+ return true;
+
+ }
+ return false;
}

+/** FATE #301994 - Correct device mapping in case windows is installed on the
second HD
+ * Remap and make active windows chainloader section
+ * if it is not on the boot (the first) disk
+ * @param list of sections
+ * @return list of sections
+ */
+
+define list<map<string,any> > checkWindowsSection(list<map<string,any> >
sections)
+{
+
+ // list of idexes from sections where is chainloader
+ // and where is necessary add remapping and makeactive
+ list < integer > list_index =[];
+ // counter
+ integer index = -1;
+ // check all sections...
+ foreach(map<string,any> section, sections,
+ {
+ index = index +1;
+ if (haskey(section, "chainloader"))
+ {
+ y2debug("chainloader section: %1", section);
+ // add only indexes for update
+ if (isWidnowsOnBootDisk(section))
+ list_index = add(list_index, index);
+ };
+ });
+
+ if (size(list_index) > 0)
+ {
+ foreach (integer idx, list_index,
+ {
+ sections[idx, "remap"] = "true";
+ sections[idx, "makeactive"] = "true";
+ y2milestone("Added remap and makeactive for section:
%1", sections[idx]:$[]);
+ });
+ }
+
+ y2debug("Checking sections for windows chainloader: %1", sections);
+ return sections;
+}
+
+
+/**
+ * FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
+ * The function reduces records (devices) in device.map
+ * Grub doesn't support more than 8 devices in device.map
+ * @return boolean true if device map was reduced
+ */
+global boolean ReduceDeviceMapTo8()
+{
+ boolean result = false;
+
+ if (size(BootCommon::device_mapping)>8)
+ {
+ result = true;
+ list <string> bios_order = (list <string> )
Map::Values(BootCommon::device_mapping);
+ //delete all grub devices with order more than 9
+ bios_order = filter(string key, bios_order, {return (size(key) < 4);});
+ bios_order = lsort(bios_order);
+ y2debug("ordered values (grub devices): %1", bios_order);
+ map<string,string> inverse_device_map = $[];
+ map<string,string> new_device_map = $[];
+ y2milestone("Device map before reducing: %1",
BootCommon::device_mapping);
+ foreach(string key, string value, BootCommon::device_mapping,
+ {
+ inverse_device_map[value]=key;
+ });
+
+ y2debug("inverse_device_map: %1", inverse_device_map);
+ integer index = 0;
+
+ foreach(string key, bios_order,
+ {
+ string device_name = inverse_device_map[key]:"";
+
+ if (index < 8)
+ {
+ y2debug("adding device: %1 with key: %2 and index is: %3",
device_name, key, index);
+ new_device_map[device_name]=key;
+ index = index + 1;
+ } else {
+ break;
+ }
+ });
+ BootCommon::device_mapping = new_device_map;
+ y2milestone("Device map after reducing: %1",
BootCommon::device_mapping);
+ } else {
+ y2milestone("Device map includes less than 9 devices. It is not
reduced. device_map: %1", BootCommon::device_mapping);
+ }
+ return result;
+}
+
+
+/**
+ * FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
+ * The function check if boot device is in device.map
+ * Grub doesn't support more than 8 devices in device.map
+ * @param string boot device
+ * @param string boot device with name by mountby
+ * @return boolean true if there is missing boot device
+ */
+define boolean checkBootDeviceInDeviceMap(string boot_dev, string
boot_dev_mountby)
+{
+ boolean result = false;
+
+ if (size(BootCommon::device_mapping)>8)
+ {
+ result = false;
+ list <string> bios_order = (list <string> )
Map::Values(BootCommon::device_mapping);
+ //delete all grub devices with order more than 9
+ bios_order = filter(string key, bios_order, {return (size(key) < 4);});
+ bios_order = lsort(bios_order);
+ y2debug("ordered values (grub devices): %1", bios_order);
+ map<string,string> inverse_device_map = $[];
+ foreach(string key, string value, BootCommon::device_mapping,
+ {
+ inverse_device_map[value]=key;
+ });
+
+ y2debug("inverse_device_map: %1", inverse_device_map);
+ integer index = 0;
+ boolean boot_device_added = false;
+ foreach(string key, bios_order,
+ {
+ string device_name = inverse_device_map[key]:"";
+
+ if (index < 8)
+ {
+ if ((device_name == boot_dev) || (device_name ==
boot_dev_mountby))
+ boot_device_added = true;
+ index = index + 1;
+ } else {
+ if (boot_device_added)
+ {
+ y2milestone("Device map includes boot disk");
+ break;
+ } else {
+ y2error("Device map doesn't include boot disk");
+ result = true;
+ break;
+ }
+ }
+ });
+ } else {
+ y2milestone("Device map includes less than 9 devices.");
+ }
+ return result;
+}
+
+
+
+
+} //last "}"
+
/*
* Local variables:
* mode: ycp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/modules/BootArch.ycp
new/yast2-bootloader-2.17.8/src/modules/BootArch.ycp
--- old/yast2-bootloader-2.17.5/src/modules/BootArch.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/modules/BootArch.ycp 2008-07-28
13:10:35.000000000 +0200
@@ -14,7 +14,7 @@
* Jiri Srain <jsrain@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: BootArch.ycp 43858 2008-01-24 07:53:31Z juhliarik $
+ * $Id: BootArch.ycp 49438 2008-07-27 15:54:51Z juhliarik $
*
*/

@@ -108,15 +108,15 @@
string ret = "";
if (Arch::i386 ())
{
- ret = "showopts ide=nodma apm=off acpi=off noresume nosmp noapic
maxcpus=0 edd=off";
+ ret = "showopts ide=nodma apm=off acpi=off noresume nosmp noapic
maxcpus=0 edd=off powersaved=off";
}
else if (Arch::x86_64 ())
{
- ret = "showopts ide=nodma apm=off acpi=off noresume edd=off";
+ ret = "showopts ide=nodma apm=off acpi=off noresume edd=off
powersaved=off";
}
else if (Arch::ia64 ())
{
- ret = "ide=nodma nohalt noresume";
+ ret = "ide=nodma nohalt noresume powersaved=off";
}
else if (Arch::s390 ())
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/modules/BootCommon.ycp
new/yast2-bootloader-2.17.8/src/modules/BootCommon.ycp
--- old/yast2-bootloader-2.17.5/src/modules/BootCommon.ycp 2008-07-23
15:16:35.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/modules/BootCommon.ycp 2008-08-01
17:20:31.000000000 +0200
@@ -15,7 +15,7 @@
* Joachim Plack <jplack@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: BootCommon.ycp 49341 2008-07-23 12:16:35Z juhliarik $
+ * $Id: BootCommon.ycp 49588 2008-08-01 15:20:30Z juhliarik $
*
*/

@@ -184,6 +184,14 @@
*/
global boolean activate = false;

+
+/** FATE #303548 - Grub: limit device.map to devices detected by BIOS
+ * Ask user if he wants to edit again bootloader settings
+ * It is used if device.map is limited and "boot" disk is out of range
+ * The range is the first 8 devices
+ */
+global boolean ask_user = false;
+
/**
* Replace MBR with generic code after bootloader installation?
*/
@@ -828,6 +836,10 @@
{
ret = ret && CommitSettings ();
}
+
+ // write settings to /etc/sysconfig/bootloader
+ WriteToSysconf(false);
+
return ret;
}
/**
@@ -886,6 +898,7 @@
// summary text
result = add (result, _("Do not install boot loader; just create
configuration files"));
+
return result;
}

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/modules/BootGRUB.ycp
new/yast2-bootloader-2.17.8/src/modules/BootGRUB.ycp
--- old/yast2-bootloader-2.17.5/src/modules/BootGRUB.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/modules/BootGRUB.ycp 2008-08-04
13:34:56.000000000 +0200
@@ -15,7 +15,7 @@
* Olaf Dabrunz <od@xxxxxxx>
* Philipp Thomas <pth@xxxxxxx>
*
- * $Id: BootGRUB.ycp 45640 2008-03-20 11:53:38Z jsrain $
+ * $Id: BootGRUB.ycp 49630 2008-08-04 11:34:56Z juhliarik $
*
*/

@@ -386,130 +386,7 @@
SCR::Execute (.target.bash, sformat ("/bin/rmdir %1", tmpdir));
}

-// FIXME: remove old code: this used to parse menu.lst and device.map files
-// from other linux partitions for "initial" (~ default, see
-// MarkInitialSection() in perl-Bootloader) sections, and adds them to the
-// current menu.lst, if none of the referenced root partition and the other
-// linux partition was `destroyed (= "new, deleted or formatted").
-/*
- BootCommon::InitializeLibrary (true, "grub");
- foreach (map o, other_l, {
- string dev = o["device"]:"";
- if (dev != "" && 0 == SCR::Execute (.target.bash,
- sformat ("/bin/mount %1 %2", dev, tmpdir))
- )
- {
- y2milestone ("Mounted %1", dev);
- list<string> filenames = [];
- foreach (string fn, [
-// not needed since there is a symlink in /boot directory
-// named boot pointing to the /boot directory
-// this caused bug #23346 - the file was found twice
-// tmpdir + "grub/menu.lst",
- tmpdir + "boot/grub/menu.lst"
- ], {
- if (-1 != (integer)SCR::Read (.target.size, fn))
- filenames = add (filenames, fn);
- });
- y2milestone ("Found files %1", filenames);
- integer count = 0;
- foreach (string f, filenames, {
- y2debug ("Checking file %1", f);
- string fc = (string)SCR::Read (.target.string, f);
- string dm = (string)SCR::Read (.target.string,
- regexpsub (f, "(.*)menu.lst$",
- "\\1device.map"));
- y2debug ("Device map file name: %1",
- regexpsub (f, "(.*)menu.lst$",
- "\\1device.map"));
- y2debug ("Device map contents: %1", dm);
-
-// here the old code tries to parse and import sections from the grub config
file from an "other" linux partition
- map<string,string> files = $[
- "/boot/grub/menu.lst" : fc,
- ];
- if (dm == nil)
- return;
-
- files["/boot/grub/device.map"] = dm;
- BootCommon::InitializeLibrary (false, "grub");
- BootCommon::SetFilesContents (files);
- list<map<string,string> > sects
- = BootCommon::GetSections ();
- y2debug ("Found sections %1", sects);
-
- // merge only "default" == "initial" entries, not all
entries
- if (merge_level == `main)
- {
- sects = filter (map<string,string> s, sects, {
- return s["initial"]:nil != nil;
- });
- }
-
- // now add the sections to our configuration, if they
qualify
- count = count + size (sects);
- foreach (map<string,any> s, sects, ``{
- s = (map<string,any>)union (s, $[
- "__changed" : false,
- "__auto" : true,
- "__converted" : true,
- ]);
- // no need to translate here...
- s["name"] = sformat ("%1 (%2)",
- s["name"]:"", dev);
- s["original_name"] = s["name"]:"";
-
- // this is a heuristic: if the mounted partition or the
- // root partition referenced in the section is "new,
- // deleted or formatted", then do not add/import the
- // section
- list<string> devs = [dev];
- string _d = s["root"]:"";
- if (_d != nil && _d != "")
- devs = add (devs, _d);
- devs = (list<string>)filter (string d, devs,
- ``(d != ""
- && d != nil
- && d != "/dev/null" && d != "false"));
- devs = toset (devs);
- devs = maplist (string d, devs, {
- return BootCommon::UpdateDevice (d);
- });
- boolean _add = true;
- foreach (string _d, devs, {
- if (contains (destroyed_partitions, _d))
- _add = false;
- });
-
- // FIXME: create a new config file section instead of
- // using <s> which only shares the name/original_name
- // This makes it possible to support cascaded boot
- // environments in a supportable way !
- if (_add)
- {
- // FIXME: fallback to vmlinux and initrd symlink if
- // present in the chroot environment of the other
- // Linux System ... #224481
-
- s["__devs"] = devs;
- out = add (out, s);
- }
- });
- });

- // if any sections from this device were added, it was a
- // genuine linux partition: ignore it when going through the
- // list of "other", non-linux partitions in the next loop below
- if (count > 0)
- others_ignore = add (others_ignore, dev);
-
- SCR::Execute (.target.bash, sformat (
- "/bin/umount %1", dev));
- }
- });
- SCR::Execute (.target.bash, sformat ("/bin/rmdir %1", tmpdir));
- }
-*/

// Go through a list of "bootable" (aa55) primary partitions that may be
// "foreign", check that it is not one of our current boot partitions and
@@ -636,96 +513,6 @@
BootCommon::ProposeDeviceMap ();
}

- // FIXME: This code can probably be removed. perl-Bootloader sets boot_*
- // flags in the globals map. That is all the UI and the proposal code deal
- // with. The decision to install the bootloader stage 1 on multiple devices
- // (for softraid, dmraid etc.) can be based on the information in the
- // boot_{root,boot,mbr} flags and the disk, partitioning and md information
- // alone. Thus, perl-Bootloader is able to do this.
-/*
- list<string> loader_devices = splitstring (
- BootCommon::globals["stage1_dev"]:"",
- ",");
-
- if (size (loader_devices) > 1) {
- // check if members of a MD are present
- map<string,map> tm = Storage::GetTargetMap ();
- list<string> md = maplist (map m, tm["/dev/md", "partitions"]:[], {
- return m["device"]:"";
- });
- if (Mode::test ())
- md = ["/dev/md0"];
- boolean md_found = false;
- // try collapse all MD disks
- foreach (string md_disk, md, {
- list<string> md_members = sort (maplist (
- string s,
- integer id,
- BootCommon::Md2Partitions (md_disk),
- {
- return s;
- }));
- if (Mode::test ())
- md_members = ["/dev/hda1", "/dev/hdb1"];
-
- boolean reduce = true;
- foreach (string member, md_members, {
- if (! contains (loader_devices, member))
- reduce = false;
- });
- if (reduce) {
- loader_devices = filter (string d, loader_devices, {
- return ! contains (md_members, d);
- });
- loader_devices = add (loader_devices, md_disk);
- }
- });
- // check MBRs of all disks holding /boot partition
- map<string,integer> boot_md
- = BootCommon::Md2Partitions (
- BootCommon::BootPartitionDevice);
- if (Mode::test ())
- boot_md = $["/dev/hda1" : 128, "/dev/hdb1" : 129];
- list<string> md_disks = maplist (string d, integer b, boot_md,
- {
- map p_dev = Storage::GetDiskPartition (d);
- return p_dev["disk"]:"";
- });
- boolean reduce = true;
- foreach (string d, md_disks, {
- if (! contains (loader_devices, d))
- reduce = false;
- });
- if (reduce)
- {
- loader_devices = filter (string d, loader_devices, {
- return ! contains (md_disks, d);
- });
- loader_devices = add (loader_devices, "mbr_md");
- }
- if (contains (loader_devices, BootCommon::BootPartitionDevice))
- {
- loader_devices = filter (string d, loader_devices, {
- return d != BootCommon::BootPartitionDevice;
- });
- backup_to_bootsector = true;
- if (size (loader_devices) > 0)
- {
- loader_devices = sort (loader_devices);
- BootCommon::loader_device = loader_devices[0]:"";
- }
- else
- {
- BootCommon::loader_device = BootCommon::BootPartitionDevice;
- }
- }
- }
- else if (size (loader_devices) == 1)
- {
- BootCommon::loader_device = loader_devices[0]:"";
- }
-*/
-
importMetaData();

return ret;
@@ -835,61 +622,20 @@
* @param flush boolean true to flush settings to the disk
* @return boolean true if success
*/
-global boolean Save (boolean clean, boolean init, boolean flush) {
- // update list of devices
-// list<string> loader_devices = [BootCommon::loader_device];
-// if (backup_to_bootsector && contains
(BootCommon::getPartitionList(`boot),
-// BootCommon::BootPartitionDevice))
-// {
-// if (loader_devices[0]:"" != nil && loader_devices[0]:"" != "/dev/null"
-// && loader_devices[0]:"" != "")
-// {
-// loader_devices[1] = BootCommon::BootPartitionDevice;
-// }
-// else
-// {
-// loader_devices = [ BootCommon::BootPartitionDevice ];
-// }
-// }
-
- // get the list of device names to install the boot loader stage 1 into:
- // - for non-md devices, use just the device name
- // - for installation to md arrays: get the list of device names from
- // name of md array, either
- // - just the container-partitions (according to yast2-storage) or
- // ("/dev/md0" -> ["/dev/hda1", ...])
- // - the (cut off) name of the corresponding disk devices
- // ("/dev/md0" -> ["/dev/hda1", ...] -> ["/dev/hda", ...])
-// list<list<string> > dev_lists = maplist (string d, loader_devices, {
-// if (substring (d, 0, 7) == "/dev/md")
-// {
-// map<string,integer> md = BootCommon::Md2Partitions (d);
-// if (Mode::test ())
-// md = $["/dev/hda1" : 128, "/dev/hdb1" : 129];
-// return maplist (string d, integer b, md, {
-// return d;
-// });
-// }
-// if (d == "mbr_md")
-// {
-// map<string,integer> md = BootCommon::Md2Partitions
-// (BootCommon::BootPartitionDevice);
-// if (Mode::test ())
-// md = $["/dev/hda1" : 128, "/dev/hdb1" : 129];
-// return maplist (string d, integer b, md, {
-// // get disk device name for this partition or disk device name
-// map p_dev = Storage::GetDiskPartition (d);
-// return p_dev["disk"]:"";
-// });
-// }
-// return [d];
-// });
-// loader_devices = flatten (dev_lists);
-// BootCommon::globals["stage1_dev"] = mergestring (loader_devices, ",");
+global boolean Save (boolean clean, boolean init, boolean flush)
+{
+ // check if windows is on second disk and add remap if it is necessary
+ // FATE #301994: Correct device mapping in case windows is installed on
the second HD
+ BootCommon::sections = checkWindowsSection(BootCommon::sections);
+
+ // reduce device map to 8 devices
+ // FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
+ ReduceDeviceMapTo8();

// now really save the settings
boolean ret = BootCommon::Save (clean, init, flush);
importMetaData();
+
return ret;
}

@@ -1103,6 +849,19 @@
];
}

+
+global boolean CheckDeviceMap()
+{
+ // FATE #303548 - Grub: limit device.map to devices detected by BIOS
+ boolean ret = false;
+ string boot_disk = BootCommon::getBootDisk();
+ if (boot_disk != "")
+ ret = checkBootDeviceInDeviceMap(boot_disk,
BootCommon::DevToLabelUdevID(boot_disk));
+
+ return ret;
+
+}
+
} // EOF

/*
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/modules/Bootloader.ycp
new/yast2-bootloader-2.17.8/src/modules/Bootloader.ycp
--- old/yast2-bootloader-2.17.5/src/modules/Bootloader.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/modules/Bootloader.ycp 2008-08-01
17:20:31.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain <jsrain@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: Bootloader.ycp 48350 2008-06-17 11:14:02Z juhliarik $
+ * $Id: Bootloader.ycp 49588 2008-08-01 15:20:30Z juhliarik $
*
*/

@@ -560,6 +560,7 @@
y2milestone ("Reinitialize bootloader library before saving: %1",
reinit);
ret = blSave (true, reinit, true) && ret;
+
if (! ret)
y2error ("Error before configuration files saving finished");

@@ -684,7 +685,7 @@
dev = Storage::GetDiskPartition(BootCommon::BootPartitionDevice);
else
dev = Storage::GetDiskPartition(BootCommon::RootPartitionDevice);
- if (dev["disk"]:"" == "/dev/nfs")
+ if (dev["disk"]:"" == "/dev/nfs")
{
y2milestone("Bootloader::Write() -> Boot partition is nfs type,
bootloader will not be installed.");
return ret;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/routines/lilolike.ycp
new/yast2-bootloader-2.17.8/src/routines/lilolike.ycp
--- old/yast2-bootloader-2.17.5/src/routines/lilolike.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/routines/lilolike.ycp 2008-08-01
17:20:31.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain <jsrain@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: lilolike.ycp 48552 2008-06-26 15:23:51Z juhliarik $
+ * $Id: lilolike.ycp 49588 2008-08-01 15:20:30Z juhliarik $
*
*/
{
@@ -24,6 +24,7 @@
import "Storage";
import "StorageDevices";
import "BootArch";
+import "Map";

global string DiskOrderSummary ();
global list<string> DisksOrder ();
@@ -1402,8 +1403,12 @@
{
integer index = tointeger (bios_id) - tointeger ("0x80");
string grub_dev = sformat ("hd%1", index);
- device_mapping[target_dev] = grub_dev;
- ids[index] = true;
+ // FATE #303548 - doesn't add disk with same bios_id with different
name (multipath machine)
+ if (! ids[index]:false)
+ {
+ device_mapping[target_dev] = grub_dev;
+ ids[index] = true;
+ }
}
});
// and guess other devices
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/routines/misc.ycp
new/yast2-bootloader-2.17.8/src/routines/misc.ycp
--- old/yast2-bootloader-2.17.5/src/routines/misc.ycp 2008-07-23
15:16:35.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/routines/misc.ycp 2008-08-01
17:20:31.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain <jsrain@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: misc.ycp 49341 2008-07-23 12:16:35Z juhliarik $
+ * $Id: misc.ycp 49588 2008-08-01 15:20:30Z juhliarik $
*
* WARNING:
* To be included to BootCommon.ycp only, requires function
@@ -35,6 +35,7 @@
import "Misc";
import "ProductFeatures";
import "Directory";
+ import "Installation";

// bootloader attributes handling functions

@@ -1576,8 +1577,162 @@
return true;
}
}
+/**
+ * Function return boot disk device with udev id name
+ * @return string name of boot disk like udev id
+ */
+define string BootDeviceToUdevID()
+{
+ string device = "";
+ if ((BootPartitionDevice != "") || (BootPartitionDevice != nil))
+ device = BootPartitionDevice;
+
+ if (device == "")
+ device = RootPartitionDevice;
+
+ if (device == "")
+ return device;
+
+ y2milestone("Boot device is: %1", device);
+ map p_dev = Storage::GetDiskPartition (device);
+
+ string boot_disk = p_dev["disk"]:"";
+
+ device = DevToLabelUdevID(boot_disk);
+ y2milestone("Boot disk is %1 and his udev id is: %2", boot_disk, device);
+ return device;
+}
+
+
+/** FATE #302245 save kernel args etc to /etc/sysconfig/bootloader
+ * Function write/update info in /etc/sysconfig/bootloader
+ * @param booloean true if it called from inst_bootloader.ycp
+ */
+
+global define void WriteToSysconf(boolean inst_bootloader)
+{
+
+ string lt = BootCommon::getLoaderType (false);
+ y2milestone ("Saving /etc/sysconfig/bootloader for %1", lt);
+ string default_boot_section_name = BootCommon::globals["default"]:"";
+
+ // get the default and failsafe append + vga parameters; if section with
+ // appropriate original name not found, just use any Linux section
+ // doing so during update may be questionable, however, the variables need
to
+ // be initialized in any case
+ string default_vga = "";
+ string default_append = "";
+ boolean default_set = false;
+ string failsafe_vga = "";
+ string failsafe_append = "";
+ boolean failsafe_set = false;
+ string xen_vga = "";
+ string xen_append = "";
+ string xen_kernel_append = "";
+ boolean xen_set = false;
+
+ foreach (map<string,any>s, BootCommon::sections,
+ {
+ if ((search(s["original_name"]:"","linux") != nil) &&
+ (s["name"]:"" == default_boot_section_name))
+ {
+ default_set = true;
+ default_vga = s["vgamode"]:"";
+ default_append = s["append"]:"";
+ }
+ if (search(s["original_name"]:"","xen") != nil)
+ {
+ xen_set = true;
+ xen_vga = s["vgamode"]:"";
+ xen_append = s["xen_append"]:"";
+ xen_kernel_append = s["append"]:"";
+ }
+ else if (search(s["original_name"]:"","failsafe") != nil)
+ {
+ failsafe_set = true;
+ failsafe_vga = s["vgamode"]:"";
+ failsafe_append = s["append"]:"";
+ }
+ if (s["type"]:"" == "image" && ! default_set)
+ {
+ default_vga = s["vgamode"]:"";
+ default_append = s["append"]:"";
+ }
+ if (s["type"]:"" == "image" && ! failsafe_set)
+ {
+ failsafe_vga = s["vgamode"]:"";
+ failsafe_append = s["append"]:"";
+ }
+ });

+ if (! xen_set)
+ {
+ xen_kernel_append = default_append;
+ xen_append = "";
+ xen_vga = default_vga;
+ }
+
+ // save some sysconfig variables
+ // register new agent pointing into the mounted filesystem
+ path sys_agent = .sysconfig.bootloader;
+
+ if (inst_bootloader)
+ {
+ WFM::Execute(.local.mkdir, Installation::destdir + "/etc/sysconfig");
+ WFM::Write(.local.bash, sformat ("touch %1/etc/sysconfig/bootloader",
Installation::destdir));
+ string target_sysconfig_path = Installation::destdir +
"/etc/sysconfig/bootloader";
+ SCR::RegisterAgent (.target.sysconfig.bootloader, `ag_ini(
+ `SysConfigFile(target_sysconfig_path)));
+
+ sys_agent = add(.target, sys_agent);
+
+ }
+
+ SCR::Write (add(sys_agent,.DEFAULT_NAME), default_boot_section_name);
+ SCR::Write (add(sys_agent,.DEFAULT_APPEND), default_append);
+ SCR::Write (add(sys_agent,.DEFAULT_VGA), default_vga);
+ SCR::Write (add(sys_agent,.FAILSAFE_APPEND), failsafe_append);
+ SCR::Write (add(sys_agent,.FAILSAFE_VGA), failsafe_vga);
+ SCR::Write (add(sys_agent,.XEN_KERNEL_APPEND), xen_kernel_append);
+ SCR::Write (add(sys_agent,.XEN_APPEND), xen_append);
+ SCR::Write (add(sys_agent,.XEN_VGA), xen_vga);
+ SCR::Write (sys_agent, nil);
+
+
+}
+
+/** FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
+ * Function select boot device - disk
+ *
+ * @return string name of boot device - disk
+ */

+global string getBootDisk()
+{
+ string boot_device = "";
+ if (BootCommon::BootPartitionDevice != "")
+ boot_device = BootCommon::BootPartitionDevice;
+ else if (BootCommon::RootPartitionDevice != "")
+ boot_device = BootCommon::RootPartitionDevice;
+
+ if (boot_device == "")
+ {
+ y2milestone("BootPartitionDevice and RootPartitionDevice are
empty");
+ return boot_device;
+ }
+ map p_dev = Storage::GetDiskPartition (boot_device);
+
+ string boot_disk_device = p_dev["disk"]:"";
+
+ if ((boot_disk_device != "") && (boot_disk_device != nil))
+ {
+ y2milestone("Boot device - disk: %1", boot_disk_device);
+ return boot_disk_device;
+ }
+
+ y2milestone("Finding boot disk failed!");
+ return "";
+}


} //end of include
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/src/routines/popups.ycp
new/yast2-bootloader-2.17.8/src/routines/popups.ycp
--- old/yast2-bootloader-2.17.5/src/routines/popups.ycp 2008-07-21
16:04:51.000000000 +0200
+++ new/yast2-bootloader-2.17.8/src/routines/popups.ycp 2008-08-01
17:20:31.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain <jsrain@xxxxxxx>
* Olaf Dabrunz <od@xxxxxxx>
*
- * $Id: popups.ycp 41373 2007-10-11 12:55:01Z odabrunz $
+ * $Id: popups.ycp 49588 2008-08-01 15:20:30Z juhliarik $
*
*/

@@ -257,6 +257,7 @@
"));
}

+
/**
* Display popup
*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-bootloader-2.17.5/VERSION
new/yast2-bootloader-2.17.8/VERSION
--- old/yast2-bootloader-2.17.5/VERSION 2008-07-23 15:18:52.000000000 +0200
+++ new/yast2-bootloader-2.17.8/VERSION 2008-08-04 13:31:24.000000000 +0200
@@ -1 +1 @@
-2.17.5
+2.17.8


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

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

< Previous Next >