Hello community, here is the log from the commit of package perl-Bootloader checked in at Fri Aug 22 01:53:52 CEST 2008. -------- --- perl-Bootloader/perl-Bootloader.changes 2008-08-15 15:15:11.000000000 +0200 +++ perl-Bootloader/perl-Bootloader.changes 2008-08-21 15:59:29.531066000 +0200 @@ -1,0 +2,12 @@ +Thu Aug 21 15:51:15 CEST 2008 - jreidinger@suse.cz + +- add support for trusted grub +- add support for reading console a trusted grub params from + sysconfig (except measures) +- split metadata and internal information about possible keys in + local/global sections +- fix duplicating configfile line (bnc #389891) +- fix selecting failsafe as default (bnc #413280) +- 0.4.69 + +------------------------------------------------------------------- Old: ---- perl-Bootloader-0.4.68.tar.bz2 New: ---- perl-Bootloader-0.4.69.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Bootloader.spec ++++++ --- /var/tmp/diff_new_pack.Z22553/_old 2008-08-22 01:50:36.000000000 +0200 +++ /var/tmp/diff_new_pack.Z22553/_new 2008-08-22 01:50:36.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package perl-Bootloader (Version 0.4.68) +# spec file for package perl-Bootloader (Version 0.4.69) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,7 +19,7 @@ Name: perl-Bootloader -Version: 0.4.68 +Version: 0.4.69 Release: 1 Requires: perl-base = %{perl_version} Requires: e2fsprogs @@ -74,6 +74,15 @@ /usr/lib/bootloader %changelog +* Thu Aug 21 2008 jreidinger@suse.cz +- add support for trusted grub +- add support for reading console a trusted grub params from + sysconfig (except measures) +- split metadata and internal information about possible keys in + local/global sections +- fix duplicating configfile line (bnc #389891) +- fix selecting failsafe as default (bnc #413280) +- 0.4.69 * Fri Aug 15 2008 jreidinger@suse.cz - added testsuite - now contains reading config files for grub, elilo and powerlilo (fate #303444) ++++++ perl-Bootloader-0.4.68.tar.bz2 -> perl-Bootloader-0.4.69.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.68/lib/Bootloader/Core/GRUB.pm new/perl-Bootloader-0.4.69/lib/Bootloader/Core/GRUB.pm --- old/perl-Bootloader-0.4.68/lib/Bootloader/Core/GRUB.pm 2008-08-15 15:00:00.000000000 +0200 +++ new/perl-Bootloader-0.4.69/lib/Bootloader/Core/GRUB.pm 2008-08-21 15:38:37.000000000 +0200 @@ -271,7 +271,62 @@ return \%exports; } - +sub GetOptions{ + my $loader = shift; + + my %options; + $options{"global_options"} = { + boot => "", + activate => "bool", + timeout => "", + default => "", + former_default_image_flavor => "", + generic_mbr => "bool", + boot_custom => "", + boot_mbr => "bool", + boot_root => "bool", + boot_boot => "bool", + boot_extended => "bool", + serial => "", + terminal => "", + fallback => "", + hiddenmenu => "bool", + gfxmenu => "path", + password => "", + debug => "bool", + configfile => "path" + }; + + $options{"section_options"} = { + image_name => "", + image_image => "path", + image_root => "", + image_vgamode => "", + image_append => "", + image_initrd => "path", + image_noverifyroot=> "bool", + image_measure => "", #special, not path due to pcr + + other_lock => "bool", + other_chainloader => "", + other_noverifyroot=> "bool", + other_makeactive => "bool", + other_blockoffset => "", + other_measure => "", #special, not path due to pcr + + xen_xen => "", + xen_xen_append => "", + xen_image => "path", + xen_root => "", + xen_vgamode => "", + xen_append => "", + xen_initrd => "path", + + menu_root => "", + menu_configfile => "path" + }; + $loader->{"options"}=\%options; +} =item C<< $obj_ref = Bootloader::Core::GRUB->new (); >> @@ -289,6 +344,7 @@ # FIXME: Add an 'init-only' parameter to GetMetaData if # perfomance goes down $loader->GetMetaData(); + $loader->GetOptions(); $loader->l_milestone ("GRUB::new: Created GRUB instance"); return $loader; } @@ -1205,8 +1261,14 @@ } elsif ($key eq "image") { + #first must be remove of pcr, because pcr can be before image + if ($val =~ /^(?:(.*)\s+)?--pcr=(\d+)(?:\s+(.*))?$/) + { + $ret{"imagepcr"} = $2 if $2 ne ""; + $val = $self->MergeIfDefined ($1, $3); + } # split into loader and parameter, note that the regex does - # always match, then split out root= vgamode= and append= values + # always match, then split out root= vgamode=,console=, --pcr and append= values $val =~ /^\s*(\S+)(?:\s+(.*))?$/; $ret{"image"} = $self->GrubPath2UnixPath ($1, $grub_root); @@ -1251,6 +1313,11 @@ } elsif ($key eq "xen") { + if ($val =~ /^(?:(.*)\s+)?--pcr=(\d+)(?:\s+(.*))?$/) + { + $ret{"xenpcr"} = $2 if $2 ne ""; + $val = $self->MergeIfDefined ($1, $3); + } # split into loader and parameter, note that the regex does # always match $val =~ /^\s*(\S+)(?:\s+(.*))?$/; @@ -1258,12 +1325,26 @@ $ret{"xen"} = $self->GrubPath2UnixPath ($1, $grub_root); $ret{"xen_append"} = $2 if defined $2; } - elsif ($key eq "initrd" || $key eq "wildcard" || $key eq "configfile") + elsif ($key eq "initrd") + { + if ($val =~ /^(?:(.*)\s+)?--pcr=(\d+)(?:\s+(.*))?$/) + { + $ret{"initrdpcr"} = $2 if $2 ne ""; + $val = $self->MergeIfDefined ($1, $3); + } + $ret{"initrd"} = $self->GrubPath2UnixPath ($val, $grub_root); + } + elsif ($key eq "wildcard" || $key eq "configfile") { $ret{$key} = $self->GrubPath2UnixPath ($val, $grub_root); } elsif ($key eq "chainloader") { + if ($val =~ /^(?:(.*)\s+)?--pcr=(\d+)(?:\s+(.*))?$/) + { + $ret{"chainloaderpcr"} = $2 if $2 ne ""; + $val = $self->MergeIfDefined ($1, $3); + } if ($val =~ /^(.*)\+(\d+)/) { $val = $1; @@ -1289,6 +1370,20 @@ { $ret{"makeactive"} = "true"; } + elsif ($key eq "measure") + { + my @parts = split(" ",$val); + $parts[0] = $self->GrubPath2UnixPath($parts[0]); + + if (exists $ret{"measure"}){ + push @{$ret{"measure"}}, $parts[0]." ".$parts[1]; + } + else + { + my @measure_array = ( $parts[0]." ".$parts[1] ); + $ret{'measure'} = \@measure_array; + } + } } $ret{"__lines"} = \@lines; @@ -1352,17 +1447,19 @@ my $sectinfo_ref = shift; my $grub_root = shift || ""; + my $pcr = $sectinfo_ref->{"imagepcr"} || ""; my $root = $sectinfo_ref->{"root"} || ""; my $vga = $sectinfo_ref->{"vgamode"} || ""; my $append = $sectinfo_ref->{"append"} || ""; my $image = $sectinfo_ref->{"image"} || ""; my $console = $sectinfo_ref->{"console"} || ""; + $pcr = "--pcr=$pcr " if $pcr ne ""; $root = " root=$root" if $root ne ""; $vga = " vga=$vga" if $vga ne ""; $append = " $append" if $append ne ""; $console = " console=$console" if $console ne ""; $image = $self->UnixPath2GrubPath ($image, $grub_root); - return "$image$root$append$vga$console"; + return "$pcr$image$root$append$vga$console"; } =item @@ -1382,26 +1479,32 @@ my $sectinfo_ref = shift; my $grub_root = shift || ""; - my $sectors = $sectinfo_ref->{"blockoffset"}; - my $line = $sectinfo_ref->{"chainloader"}; - if (substr ($line, 0, 5) eq "/dev/" && ! defined ($sectors)) + my $sectors = $sectinfo_ref->{"blockoffset"} || ""; + my $chain = $sectinfo_ref->{"chainloader"}; + my $pcr = $sectinfo_ref->{"chainloaderpcr"} || ""; + + $pcr = "--pcr=$pcr " if $pcr ne ""; + + if (substr ($chain, 0, 5) eq "/dev/" && $sectors eq "") { - $sectors = 1; + $sectors = "1"; } - if (defined ($sectors) && $sectors > 0) + $sectors = "+$sectors" if $sectors ne ""; + + if ($sectors eq "") { - $line = $self->UnixDev2GrubDev ($line); - if (substr ($line, 0, length ($grub_root)) eq $grub_root) - { - $line = substr ($line, length ($grub_root)); - } - $line = $line . "+" . $sectors; - return $line; + $chain = $self->UnixPath2GrubPath ($chain, $grub_root); } else { - return $self->UnixPath2GrubPath ($line, $grub_root); + $chain = $self->UnixDev2GrubDev ($chain); + if (substr ($chain, 0, length ($grub_root)) eq $grub_root) + { + $chain = substr ($chain, length ($grub_root)); + } } + + return "$pcr$chain$sectors"; } @@ -1493,7 +1596,7 @@ my @lines = @{$sectinfo{"__lines"} || []}; my $type = $sectinfo{"type"} || ""; - my $so = $self->{"exports"}{"section_options"}; + my $so = $self->{'options'}{'section_options'}; my $modules = 0; # allow to keep the section unchanged @@ -1514,7 +1617,7 @@ # remap the first disk to the chainloader if requested # store the information about remapped disk my $remap_device = undef; - if (defined ($sectinfo{"remap"}) && $sectinfo{"remap"} == "true" && defined ($sectinfo{"chainloader"})) + if (defined ($sectinfo{"remap"}) && $sectinfo{"remap"} eq "true" && defined ($sectinfo{"chainloader"})) { $self->l_milestone ("GRUB::Info2Section: Remapping the device map"); $remap_device = $sectinfo{"chainloader"}; @@ -1560,7 +1663,7 @@ { # merge console and speed into xen_append my $console = sprintf("com%d", $1+1); - my $speed = sprintf("%s=%d", $console, $2); + my $speed = sprintf("%s=%s", $console, $2); if (exists $sectinfo{"xen_append"}) { my $xen_append = $sectinfo{"xen_append"}; while ($xen_append =~ @@ -1580,25 +1683,35 @@ my $line_ref = $_; my $key = $line_ref->{"key"}; - if ($key eq "root" or $key eq "rootnoverify") - { - # always remove old root line - $line_ref = undef; - } - elsif ($key eq "title") + if ($key eq "title") { $line_ref = $self->UpdateSectionNameLine ($sectinfo{"name"}, $line_ref, $sectinfo{"original_name"}); delete ($sectinfo{"name"}); } - elsif ($key eq "module") { + #entries which must be recreated due to hard check if valid or order + elsif ($key eq "module" or $key eq "measure" or $key eq "configfile" or + $key eq "root" or $key eq "rootnoverify" or $key eq "map") { # put module lines always at the end. $line_ref = undef; } + elsif ($key eq "makeactive") + { + if( exists $sectinfo{"makeactive"} + and $sectinfo{"makeactive"} eq "true") + { + delete $sectinfo{"makeactive"}; + } else { + $line_ref = undef; + } + } elsif ($key eq "kernel") { if ($type eq "xen") { $line_ref->{"value"} = $self->UnixPath2GrubPath (delete($sectinfo{"xen"}), $grub_root) . " " . (delete($sectinfo{"xen_append"}) || ""); + my $pcr = delete ($sectinfo{"xenpcr"}) || ""; + $pcr = "--pcr=$pcr " if $pcr ne ""; + $line_ref->{"value"} = "$pcr".$line_ref->{"value"}; } elsif ($type eq "image") { $line_ref->{"value"} = $self->CreateKernelLine (\%sectinfo, $grub_root); @@ -1607,6 +1720,7 @@ delete ($sectinfo{"append"}); delete ($sectinfo{"image"}); delete ($sectinfo{"console"}); + delete ($sectinfo{"imagepcr"}); } } elsif ($key eq "initrd" || $key eq "wildcard") @@ -1616,6 +1730,12 @@ } else { $line_ref->{"value"} = $self->UnixPath2GrubPath ($sectinfo{$key}, $grub_root); + if ( $key eq "initrd") + { + my $pcr = delete ($sectinfo{"initrdpcr"}) || ""; + $pcr = "--pcr=$pcr " if $pcr ne ""; + $line_ref->{"value"} = $pcr.$line_ref->{"value"}; + } } delete ($sectinfo{$key}); } @@ -1648,17 +1768,12 @@ $line_ref->{"value"} = $self->CreateChainloaderLine (\%sectinfo, $grub_root); delete ($sectinfo{$key}); delete ($sectinfo{"blockoffset"}); + delete ($sectinfo{"chainloaderpcr"}); } else { $line_ref = undef; } } - elsif ($key eq "map") - { - #just remove them for now, it will work even though it is not the best solution - # FIXME when time permits - $line_ref = undef; - } defined $line_ref ? $line_ref : (); } @lines; @@ -1687,11 +1802,15 @@ # keep a hard order for the following three entries if (exists $sectinfo{"xen"}) { - push @lines, { - "key" => "kernel", - "value" => $self->UnixPath2GrubPath ($sectinfo{"xen"}, $grub_root) - . " " . ($sectinfo{"xen_append"} || ""), - }; + my $value = $self->UnixPath2GrubPath ($sectinfo{"xen"}, $grub_root) + . " " . ($sectinfo{"xen_append"} || ""); + my $pcr = $sectinfo{"xenpcr"} || ""; + $pcr = "--pcr=$pcr " if $pcr ne ""; + $value = "$pcr$value"; + push @lines, { + "key" => "kernel", + "value" => $value, + }; } if (exists $sectinfo{"image"}) { my $val = $self->CreateKernelLine (\%sectinfo, $grub_root); @@ -1701,9 +1820,13 @@ }; } if (exists $sectinfo{"initrd"}) { + my $value = $self->UnixPath2GrubPath ($sectinfo{"initrd"}, $grub_root); + my $pcr = $sectinfo{"initrdpcr"} || ""; + $pcr = "--pcr=$pcr " if $pcr ne ""; + $value = "$pcr$value"; push @lines, { "key" => ($type eq "xen") ? "module" : "initrd", - "value" => $self->UnixPath2GrubPath ($sectinfo{"initrd"}, $grub_root), + "value" => $value, }; } @@ -1718,8 +1841,9 @@ } elsif ($key eq "chainloader") { - # FIXME: is this necessary? It seems this is already handled in a + # is this necessary? It seems this is already handled in a # loop above (where the sectinfo stuff for chainloader is deleted). + # JR: yes it is necessary if in previous lines hasn't been chainloader line (or lines is empty) push @lines, { "key" => $key, "value" => $self->CreateChainloaderLine (\%sectinfo, $grub_root), @@ -1750,7 +1874,19 @@ "value" => "", }; } - + elsif ($key eq "measure") + { + my @parts; + foreach my $measure (@{$value}){ + @parts = undef; + @parts = split(" ",$measure); + $parts[0] = $self->UnixPath2GrubPath($parts[0],$grub_root); + push @lines, { + "key" => "measure", + "value" => $parts[0]." ".$parts[1], + }; + } + } } my $ret = $self->FixSectionLineOrder (\@lines, @@ -1840,7 +1976,7 @@ my $sections_ref = shift; my @lines = @{$globinfo{"__lines"} || []}; - my $go = $self->{"exports"}{"global_options"}; + my $go = $self->{'options'}{"global_options"}; # allow to keep the section unchanged return \@lines unless $globinfo{"__modified"} || 0; @@ -1857,7 +1993,7 @@ @lines = map { my $line_ref = $_; my $key = $line_ref->{"key"}; - my ($type) = split(/:/, $go->{$key} || ""); + my ($type) = $go->{$key} || ""; # only accept known global options :-) if ( !exists $go->{$key} ) { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.68/lib/Bootloader/Tools.pm new/perl-Bootloader-0.4.69/lib/Bootloader/Tools.pm --- old/perl-Bootloader-0.4.68/lib/Bootloader/Tools.pm 2008-08-15 10:30:01.000000000 +0200 +++ new/perl-Bootloader-0.4.69/lib/Bootloader/Tools.pm 2008-08-21 15:38:37.000000000 +0200 @@ -1302,33 +1302,33 @@ } $new{"name"} = $name; - # In case of a xen entry, look for a existing xen_append parameter and - # add it to the new one respectively - foreach my $s (@sections) { - while ((my $k, my $v) = each (%$s)) { - if ($k eq "xen_append") { - $new{"xen_append"} = $v; - } - } - } - # Append flavor appendix to section label if necessary AdjustSectionNameAppendix ("add", \%new); - if ($name =~ m/^Failsafe.*$/) { + my $failsafe_modified = 0; + + if ($name =~ m/^Failsafe.*$/ or $option{"original_name"} eq "failsafe") { $new{"append"} = GetSysconfigValue("FAILSAFE_APPEND"); - $new{"vgamode"} = GetSysconfigValue("FAILSAFE_VGA") + $new{"vgamode"} = GetSysconfigValue("FAILSAFE_VGA"); + $failsafe_modified = 1; + $default = 0; } elsif ($option{"type"} eq "xen") { - $new{"append"} = GetSysconfigValue("XEN_APPEND"); - $new{"vgamode"} = GetSysconfigValue("XEN_VGA") + $new{"append"} = GetSysconfigValue("XEN_KERNEL_APPEND"); + $new{"vgamode"} = GetSysconfigValue("XEN_VGA"); + $new{"xen_append"} = GetSysconfigValue("XEN_APPEND"); } else { $new{"append"} = GetSysconfigValue("DEFAULT_APPEND"); $new{"vgamode"} = GetSysconfigValue("DEFAULT_VGA") } - my $failsafe_modified = 0; + $new{"console"} = GetSysconfigValue("CONSOLE"); + $new{"imagepcr"} = GetSysconfigValue("IMAGE_PCR"); + $new{"initrdpcr"} = GetSysconfigValue("INITRD_PCR"); + $new{"xenpcr"} = GetSysconfigValue("XEN_PCR"); + $new{"chainloaderpcr"} = GetSysconfigValue("CHAINLOADER_PCR"); + # FIXME: Failsafe parameters should be set dynamically in the future # if ($name =~ m/^Failsafe.*$/) { ++++++ update-bootloader ++++++ --- perl-Bootloader/update-bootloader 2008-08-15 15:15:11.000000000 +0200 +++ perl-Bootloader/update-bootloader 2008-08-21 15:59:29.845908000 +0200 @@ -350,10 +350,12 @@ $version =~ s/-[^-]*$//; $opt_name = $flavor . " -- " . GetProduct() . " - " . $version; + $opt_failsafe = "Failsafe -- " . GetProduct() . " - " . $version; } # Create short labels for all other loaders else { $opt_name = $flavor; + $opt_failsafe = "Failsafe"; } } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org