Hello community,
here is the log from the commit of package perl-Bootloader
checked in at Thu Nov 6 22:25:46 CET 2008.
--------
--- perl-Bootloader/perl-Bootloader.changes 2008-10-23 17:17:01.000000000 +0200
+++ /mounts/work_src_done/STABLE/perl-Bootloader/perl-Bootloader.changes 2008-11-06 17:19:44.781740000 +0100
@@ -1,0 +2,13 @@
+Thu Nov 6 15:17:43 CET 2008 - jreidinger@suse.cz
+
+- ignore keys image, xen and initrd in chainloader section
+ (bnc #441463)
+- fix warnings (bnc #440122)
+- break attach mountpoint to grub dev if grub dev translate fail
+ (bnc #438051)
+- add blank bootloader for ignore any write (bnc #438833)
+- change /etc/mtab to /proc/mounts and allow skip (bnc #439181)
+- add autogenerate of html documentation to Makefile
+- 0.4.77
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
perl-Bootloader-0.4.76.tar.bz2
New:
----
perl-Bootloader-0.4.77.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Bootloader.spec ++++++
--- /var/tmp/diff_new_pack.Rl8174/_old 2008-11-06 22:25:33.000000000 +0100
+++ /var/tmp/diff_new_pack.Rl8174/_new 2008-11-06 22:25:33.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package perl-Bootloader (Version 0.4.76)
+# spec file for package perl-Bootloader (Version 0.4.77)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Name: perl-Bootloader
-Version: 0.4.76
+Version: 0.4.77
Release: 1
Requires: perl-base = %{perl_version}
Requires: e2fsprogs
@@ -74,6 +74,16 @@
/usr/lib/bootloader
%changelog
+* Thu Nov 06 2008 jreidinger@suse.cz
+- ignore keys image, xen and initrd in chainloader section
+ (bnc #441463)
+- fix warnings (bnc #440122)
+- break attach mountpoint to grub dev if grub dev translate fail
+ (bnc #438051)
+- add blank bootloader for ignore any write (bnc #438833)
+- change /etc/mtab to /proc/mounts and allow skip (bnc #439181)
+- add autogenerate of html documentation to Makefile
+- 0.4.77
* Thu Oct 23 2008 jreidinger@suse.cz
- improve logging library input/output
- fix bug with xen kernel in xen enviroment (bnc #436899)
@@ -322,7 +332,7 @@
yast2-bootloader is able to set the new default value properly in
case of an update (#309837)
- Version bump to 0.4.26
-* Fri Sep 14 2007 od@suse.de
+* Thu Sep 13 2007 od@suse.de
- Needed for #309837 and #304515 and others:
- Convert debug messages to milestones in GrubDev2UnixDev() and
UnixDev2GrubDev(): we always want to have logs available when
@@ -362,7 +372,7 @@
adapts YaST-like comments in existing sections to be handled
properly by yast-bootloader (#283709)
- Version bump to 0.4.21
-* Tue Aug 14 2007 od@suse.de
+* Mon Aug 13 2007 od@suse.de
- feature #302302:
- removed CreateChainloaderLine() function and call again:
- we use a "root" entry now in a configfile section
@@ -595,7 +605,7 @@
- fix for efi boot entry handling (#233537)
* Wed Jan 17 2007 jplack@suse.de
- proposed fix for append quotation in elilo (#235400)
-* Wed Jan 17 2007 jplack@suse.de
+* Tue Jan 16 2007 jplack@suse.de
- fix various zipl configuration problems (#235486)
* Thu Jan 11 2007 jplack@suse.de
- final (at least should be ) fix for ELILO (#228833)
@@ -707,7 +717,7 @@
- do not replace section names of new sections by default section
name (#190529)
- do not interpret zero integer values as null string (#190529)
-* Tue Jul 04 2006 jplack@suse.de
+* Mon Jul 03 2006 jplack@suse.de
- several 'each' iterators for global hashes not properly reset.
This broke root-on-raid1 support so far.
* Mon Jul 03 2006 jplack@suse.de
@@ -904,7 +914,7 @@
* Wed Oct 26 2005 jsrain@suse.cz
- fixed updating elilo configuration (#116739)
- do more verbose output to log when installing lilo
-* Thu Sep 29 2005 dmueller@suse.de
+* Wed Sep 28 2005 dmueller@suse.de
- add norootforbuild
* Tue Sep 27 2005 jsrain@suse.cz
- fixed quoting of options in lilo.conf (#117642)
@@ -980,7 +990,7 @@
- added s390/s390x specific part (zipl)
* Thu Feb 17 2005 jsrain@suse.cz
- avoid calling hwinfo when detecting partitioning (#50615)
-* Thu Feb 17 2005 schwab@suse.de
+* Wed Feb 16 2005 schwab@suse.de
- Don't remove BuildRoot in %%install.
* Wed Feb 16 2005 jsrain@suse.cz
- added support for embedding stage1.5 of GRUB
++++++ bootloader_entry ++++++
--- /var/tmp/diff_new_pack.Rl8174/_old 2008-11-06 22:25:33.000000000 +0100
+++ /var/tmp/diff_new_pack.Rl8174/_new 2008-11-06 22:25:33.000000000 +0100
@@ -301,10 +301,12 @@
fi
) >> $logname
-if [ `grep -c "^[^#[:space:]]\+[[:space:]]\+/boot[[:space:]]" /etc/fstab` -ne \
- `grep -c "^[^[:space:]]\+[[:space:]]\+/boot[[:space:]]" /etc/mtab` ]; then
- echo "/boot directory is not mounted";
- exit 1;
+if test ! "$PBL_SKIP_BOOT_TEST"; then
+ if test `grep -c "^[^#[:space:]]\+[[:space:]]\+/boot[[:space:]]" /etc/fstab` -ne \
+ `grep -c "^[^[:space:]]\+[[:space:]]\+/boot[[:space:]]" /proc/mounts`; then
+ echo "/boot directory is not mounted. If this is bad detection you can avoid it by 'export PBL_SKIP_BOOT_TEST=1'";
+ exit 1;
+ fi
fi
# File containing commands for later execution
++++++ perl-Bootloader-0.4.76.tar.bz2 -> perl-Bootloader-0.4.77.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Core/ELILO.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Core/ELILO.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Core/ELILO.pm 2008-10-09 15:34:21.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Core/ELILO.pm 2008-10-27 09:19:36.000000000 +0100
@@ -201,7 +201,7 @@
xen_initrd => "path:Initial RAM disk:/boot/initrd",
};
if ($arch eq "ia64") {
- $exports{"sction_options"}{"image_relocatable"} = "bool:Allow Attempt to relocate:";
+ $exports{"section_options"}{"image_relocatable"} = "bool:Allow Attempt to relocate:";
}
my $so = $exports{"section_options"};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Core/GRUB.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Core/GRUB.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Core/GRUB.pm 2008-10-23 15:26:35.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Core/GRUB.pm 2008-11-05 09:03:25.000000000 +0100
@@ -163,7 +163,7 @@
# /dev/sda9 /dev/sda 9 258 Apple_HFS `primary 0 18237
#
- # boot from any primary partition with PReP or FAT partition id
+ # boot from any bootable primary partition which doesn't have xfs (small size of boot sector)
my $boot_partitions = join(":",
map {
my ($device, $disk, $nr, $fsid, $fstype,
@@ -174,7 +174,7 @@
);
# give a list of possible root devices: all MD devices
- # and all 'Linux' devices above 20 cylinders
+ # and all 'Linux' devices above 20 cylinders and not swap
my $root_devices = join(":",
(map {
my ($device, $disk, $nr, $fsid, $fstype,
@@ -197,10 +197,10 @@
} @partinfo
);
- # FIXME: does it make sense to distinguish between x86_64 and x86?
+ # does it make sense to distinguish between x86_64 and x86?
+ #jreidinger: no, it only is here to uniform with ppc where it is reasonable
$exports{"arch"} = "x86";
$exports{"global_options"} = {
- # for iseries list for others exactly one allowed
boot => "multi:Boot Loader Locations:",
activate => "bool:Set active Flag in Partition Table for Boot Partition:true",
timeout => "int:Timeout in Seconds:8:0:3600",
@@ -233,8 +233,6 @@
debug => "bool:Debugging flag:false"
};
- my $go = $exports{"global_options"};
-
$exports{"section_options"} = {
type_image => "bool:Image section",
# image_name => "string:Name of section", # implicit
@@ -266,13 +264,11 @@
menu_configfile => "path:Menu description file:/boot/grub/menu.lst"
};
- # my $so = $exports{"section_options"};
- # add architecture specific section_options here in case
-
$loader->{"exports"}=\%exports;
return \%exports;
}
+# Internal metadata only for checking of valid values, doesn't affect any yast
sub GetOptions{
my $loader = shift;
@@ -330,6 +326,10 @@
};
$loader->{"options"}=\%options;
}
+
+#end of internal metadata
+
+
=item
C<< $obj_ref = Bootloader::Core::GRUB->new (); >>
@@ -344,9 +344,7 @@
my $loader = $self->SUPER::new ($old);
bless ($loader);
- # FIXME: Add an 'init-only' parameter to GetMetaData if
- # perfomance goes down
- $loader->GetMetaData();
+ $loader->GetMetaData(); #FIXME this is not need but need test before remove
$loader->GetOptions();
$loader->l_milestone ("GRUB::new: Created GRUB instance");
return $loader;
@@ -386,57 +384,11 @@
}
=item
-C<< $unix_dev = Bootloader::Core::GRUB->UnixFile2UnixDev ($unix_file); >>
-
-Detects the underlying partition (e.g. '/dev/sda1') a given UNIX file
-(e.g. '/boot') is located on. Takes a UNIX file as argument and returns
-the corresponding UNIX device.
-
-=cut
-
-# string UnixFile2UnixDev (string unix_file)
-sub UnixFile2UnixDev {
- my $self = shift;
- my $unix_file = shift;
- my $unix_dev = "";
-
- # Collect information about device using "stat"
- my ($temp_unix_dev, undef, undef, undef, undef, undef, undef, undef,
- undef, undef, undef, undef, undef)
- = stat ($unix_file);
-
- # Open "/proc/partitions" to look up the partition corresponding to
- # major and minor device numbers
- open (PARTITIONS, "GrubDev2UnixDev ($grub_dev); >>
Translates the GRUB device (eg. '(hd0,0)') to UNIX device (eg. '/dev/hda1').
-As argument takes the GRUB device, returns the UNIX device (both strings).
+As argument takes the GRUB device, returns the UNIX device (both strings)
+or argument if translate fail.
=cut
@@ -446,11 +398,11 @@
my $dev = shift;
unless ($dev) {
- $self->l_milestone ("GRUB::GrubDev2UnixDev: Empty device to translate");
+ $self->l_error ("GRUB::GrubDev2UnixDev: Empty device to translate");
return $dev;
}
if ($dev !~ /^\(.*\)$/) {
- $self->l_milestone ("GRUB::GrubDev2UnixDev: Not translating device $dev");
+ $self->l_warning ("GRUB::GrubDev2UnixDev: Not translating device $dev");
return $dev;
}
@@ -477,6 +429,7 @@
$match_found = 1;
}
}
+
if ($match_found == 0) {
$self->l_error ("GRUB::GrubDev2UnixDev: did not find a match for $dev in the device map");
return $original;
@@ -501,7 +454,7 @@
}
}
#no partition found so return $dev with partition
- $self->l_milestone ("GRUB::GrubDev2UnixDev: No partition found for $dev with $partition.");
+ $self->l_warning ("GRUB::GrubDev2UnixDev: No partition found for $dev with $partition.");
return $dev.$partition;
}
@@ -530,12 +483,12 @@
my $dev = shift;
unless (defined($dev) and $dev) {
- $self->l_milestone ("GRUB::UnixDev2GrubDev: Empty device to translate");
+ $self->l_error ("GRUB::UnixDev2GrubDev: Empty device to translate");
return ""; # return an error
}
# Seems to be a grub device already
if ($dev =~ /^\(${grubdev_pattern}\)$/) {
- $self->l_milestone ("GRUB::UnixDev2GrubDev: Not translating device $dev");
+ $self->l_warning ("GRUB::UnixDev2GrubDev: Not translating device $dev");
return $dev;
}
@@ -602,7 +555,7 @@
# print all entries of device.map. This is rather for debugging
if (exists $self->{"device_map"}) {
- $self->l_milestone ("GRUB::GrubDev2UnixDev: device_map: ".$self->{"device_map"});
+ $self->l_milestone ("GRUB::UnixDev2UnixDev: device_map: ".$self->{"device_map"});
$self->l_milestone ("GRUB::UnixDev2GrubDev: Read from internal structure device_map:");
while ((my $unix_dev, my $grub_dev) = each (%{$self->{"device_map"}})) {
@@ -610,7 +563,7 @@
}
}
else {
- $self->l_milestone ("GRUB::UnixDev2GrubDev: Internal structure device_map doesn't exist.");
+ $self->l_warning ("GRUB::UnixDev2GrubDev: Internal structure device_map doesn't exist.");
}
$self->l_milestone ("GRUB::UnixDev2GrubDev: Translated UNIX device/partition -> GRUB device: $original to $dev");
@@ -622,13 +575,16 @@
if ($dev !~ /^${grubdev_pattern}$/) {
$dev = "hd0";
- $self->l_milestone ("GRUB::UnixDev2GrubDev: Unknown device '$original', fall back to ($dev)");
+ $self->l_warning ("GRUB::UnixDev2GrubDev: Unknown device '$original', fall back to ($dev)");
}
$dev = defined ($partition)
? "($dev,$partition)"
: "($dev,$partition_fallback)";
+ $self->l_warning("GRUB::UnixDev2GrubDev: Unknown partition, fallback to first")
+ unless (defined ($partition));
+
$self->l_milestone ("GRUB::UnixDev2GrubDev: Translated UNIX->GRUB: $original to $dev");
return $dev;
@@ -1816,7 +1772,7 @@
}
# keep a hard order for the following three entries
- if (exists $sectinfo{"xen"}) {
+ if (exists $sectinfo{"xen"} && $type eq "xen") {
my $value = $self->UnixPath2GrubPath ($sectinfo{"xen"}, $grub_root)
. " " . ($sectinfo{"xen_append"} || "");
my $pcr = $sectinfo{"xenpcr"} || "";
@@ -1827,7 +1783,7 @@
"value" => $value,
};
}
- if (exists $sectinfo{"image"}) {
+ if (exists $sectinfo{"image"} && $type ne "other") {
my $val = $self->CreateKernelLine (\%sectinfo, $grub_root);
my $key = "kernel";
if ($type eq "xen")
@@ -1846,7 +1802,7 @@
"value" => $val,
};
}
- if (exists $sectinfo{"initrd"}) {
+ if (exists $sectinfo{"initrd"} && $type ne "other") {
my $value = $self->UnixPath2GrubPath ($sectinfo{"initrd"}, $grub_root);
my $pcr = $sectinfo{"initrdpcr"} || "";
$pcr = "--pcr=$pcr " if $pcr ne "";
@@ -2266,6 +2222,9 @@
my $grub_dev = shift;
my @devices = ();
my $device = $self->GrubDev2UnixDev($grub_dev);
+
+ return $grub_dev if ($grub_dev eq $device); #immediatelly return if GrubDev2UnixDev fail
+
$self->l_milestone ("GRUB::GrubDev2MountPoint : device: $device");
# MD-RAID handling: find the corresponding /dev/mdX if any.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Core/NONE.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Core/NONE.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Core/NONE.pm 1970-01-01 01:00:00.000000000 +0100
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Core/NONE.pm 2008-11-04 18:28:50.000000000 +0100
@@ -0,0 +1,169 @@
+#! /usr/bin/perl -w
+#
+# Bootloader configuration base library
+#
+
+=head1 NAME
+
+Bootlader::Core::NONE - library for blank configuration
+
+
+=head1 PREFACE
+
+This package is the NONE library of the bootloader configuration
+
+=head1 SYNOPSIS
+
+use Bootloader::Core::NONE;
+
+C<< $obj_ref = Bootloader::Core::NONE->new (); >>
+
+C<< $files_ref = Bootloader::Core::NONE->ListFiles (); >>
+
+C<< $status = Bootloader::Core::NONE->ParseLines (\%files, $avoid_reading_device_map); >>
+
+C<< $files_ref = Bootloader::Core::NONE->CreateLines (); >>
+
+C<< $settings_ref = Bootloader::Core::NONE->GetSettings (); >>
+
+C<< $status = Bootloader::Core::NONE->SetSettings (\%settings); >>
+
+C<< $status = Bootloader::Core::NONE->InitializeBootloader (); >>
+
+
+=head1 DESCRIPTION
+
+=over 2
+
+=cut
+
+
+package Bootloader::Core::NONE;
+
+use strict;
+
+use Bootloader::Core;
+our @ISA = ('Bootloader::Core');
+use Bootloader::Path;
+
+#module interface
+
+sub GetMetaData() {
+ my $loader = shift;
+
+ my %exports;
+
+ $exports{"global_options"} = {};
+
+ $exports{"section_options"} = {};
+
+ $loader->{"exports"}=\%exports;
+ return \%exports;
+}
+
+=item
+C<< $obj_ref = Bootloader::Core::NONE->new (); >>
+
+Creates an instance of the Bootloader::Core::NONE class.
+
+=cut
+
+sub new {
+ my $self = shift;
+ my $old = shift;
+
+ my $loader = $self->SUPER::new ($old);
+ bless ($loader);
+
+ $loader->l_milestone ("NONE::new: Created NONE instance");
+ return $loader;
+}
+
+=item
+C<< $files_ref = Bootloader::Core::NONE->ListFiles (); >>
+
+Returns the list of the configuration files of the bootloader
+
+=cut
+
+# list<string> ListFiles ()
+sub ListFiles {
+ return [];
+}
+
+=item
+C<< $status = Bootloader::Core::NONE->ParseLines (\%files, $avoid_reading_device_map); >>
+
+Simulate parsing lines. Do nothing. Return non-zero for success.
+
+=cut
+
+# void ParseLines (map, boolean)
+sub ParseLines {
+ return 1;
+}
+
+
+=item
+C<< $files_ref = Bootloader::Core::NONE->CreateLines (); >>
+
+Simulate creating lines and return empty lines hash structure.
+
+=cut
+
+# map CreateLines ()
+sub CreateLines {
+ return { };
+}
+
+=item
+C<< $settings_ref = Bootloader::Core::NONE->GetSettings (); >>
+
+returns the complete settings in a hash. Does not read the settings
+from the system, but returns internal structures.
+
+=cut
+
+# map GetSettings ()
+sub GetSettings {
+ my $self = shift;
+
+ my $ret = $self->SUPER::GetSettings ();
+ return $ret;
+}
+
+=item
+C<< $status = Bootloader::Core::NONE->SetSettings (\%settings); >>
+
+Do nothing, as none bootloader cannot change internal settings.
+
+=cut
+
+# void SetSettings (map settings)
+sub SetSettings {
+ my $self = shift;
+ return 1;
+}
+
+=item
+C<< $status = Bootloader::Core::NONE->InitializeBootloader (); >>
+
+Simulate initializing bootloader. Allways success.
+
+=cut
+
+# boolean InitializeBootloader ()
+sub InitializeBootloader {
+ my $self = shift;
+ return 1;
+}
+1;
+
+#
+# Local variables:
+# mode: perl
+# mode: font-lock
+# mode: auto-fill
+# fill-column: 78
+# End:
+#
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Core/PowerLILO.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Core/PowerLILO.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Core/PowerLILO.pm 2008-09-23 13:04:17.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Core/PowerLILO.pm 2008-11-06 15:07:56.000000000 +0100
@@ -597,7 +597,8 @@
delete ($sectinfo{"name"});
}
elsif (!exists $so->{$type . "_" . $key}) {
- # only accept known section options :-)
+ $self->l_milestone (
+ "PowerLILO::Info2Section: Ignoring key '$key' for section type '$type'");
next;
}
else
@@ -645,7 +646,8 @@
}
elsif (! exists ($so->{$type . "_" . $key}))
{
- # only accept known section options :-)
+ $self->l_milestone (
+ "PowerLILO::Info2Section: Ignoring key '$key' for section type '$type'");
next;
}
else
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Core.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Core.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Core.pm 2008-10-23 15:26:35.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Core.pm 2008-11-05 11:49:50.000000000 +0100
@@ -1849,16 +1849,16 @@
{
foreach my $section (@{$settings{$key}})
{
- $self->l_milestone ("Core::SetSettings: store: $key:" . join( " - ", %{$section}));
+ $self->l_milestone ("Core::SetSettings: store: $key:" . join( " - ", %{$section})||"");
}
}
elsif ($key eq "global" or $key eq "device_map")
{
- $self->l_milestone ("Core::SetSettings: store: $key:" . join( ",", %{$settings{$key}}));
+ $self->l_milestone ("Core::SetSettings: store: $key:" . join( ",", %{$settings{$key}}) || "");
}
else
{
- $self->l_milestone ("Core::SetSettings: store: $key:" . join( ",", $settings{$key}));
+ $self->l_milestone ("Core::SetSettings: store: $key:" . join( ",", $settings{$key})||"");
}
}
}
@@ -2005,7 +2005,7 @@
{
$ret = $self->CanonicalPath($filename);
}
- $self->l_debug ("Core::RealFileName: Filename $filename after resolving symlinks: $ret");
+ $self->l_milestone ("Core::RealFileName: Filename $filename after resolving symlinks: $ret");
return $ret;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Library.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Library.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Library.pm 2008-09-30 12:02:49.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Library.pm 2008-11-04 18:16:46.000000000 +0100
@@ -91,6 +91,7 @@
use Bootloader::Core::ELILO;
use Bootloader::Core::ZIPL;
use Bootloader::Core::PowerLILO;
+use Bootloader::Core::NONE;
=item
C<< $obj_ref = Bootloader::Library->new (); >>
@@ -156,11 +157,14 @@
{
$loader = Bootloader::Core::PowerLILO->new ($loader);
}
+ elsif ($bootloader eq "none")
+ {
+ $loader = Bootloader::Core::NONE->new ($loader);
+ }
else
{
- # FIXME: handle case 'none'
- $loader = Bootloader::Core->new ($loader);
- $loader->l_error ("Bootloader::Library::SetLoaderType: Initializing for unknown bootloader $bootloader");
+ $loader = Bootloader::Core::NONE->new ($loader);
+ $loader->l_error ("Bootloader::Library::SetLoaderType: Initializing for unknown bootloader $bootloader, fallback to none");
}
$self->{"loader"} = $loader;
@@ -867,30 +871,6 @@
}
=item
-C<< $grub_dev = Bootloader::Library->UnixFile2GrubDev ($unix_file); >>
-
-Detects the underlying partition (e.g. '/dev/sda1') a given UNIX file
-(e.g. '/boot') is located on and translates it to the corresponding GRUB
-device (e.g. '(hd0,0)'). Takes a UNIX file as argument and returns the
-corresponding GRUB device.
-
-=cut
-
-# string UnixFile2GrubDev (string unix_file)
-sub UnixFile2GrubDev {
- my $self = shift;
- my $unix_file = shift;
- my $loader = $self->{loader} || return undef;
-
- $loader->l_milestone( "Library::UnixFile2GrubDev unix_file: $unix_file" );
-
- my $unix_dev = $loader->UnixFile2UnixDev ($unix_file);
- my $grub_dev = $loader->UnixDev2GrubDev ($unix_dev);
-
- return $grub_dev;
-}
-
-=item
C<< $unix_dev = Bootloader::Core::GRUB->GrubDev2UnixDev ($grub_dev); >>
Translates the GRUB device (eg. '(hd0,0)') to UNIX device (eg. '/dev/hda1').
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/MBRTools.pm new/perl-Bootloader-0.4.77/lib/Bootloader/MBRTools.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/MBRTools.pm 2008-09-19 15:43:23.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/MBRTools.pm 2008-11-04 19:46:41.000000000 +0100
@@ -10,7 +10,8 @@
=head1 PREFACE
-This package contains a set of low-level functions for mbr manipulation
+This package contains a set of low-level functions for mbr manipulation.
+Now it is only for testing purpose. Don't use it.
=head1 SYNOPSIS
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Path.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Path.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Path.pm 2008-07-25 18:00:41.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Path.pm 2008-11-04 19:32:28.000000000 +0100
@@ -4,87 +4,253 @@
# $PERL_BOOTLOADER_TESTSUITE_PATH
#
+=head1 NAME
+
+Bootloader::Path - abstraction of path constants
+
+
+=head1 PREFACE
+
+This package provides path for configuration files. It is used to enable testing on created chroot.
+It is used only for internal purpose.
+
+=head1 SYNOPSIS
+
+
+C<< use Bootloader::Path; >>
+
+C<< $path = Bootloader::Path::Prefix ($path); >>
+
+C<< $path = Bootloader::Path::Logname(); >>
+
+C<< $path = Bootloader::Path::Fstab(); >>
+
+C<< $path = Bootloader::Path::Blkid(); >>
+
+C<< $path = Bootloader::Path::Sysconfig(); >>
+
+C<< $path = Bootloader::Path::Grub_menulst(); >>
+
+C<< $path = Bootloader::Path::Grub_devicemap(); >>
+
+C<< $path = Bootloader::Path::Grub_grubconf(); >>
+
+C<< $path = Bootloader::Path::Grub_grub(); >>
+
+C<< $path = Bootloader::Path::Elilo_conf(); >>
+
+C<< $path = Bootloader::Path::Elilo_efi(); >>
+
+C<< $path = Bootloader::Path::Elilo_elilo(); >>
+
+C<< $path = Bootloader::Path::Lilo_lilo(); >>
+
+C<< $path = Bootloader::Path::Lilo_conf(); >>
+
+C<< $path = Bootloader::Path::Zipl_conf(); >>
+
+C<< $path = Bootloader::Path::Zipl_zipl(); >>
+
+=head1 DESCRIPTION
+
+=over 2
+
+=cut
package Bootloader::Path;
use strict;
+=item
+C<< $path = Bootloader::Path::Prefix ($); >>
+
+Add to absolute path prefix. Only internal function.
+Allways retuns correct value.
+
+=cut
+
sub Prefix {
my $value = shift;
return $ENV{PERL_BOOTLOADER_TESTSUITE_PATH} . $value if (defined($ENV{PERL_BOOTLOADER_TESTSUITE_PATH}));
return $value;
}
+=item
+C<< $path = Bootloader::Path::Logname(); >>
+
+Gets logname path.
+
+=cut
+
sub Logname {
my $value = "/var/log/YaST2/perl-BL-standalone-log";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Fstab(); >>
+
+Gets fstab path.
+
+=cut
+
sub Fstab {
my $value = "/etc/fstab";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Blkid(); >>
+
+Gets path for utility blkid.
+
+=cut
+
sub Blkid {
my $value = "/sbin/blkid";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Sysconfig(); >>
+
+Gets path for bootloader sysconfig.
+
+=cut
+
sub Sysconfig {
my $value = "/etc/sysconfig/bootloader";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Grub_menulst(); >>
+
+Gets path for grub configuration file menu.lst.
+
+=cut
+
sub Grub_menulst {
my $value = "/boot/grub/menu.lst";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Grub_devicemap(); >>
+
+Gets path for grub configuration file device.map.
+
+=cut
+
sub Grub_devicemap {
my $value = "/boot/grub/device.map";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Grub_grubconf(); >>
+
+Gets path for grub configuration file grub.conf
+(this file contains commands for initialize bootloader).
+
+=cut
+
sub Grub_grubconf {
my $value = "/etc/grub.conf";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Grub_grub(); >>
+
+Gets path for grub binary
+
+=cut
+
sub Grub_grub {
my $value = "/usr/sbin/grub";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Elilo_conf(); >>
+
+Gets path of elilo configuration file.
+
+=cut
+
sub Elilo_conf {
my $value = "/etc/elilo.conf";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Elilo_efi(); >>
+
+Gets path to efi directory.
+
+=cut
+
sub Elilo_efi {
my $value = "/boot/efi/efi/SuSE";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Elilo_elilo(); >>
+
+Gets path to elilo binary.
+
+=cut
+
sub Elilo_elilo {
my $value = "/sbin/elilo";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Lilo_lilo(); >>
+
+Gets path to lilo(or powerlilo) binary.
+
+=cut
+
sub Lilo_lilo {
my $value = "/sbin/lilo";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Lilo_conf(); >>
+
+Gets path to lilo(or powerlilo) configuration file.
+
+=cut
+
sub Lilo_conf {
my $value = "/etc/lilo.conf";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Zipl_conf(); >>
+
+Gets path to zipl configuration file.
+
+=cut
+
sub Zipl_conf {
my $value = "/etc/zipl.conf";
return Prefix($value);
}
+=item
+C<< $path = Bootloader::Path::Zipl_zipl(); >>
+
+Gets path to zipl binary.
+
+=cut
+
sub Zipl_zipl {
my $value = "/sbin/zipl";
return Prefix($value);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.76/lib/Bootloader/Tools.pm new/perl-Bootloader-0.4.77/lib/Bootloader/Tools.pm
--- old/perl-Bootloader-0.4.76/lib/Bootloader/Tools.pm 2008-10-09 10:39:18.000000000 +0200
+++ new/perl-Bootloader-0.4.77/lib/Bootloader/Tools.pm 2008-11-06 17:19:13.000000000 +0100
@@ -109,13 +109,13 @@
sub DumpLog {
my $core_lib = shift;
- my $perl_logfile = Bootloader::Path::Logname();
my $using_logfile = 1;
+ my $logname = Bootloader::Path::Logname();
- if (not open LOGFILE, ">>$perl_logfile") {
+ if (not open LOGFILE, ">>$logname") {
$using_logfile = 0;
open LOGFILE, ">&STDERR" or die "Can't dup STDERR: $!";
- print LOGFILE ("WARNING: Can't open $perl_logfile, using STDERR instead.\n");
+ print LOGFILE ("WARNING: Can't open $logname, using STDERR instead.\n");
}
# Adding timestamp to log messages
@@ -286,8 +286,12 @@
sub ReadPartitions {
my $sb = "/sys/block";
my $mounted = undef;
+ my $logname = Bootloader::Path::Logname();
unless (-e $sb) {
$mounted = `mount /sys`;
+ open (LOG, ">>$logname");
+ print LOG ("Mount /sys\n");
+ close LOG;
}
opendir(BLOCK_DEVICES, "$sb") ||
die ("ReadPartitions(): Failed to open dir $sb");
@@ -298,6 +302,10 @@
} readdir(BLOCK_DEVICES);
closedir BLOCK_DEVICES;
+ open (LOG, ">>$logname");
+ print LOG ("Finded disks: ". join (",",@disks)||"");
+ close LOG;
+
# get partition info for all partitions on all @disks
my @devices = ();
@@ -363,11 +371,19 @@
} readdir (BLOCK_DEVICES);
closedir BLOCK_DEVICES;
+ open (LOG, ">>$logname");
+ print LOG ("Finded parts: ". join (",",@parts)||"");
+ close LOG;
+
# generate proper device names and other info for all @part[ition]s
foreach my $part (@parts)
{
chomp ($part);
$part = Udev2Dev ("$disk/$part");
+ open (LOG, ">>$logname");
+ print LOG ("Processing part: ". join (",",$part)||"");
+ close LOG;
+
my $index = substr ($part, length ($dev_disk));
while (length ($index) > 0 && substr ($index, 0, 1) !~ /[0-9]/)
{
@@ -1128,33 +1144,6 @@
my $core_lib = $lib_ref->{"loader"};
-# FIXME: Maybe activate this part of code later if - against all expectations
-# - still needed, but this shouldn't happen.
- # Examines if image and initrd strings already contain a grub device
- # prefix. If it is not the case, attach it.
-=cut
- if ($loader eq "grub") {
- foreach my $key (sort keys %option) {
- unless ($option{$key} =~ /^\(hd\d+,\d+\).*$/) {
- # In case /boot is resided on an own partition, the function
- # UnixPath2GrubPath (in GRUB.pm) doesn't substitute "/boot"
- # with the corresponding grub device, but keeps it.
- #
- # So the image, kernel and initrd values in the @sections
- # array don't contain such a grub device prefix. Thus, to
- # match sections to be deleted, a grub device prefix must not
- # be attached to the given @option elements.
- if ($lib_ref->UnixFile2GrubDev ("/boot") eq $lib_ref->UnixFile2GrubDev ("/")){
- if ($key eq "image" || $key eq "initrd" || $key eq "kernel") {
- my $grub_dev = $lib_ref->UnixFile2GrubDev ("/boot");
- $option{$key} = $grub_dev . $option{$key};
- }
- }
- }
- }
- }
-=cut
-
normalize_options(\%option);
my @sections = @{$lib_ref->GetSections ()};
@@ -1385,80 +1374,6 @@
$boot_mp = $v if ($k eq "/boot");
}
- # Resolve kernel symlinks (if available) to full names
- my $link_target = '';
- foreach my $s (@sections) {
- while ((my $k, my $v) = each (%$s)) {
- if ($k eq "initrd" || $k eq "image" || $k eq "kernel") {
- # Check if $v has a grub device prefix
- if (($v =~ s#\/.*$##) && $v ne '') {
- my $unix_dev = $lib_ref->GrubDev2UnixDev($v);
-
- $valid_part = 1;
- unless ($unix_dev eq $root_mp || $unix_dev eq $boot_mp) {
- $valid_part = 0;
- }
- }
- }
-
- if (($k eq "kernel" || $k eq "image" || $k eq "initrd") && $valid_part) {
- if ($link_target = readlink ($v)) {
- chomp ($link_target);
- $s->{$k} = "/boot/" . $link_target;
- }
- }
-
- if (($k eq "__lines") && $valid_part) {
- my $index = 0;
-
- # Print the whole __lines structure
- # Comment out this area for debug purposes
- #foreach my $elem (@$v) {
- # print ("__lines contains: $elem\n");
- # while ((my $k, my $v) = each (%$elem)) {
- # print ("key = $k,\tvalue = $v\n");
- # }
- # print ("\n");
- #}
-
- foreach my $lineref (@$v) {
- # Search in lines cache for possible kernel symlinks
- # and resolve them if found
- if ($lineref->{"key"} eq "kernel") {
- my $kernel_symlink = (split (/ /, $lineref->{"value"}))[0];
- if ($link_target = readlink ($kernel_symlink)
- and $kernel_symlink =~ m/\/vmlinu[xz]$/) { #change only default symlink, not user created
- chomp ($link_target);
-
- # Create the new kernel line with long (resolved)
- # kernel filename
- my $kernel_line = $s->{"__lines"}[$index]->{"value"};
- $kernel_line =~ s/(^\S*)vmlinu[xz](\s*)/$1$link_target$2/;
- $s->{"__lines"}[$index]->{"value"} = $kernel_line;
- }
- }
-
- # Search in lines cache for possible kernel symlinks
- # and resolve them if found
- if ($lineref->{"key"} eq "initrd") {
- my $initrd_symlink = (split (/ /, $lineref->{"value"}))[0];
- if ($link_target = readlink ($initrd_symlink)
- and $initrd_symlink =~ m/\/initrd$/) {
- chomp ($link_target);
-
- # Create the new initrd line with long (resolved)
- # initrd filename
- my $initrd_line = $s->{"__lines"}[$index]->{"value"};
- $initrd_line =~ s/(^\S*)initrd(\s*)/$1$link_target$2/;
- $s->{"__lines"}[$index]->{"value"} = $initrd_line;
- }
- }
- $index += 1;
- }
- }
- }
- }
-
# Switch the first 2 entries in @sections array to put the normal entry on
# top of corresponding failsafe entry
if (($failsafe_modified == 1) && scalar (@sections) >= 2) {
@@ -1592,35 +1507,7 @@
my $default_section = $glob_ref->{"default"} || "";
my $default_removed = 0;
-# FIXME: Maybe activate this part of code later if - against all expectations
-# - still needed, but this shouldn't happen.
my $loader = GetBootloader ();
- # Examines if image and initrd strings already contain a grub device
- # prefix. If it is not the case, attach it.
-=cut
- if ($loader eq "grub") {
- foreach my $key (sort keys %option) {
- unless ($option{$key} =~ /^\(hd\d+,\d+\).*$/) {
- print ("(hdx,y) not detected, key = $key,\tval = $option{$key}\n");
- # In case /boot is resided on an own partition, the function
- # UnixPath2GrubPath (in GRUB.pm) doesn't substitute "/boot"
- # with the corresponding grub device, but keeps it.
- #
- # So the image, kernel and initrd values in the @sections
- # array don't contain such a grub device prefix. Thus, to
- # match sections to be deleted, a grub device prefix must not
- # be attached to the given @option elements.
- if ($lib_ref->UnixFile2GrubDev ("/boot") eq $lib_ref->UnixFile2GrubDev ("/")){
- print("equal\n");
- if ($key eq "image" || $key eq "initrd" || $key eq "kernel") {
- my $grub_dev = $lib_ref->UnixFile2GrubDev ("/boot");
- $option{$key} = $grub_dev . $option{$key};
- }
- }
- }
- }
- }
-=cut
my $core_lib = $lib_ref->{"loader"};
++++++ update-bootloader ++++++
--- /var/tmp/diff_new_pack.Rl8174/_old 2008-11-06 22:25:33.000000000 +0100
+++ /var/tmp/diff_new_pack.Rl8174/_new 2008-11-06 22:25:33.000000000 +0100
@@ -390,6 +390,9 @@
if (not $opt_force) {
pod2usage("There are already sections with image '$opt_image'");
}
+ open (LOG, ">>$logname");
+ print LOG ("update-bootloader: section already exist. Skip add.\n");
+ close LOG;
} else {
# If, if option $opt_force_default is set, let this new kernel be
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org