From 281319225baf64c81ab15c6552632dc5dcf0fa8f Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Mon, 28 Jan 2013 22:02:44 +0000 Subject: [PATCH] added script to to genesis-builder to determine the rpms we included from mcp git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15006 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-genesis-builder/findmcprpms | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 xCAT-genesis-builder/findmcprpms diff --git a/xCAT-genesis-builder/findmcprpms b/xCAT-genesis-builder/findmcprpms new file mode 100755 index 000000000..837a93568 --- /dev/null +++ b/xCAT-genesis-builder/findmcprpms @@ -0,0 +1,26 @@ +#!/usr/bin/perl +# Figure out which rpms are used in the mcp-based version of genesis by looking at the files +# we pull in and working backward to the rpms. +use strict; + +my $genesisrpm = shift @ARGV; +my %rpms; +my @files = `rpm -qlp $genesisrpm`; +my $total = scalar(@files); +my $i = 0; +foreach my $f (@files) { + $i++; + print "$i/$total\r"; + chomp($f); + if ($f !~ m|/opt/xcat/share/xcat/netboot/genesis/x86_64/fs|) { next; } + $f =~ s|^/opt/xcat/share/xcat/netboot/genesis/x86_64/fs||; + if (!$f || !(-e $f)) { next; } # there are files dracut creates that are not part of an rpm + my $rpm = `rpm -q --whatprovides $f`; + if ($?) { next; } # there are files dracut creates that are not part of an rpm + #print '.'; # show progress + chomp($rpm); + $rpms{$rpm} = 1; +} +print "\n"; +foreach my $r (sort keys %rpms) { print "$r\n"; } +exit;