Hello community,
here is the log from the commit of package yast2-bootloader
checked in at Sun Aug 12 00:10:43 CEST 2007.
--------
--- yast2-bootloader/yast2-bootloader.changes 2007-07-26 07:28:49.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-bootloader/yast2-bootloader.changes 2007-08-10 20:13:14.191793000 +0200
@@ -1,0 +2,27 @@
+Fri Aug 10 20:11:24 CEST 2007 - od@suse.de
+
+- part of feature #301313:
+ - added front-end function and infrastructure in switcher.ycp for
+ FlagOnetimeBoot()
+ - added FlagOnetimeBoot() implementation for POWERLILO
+- fixed return codes of examine_mbr.pl: do not overlap error codes
+ with "bootloader stage1 needs to be (re)-installed here" return
+ code
+- evaluate new return code in yast2-bootloader
+- added documentation comment to examine_mbr.pl
+- changed documentation comments where yast2-bootloader calls
+ examine_mbr.pl
+- fixed error in autoinstall client that prevented importing legacy
+ global keys
+- added/fixed some comments
+- added documentation comments to BootGRUB::CreateSections()
+- changed two y2debug() into y2milestone()
+- fixed: a chainloader entry may have been produced that pointed to
+ the boot partition of our current installation
+- grub: implemented booting other Linux installations on the system
+ via chainloader/configfile entries (feature #302302)
+- fixed: if-block contained no statement, uncommented y2debug() in
+ there
+- 2.15.15
+
+-------------------------------------------------------------------
Old:
----
yast2-bootloader-2.15.14.tar.bz2
New:
----
yast2-bootloader-2.15.15.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.S28124/_old 2007-08-12 00:10:12.000000000 +0200
+++ /var/tmp/diff_new_pack.S28124/_new 2007-08-12 00:10:12.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-bootloader (Version 2.15.14)
+# spec file for package yast2-bootloader (Version 2.15.15)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-bootloader
-Version: 2.15.14
+Version: 2.15.15
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-bootloader-2.15.14.tar.bz2
+Source0: yast2-bootloader-2.15.15.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:
@@ -50,7 +50,7 @@
Olaf Dabrunz
%prep
-%setup -n yast2-bootloader-2.15.14
+%setup -n yast2-bootloader-2.15.15
%build
%{prefix}/bin/y2tool y2autoconf
@@ -95,6 +95,30 @@
/usr/share/YaST2/schema/autoyast/rnc/bootloader.rnc
%changelog
+* Fri Aug 10 2007 - od@suse.de
+- part of feature #301313:
+ - added front-end function and infrastructure in switcher.ycp for
+ FlagOnetimeBoot()
+ - added FlagOnetimeBoot() implementation for POWERLILO
+- fixed return codes of examine_mbr.pl: do not overlap error codes
+ with "bootloader stage1 needs to be (re)-installed here" return
+ code
+- evaluate new return code in yast2-bootloader
+- added documentation comment to examine_mbr.pl
+- changed documentation comments where yast2-bootloader calls
+ examine_mbr.pl
+- fixed error in autoinstall client that prevented importing legacy
+ global keys
+- added/fixed some comments
+- added documentation comments to BootGRUB::CreateSections()
+- changed two y2debug() into y2milestone()
+- fixed: a chainloader entry may have been produced that pointed to
+ the boot partition of our current installation
+- grub: implemented booting other Linux installations on the system
+ via chainloader/configfile entries (feature #302302)
+- fixed: if-block contained no statement, uncommented y2debug() in
+ there
+- 2.15.15
* Thu Jul 26 2007 - jsrain@suse.cz
- removed unneeded yast2-devel from BuildRequires
- 2.15.14
++++++ yast2-bootloader-2.15.14.tar.bz2 -> yast2-bootloader-2.15.15.tar.bz2 ++++++
++++ 11288 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/configure.in new/yast2-bootloader-2.15.15/configure.in
--- old/yast2-bootloader-2.15.14/configure.in 2007-07-26 07:26:42.000000000 +0200
+++ new/yast2-bootloader-2.15.15/configure.in 2007-07-03 14:50:07.000000000 +0200
@@ -1,9 +1,9 @@
dnl configure.in for yast2-bootloader
dnl
-dnl -- This file is generated by y2autoconf 2.15.1 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.15.0 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-bootloader, 2.15.14, http://bugs.opensuse.org/, yast2-bootloader)
+AC_INIT(yast2-bootloader, 2.15.8, http://bugs.opensuse.org/, yast2-bootloader)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.15.14"
+VERSION="2.15.8"
RPMNAME="yast2-bootloader"
MAINTAINER="Olaf Dabrunz "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/missing new/yast2-bootloader-2.15.15/missing
--- old/yast2-bootloader-2.15.14/missing 2007-07-26 07:26:56.000000000 +0200
+++ new/yast2-bootloader-2.15.15/missing 2007-07-03 14:50:22.000000000 +0200
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2005-06-08.21
+scriptversion=2006-05-10.23
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
@@ -33,6 +33,8 @@
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +46,7 @@
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -77,6 +79,7 @@
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -106,7 +109,7 @@
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
-case "$1" in
+case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
@@ -135,7 +138,7 @@
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case "$1" in
+case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -164,7 +167,7 @@
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -192,8 +195,8 @@
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -214,25 +217,25 @@
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@@ -244,18 +247,18 @@
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
@@ -267,11 +270,9 @@
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -289,11 +290,17 @@
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@@ -317,13 +324,13 @@
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/scripts/examine_mbr.pl new/yast2-bootloader-2.15.15/scripts/examine_mbr.pl
--- old/yast2-bootloader-2.15.14/scripts/examine_mbr.pl 2007-05-18 10:05:48.000000000 +0200
+++ new/yast2-bootloader-2.15.15/scripts/examine_mbr.pl 2007-08-06 22:44:56.000000000 +0200
@@ -1,5 +1,27 @@
#!/usr/bin/perl
+#
+# Examine an MBR and print what kind of bootloader stage1 code has been found.
+#
+# Exit codes:
+#
+# 0 : do not update the code in this MBR, it is either not maintained by us
+# (but belongs to some other OS) or some other unknown/unidentified
+# (bootloader?) code that we should not touch
+#
+# 254 : found known bootloader code that needs to be updated when the boot
+# setup is changing (because it contains a disk pointer to the next
+# bootloader stage, which may have changed)
+#
+# 1 -
+# xxx : some error occured while opening or reading from the (device) file
+# that contains the MBR
+# (254 is currently not produced as a system error code, and is not
+# expected to be produced; this script does not return error codes from
+# external commands; when no error code is set, this script exits with
+# code 255)
+#
+
use Compress::Zlib;
die "must specify 1 device file to examine" unless @ARGV == 1;
@@ -17,7 +39,7 @@
if (length($out) < 70) {
print "Definitely invalid\n";
- exit 1;
+ exit 254;
}
if (substr($MBR, 320, 126) =~
@@ -28,7 +50,7 @@
if (substr($MBR, 346, 100) =~ m,GRUB .Geom.Hard Disk.Read. Error,) {
print "Grub stage1\n";
- exit 1;
+ exit 254;
}
if (substr($MBR, 4, 20) =~ m,LILO,) {
@@ -36,5 +58,11 @@
exit 1;
}
+if (substr($MBR, 12, 500) =~ m,NTLDR is missing,) {
+ print "Windows bootloader stage1\n";
+ exit 0;
+}
+
print "unknown\n";
exit 0;
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/src/clients/bootloader_proposal.ycp new/yast2-bootloader-2.15.15/src/clients/bootloader_proposal.ycp
--- old/yast2-bootloader-2.15.14/src/clients/bootloader_proposal.ycp 2007-05-18 10:05:48.000000000 +0200
+++ new/yast2-bootloader-2.15.15/src/clients/bootloader_proposal.ycp 2007-08-10 20:08:37.000000000 +0200
@@ -1,7 +1,7 @@
/**
* Module: bootloader_proposal.ycp
*
- * $Id: bootloader_proposal.ycp 34495 2006-11-20 15:13:00Z jplack $
+ * $Id: bootloader_proposal.ycp 40212 2007-08-10 18:08:36Z odabrunz $
*
* Author: Klaus Kaempf
*
@@ -84,6 +84,9 @@
if (Bootloader::getLoaderType () == "grub")
{
import "BootGRUB";
+ // merge_level == `main means: merge only the "default" key(s?) of
+ // a "foreign" grub configuration from a different configuration
+ // into our configuration
BootGRUB::merge_level = `main;
Bootloader::Propose ();
BootGRUB::merge_level = `none;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/src/grub/misc.ycp new/yast2-bootloader-2.15.15/src/grub/misc.ycp
--- old/yast2-bootloader-2.15.14/src/grub/misc.ycp 2007-07-18 12:39:00.000000000 +0200
+++ new/yast2-bootloader-2.15.15/src/grub/misc.ycp 2007-08-10 20:08:38.000000000 +0200
@@ -12,7 +12,7 @@
* Jiri Srain
* Olaf Dabrunz
*
- * $Id: misc.ycp 39304 2007-07-10 21:00:36Z odabrunz $
+ * $Id: misc.ycp 40212 2007-08-10 18:08:36Z odabrunz $
*
*/
@@ -650,18 +650,19 @@
selected_location = `boot;
BootCommon::globals["activate"] = "true";
BootCommon::activate_changed = true;
- // examine_mbr.pl returns
- // - != 0 for a read error: "cannot read 512 bytes from <dev>"
- // - 1 for an "invalid MBR", i.e. without enough entropy to
- // contain boot code
- // - 0 for a "Generic MBR" (DOS MBR)
- // - 1 for a GRUB or lilo "stage 1"
- // - 0 for an unknown MBR
+ // examine_mbr.pl returns
+ // - != 0 (errno, e.g. 2) for a read error: "cannot read 512
+ // bytes from <dev>"
+ // - 254 for an "invalid MBR", i.e. without enough entropy to
+ // contain boot code
+ // - 0 for a "Generic MBR" (DOS MBR)
+ // - 254 for a GRUB or lilo "stage 1"
+ // - 0 for an unknown MBR
map out = (map)SCR::Execute (.target.bash_output, sformat (
"/usr/lib/YaST2/bin/examine_mbr.pl %1", boot_partition_disk));
y2milestone ("MBR examining script returned %1", out);
integer exit = out["exit"]:0;
- BootCommon::globals["generic_mbr"] = ((exit != 0) && (! keep_mbr)) ? "true" : "false";
+ BootCommon::globals["generic_mbr"] = ((exit == 254) && (! keep_mbr)) ? "true" : "false";
}
else if (size (underlying_boot_partition_devices) > 1)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/src/modules/BootCommon.ycp new/yast2-bootloader-2.15.15/src/modules/BootCommon.ycp
--- old/yast2-bootloader-2.15.14/src/modules/BootCommon.ycp 2007-07-18 12:39:00.000000000 +0200
+++ new/yast2-bootloader-2.15.15/src/modules/BootCommon.ycp 2007-08-10 20:08:38.000000000 +0200
@@ -15,7 +15,7 @@
* Joachim Plack
* Olaf Dabrunz
*
- * $Id: BootCommon.ycp 39407 2007-07-13 16:18:09Z odabrunz $
+ * $Id: BootCommon.ycp 40212 2007-08-10 18:08:36Z odabrunz $
*
*/
@@ -455,7 +455,7 @@
: "";
// FIXME:
- // This only works in the installed system (problem with GetFinalKernel))),
+ // This only works in the installed system (problem with GetFinalKernel()),
// in all other cases we use the symlinks.
string kernel_fn = "";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-bootloader-2.15.14/src/modules/BootGRUB.ycp new/yast2-bootloader-2.15.15/src/modules/BootGRUB.ycp
--- old/yast2-bootloader-2.15.14/src/modules/BootGRUB.ycp 2007-07-18 12:39:00.000000000 +0200
+++ new/yast2-bootloader-2.15.15/src/modules/BootGRUB.ycp 2007-08-10 20:08:39.000000000 +0200
@@ -13,7 +13,7 @@
* Jiri Srain
* Joachim Plack
*
- * $Id: BootGRUB.ycp 39304 2007-07-10 21:00:36Z odabrunz $
+ * $Id: BootGRUB.ycp 40212 2007-08-10 18:08:36Z odabrunz $
*
*/
@@ -139,16 +139,36 @@
out = add (out, CreateLinuxSection ("linux"));
if (BootCommon::XenPresent ())
out = add (out, CreateLinuxSection ("xen"));
+
list<string> others_ignore = [];
+
+ string linux_fallback_text = "Linux other";
+ integer fallback_num = 1;
+
+ // get a list of bootable (= "aa55" at the end of block 0) primary
+ // partitions classified by partition type:
+ //
+ // "/dev/sda3 Linux other 1"
+ // "/dev/sda4 Linux other 2"
+ // "/dev/sda2 dos 1"
+ // "/dev/sda3 windows 1"
+ // "/dev/sda3 OS/2 Boot Manager 1"
+ // "/dev/sda1 Vendor diagnostic"
+ // ...
list<string> others = (list<string>)Storage::GetForeignPrimary();
- y2debug ("Other primaries: %1", others);
+ y2milestone ("Other primaries: %1", others);
+
+ // get list of all Linux Partitions on all real disks
list<map> other_l = (list<map>)Storage::GetOtherLinuxPartitions();
- y2debug ("Other linux parts: %1", other_l);
+ y2milestone ("Other linux parts: %1", other_l);
+
list<string> destroyed_partitions
= BootCommon::getPartitionList (`destroyed);
string tmpdir = (string)SCR::Read (.target.tmpdir) + "/bldetect/";
+ // load additional modules for filesystems used by other linux partitions,
+ // if needed
if (merge_level != `none && other_l != nil && size (other_l) > 0
&& 0 == SCR::Execute (.target.bash,
sformat ("test -d %1 || /bin/mkdir %1", tmpdir))
@@ -177,6 +197,207 @@
y2debug ("result of loading %1 is %2", modname, r);
}
});
+
+ foreach (map o, other_l, {
+
+ // Here is the general logic:
+ //
+ // not mountable => no entry
+ // mountable bootable has_menu_lst name_found => chainloader ("openSUSE 10.2 (/dev/sda2)")
+ // mountable bootable not name_found => chainloader ("Linux other 1 (/dev/sda2)")
+ // mountable not bootable has_menu_lst name_found => configfile ("openSUSE 10.2 (/dev/sda2)")
+ // mountable not bootable has_menu_lst not name_found => configfile ("Linux other 1 (/dev/sda2)")
+ // mountable not bootable not has_menu_lst => no entry
+
+ boolean bootable = false;
+ boolean has_menu_lst = false;
+ string menu_lst = "";
+ boolean name_found = false;
+ string new_sect_name_prefix = "";
+
+ BootCommon::InitializeLibrary (false, "grub");
+ string dev = o["device"]:"";
+ if (dev != "" && 0 == SCR::Execute (.target.bash,
+ sformat ("/bin/mount %1 %2", dev, tmpdir))
+ )
+ {
+ // mountable: true
+
+ 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);
+
+ // bootable: ?
+ //
+ // use examine_mbr.pl to analyze PBR (partition boot record):
+ // examine_mbr.pl prints "* stage1" when it finds the signature
+ // of some stage1 bootloader
+ // (The exit code would tell us only whether we should
+ // (re-)install a bootloader stage1 there in order to make the
+ // partition bootable, not whether a stage1 already exists.)
+ map result = (map)SCR::Execute (.target.bash_output, sformat (
+ "/usr/lib/YaST2/bin/examine_mbr.pl %1", dev));
+ y2milestone ("PBR examining script returned %1", result);
+ bootable = search(result["stdout"]:"", "stage1") != nil ? true : false;
+
+ // has_menu_lst: ?
+ // name_found: ?
+ //
+ // look for a readable menu.lst and try to extract a section
+ // name from a qualifying section
+ foreach (string f, filenames, {
+ if (name_found)
+ return;
+
+ y2debug ("Checking file %1", f);
+ string fc = (string)SCR::Read (.target.string, f);
+ if (fc == nil)
+ return;
+
+ has_menu_lst = true;
+ menu_lst = substring(f, size(tmpdir));
+ if ( substring(menu_lst, 0, 1) != "/" )
+ menu_lst = "/" + menu_lst;
+
+ 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);
+
+ // pass the menu.lst and device.map to the parser
+ map files = $[
+ "/boot/grub/menu.lst" : fc,
+ ];
+ if (dm == nil)
+ return;
+
+ files["/boot/grub/device.map"] = dm;
+
+ BootCommon::InitializeLibrary (false, "grub");
+ BootCommon::SetFilesContents (files);
+ list