[yast-commit] r39186 - in /trunk/bootloader: package/yast2-bootloader.changes src/modules/Bootloader_API.pm src/modules/Makefile.am yast2-bootloader.spec.in
Author: odabrunz Date: Thu Jul 5 13:13:04 2007 New Revision: 39186 URL: http://svn.opensuse.org/viewcvs/yast?rev=39186&view=rev Log: - re-added limal-devel to BuildRequires - moved Bootloader_API.pm from limal-bootloader to yast2-bootloader - fix changelog entry order Added: trunk/bootloader/src/modules/Bootloader_API.pm Modified: trunk/bootloader/package/yast2-bootloader.changes trunk/bootloader/src/modules/Makefile.am trunk/bootloader/yast2-bootloader.spec.in Modified: trunk/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloader.changes?rev=39186&r1=39185&r2=39186&view=diff ============================================================================== --- trunk/bootloader/package/yast2-bootloader.changes (original) +++ trunk/bootloader/package/yast2-bootloader.changes Thu Jul 5 13:13:04 2007 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Tue Jul 3 17:27:50 CEST 2007 - od@suse.de + +- re-added limal-devel to BuildRequires + +------------------------------------------------------------------- +Tue Jul 3 16:34:02 CEST 2007 - od@suse.de + +- moved Bootloader_API.pm from limal-bootloader to yast2-bootloader + +------------------------------------------------------------------- +Thu Jun 21 17:36:59 CEST 2007 - adrian@suse.de + +- fix changelog entry order + +------------------------------------------------------------------- Fri May 25 13:30:04 CEST 2007 - jsrain@suse.cz - removed outdated translations from .desktop-files (#271209) @@ -3145,13 +3160,6 @@ - Report error when boot loader installation fails. ------------------------------------------------------------------- -Wed Oct 30 21:44:47 CET 2002 - kukuk@suse.de - -- fix log path in dosilo script -- update_silo_conf: modify version number in /boot/message -- BootSILO.ycp: Don't show popup on success when installing silo - -------------------------------------------------------------------- Wed Nov 13 09:08:12 CET 2002 - jsrain@suse.cz - again fixed installing a kernel to *NWSSTG when root is on RAID @@ -3168,6 +3176,13 @@ - 2.6.65 ------------------------------------------------------------------- +Wed Oct 30 21:44:47 CET 2002 - kukuk@suse.de + +- fix log path in dosilo script +- update_silo_conf: modify version number in /boot/message +- BootSILO.ycp: Don't show popup on success when installing silo + +------------------------------------------------------------------- Wed Oct 30 21:39:20 CET 2002 - kukuk@suse.de - fix log path in dosilo script @@ -3468,6 +3483,12 @@ - 2.6.33 ------------------------------------------------------------------- +Wed Aug 28 12:13:05 CEST 2002 - kkaempf@suse.de + +- fix checking for splashscreen +- 2.6.31 + +------------------------------------------------------------------- Wed Aug 28 11:57:22 CEST 2002 - jsrain@suse.cz - fixed building on SPARC @@ -3477,12 +3498,6 @@ - 2.6.32 ------------------------------------------------------------------- -Wed Aug 28 12:13:05 CEST 2002 - kkaempf@suse.de - -- fix checking for splashscreen -- 2.6.31 - -------------------------------------------------------------------- Tue Aug 27 16:19:25 CEST 2002 - jsrain@suse.cz - if no boot message exists not including in menu.lst (Bug #18381) Added: trunk/bootloader/src/modules/Bootloader_API.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/Bootloader_API.pm?rev=39186&view=auto ============================================================================== --- trunk/bootloader/src/modules/Bootloader_API.pm (added) +++ trunk/bootloader/src/modules/Bootloader_API.pm Thu Jul 5 13:13:04 2007 @@ -0,0 +1,284 @@ +#!/usr/bin/perl -w + +# +# Interface to perl-Bootloader library +# + +package Bootloader_API; + +use strict; + +use Bootloader::Library; +use LIMAL::LogHelper; + +our %TYPEINFO; + +BEGIN { $TYPEINFO{ALL_METHODS} = 0; } + +# create a new bootloader object +my $lib_ref = Bootloader::Library->new(); + +my @lines_cache = (); +my $lines_cache_index = 0; + +# Log collected log messages +sub DumpLog { + foreach my $rec (@{$lib_ref->GetLogRecords() || []}) + { + if ($rec->{"level"} eq "debug") + { + LIMAL::LogHelper::logDebug ($rec->{"message"}); + } + elsif ($rec->{"level"} eq "milestone") + { + LIMAL::LogHelper::logInfo ($rec->{"message"}); + } + elsif ($rec->{"level"} eq "warning") + { + LIMAL::LogHelper::logError ("WARNING: " . $rec->{"message"}); + } + elsif ($rec->{"level"} eq "error") + { + LIMAL::LogHelper::logError ($rec->{"message"}); + } + else + { + LIMAL::LogHelper::logError ("Incomplete log record"); + LIMAL::LogHelper::logError ($rec->{"message"}); + } + } +} + + +BEGIN { $TYPEINFO{setLoaderType} = ["function", "void", "string"]; } +# do library initialization for a specific bootloader type +sub setLoaderType($) { + my ($lt) = @_; + my $ret = $lib_ref->SetLoaderType($lt); + + @lines_cache = (); + $lines_cache_index = 0; + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{updateBootloader} = ["function", "boolean", "boolean"]; } +sub updateBootloader() { + my ($avoid_init) = @_; + my $ret = $lib_ref->UpdateBootloader($avoid_init); + + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{initializeBootloader} = ["function", "boolean"]; } +# first time initialization of firmware/bios specific code +sub initializeBootloader() { + my $ret = $lib_ref->InitializeBootloader(); + + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{readSettings} = ["function", "boolean"]; } +# read configuration +sub readSettings() { + my $ret = $lib_ref->ReadSettings(); + + DumpLog(); + return $ret ? "true" : "false"; +} + +BEGIN { $TYPEINFO{writeSettings} = ["function", "boolean"]; } +# write settings to the files +sub writeSettings() { + my $ret = $lib_ref->WriteSettings(); + DumpLog(); + + return $ret; +} + + +BEGIN { $TYPEINFO{getMetaData} = ["function", ["map", "string", "string"]]; } +# get data format and type description as far as available for +# specific bootloader +sub getMetaData() { + my $mdat_ref = $lib_ref->GetMetaData() || {}; + + # copy the hash and encode meta tags + my %metadata=(); + while ((my $key, my $value) = each ( %{$mdat_ref} )) { + if (ref($value)) { + if (ref($value) eq "HASH") { + foreach my $k (keys %$value) { + $metadata{"%" . $key . "%" . $k} = $value->{$k}; + } + } + elsif (ref($value) eq "ARRAY") { + foreach my $i (0 .. $#$value) { + $metadata{"#" . $key . "#" . $i} = $value->[$i]; + } + } + } + else { + $metadata{$key} = $value; + } + } + + DumpLog(); + return \%metadata; +} + + +BEGIN { $TYPEINFO{getDeviceMapping} = ["function", ["map", "string", "string"]]; } +sub getDeviceMapping() { + my $devmap = $lib_ref->GetDeviceMapping () || {}; + DumpLog(); + return $devmap; +} + +BEGIN { $TYPEINFO{setDeviceMapping} = ["function", "boolean", ["map", "string", "string"]]; } +sub setDeviceMapping($) { + my ($dm) = @_; + + my $ret = $lib_ref->SetDeviceMapping ($dm); + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{getGlobalSettings} = ["function", ["map", "string", "string"]]; } +sub getGlobalSettings() { + my %globalsettings = %{$lib_ref->GetGlobalSettings () || {}}; + + # remove "__lines" key - it's internal + my $idx = $lines_cache_index++; + $globalsettings{"lines_cache_id"} = $idx; + $lines_cache[$idx] = delete( $globalsettings{'__lines'} ); + + # if there is "stage1_dev" key then convert the values to single string + if (defined $globalsettings{'stage1_dev'}) + { + my $string = join(",",@{$globalsettings{'stage1_dev'}}) ; + $globalsettings{'stage1_dev'} = $string; + } + + my %ret; + # convert data to string type + while ((my $key, my $value) = each %globalsettings) { + $ret{"$key"} = "$value"; + } + + return \%ret; +} + +BEGIN { $TYPEINFO{setGlobalSettings} = ["function", "boolean", ["map", "string", "string"]]; } +sub setGlobalSettings($) { + my ($globals) = @_; + my %globalsettings = %{$globals}; + + # if there is "stage1_dev" key then convert the value from single + # string back to an array + if (defined $globalsettings{'stage1_dev'}) { + # split device string into a list + my @devices = split(',', $globalsettings{'stage1_dev'}); + $globalsettings{'stage1_dev'} = \@devices; + } + + + my $index = exists($globalsettings{"lines_cache_id"}) ? + $globalsettings{"lines_cache_id"} : undef; + if (defined($index)) { + $globalsettings{"__lines"} = $lines_cache[$index]; + } + + my $ret = $lib_ref->SetGlobalSettings (\%globalsettings); + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{getSections} = ["function", ["list", ["map", "string", "string"]]]; } +sub getSections() { + my @sections = @{$lib_ref->GetSections () || []}; + + # remove "__lines" key - it's internal + # FIXME: this should be done in Bootloader::Core which can do + # house holding of its internals by itself!! + foreach my $section (@sections) { + my $index = $lines_cache_index++; + $lines_cache[$index] = $section->{'__lines'}; + delete $section->{'__lines'}; + $section->{"lines_cache_id"} = $index; + } + DumpLog(); + return \@sections; +} + +BEGIN { $TYPEINFO{setSections} = ["function", "boolean", ["list", ["map", "string", "string"]]]; } +sub setSections($) { + my ($sections) = @_; + + my @sections = @{$sections || []}; + foreach my $section (@sections) { + my $index = exists($section->{"lines_cache_id"}) ? + $section->{"lines_cache_id"} : undef; + if (defined($index)) + { + $section->{"__lines"} = $lines_cache[$index]; + } + } + my $ret = $lib_ref->SetSections($sections); + DumpLog(); + return $ret; +} + +# handle native config file text +# +BEGIN { $TYPEINFO{setFilesContents} = ["function", "boolean", ["map", "string", "string"]]; } +sub setFilesContents($) { + my ($contents) = @_; + + my $ret = $lib_ref->SetFilesContents($contents); + + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{getFilesContents} = ["function", ["map", "string", "string"]]; } +sub getFilesContents() { + my $ret = $lib_ref->GetFilesContents(); + + DumpLog(); + return $ret; +} + + +BEGIN { $TYPEINFO{setMountPoints} = ["function", "boolean", ["map", "string", "string"]]; } +sub setMountPoints($) { + my ($dm) = @_; + my $ret = $lib_ref->DefineMountPoints ($dm); + + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{setPartitions} = ["function", "boolean", ["list", ["list", "string"]]]; } +sub setPartitions($) { + my ($dm) = @_; + my $ret = $lib_ref->DefinePartitions($dm); + + DumpLog(); + return $ret; +} + +BEGIN { $TYPEINFO{setMDArrays} = ["function", "boolean", ["map", "string", ["list", "string"]]]; } +sub setMDArrays($) { + my ($dm) = @_; + my $ret = $lib_ref->DefineMDArrays($dm); + + DumpLog(); + return $ret; +} + + +# import fails if we cannot create the object +$lib_ref; Modified: trunk/bootloader/src/modules/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/Makefile.am?rev=39186&r1=39185&r2=39186&view=diff ============================================================================== --- trunk/bootloader/src/modules/Makefile.am (original) +++ trunk/bootloader/src/modules/Makefile.am Thu Jul 5 13:13:04 2007 @@ -13,14 +13,15 @@ BootGRUB.ycp \ BootLILO.ycp \ BootPOWERLILO.ycp \ - BootZIPL.ycp + BootZIPL.ycp \ + Bootloader_API.pm # BootS390.ycp \ # BootMILO.ycp \ # BootABOOT.ycp Bootloader_API.pm: - test -f Bootloader_API.pm || ln -sf `find /usr/lib/perl5 -name Bootloader_API.pm | tail -1` + test -f Bootloader_API.pm || exit 1 EXTRA_DIST = \ @@ -35,10 +36,6 @@ BootCommon.ybc: Bootloader_API.pm -install: install_Bootloader_API install-am - -install_Bootloader_API: - test -d ${RPM_BUILD_ROOT}/@moduledir@ || mkdir -p ${RPM_BUILD_ROOT}/@moduledir@ - /bin/cp -f -d Bootloader_API.pm ${RPM_BUILD_ROOT}/@moduledir@ +install: install-am include $(top_srcdir)/Makefile.am.common Modified: trunk/bootloader/yast2-bootloader.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/yast2-bootloader.spec.in?rev=39186&r1=39185&r2=39186&view=diff ============================================================================== --- trunk/bootloader/yast2-bootloader.spec.in (original) +++ trunk/bootloader/yast2-bootloader.spec.in Thu Jul 5 13:13:04 2007 @@ -1,9 +1,9 @@ @HEADER-COMMENT@ @HEADER@ -BuildRequires: gcc-c++ limal-devel yast2-devel yast2-devtools yast2-testsuite yast2-installation yast2-storage limal-bootloader update-desktop-files swig docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel yast2-perl-bindings perl-gettext update-alternatives +BuildRequires: gcc-c++ limal-devel yast2-devel yast2-devtools yast2-testsuite yast2-installation yast2-storage update-desktop-files swig docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel yast2-perl-bindings perl-gettext perl-Bootloader update-alternatives PreReq: /bin/sed %fillup_prereq -Requires: yast2 yast2-core yast2-storage perl-Bootloader limal-bootloader parted perl-Compress-Zlib +Requires: yast2 yast2-core yast2-storage perl-Bootloader parted perl-Compress-Zlib %ifarch %ix86 x86_64 Requires: master-boot-code %endif -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
odabrunz@svn.opensuse.org