Hello community, here is the log from the commit of package perl-Bootloader checked in at Fri Dec 8 16:22:26 CET 2006. -------- --- perl-Bootloader/perl-Bootloader.changes 2006-12-07 13:54:37.000000000 +0100 +++ /mounts/work_src_done/STABLE/perl-Bootloader/perl-Bootloader.changes 2006-12-08 14:48:55.000000000 +0100 @@ -1,0 +2,10 @@ +Fri Dec 8 13:04:55 CET 2006 - jplack@suse.de + +- fixed comment handling for ZIPL +- basic implementation for generic bootloader widgets for ZIPL + (Fate#300732) +- basic implementation for generic bootloader widgets for ELILO + (Fate#300732) +- version bump 0.4.7 + +------------------------------------------------------------------- Old: ---- perl-Bootloader-0.4.6.tar.bz2 New: ---- perl-Bootloader-0.4.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Bootloader.spec ++++++ --- /var/tmp/diff_new_pack.pF7Rpy/_old 2006-12-08 16:22:10.000000000 +0100 +++ /var/tmp/diff_new_pack.pF7Rpy/_new 2006-12-08 16:22:10.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package perl-Bootloader (Version 0.4.6) +# spec file for package perl-Bootloader (Version 0.4.7) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,7 +11,7 @@ # norootforbuild Name: perl-Bootloader -Version: 0.4.6 +Version: 0.4.7 Release: 1 Requires: perl >= %{perl_version} Requires: perl-gettext @@ -64,6 +64,13 @@ /usr/lib/bootloader %changelog -n perl-Bootloader +* Fri Dec 08 2006 - jplack@suse.de +- fixed comment handling for ZIPL +- basic implementation for generic bootloader widgets for ZIPL + (Fate#300732) +- basic implementation for generic bootloader widgets for ELILO + (Fate#300732) +- version bump 0.4.7 * Thu Dec 07 2006 - aosthof@suse.de - fixed identation (correct usage of tabs) - fixed remove_entry() that it removes xen entries correctly ++++++ perl-Bootloader-0.4.6.tar.bz2 -> perl-Bootloader-0.4.7.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.6/lib/Bootloader/Core/ELILO.pm new/perl-Bootloader-0.4.7/lib/Bootloader/Core/ELILO.pm --- old/perl-Bootloader-0.4.6/lib/Bootloader/Core/ELILO.pm 2006-04-03 17:36:14.000000000 +0200 +++ new/perl-Bootloader-0.4.7/lib/Bootloader/Core/ELILO.pm 2006-12-08 12:21:05.000000000 +0100 @@ -44,6 +44,116 @@ #module interface + +sub GetMetaData() { + my $loader = shift; + + # possible global entries + # + # default=value Name the default image to boot. If not defined ELILO + # will boot the first defined image. + # timeout=number The number of 10th of seconds to wait while in + # interactive mode before auto booting default kernel. + # Default is infinity. + # delay=number The number of 10th of seconds to wait before + # auto booting when not in interactive mode. + # Default is 0. + # prompt Force interactive mode + # verbose=number Set level of verbosity [0-5]. Default 0 (no verbose) + # root=filename Set global root filesystem for Linux/ia64 + # read-only Force root filesystem to be mounted read-only + # append=string Append a string of options to kernel command line + # initrd=filename Name of initrd file + # image=filename Define a new image + # chooser=name Specify kernel chooser to use: 'simple' or 'textmenu'. + # message=filename a message that is printed on the main screen if supported by + # the chooser. + # fX=filename Some choosers may take advantage of this option to + # display the content of a file when a certain function + # key X is pressed. X can vary from 1-12 to cover + # function keys F1 to F12. + # noedd30 do not force the EDD30 EFI variable to TRUE when FALSE. In other + # words, don't force the EDD30 mode if not set. + # + # + # possible section types: + # image + # + # image section options: + # root=filename Set root filesystem for kernel + # read-only Force root filesystem to be mounted read-only + # append=string Append a string of options to kernel command line + # initrd=filename Name of initrd file + # label=string Logical name of image (used in interactive mode) + # description=string One line text description of the image. + + + my %exports; + + my @bootpart; + my @partinfo = @{$loader->{"partitions"} || []}; + + # boot from any partition (really?) + @bootpart = map { + my ($device, $disk, $nr, $fsid, $fstype, $part_type, $start_cyl, $size_cyl) = @$_; + $device; + } @partinfo; + + my $boot_partitions = join(":", @bootpart); + + my $root_devices = join(":", + map { + my ($device, $disk, $nr, $fsid, $fstype, $part_type, $start_cyl, $size_cyl) = @$_; + # FIXME: weed out non-root partitions + } @ partinfo, + keys %{$loader->{"md_arrays"} || {}} + ); + + # FIXME: is "arch" export necessary? + + $exports{"global_options"} = { + # maps to either deafult or default_menu + default => "string:Default Boot Section/Menu:linux", + #default_menu => "string:Default Boot Menu:", + #timeout => "int:Timeout in Seconds:5:0:60", + #prompt => "bool:Show boot menu", + #target => "path:Target directory for configuration/menu section:/boot/zipl", + }; + + my $go = $exports{"global_options"}; + + $exports{"section_options"} = { + type_image => "bool:Image Section", + type_dump => "bool:Dump Section (obsolete)", + type_menu => "bool:Menu Section", + # section type image; omitting implicit "label" + image_target => "path:Target Directory for Configuration Section:/boot/zipl", + image_image => "path:Kernel Image:/boot/image", + image_ramdisk => "path:Initial RAM Disk:/boot/initrd", + image_parameters => "string:Optional Kernel Parameters", + image_parmfile => "path:Optional Parameter File", + # section type image; omitting implicit "label" + dump_target => "path:Target Directory for Dump Section:/boot/zipl", + dump_dumpto => "path:Dump Device:/dev/dasd", + dump_dumptofs => "path:SCSI Dump Device:/dev/zfcp", + # section type image; omitting implicit "label" + menu_menuname => "string:Menu name:usermenu", + menu_target => "path:Target Directory for Menu Section:/boot/zipl", + menu_list => "string:List of Menu Entries:linux:", + # menu_list => "list:List of Menu Entries:linux:", + menu_default => "int:Number of Default Entry:1:1:10", + menu_timeout => "int:Timeout in seconds:5:0:60", + menu_prompt => "bool:Show boot menu", + # FIXME: dump section has a target, too + }; + + my $so = $exports{"section_options"}; + + $loader->{"exports"}=\%exports; + return \%exports; +} + + =item C<< $obj_ref = Bootloader::Core::ELILO->new (); >> @@ -62,6 +172,8 @@ { "key" => "relocatable", "value" => "" }, ]; bless ($loader); + + $loader->GetMetaData(); $loader->l_milestone ("ELILO::new: Created ELILO instance"); return $loader; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.6/lib/Bootloader/Core/GRUB.pm new/perl-Bootloader-0.4.7/lib/Bootloader/Core/GRUB.pm --- old/perl-Bootloader-0.4.6/lib/Bootloader/Core/GRUB.pm 2006-11-30 15:44:51.000000000 +0100 +++ new/perl-Bootloader-0.4.7/lib/Bootloader/Core/GRUB.pm 2006-12-08 12:31:55.000000000 +0100 @@ -113,7 +113,7 @@ # gfxmenu # * password:: Set a password for the menu interface - # * bootp:: --with-configfile Initialize a network device via BOOTP + # * bootp:: --with-configfile Initialize a network device via BOOTP # * color:: Color the menu interface # * dhcp:: Initialize a network device via DHCP # * ifconfig:: Configure a network device manually @@ -225,7 +225,7 @@ my $go = $exports{"global_options"}; $exports{"section_options"} = { - type_image => "bool:Kernel section", + type_image => "bool:Image section", # image_name => "string:Name of section", # implicit image_image => "path:Kernel image:/boot/vmlinux", image_root => "selectdevice:Root device::" . $root_devices, diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.6/lib/Bootloader/Core/ZIPL.pm new/perl-Bootloader-0.4.7/lib/Bootloader/Core/ZIPL.pm --- old/perl-Bootloader-0.4.6/lib/Bootloader/Core/ZIPL.pm 2006-05-29 17:24:57.000000000 +0200 +++ new/perl-Bootloader-0.4.7/lib/Bootloader/Core/ZIPL.pm 2006-12-08 14:58:31.000000000 +0100 @@ -59,7 +59,7 @@ #module interface -sub getExports() { +sub GetMetaData() { my $loader = shift; # possible global entries @@ -69,6 +69,11 @@ # prompt # target # + # possible section types: + # image + # dump + # menu + # # per section entries # # label @@ -105,33 +110,45 @@ # FIXME: is "arch" export necessary? $exports{"global_options"} = { - default => "string:Default boot section:linux", - timeout => "int:Timeout in seconds:0:60:5", - prompt => "bool:Show boot menu", - target => "path:Target directory for configuration/menu section:/boot/zipl", + # maps to either deafult or default_menu + default => "string:Default Boot Section/Menu:linux", + #default_menu => "string:Default Boot Menu:", + #timeout => "int:Timeout in Seconds:5:0:60", + #prompt => "bool:Show boot menu", + #target => "path:Target directory for configuration/menu section:/boot/zipl", }; my $go = $exports{"global_options"}; $exports{"section_options"} = { - type_image => "bool:Kernel section", - type_dump => "bool:Dump section (obsolete)", - type_menu => "bool:Menu section", - # omitting implicit "label" - menu_menuname => "string:Menu name:usermenu", - image_image => "path:Kernel image:/boot/image", - image_ramdisk => "path:Initial RAM disk:/boot/initrd", - dump_dumpto => "path:Dump device:/dev/dasd", - image_target => "path:Target directory for configuration/menu section:/boot/zipl", - # FIXME: dump section has a target, too - image_parameters => "string:Optional kernel parameters", - image_parmfile => "path:Optional parameter file", - dump_dumptofs => "path:SCSI dump device:/dev/zfcp", + type_image => "bool:Image Section", + image_target => "path:Target Directory for Image Section:/boot/zipl", + image_image => "path:Kernel Image:/boot/image", + # converted from ramdisk => initrd + image_initrd => "path:Initial RAM Disk:/boot/initrd", + # converted from parameters => append, root + image_append => "string:Optional Kernel Parameters", + image_root => "selectdevice:Root device::" . $root_devices, + image_parmfile => "path:Optional Parameter File", + + type_dump => "bool:Dump Section (obsolete)", + dump_target => "path:Target Directory for Dump Section:/boot/zipl", + dump_dumpto => "path:Dump Device:/dev/dasd", + dump_dumptofs => "path:SCSI Dump Device:/dev/zfcp", + + type_menu => "bool:Menu Section", + menu_target => "path:Target Directory for Menu Section:/boot/zipl", + menu_list => "string:List of Menu Entries:linux:", + # menu_list => "list:List of Menu Entries:linux:", + menu_default => "int:Number of Default Entry:1:1:10", + menu_timeout => "int:Timeout in seconds:5:0:60", + menu_prompt => "bool:Show boot menu", }; my $so = $exports{"section_options"}; $loader->{"exports"}=\%exports; + return \%exports; } @@ -148,10 +165,10 @@ my $old = shift; my $loader = $self->SUPER::new ($old); - $loader->{"default_global_lines"} = [ - ]; - + $loader->{"default_global_lines"} = [ ]; bless ($loader); + + $loader->GetMetaData(); $loader->l_milestone ("ZIPL::new: Created ZIPL instance"); return $loader; } @@ -167,7 +184,6 @@ # map<string,any> GetSettings () sub GetSettings { my $self = shift; - $self->getExports(); return $self->SUPER::GetSettings(); } @@ -331,10 +347,9 @@ # $line_ref->{"key"}="[".$line_ref->{"value"}."]"; # $line_ref->{"value"}=""; } - elsif ($key eq "image" || $key eq "ramdisk") + elsif ($key eq "ramdisk") { - $key = "kernel" if ($key eq "image"); - $key = "initrd" if ($key eq "ramdisk"); + $key = "initrd"; $line_ref->{"value"} = $sectinfo{$key}; delete ($sectinfo{$key}); } @@ -344,70 +359,71 @@ delete ($sectinfo{"root"}); delete ($sectinfo{"append"}); } - elsif ($key eq "dumpto" || $key eq "target") + elsif ($key eq "image" || $key eq "dumpto" || $key eq "target") { $line_ref->{"value"} = $sectinfo{$key}; delete ($sectinfo{$key}); } elsif ($key eq "menuname") { - $line_ref->{"key"}="menuname"; - $line_ref->{"value"}=""; + # $line_ref->{"key"}="menuname"; + $line_ref->{"value"}=delete $sectinfo{"name"}; } - elsif (!exists $so->{$type . "_" . $key}) + elsif (not exists $so->{$type . "_" . $key}) { # print $type . "_" . $key . " unknown!\n"; - next; # only accept known section options CAVEAT! + $line_ref = undef; # only accept known section options CAVEAT! } else { - next unless defined ($sectinfo{$key}); - - $line_ref->{"value"} = $sectinfo{$key}; - delete ($sectinfo{$key}); + if (defined ($sectinfo{$key})) { + $line_ref->{"value"} = $sectinfo{$key}; + delete ($sectinfo{$key}); + } + else { + $line_ref = undef; + } } - $line_ref; - } @lines; - - @lines = grep { - defined $_; + defined $line_ref ? $line_ref : (); } @lines; my $parameters = ""; while ((my $key, my $value) = each (%sectinfo)) { - if ($key eq "name") - { - my $line_ref = $self->UpdateSectionNameLine ($sectinfo{"name"}, {}, $sectinfo{"original_name"}); - $line_ref->{"key"} = "label"; -# $line_ref->{"key"}="[".$line_ref->{"value"}."]"; -# $line_ref->{"value"}=""; - push @lines, $line_ref; - } - elsif ($key eq "kernel" || $key eq "initrd" || $key eq "dumpto" || $key eq "target") - { - $key = "image" if ($key eq "kernel"); + if ($key eq "name") { + if ($type eq "image" || $type eq "dump") { + my $line_ref = $self->UpdateSectionNameLine($sectinfo{"name"}, {}, + $sectinfo{"original_name"}); + $line_ref->{"key"} = "label"; + # $line_ref->{"key"}="[".$line_ref->{"value"}."]"; + # $line_ref->{"value"}=""; + push @lines, $line_ref; + } + elsif ($type eq "menu") { + push @lines, { + "key" => "menuname", + "value" => $value, + }; + } # else ignore for unknown section type + } + elsif ($key eq "initrd" || $key eq "dumpto" || $key eq "target") { $key = "ramdisk" if ($key eq "initrd"); push @lines, { "key" => $key, "value" => $value, }; } - elsif ($key eq "root") - { + elsif ($key eq "root") { $parameters = "root=" . $value . " " . $parameters; } - elsif ($key eq "append") - { + elsif ($key eq "append") { $parameters = $parameters . $value; } - elsif (! exists ($so->{$type . "_" . $key})) - { + elsif (not exists ($so->{$type . "_" . $key})) { # print $type . "_" . $key . " unknown!\n"; next; # only accept known section options CAVEAT! } - else - { + else { my ($stype) = split /:/, $so->{$type . "_" . $key}; # bool values appear in a config file or not if ($stype eq "bool") { @@ -422,8 +438,8 @@ } } - if($parameters) - { + + if ($parameters) { push @lines, { "key" => "parameters", "value" => "" . $parameters . "" @@ -431,7 +447,7 @@ } my $ret = $self->FixSectionLineOrder (\@lines, - ["label","menuname"]); + [ "label", "menuname" ]); return $ret; } @@ -453,15 +469,14 @@ foreach my $line_ref (@lines) { my $key = $line_ref->{"key"}; - if ($key eq "label") - { + if ($key eq "label") { $ret{"name"} = $line_ref->{"value"}; my $on = $self->Comment2OriginalName ($line_ref->{"comment_before"}); $ret{"original_name"} = $on if ($on ne ""); } elsif ($key eq "image") { - $ret{"kernel"} = $line_ref->{"value"}; + $ret{$key} = $line_ref->{"value"}; $ret{"type"} = "image"; } elsif ($key eq "ramdisk" || $key eq "dumpto" || $key eq "default" || @@ -487,14 +502,19 @@ } elsif ($key eq "menuname") { - $ret{"menuname"} = $line_ref->{"value"}; + $ret{"name"} = $line_ref->{"value"} || "menu"; $ret{"type"} = "menu"; - $ret{"target"} = "/boot/zipl" unless $ret{"target"}; - $ret{"menuname"} = "menu" unless $ret{"menuname"}; - $ret{"prompt"} = "1" unless $ret{"prompt"}; - $ret{"timeout"} = "10" unless $ret{"timeout"}; } } + + + # Fill menu with default values + if ($ret{"type"} eq "menu") { + $ret{"target"} = "/boot/zipl" unless $ret{"target"}; + $ret{"prompt"} = "1" unless $ret{"prompt"}; + $ret{"timeout"} = "10" unless $ret{"timeout"}; + } + $ret{"__lines"} = \@lines; return \%ret; } @@ -718,7 +738,10 @@ # print "mangling section " . $sections->[$i]->{"name"} . ", type " . $sections->[$i]->{"type"} . "\n"; # menu to mangle -> global section - if (defined ($sections->[$i]->{"type"}) && $sections->[$i]->{"type"} eq "menu" && !$automangled_menu) + if (0 && + defined ($sections->[$i]->{"type"}) && + $sections->[$i]->{"type"} eq "menu" && + !$automangled_menu) { push @$global_ref, { "key" => "menuname", @@ -779,20 +802,13 @@ # defaultboot -> global section elsif ($sec->{"name"} eq "defaultboot") { - push @$global_ref, { - "key" => "default", - "value" => $sec->{"default"} - }; - if($sec->{"defaultmenu"}) - { - push @$global_ref, { - "key" => "defaultmenu", - "value" => $sec->{"defaultmenu"} - }; - } - # delete it - splice(@$sections,$i,1); - $i--; + push @$global_ref, { + "key" => "default", + "value" => $sec->{"default"} || $sec->{"defaultmenu"} + }; + # delete it + splice(@$sections,$i,1); + $i--; } } @@ -818,7 +834,7 @@ =cut # (list<map<string,string>>, list<string> comment_before) ProcessSingleMenuFileLine -# (string line, string comment_before, string separator) +# (string line, array ref comment_before, string separator) sub ProcessSingleMenuFileLine($$$) { my $self = shift; my $line = shift; @@ -839,7 +855,7 @@ "comment_before" => $comment_before, "comment_after" => "" ); - return ( [\%val], ""); + return ( [\%val], []); } elsif ($line =~ /^[ \t]*\:(.+)$/) { @@ -849,7 +865,7 @@ "comment_before" => $comment_before, "comment_after" => "" ); - return ( [\%val], ""); + return ( [\%val], []); } else { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.6/lib/Bootloader/Core.pm new/perl-Bootloader-0.4.7/lib/Bootloader/Core.pm --- old/perl-Bootloader-0.4.6/lib/Bootloader/Core.pm 2006-11-21 18:13:46.000000000 +0100 +++ new/perl-Bootloader-0.4.7/lib/Bootloader/Core.pm 2006-12-08 13:01:45.000000000 +0100 @@ -656,7 +656,7 @@ =cut # (list<map<string,string>>, list<string> comment_before) ProcessSingleMenuFileLine -# (string line, string comment_before, string separator) +# (string line, array ref comment_before, string separator) sub ProcessSingleMenuFileLine($$$) { my $self = shift; my $line = shift; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@suse.de