commit installation-images for openSUSE:Factory
Hello community, here is the log from the commit of package installation-images for openSUSE:Factory checked in at Mon Apr 26 17:21:32 CEST 2010. -------- --- installation-images/installation-images.changes 2010-04-22 21:28:01.000000000 +0200 +++ installation-images/installation-images.changes 2010-04-26 16:10:43.000000000 +0200 @@ -1,0 +2,5 @@ +Mon Apr 26 16:10:30 CEST 2010 - snwint@suse.de + +- rewrote package handling + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- installation-images-12.49.tar.bz2 needed_space_in_mb new.patch New: ---- installation-images-12.50.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ installation-images.spec ++++++ --- /var/tmp/diff_new_pack.2PaOEk/_old 2010-04-26 17:17:52.000000000 +0200 +++ /var/tmp/diff_new_pack.2PaOEk/_new 2010-04-26 17:17:52.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package installation-images (Version 12.49) +# spec file for package installation-images (Version 12.50) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -103,10 +103,9 @@ Obsoletes: y2image AutoReqProv: off Summary: Installation Image Files -Version: 12.49 -Release: 2 -Source: installation-images-12.49.tar.bz2 -Patch0: new.patch +Version: 12.50 +Release: 1 +Source: installation-images-12.50.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %define _binary_payload w.ufdio @@ -176,7 +175,6 @@ %prep %setup -%patch0 -p1 rm -f /usr/lib/build/checks/04-check-filelist %build ++++++ installation-images-12.49.tar.bz2 -> installation-images-12.50.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/Makefile new/installation-images-12.50/Makefile --- old/installation-images-12.49/Makefile 2010-04-22 11:56:58.000000000 +0200 +++ new/installation-images-12.50/Makefile 2010-04-26 16:08:12.000000000 +0200 @@ -42,7 +42,8 @@ DESTDIR := images/instsys ifneq ($(filter i386 x86_64, $(ARCH)),) -THEMES += Zen +# needs SLES themes +# THEMES += Zen endif export ARCH THEMES DESTDIR INSTSYS_PARTS BOOT_PARTS WITH_FLOPPY diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/VERSION new/installation-images-12.50/VERSION --- old/installation-images-12.49/VERSION 2010-04-22 15:41:58.000000000 +0200 +++ new/installation-images-12.50/VERSION 2010-04-26 16:10:17.000000000 +0200 @@ -1 +1 @@ -12.49 +12.50 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/changelog new/installation-images-12.50/changelog --- old/installation-images-12.49/changelog 2010-04-22 15:42:03.000000000 +0200 +++ new/installation-images-12.50/changelog 2010-04-26 16:10:20.000000000 +0200 @@ -1,4 +1,7 @@ -2010-04-22: HEAD +2010-04-26: HEAD + - rewrote package handling + +2010-04-22: 12.49 - fix module config to include some ex-ppc-only modules (bnc #565623) 2010-04-22: 12.48 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/data/base/base.file_list new/installation-images-12.50/data/base/base.file_list --- old/installation-images-12.49/data/base/base.file_list 2010-04-21 17:22:59.000000000 +0200 +++ new/installation-images-12.50/data/base/base.file_list 2010-04-26 14:48:18.000000000 +0200 @@ -88,7 +88,8 @@ /lib* findutils: - /usr/bin/{find,xargs} + /bin + /usr/bin diffutils: /usr/bin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/data/base/mlist3 new/installation-images-12.50/data/base/mlist3 --- old/installation-images-12.49/data/base/mlist3 2010-04-21 17:22:59.000000000 +0200 +++ new/installation-images-12.50/data/base/mlist3 2010-04-26 14:35:59.000000000 +0200 @@ -8,7 +8,7 @@ $err = 0; -for $m (<$modules_dir/*>) { +for $m (<$modules_dir/*.ko>) { chomp $m; chomp(@l = `modinfo -F firmware $m`); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/lib/AddFiles.pm new/installation-images-12.50/lib/AddFiles.pm --- old/installation-images-12.49/lib/AddFiles.pm 2010-04-22 15:38:49.000000000 +0200 +++ new/installation-images-12.50/lib/AddFiles.pm 2010-04-26 14:38:47.000000000 +0200 @@ -59,6 +59,7 @@ sub fixup_re; + sub AddFiles { local $_; @@ -66,9 +67,9 @@ my ($rpms, $tdir, $tfile, $p, $r, $rc, $d, $u, $g, $files); my ($mod_list, @mod_list, %mod_list); my ($inc_file, $inc_it, $debug, $ifmsg, $ignore); - my ($old_warn, $ver, $i, $cache_dir, $tmp_cache_dir, $tmp_rpm); - my (@scripts, $s, @s, %script, $use_cache); - my (@packs, $sl, $rpm_cmd); + my ($old_warn, $ver, $i); + my (@scripts, $s, @s, %script); + my (@packs, $sl, $rpm_dir); my (@plog, $current_pack, %acc_all_files, %acc_pack_files, $account); my ($su, @requires); @@ -98,13 +99,6 @@ $debug = "pkg"; $debug = $ENV{'debug'} if exists $ENV{'debug'}; - $use_cache = 0; - $use_cache = $ENV{'cache'} if exists $ENV{'cache'}; - if($use_cache) { - $cache_dir = $ConfigData{'cache_dir'}; - $tmp_cache_dir = $ConfigData{'tmp_cache_dir'}; - } - $ignore = $debug =~ /\bignore\b/ ? 1 : 0; $account = $debug =~ /\baccount\b/ ? 1 : 0; @@ -123,31 +117,12 @@ $debug .= ',pkg'; -# if(!$AutoBuild) { -# $rpms = "$ConfigData{suse_base}/suse"; -# die "$Script: where are the rpms?" unless $ConfigData{suse_base} && -d $rpms; -# $rpms = "$rpms/*"; -# } -# else { -# $rpms = $AutoBuild; -# die "$Script: where are the rpms?" unless -d $rpms; -# print "running in autobuild environment\n"; -# } - if(! -d $dir) { die "$Script: failed to create $dir ($!)" unless mkdir $dir, 0755; } - if(!($use_cache & 4)) { - $tdir = "${TmpBase}.dir"; - die "$Script: failed to create $tdir ($!)" unless mkdir $tdir, 0777; - } $tfile = "${TmpBase}.afile"; - # see if our rpm understands --nosignature - $rpm_cmd = "rpm"; - $rpm_cmd .= " --nosignature" if `$rpm_cmd --help` =~ /--nosignature/s; - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # now we really start... @@ -200,16 +175,6 @@ next } -# drop these -# if(/^ifarch\s+/) { $if_val <<= 1; $if_val |= 1 if !/\b$arch\b/ || $arch eq ""; next } -# if(/^ifnarch\s+/) { $if_val <<= 1; $if_val |= 1 if /\b$arch\b/ && $arch ne ""; next } -# if(/^ifdef\s+/) { $if_val <<= 1; $if_val |= 1 if !/\b$tag\b/ || $tag eq ""; next } -# if(/^ifndef\s+/) { $if_val <<= 1; $if_val |= 1 if /\b$tag\b/ && $tag ne ""; next } -# if(/^ifabuild/) { $if_val <<= 1; $if_val |= 1 if !$AutoBuild; next } -# if(/^ifnabuild/) { $if_val <<= 1; $if_val |= 1 if $AutoBuild; next } -# if(/^ifenv\s+(\S+)\s+(\S+)/) { $if_val <<= 1; $if_val |= 1 if $ENV{$1} ne $2; next } -# if(/^ifnenv\s+(\S+)\s+(\S+)/) { $if_val <<= 1; $if_val |= 1 if $ENV{$1} eq $2; next } - if(/^(els)?if\s+(.+)/) { no integer; @@ -278,152 +243,43 @@ undef $rc; undef $r; - $r = RealRPM $p; - warn("$Script: no such package: $p"), next unless $r; - $p = $r; - - if($p =~ /^\//) { - $r = $p; - warn("$Script: no such package: $r"), next unless -f $r; - } - else { - $r = RPMFileName $p; - - if($use_cache) { - $rc = "$cache_dir/$p.rpm"; - $tmp_rpm = "$tmp_cache_dir/$p"; - } - warn("$Script: no such package: $p.rpm"), next unless $r && -f $r; - - if(($use_cache & 2) && $rc && $r && -f($r) && $rc ne $r) { - if(! -d($cache_dir)) { - SUSystem("mkdir -p $cache_dir"); - } - if(-d $cache_dir) { - SUSystem("cp -a $r $rc"); - if(-f $rc) { - $r = $rc; - } - else { - warn "$Script: failed to cache package $r"; - } - } - else { - warn "$Script: failed to create cache dir $cache_dir"; - $use_cache = 0; - } - } - } + $rpm_dir = ReadRPM $p; - $current_pack = $p; + next unless $rpm_dir; - $ver = (`$rpm_cmd -qp $r`)[0]; - $ver = "" unless defined $ver; - $ver =~ s/\s*$//; - if($ver =~ /^(\S+)-([^-]+-[^-]+)$/) { - $ver = $1 eq $p ? " [$2]" : ""; - } - else { - $ver = ""; - } - if($use_cache) { - if(-d $tmp_rpm) { - $ver .= '#'; - } - elsif(defined($rc) && $rc eq $r) { - $ver .= '*'; - } - } + $current_pack = RealRPM($p)->{name}; - undef $sl; + $ver = ReadFile "$rpm_dir/version"; + $ver = "[$ver]"; - @s = `$rpm_cmd -qp --qf '%|PREIN?{PREIN\n}:{}|%|POSTIN?{POSTIN\n}:{}|%|PREUN?{PREUN\n}:{}|%|POSTUN?{POSTUN\n}:{}|' $r 2>/dev/null`; - for $s (@s) { - chomp $s; - $sl .= "," if $sl; - $sl .= "\L$s"; - } - $ver .= " \{$sl\}" if $sl; + push @plog, "$current_pack $ver\n"; - push @plog, "$p$ver\n"; + $_ = ReadFile "$rpm_dir/scripts"; + $ver .= " {$_}" if $_; - print "adding package $p$ver\n" if $debug =~ /\bpkg\b/; + print "adding package $current_pack $ver\n" if $debug =~ /\bpkg\b/; - push @packs, "$p\n"; + push @packs, "$current_pack\n"; for $s (@scripts) { - @{$script{$s}} = - @s = `$rpm_cmd --queryformat '%{\U$s\E}' -qp $r 2>/dev/null`; - if(@s == 0 || $s[0] =~ /^\(none\)\s*$/) { - warn "$Script: no \"$s\" script in $r"; + $_ = ReadFile "$rpm_dir/$s"; + if(!$_) { + warn "$Script: no \"$s\" script in $current_pack"; } else { print " got \"$s\" script\n" if $debug =~ /\bscripts\b/; - @{$script{$s}} = @s; + $script{$s} = $_; } } if(@requires) { - @requires = `$rpm_cmd --requires -qp $r 2>/dev/null`; + $_ = ReadFile "$rpm_dir/requires"; open R, ">$dir/$p.requires"; - print R @requires; + print R $_; close R; } - if(!($use_cache & 4)) { - SUSystem "rm -rf $tdir" and die "$Script: failed to remove $tdir"; - die "$Script: failed to create $tdir ($!)" unless mkdir $tdir, 0777; - SUSystem "sh -c 'cd $tdir ; rpm2cpio $r | cpio --quiet --sparse -dimu --no-absolute-filenames'" and - warn "$Script: failed to extract $r"; - } - else { - $tdir = $tmp_rpm; - if(!-d($tdir)) { - die "$Script: failed to create $tdir ($!)" unless mkdir $tdir, 0777; - SUSystem "sh -c 'cd $tdir ; rpm2cpio $r | cpio --quiet --sparse -dimu --no-absolute-filenames'" and - warn "$Script: failed to extract $r"; - - if($p eq $ConfigData{kernel_rpm}) { - my $r2 = RPMFileName "$p-base"; - if($r2 && -f $r2) { - SUSystem "sh -c 'cd $tdir ; rpm2cpio $r2 | cpio --quiet --sparse -dimu --no-absolute-filenames'" and - warn "$Script: failed to extract $r2"; - } - else { - print STDERR "$Script: no such package: ${p}-base.rpm\n"; - } - - $r2 = RPMFileName "$p-extra"; - if($r2 && -f $r2) { - SUSystem "sh -c 'cd $tdir ; rpm2cpio $r2 | cpio --quiet --sparse -dimu --no-absolute-filenames'" and - warn "$Script: failed to extract $r2"; - } - else { - print STDERR "$Script: no such package: ${p}-extra.rpm\n"; - } - - my ($kmp, $kmp_name); - for $kmp (split(',', $ConfigData{kmp_list})) { - ($kmp_name = $p) =~ s/^kernel/$kmp-kmp/; - my $r2 = RPMFileName "$kmp_name"; - (print STDERR "$Script: no such package: ${kmp_name}.rpm\n"), next unless $r2 && -f $r2; - print "adding kmp $kmp_name\n"; - SUSystem "sh -c 'cd $tdir ; rpm2cpio $r2 | cpio --quiet --sparse -dimu --no-absolute-filenames'" and - warn "$Script: failed to extract $r2"; - } - - my $fw; - for $fw (split(',', $ConfigData{fw_list})) { - my $r2 = RPMFileName $fw; - if($r2 && -f $r2) { - print "adding firmware $fw\n"; - SUSystem "sh -c 'cd $tdir ; rpm2cpio $r2 | cpio --quiet --sparse -dimu --no-absolute-filenames'" and - warn "$Script: failed to extract $r2"; - } - } - } - } - } + $tdir = "$rpm_dir/rpm"; } elsif(!/^[a-zA-Z]\s+/ && /^(.*)$/) { $files = $1; @@ -611,7 +467,7 @@ SUSystem "sh -c 'mkdir $dir/install && chmod 777 $dir/install'" and die "$Script: failed to create $dir/install"; die "$Script: unable to create $pm" unless open W, ">$dir/install/inst.sh"; - print W @{$script{$cmd}}; + print W $script{$cmd}; close W; $e = 'E' if $xdir eq 'base'; @@ -687,9 +543,6 @@ $account_size->($dir); - if(!($use_cache & 4)) { - SUSystem "rm -rf $tdir"; - } SUSystem "rm -f $tfile"; open F, ">${dir}.rpms"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-12.49/lib/ReadConfig.pm new/installation-images-12.50/lib/ReadConfig.pm --- old/installation-images-12.49/lib/ReadConfig.pm 2010-04-22 15:38:49.000000000 +0200 +++ new/installation-images-12.50/lib/ReadConfig.pm 2010-04-26 14:45:43.000000000 +0200 @@ -165,13 +165,14 @@ @ISA = qw ( Exporter ); @EXPORT = qw ( $Script $BasePath $LibPath $BinPath $CfgPath $ImagePath $DataPath - $TmpBase %ConfigData RPMFileName RealRPM $SUBinary SUSystem Print2File $MToolsCfg $AutoBuild + $TmpBase %ConfigData ReadFile RealRPM ReadRPM $SUBinary SUSystem Print2File $MToolsCfg $AutoBuild ); use strict 'vars'; use vars qw ( $Script $BasePath $LibPath $BinPath $CfgPath $ImagePath $DataPath $TmpBase %ConfigData $SUBinary &RPMFileName &SUSystem &Print2File $MToolsCfg $AutoBuild + $rpmData ); sub DebugInfo @@ -194,105 +195,161 @@ } } + +sub ReadFile +{ + my ($f, $buf); + + open $f, $_[0]; + sysread($f, $buf, -s $_[0]); + close $f; + + return $buf; +} + + # +# Returns hash with 'name' and 'file' keys or undef if package does not +# exist. # -# -sub RPMFileName -{ - my ($rpm, $file, @f, $x); +sub RealRPM +{ local $_; + my $rpm = shift; + my ($f, @f, @ff, $p, $back, $n, %n); - $rpm = shift; - - $file = $ConfigData{'cache_dir'}; + return $rpmData->{$rpm} if exists $rpmData->{$rpm}; - if($ConfigData{'use_cache'} && $file && -f "$file/$rpm.rpm") { + my $dir = $ConfigData{'suse_base'}; - # print "*$rpm: $file/$rpm.rpm\n"; + $back = 1 if $rpm =~ s/~$//; - return "$file/$rpm.rpm"; + @f = grep { -f } <$dir/$rpm.rpm>; + for (@f) { + $n = $_; + s#^.*/|\.rpm$##g; + $n{$_} = $n; } - $file = $ConfigData{'tmp_cache_dir'}; + return $rpmData->{$rpm} = undef if @f == 0; + + $p = $rpm; + $p = "\Q$p"; + $p =~ s/\\\*/([0-9_]+)/g; + @f = grep { /^$p$/ } @f; + @f = sort @f; + # for (@f) { print ">$_<\n"; } + $f = pop @f; + $f = pop @f if $back; - if($file && -d $file) { - $file .= "/.rpms"; - mkdir $file, 0755 unless -d $file; - $file .= "/$rpm.rpm"; + return $rpmData->{$f} = $rpmData->{$rpm} = { name => $f, file => $n{$f} } ; +} - # print "#$rpm: $file\n" if -f $file; - return $file if -f $file; - } +# +# 'rpm' is hash as returned from RealRPM(). +# +sub UnpackRPM +{ + my $rpm = shift; + my $dir = shift; - undef $file; + return 1 unless $rpm; - for (`cat $ConfigData{'suse_base'}/find-name-rpm 2>/dev/null`) { - chomp; - s/^\.\///; - if(m#/(\Q$rpm\E|\Q$rpm\E\-[^\-]+\-[^\-]+\.[^.\-]+)\.rpm$#) { - $file = "$ConfigData{'suse_base'}/$_"; - last; - } + if(SUSystem "sh -c 'cd $dir ; rpm2cpio $rpm->{file} | cpio --quiet --sparse -dimu --no-absolute-filenames'") { + warn "$Script: failed to extract $rpm->{name}"; + return 1; } - if(!$file) { - @f = glob "$ConfigData{'suse_base'}/$rpm.rpm"; - if($f[0] && -f $f[0]) { - $file = $f[0]; - } - } + return 0; +} - if(!$file) { - @f = glob "$ConfigData{'suse_base'}/$rpm-*-*.rpm"; - for (@f) { - next if /\.src\.rpm$/; - if($_ && -f $_ && m#/\Q$rpm\E\-[^\-]+\-[^\-]+\.[^.\-]+\.rpm$#) { - $file = $_; - last; - } - } - } - $x = $ConfigData{'tmp_cache_dir'}; +# +# Unpack rpm to cache dir and return path to dir or undef if failed. +# +sub ReadRPM +{ + local $_; + my ($s, $f, @s); + + my $rpm = RealRPM $_[0]; - if($file && $x && -d($x)) { - $x .= "/.rpms"; - mkdir $x, 0755 unless -d $x; - if(-d $x) { - symlink($file, "$x/$rpm.rpm"); - } + if(!$rpm) { + warn "$Script: no such package: $_[0]"; + return undef; } - # print "$rpm: $file\n" if $file; + my $rpm_cmd = "rpm --nosignature"; + my $dir = "$ConfigData{tmp_cache_dir}/$rpm->{name}"; + my $tdir = "$dir/rpm"; - return $file; -} + return $dir if -d $dir; + die "$Script: failed to create $dir ($!)" unless mkdir $dir, 0777; + die "$Script: failed to create $tdir ($!)" unless mkdir $tdir, 0777; -sub RealRPM -{ - my $rpm = shift; - my ($f, @f, $p, $back); - local $_; + my $err = UnpackRPM $rpm, $tdir; - my $dir = $ConfigData{'suse_base'}; + if(!$err) { + $_ = `$rpm_cmd -qp --qf '%{VERSION}-%{RELEASE}.%{ARCH}' $rpm->{file} 2>/dev/null`; + open $f, ">$dir/version"; + print $f $_; + close $f; - $back = 1 if $rpm =~ s/~$//; + $_ = `$rpm_cmd -qp --requires $rpm->{file} 2>/dev/null`; + open $f, ">$dir/requires"; + print $f $_; + close $f; - @f = <$dir/$rpm.rpm>; - s#^.*/|\.rpm$##g for @f; - # @f = grep { !/(-32bit|-debuginfo|-debugsource|-devel)$/ } @f; - $p = $rpm; - $p = "\Q$p"; - $p =~ s/\\\*/([0-9_]+)/g; - @f = grep { /^$p$/ } @f; - @f = sort @f; - # for (@f) { print ">$_<\n"; } - $f = pop @f; - $f = pop @f if $back; + @s = `$rpm_cmd -qp --qf '%|PREIN?{PREIN\n}:{}|%|POSTIN?{POSTIN\n}:{}|%|PREUN?{PREUN\n}:{}|%|POSTUN?{POSTUN\n}:{}|' $rpm->{file} 2>/dev/null`; + for (@s) { + chomp; + $_ = "\L$_"; + $s = `$rpm_cmd -qp --qf '%{\U$_\E}' $rpm->{file} 2>/dev/null`; + open $f, ">$dir/$_"; + print $f $s; + close $f; + } + if(@s) { + $s = join ",", @s; + open $f, ">$dir/scripts"; + print $f "\L$s"; + close $f; + } + } + + if(!$err && $rpm->{name} eq $ConfigData{kernel_rpm}) { + SUSystem "find $tdir -type d -exec chmod a+rx '{}' \\;"; + + $_ = <$tdir/lib/modules/*>; + if(-d) { + s#.*/##; + open $f, ">$dir/kernel"; + print $f $_; + close $f; + } + + UnpackRPM RealRPM("$rpm-base"), $tdir; + UnpackRPM RealRPM("$rpm-extra"), $tdir; + + my $kmp; + for (split(',', $ConfigData{kmp_list})) { + ($kmp = $rpm->{name}) =~ s/^kernel/$_-kmp/; + print "adding kmp $kmp\n"; + UnpackRPM RealRPM($kmp), $tdir; + } + + for (split(',', $ConfigData{fw_list})) { + print "adding firmware $_\n"; + UnpackRPM RealRPM($_), $tdir; + } + + # keep it readable + SUSystem "find $tdir -type d -exec chmod a+rx '{}' \\;"; + } - return $f; + return $err ? undef : $dir; } @@ -330,16 +387,16 @@ sub KernelImg { local $_; - my ($k_regexp, @k_files, @k_images, @kernels); + my ($k_files, @k_images); - ($k_regexp, @k_files) = @_; + $k_files = shift; - chomp @k_files; + chomp @$k_files; - for (@k_files) { - s#^/boot/##; + for (@$k_files) { + s#.*/boot/##; next if /autoconf|config|shipped|version/; # skip obvious garbage - push @k_images, $_ if m#$k_regexp#; + push @k_images, $_ if m#$ConfigData{kernel_img}#; } return @k_images; @@ -639,57 +696,10 @@ $tmp_cache_dir .= "/${BasePath}tmp/cache/$ConfigData{dist}"; $ConfigData{'tmp_cache_dir'} = $tmp_cache_dir; system "mkdir -p $tmp_cache_dir" unless -d $tmp_cache_dir; - my $use_cache = 0; - $ENV{'cache'} = 4 unless exists $ENV{'cache'}; - $use_cache = $ENV{'cache'} if exists $ENV{'cache'}; - $ConfigData{'use_cache'} = $use_cache; - - if($in_abuild) { - my (@k_images2, %k_rpms); - - my @k_images = KernelImg $ConfigData{kernel_img}, (`find $ConfigData{buildroot}/boot -type f`); - - if(!@k_images) { - die "Error: No kernel image identified! (Looking for \"$ConfigData{kernel_img}\" in \"$ConfigData{kernel_rpm}\".)\n\n"; - } - - $i = $ConfigData{buildroot} ? "-r $ConfigData{buildroot}" : ""; - - for (@k_images) { - $j = `rpm $i -qf /boot/$_ | head -n 1 | sed 's/-[^-]*-[^-]*\$//'` if -f "$ConfigData{buildroot}/boot/$_"; - chomp $j; - undef $j if $j =~ /^file /; # avoid "file ... not owned by any package" - $j =~ s/\-base$//; - $k_rpms{$_} = $j if $j; - if($j && $j eq $ConfigData{kernel_rpm}) { - push @k_images2, $_; - } - } - - if(@k_images == 1) { - # ok, use just this one - $ConfigData{kernel_img} = $k_images[0]; - } - else { - if(!@k_images2) { - die "Error: No kernel image identified! (Looking for \"$ConfigData{kernel_img}\" in \"$ConfigData{kernel_rpm}\".)\n\n"; - } - elsif(@k_images2 > 1) { - warn - "Warning: Can't identify the real kernel image, choosing the first:\n", - join(", ", @k_images2), "\n\n"; - } - $ConfigData{kernel_img} = $k_images2[0]; - } - $ConfigData{kernel_rpm} = $k_rpms{$ConfigData{kernel_img}} if $k_rpms{$ConfigData{kernel_img}}; - - $kv = `rpm $i -ql $ConfigData{kernel_rpm} 2>/dev/null | grep -m 1 modules | cut -d / -f 4`; - } - else { - $i = RPMFileName "$ConfigData{kernel_rpm}-base"; - - my @k_images = KernelImg $ConfigData{kernel_img}, (`rpm -qlp $i 2>/dev/null | grep ^/boot`); + my $k_dir = ReadRPM $ConfigData{kernel_rpm}; + if($k_dir) { + my @k_images = KernelImg [ `find $k_dir/rpm/boot -type f` ]; if(!@k_images) { die "Error: No kernel image identified! (Looking for \"$ConfigData{kernel_img}\".)\n\n"; @@ -700,14 +710,9 @@ } $ConfigData{kernel_img} = $k_images[0]; - - $kv = `rpm -qlp $i 2>/dev/null | grep -m 1 modules | cut -d / -f 4`; + $ConfigData{kernel_ver} = ReadFile "$k_dir/kernel"; + $ConfigData{module_type} = 'ko'; } - chomp $kv; - - $ConfigData{kernel_ver} = $kv; - - $ConfigData{module_type} = $kv =~ /^2\.[0-4]\./ ? "o" : "ko"; # print STDERR "kernel_img = $ConfigData{kernel_img}\n"; # print STDERR "kernel_rpm = $ConfigData{kernel_rpm}\n"; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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@hilbert.suse.de