2008-02-12 19:10:33 +00:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
use File::Basename;
|
|
|
|
use File::Path;
|
|
|
|
use File::Copy;
|
|
|
|
use File::Find;
|
|
|
|
use Getopt::Long;
|
2008-09-11 22:03:01 +00:00
|
|
|
use Cwd qw(realpath);
|
2008-04-24 16:06:50 +00:00
|
|
|
#use strict;
|
2008-02-12 19:10:33 +00:00
|
|
|
Getopt::Long::Configure("bundling");
|
|
|
|
Getopt::Long::Configure("pass_through");
|
|
|
|
|
|
|
|
my $prinic; #TODO be flexible on node primary nic
|
|
|
|
my $othernics; #TODO be flexible on node primary nic
|
|
|
|
my $netdriver;
|
|
|
|
my @yumdirs;
|
|
|
|
my $arch = `uname -m`;
|
|
|
|
chomp($arch);
|
2008-04-29 17:51:53 +00:00
|
|
|
if ($arch =~ /i.86$/) {
|
|
|
|
$arch = x86;
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
my %libhash;
|
|
|
|
my @filestoadd;
|
|
|
|
my $profile;
|
|
|
|
my $osver;
|
|
|
|
my $pathtofiles=dirname($0);
|
2008-09-11 22:03:01 +00:00
|
|
|
my $fullpath=realpath($pathtofiles);
|
2008-02-12 19:36:20 +00:00
|
|
|
my $name = basename($0);
|
|
|
|
my $onlyinitrd=0;
|
|
|
|
if ($name =~ /geninitrd/) {
|
|
|
|
$onlyinitrd=1;
|
|
|
|
}
|
2008-02-27 20:32:31 +00:00
|
|
|
my $rootlimit;
|
|
|
|
my $tmplimit;
|
2008-05-12 15:45:49 +00:00
|
|
|
my $installroot = "/install";
|
|
|
|
my $kernelver = ""; #`uname -r`;
|
|
|
|
my $basekernelver; # = $kernelver;
|
2008-09-11 22:03:01 +00:00
|
|
|
my $customdir=$fullpath;
|
|
|
|
$customdir =~ s/.*share\/xcat/$installroot\/custom/;
|
2008-02-12 19:36:20 +00:00
|
|
|
|
2008-05-20 14:12:27 +00:00
|
|
|
sub xdie {
|
|
|
|
system("rm -rf /tmp/xcatinitrd.$$");
|
|
|
|
die @_;
|
|
|
|
}
|
|
|
|
|
|
|
|
$SIG{INT} = $SIG{TERM} = sub { xdie "Interrupted" };
|
2008-02-12 19:10:33 +00:00
|
|
|
GetOptions(
|
2008-05-12 15:45:49 +00:00
|
|
|
'a=s' => \$arch,
|
2008-02-12 19:10:33 +00:00
|
|
|
'p=s' => \$profile,
|
|
|
|
'o=s' => \$osver,
|
|
|
|
'n=s' => \$netdriver,
|
|
|
|
'i=s' => \$prinic,
|
2008-02-27 20:32:31 +00:00
|
|
|
'r=s' => \$othernics,
|
|
|
|
'l=s' => \$rootlimit,
|
2008-05-09 20:09:23 +00:00
|
|
|
't=s' => \$tmplimit,
|
|
|
|
'k=s' => \$kernelver
|
2008-02-12 19:10:33 +00:00
|
|
|
);
|
|
|
|
unless ($osver and $profile and $netdriver and $prinic) {
|
2008-05-09 20:09:23 +00:00
|
|
|
print 'Usage: genimage -i <nodebootif> -n <nodenetdrivers> [-r <otherifaces>] -o <OSVER> -p <PROFILE> -k <KERNELVER>'."\n";
|
2008-02-12 19:10:33 +00:00
|
|
|
print "Examples:\n";
|
|
|
|
print " genimage -i eth0 -n tg3 -o centos5.1 -p compute\n";
|
|
|
|
print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o centos5.1 -p compute\n";
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
my @ndrivers;
|
|
|
|
foreach (split /,/,$netdriver) {
|
|
|
|
unless (/\.ko$/) {
|
|
|
|
s/$/.ko/;
|
|
|
|
}
|
|
|
|
if (/^$/) {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
push @ndrivers,$_;
|
|
|
|
}
|
|
|
|
|
2008-03-27 13:26:20 +00:00
|
|
|
unless ($onlyinitrd) {
|
2008-03-27 13:29:39 +00:00
|
|
|
my $srcdir = "$installroot/$osver/$arch";
|
|
|
|
@yumdirs=();
|
|
|
|
find(\&isyumdir, <$installroot/$osver/$arch/>);
|
|
|
|
unless (scalar(@yumdirs)) {
|
|
|
|
#unless ( -d $srcdir."/repodata" ) {
|
2008-04-29 17:53:33 +00:00
|
|
|
print "Need $installroot/$osver/$arch/ available from a system that has ran copycds on $osver $arch\n";
|
2008-03-27 13:29:39 +00:00
|
|
|
exit 1;
|
|
|
|
}
|
2008-09-09 23:52:04 +00:00
|
|
|
|
2008-03-27 13:29:39 +00:00
|
|
|
my $yumconfig;
|
|
|
|
open($yumconfig,">","/tmp/genimage.$$.yum.conf");
|
|
|
|
my $repnum=0;
|
|
|
|
foreach $srcdir (@yumdirs) {
|
|
|
|
print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n";
|
|
|
|
$repnum += 1;
|
|
|
|
}
|
|
|
|
$repnum-=1;
|
|
|
|
close($yumconfig);
|
2008-05-06 18:18:33 +00:00
|
|
|
mkpath "$installroot/netboot/$osver/$arch/$profile/rootimg/etc";
|
|
|
|
my $fd;
|
|
|
|
open($fd,">>","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/fstab");
|
|
|
|
print $fd "#Dummy fstab for rpm postscripts to see\n";
|
|
|
|
close($fd);
|
2008-03-27 13:29:39 +00:00
|
|
|
my $yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$installroot/netboot/$osver/$arch/$profile/rootimg/ --disablerepo=* ";
|
|
|
|
foreach (0..$repnum) {
|
2008-09-09 21:08:48 +00:00
|
|
|
$yumcmd .= "--enablerepo=$osver-$arch-$_ ";
|
2008-03-27 13:29:39 +00:00
|
|
|
}
|
2008-09-09 23:52:04 +00:00
|
|
|
|
2008-03-27 13:29:39 +00:00
|
|
|
$yumcmd .= "install ";
|
|
|
|
mkpath("$installroot/netboot/$osver/$arch/$profile/rootimg/var/lib/yum");
|
2008-09-09 21:08:48 +00:00
|
|
|
|
2008-09-11 22:03:01 +00:00
|
|
|
my $pkglist= get_pkglist_file_name($customdir);
|
|
|
|
if (!$pkglist) {
|
|
|
|
$pkglist= get_pkglist_file_name($pathtofiles);
|
|
|
|
}
|
|
|
|
print "pkglist=$pkglist\n";
|
|
|
|
|
|
|
|
if (!$pkglist) {
|
2008-03-27 13:29:39 +00:00
|
|
|
print "Unable to find package list for $profile!";
|
2009-07-02 21:41:39 +00:00
|
|
|
exit 1;
|
2008-03-27 13:29:39 +00:00
|
|
|
}
|
2008-09-11 22:03:01 +00:00
|
|
|
|
2008-03-27 13:29:39 +00:00
|
|
|
open($yumconfig,"<","$pkglist");
|
|
|
|
while (<$yumconfig>) {
|
|
|
|
chomp;
|
|
|
|
$yumcmd .= $_ . " ";
|
|
|
|
}
|
2008-09-09 21:08:48 +00:00
|
|
|
close($yumconfig);
|
2008-03-27 13:29:39 +00:00
|
|
|
$yumcmd =~ s/ $/\n/;
|
2008-09-09 23:52:04 +00:00
|
|
|
|
|
|
|
#debug
|
|
|
|
#print "yumcmd=$yumcmd\n";
|
|
|
|
#my $repo=`cat /tmp/genimage.$$.yum.conf`;
|
|
|
|
#print "repo=$repo";
|
|
|
|
|
2008-02-12 19:36:20 +00:00
|
|
|
my $rc = system($yumcmd);
|
|
|
|
if ($rc) {
|
|
|
|
print "yum invocation failed\n";
|
|
|
|
exit 1;
|
|
|
|
}
|
2009-07-02 21:41:39 +00:00
|
|
|
|
|
|
|
#Now let's handle extra packages
|
|
|
|
my $srcdir_otherpkgs = "$installroot/post/otherpkgs/$osver/$arch";
|
|
|
|
my %extra_hash=get_extra_package_names();
|
|
|
|
my $extrapkgnames;
|
|
|
|
|
|
|
|
if (keys(%extra_hash) > 0) {
|
|
|
|
open($yumconfig,">>","/tmp/genimage.$$.yum.conf");
|
|
|
|
my $index=1;
|
|
|
|
foreach (keys(%extra_hash)) {
|
|
|
|
print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n";
|
|
|
|
$index++;
|
|
|
|
my $pa=$extra_hash{$_};
|
|
|
|
$extrapkgnames .= " " . join(' ', @$pa);
|
|
|
|
}
|
|
|
|
close($yumconfig);
|
|
|
|
$index--;
|
|
|
|
#enable extra package repo
|
|
|
|
$yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$installroot/netboot/$osver/$arch/$profile/rootimg/ --disablerepo=* ";
|
|
|
|
foreach (0..$repnum) {
|
|
|
|
$yumcmd .= "--enablerepo=$osver-$arch-$_ ";
|
|
|
|
}
|
|
|
|
for (1..$index) {
|
|
|
|
$yumcmd .= "--enablerepo=otherpkgs$_ ";
|
|
|
|
}
|
|
|
|
$yumcmd .= "install ";
|
|
|
|
#append extra pkg names to yum command
|
|
|
|
if ($extrapkgnames) {
|
|
|
|
$yumcmd .= " $extrapkgnames ";
|
|
|
|
}
|
|
|
|
$yumcmd =~ s/ $/\n/;
|
|
|
|
|
|
|
|
#debug
|
|
|
|
#print "yumcmd=$yumcmd\n";
|
|
|
|
#my $repo=`cat /tmp/genimage.$$.yum.conf`;
|
|
|
|
#print "repo=$repo";
|
|
|
|
|
|
|
|
my $rc = system($yumcmd);
|
|
|
|
if ($rc) {
|
|
|
|
print "yum invocation failed\n";
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-12 19:36:20 +00:00
|
|
|
postscripts(); #run 'postscripts'
|
2008-02-12 19:10:33 +00:00
|
|
|
}
|
2008-07-01 14:11:01 +00:00
|
|
|
#Default to the first kernel found in the install image if nothing specified explicitly.
|
|
|
|
#A more accurate guess than whatever the image build server happens to be running
|
|
|
|
#If specified, that takes precedence.
|
|
|
|
#if image has one, that is used
|
|
|
|
#if all else fails, resort to uname -r like this script did before
|
|
|
|
my @KVERS= <$installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/*>;
|
|
|
|
if (scalar(@KVERS)) {
|
|
|
|
$basekernelver = basename($KVERS[0]);
|
|
|
|
}
|
|
|
|
unless ($basekernelver) {
|
|
|
|
$basekernelver = `uname -r`;
|
|
|
|
}
|
|
|
|
unless ($kernelver) {
|
|
|
|
$kernelver=$basekernelver;
|
|
|
|
}
|
|
|
|
chomp($kernelver);
|
2008-02-12 19:10:33 +00:00
|
|
|
unlink "/tmp/genimage.$$.yum.conf";
|
2009-02-19 06:25:49 +00:00
|
|
|
|
|
|
|
#-- run postinstall script
|
|
|
|
if (-x "$pathtofiles/$profile.$osver.$arch.postinstall") {
|
|
|
|
my $rc = system("$pathtofiles/$profile.$osver.$arch.postinstall", "$installroot/netboot/$osver/$arch/$profile/rootimg",$osver,$arch,$profile);
|
|
|
|
if($rc) {
|
|
|
|
print "postinstall script failed\n";
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif (-x "$pathtofiles/$profile.postinstall") {
|
|
|
|
my $rc = system("$pathtofiles/$profile.postinstall","$installroot/netboot/$osver/$arch/$profile/rootimg",$osver,$arch,$profile);
|
|
|
|
if ($rc) {
|
|
|
|
print "postinstall script failed\n";
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-12 19:36:20 +00:00
|
|
|
mkinitrd();
|
2008-02-12 19:10:33 +00:00
|
|
|
|
|
|
|
sub getlibs {
|
|
|
|
my $file = shift;
|
|
|
|
my $liblist = `chroot $installroot/netboot/$osver/$arch/$profile/rootimg ldd $file`;
|
|
|
|
my @libs = split/\n/,$liblist;
|
|
|
|
my @return;
|
|
|
|
foreach (@libs) {
|
|
|
|
unless (/=>/) {
|
|
|
|
(my $wjnk, my $lib,my $jnk) = split /\s+/,$_,3;
|
|
|
|
$lib =~ s/^\///;
|
|
|
|
$libhash{$lib}=1;
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
(my $temp1,my $temp2) = split />/,$_,2;
|
|
|
|
(my $whitespace,$temp1,$temp2) = split /\s+/,$temp2,4;
|
|
|
|
unless ($temp1 =~ /\//) {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
$temp1 =~ s/^\///;
|
|
|
|
$libhash{$temp1}=1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub mkinitrd {
|
2008-05-09 20:09:23 +00:00
|
|
|
mkpath("/tmp/xcatinitrd.$$/bin");
|
|
|
|
if($basekernelver eq $kernelver) {
|
|
|
|
rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz*>,"$installroot/netboot/$osver/$arch/$profile/kernel");
|
|
|
|
}
|
|
|
|
else {
|
2008-05-20 12:08:32 +00:00
|
|
|
if(-r "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver") {
|
2008-05-19 17:38:12 +00:00
|
|
|
rename("$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel");
|
|
|
|
} elsif(-r "/boot/vmlinuz-$kernelver") {
|
2008-05-09 20:09:23 +00:00
|
|
|
copy("/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel");
|
|
|
|
}
|
|
|
|
else {
|
2008-05-20 14:12:27 +00:00
|
|
|
xdie("Cannot read /boot/vmlinuz-$kernelver");
|
2008-05-09 20:09:23 +00:00
|
|
|
}
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
symlink("bin","/tmp/xcatinitrd.$$/sbin");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/usr/bin");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/usr/sbin");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/usr/lib");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/usr/lib64");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/lib/firmware");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/lib64/firmware");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/proc");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/sys");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/dev/mapper");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/sysroot");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/etc/ld.so.conf.d");
|
|
|
|
mkpath("/tmp/xcatinitrd.$$/var/lib/dhclient");
|
|
|
|
my $inifile;
|
|
|
|
open($inifile,">","/tmp/xcatinitrd.$$/init");
|
|
|
|
print $inifile "#!/sbin/busybox.anaconda sh\n";
|
|
|
|
print $inifile "busybox.anaconda mount -t proc /proc /proc\n";
|
|
|
|
print $inifile "busybox.anaconda --install\n";
|
|
|
|
print $inifile "mount -t sysfs /sys /sys\n";
|
|
|
|
print $inifile "mount -o mode=0755 -t tmpfs /dev /dev\n";
|
|
|
|
print $inifile "mkdir /dev/pts\n";
|
|
|
|
print $inifile "mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts\n";
|
|
|
|
print $inifile "mkdir /dev/shm\n";
|
|
|
|
print $inifile "mkdir /dev/mapper\n";
|
|
|
|
print $inifile "mknod /dev/null c 1 3\n";
|
|
|
|
print $inifile "mknod /dev/zero c 1 5\n";
|
|
|
|
print $inifile "mknod /dev/systty c 4 0\n";
|
|
|
|
print $inifile "mknod /dev/tty c 5 0\n";
|
|
|
|
print $inifile "mknod /dev/console c 5 1\n";
|
|
|
|
print $inifile "mknod /dev/ptmx c 5 2\n";
|
|
|
|
print $inifile "mknod /dev/rtc c 10 135\n";
|
|
|
|
print $inifile "mknod /dev/tty0 c 4 0\n";
|
|
|
|
print $inifile "mknod /dev/tty1 c 4 1\n";
|
|
|
|
print $inifile "mknod /dev/tty2 c 4 2\n";
|
|
|
|
print $inifile "mknod /dev/tty3 c 4 3\n";
|
|
|
|
print $inifile "mknod /dev/tty4 c 4 4\n";
|
|
|
|
print $inifile "mknod /dev/tty5 c 4 5\n";
|
|
|
|
print $inifile "mknod /dev/tty6 c 4 6\n";
|
|
|
|
print $inifile "mknod /dev/tty7 c 4 7\n";
|
|
|
|
print $inifile "mknod /dev/tty8 c 4 8\n";
|
|
|
|
print $inifile "mknod /dev/tty9 c 4 9\n";
|
|
|
|
print $inifile "mknod /dev/tty10 c 4 10\n";
|
|
|
|
print $inifile "mknod /dev/tty11 c 4 11\n";
|
|
|
|
print $inifile "mknod /dev/tty12 c 4 12\n";
|
|
|
|
print $inifile "mknod /dev/ttyS0 c 4 64\n";
|
|
|
|
print $inifile "mknod /dev/ttyS1 c 4 65\n";
|
|
|
|
print $inifile "mknod /dev/ttyS2 c 4 66\n";
|
|
|
|
print $inifile "mknod /dev/ttyS3 c 4 67\n";
|
|
|
|
foreach (@ndrivers) {
|
|
|
|
print $inifile "insmod /lib/$_\n";
|
|
|
|
}
|
2008-04-24 16:06:50 +00:00
|
|
|
print $inifile <<EOMS;
|
|
|
|
netstart
|
2008-10-23 14:28:32 +00:00
|
|
|
while ! ifconfig | grep inet; do
|
|
|
|
echo Failed to acquire address, retrying
|
|
|
|
sleep 1
|
|
|
|
netstart
|
|
|
|
done
|
2008-05-14 23:16:48 +00:00
|
|
|
ifconfig lo 127.0.0.1
|
|
|
|
ifconfig lo up
|
2008-04-24 16:06:50 +00:00
|
|
|
cd /
|
|
|
|
for i in `cat /proc/cmdline`; do
|
|
|
|
KEY=`echo \$i |awk -F= '{print \$1}'`
|
|
|
|
if [ "\$KEY" == 'imgurl' ]; then
|
|
|
|
VALUE=`echo \$i |awk -F= '{print \$2}'`
|
|
|
|
if [ "http" == "`echo \$VALUE|awk -F: '{print \$1}'`" ]; then
|
|
|
|
#NOTE needs FT retry code to scale
|
|
|
|
#NOTE: should prob have max count
|
|
|
|
FILENAME=`echo \$VALUE|awk -F/ '{print \$NF}'`
|
|
|
|
while [ ! -r "\$FILENAME" ]; do
|
|
|
|
echo Getting \$VALUE...
|
|
|
|
if ! wget \$VALUE; then
|
|
|
|
sleep 5 #should be random, exponential for scale
|
|
|
|
rm -f \$FILENAME
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
NFS=0
|
|
|
|
fi
|
|
|
|
if [ "nfs" == "`echo \$VALUE|awk -F: '{print \$1}'`" ]; then
|
|
|
|
NFS=1
|
|
|
|
SERVER=`echo \$VALUE|awk -F/ '{print \$3}'`
|
|
|
|
ROOTDIR=`echo \$VALUE|awk -F/ '{for(i=4;i<=NF;i++) printf "/%s",\$i}'`
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2009-03-03 20:05:17 +00:00
|
|
|
echo 0 > /proc/sys/vm/zone_reclaim_mode #Avoid kernel bug
|
2008-04-24 16:06:50 +00:00
|
|
|
if [ "\$NFS" = "1" ]; then
|
|
|
|
echo Setting up nfs with ram overlay.
|
|
|
|
mknod /dev/loop0 b 7 0
|
|
|
|
mkdir -p /ro
|
|
|
|
mkdir -p /rw
|
|
|
|
#NOTE: should prob have max count
|
|
|
|
while [ ! -d /ro/bin ]; do
|
|
|
|
echo mounting \$SERVER:\$ROOTDIR on /ro
|
2008-04-28 18:03:18 +00:00
|
|
|
mount.nfs \$SERVER:\$ROOTDIR /ro -r -n -o nolock,rsize=32768,udp,nfsvers=3,timeo=14
|
2008-04-24 16:06:50 +00:00
|
|
|
sleep 5 #should be random, exponential for scale
|
|
|
|
done
|
|
|
|
mount -t tmpfs rw /rw
|
2008-05-11 14:25:45 +00:00
|
|
|
mkdir -p /rw/etc
|
|
|
|
mkdir -p /rw/var/lib/dhclient
|
|
|
|
cp /etc/resolv.conf /rw/etc/
|
2008-05-14 23:16:48 +00:00
|
|
|
cp /var/lib/dhclient/dhclient.leases /rw/var/lib/dhclient/dhclient-$prinic.leases
|
2008-04-24 16:06:50 +00:00
|
|
|
mount -t aufs -o dirs=/rw:/ro mergedroot /sysroot
|
2008-05-09 15:31:09 +00:00
|
|
|
mkdir -p /sysroot/ro
|
|
|
|
mkdir -p /sysroot/rw
|
|
|
|
mount --move /ro /sysroot/ro
|
|
|
|
mount --move /rw /sysroot/rw
|
2008-04-28 18:03:18 +00:00
|
|
|
cp /etc/resolv.conf /sysroot/etc/
|
2008-09-09 23:52:04 +00:00
|
|
|
echo xcatfs / aufs rw,_netdev 0 0 >> /sysroot/etc/fstab
|
2008-04-24 16:06:50 +00:00
|
|
|
elif [ -r /rootimg.sfs ]; then
|
|
|
|
echo Setting up squashfs with ram overlay.
|
|
|
|
mknod /dev/loop0 b 7 0
|
|
|
|
mkdir -p /ro
|
|
|
|
mkdir -p /rw
|
|
|
|
mount -t squashfs /rootimg.sfs /ro
|
|
|
|
mount -t tmpfs rw /rw
|
|
|
|
mount -t aufs -o dirs=/rw:/ro mergedroot /sysroot
|
2008-05-09 15:31:09 +00:00
|
|
|
mkdir -p /sysroot/ro
|
|
|
|
mkdir -p /sysroot/rw
|
|
|
|
mount --move /ro /sysroot/ro
|
|
|
|
mount --move /rw /sysroot/rw
|
2008-04-24 16:06:50 +00:00
|
|
|
EOMS
|
2008-02-12 19:10:33 +00:00
|
|
|
print $inifile "elif [ -r /rootimg.gz ]; then\n";
|
2008-04-24 16:06:50 +00:00
|
|
|
print $inifile "echo Setting up RAM-root tmpfs.\n";
|
2008-02-27 20:32:31 +00:00
|
|
|
if ($rootlimit) {
|
|
|
|
print $inifile " mount -o size=$rootlimit -t tmpfs rootfs /sysroot\n";
|
|
|
|
} else {
|
|
|
|
print $inifile " mount -t tmpfs rootfs /sysroot\n";
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
print $inifile " cd /sysroot\n";
|
|
|
|
print $inifile " echo -n \"Extracting root filesystem:\"\n";
|
|
|
|
print $inifile " if [ -x /bin/cpio ]; then\n";
|
|
|
|
print $inifile " zcat /rootimg.gz |/bin/cpio -idum\n";
|
|
|
|
print $inifile " else\n";
|
|
|
|
print $inifile " zcat /rootimg.gz |cpio -idum\n";
|
|
|
|
print $inifile " fi\n";
|
|
|
|
print $inifile " echo Done\n";
|
|
|
|
print $inifile "else\n";
|
|
|
|
print $inifile " echo -n Failed to download image, panicing in 5...\n";
|
|
|
|
print $inifile " for i in 4 3 2 1 0; do\n";
|
|
|
|
print $inifile " /bin/sleep 1\n";
|
|
|
|
print $inifile " echo -n \$i...\n";
|
|
|
|
print $inifile " done\n";
|
|
|
|
print $inifile " echo\n";
|
2008-04-24 16:06:50 +00:00
|
|
|
print $inifile <<EOMS;
|
|
|
|
echo "You're dead. rpower nodename reset to play again.
|
|
|
|
|
|
|
|
* Did you packimage with -m cpio, -m squashfs, or -m nfs?
|
|
|
|
* If using -m squashfs did you include aufs.ko with geninitrd?
|
|
|
|
e.g.: -n tg3,squashfs,aufs,loop
|
|
|
|
* If using -m nfs did you export NFS and sync rootimg? And
|
|
|
|
did you include the aufs and nfs modules in the proper order:
|
|
|
|
e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs
|
|
|
|
|
|
|
|
"
|
|
|
|
sleep 5
|
|
|
|
EOMS
|
2008-02-12 19:10:33 +00:00
|
|
|
print $inifile " exit\n";
|
|
|
|
print $inifile "fi\n";
|
|
|
|
print $inifile "cd /\n";
|
2008-02-27 14:47:07 +00:00
|
|
|
print $inifile "cp /var/lib/dhclient/dhclient.leases /sysroot/dev/.dhclient-$prinic.leases\n";
|
2008-05-14 23:16:48 +00:00
|
|
|
print $inifile "cp /var/lib/dhclient/dhclient.leases /sysroot/var/lib/dhclient/dhclient-$prinic.leases\n";
|
2008-02-12 19:10:33 +00:00
|
|
|
print $inifile "mknod /sysroot/dev/console c 5 1\n";
|
|
|
|
print $inifile "exec switch_root -c /dev/console /sysroot /sbin/init\n";
|
|
|
|
close($inifile);
|
|
|
|
open($inifile,">"."/tmp/xcatinitrd.$$/bin/netstart");
|
|
|
|
print $inifile "#!/sbin/nash\n";
|
2008-02-27 14:47:07 +00:00
|
|
|
print $inifile "network --device $prinic --bootproto dhcp\n";
|
2008-02-12 19:10:33 +00:00
|
|
|
close($inifile);
|
|
|
|
chmod(0755,"/tmp/xcatinitrd.$$/init");
|
|
|
|
chmod(0755,"/tmp/xcatinitrd.$$/bin/netstart");
|
|
|
|
@filestoadd=();
|
|
|
|
foreach (@ndrivers) {
|
2008-09-11 22:03:01 +00:00
|
|
|
if (-f "$customdir/$_") {
|
2008-02-12 19:10:33 +00:00
|
|
|
push @filestoadd,[$_,"lib/$_"];
|
2008-09-11 22:03:01 +00:00
|
|
|
} elsif (-f "$pathtofiles/$_") {
|
|
|
|
push @filestoadd,[$_,"lib/$_"];
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
}
|
2008-09-11 22:03:01 +00:00
|
|
|
|
2008-05-07 20:09:23 +00:00
|
|
|
foreach ("bin/cpio","sbin/nash","sbin/busybox.anaconda","sbin/rmmod","sbin/mount.nfs") {
|
2008-02-12 19:10:33 +00:00
|
|
|
getlibs($_);
|
|
|
|
push @filestoadd,$_;
|
|
|
|
}
|
2008-05-07 20:09:23 +00:00
|
|
|
if ($arch =~ /x86_64/) {
|
|
|
|
push @filestoadd,"lib64/libnss_dns.so.2";
|
2008-06-24 13:48:35 +00:00
|
|
|
push @filestoadd,"lib64/libresolv.so.2";
|
2008-05-07 20:09:23 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
push @filestoadd,"lib/libnss_dns.so.2";
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
push @filestoadd,keys %libhash;
|
2008-05-09 20:09:23 +00:00
|
|
|
if($basekernelver ne $kernelver) {
|
|
|
|
system("rm -rf $installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/$basekernelver");
|
2008-05-19 17:38:12 +00:00
|
|
|
unless (-d "$installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/$kernelver") {
|
|
|
|
if(-d "/lib/modules/$kernelver") {
|
|
|
|
system("cd /lib/modules;cp -r $kernelver $installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/");
|
|
|
|
}
|
|
|
|
else {
|
2008-05-20 14:12:27 +00:00
|
|
|
xdie("Cannot read /lib/modules/$kernelver");
|
2008-05-19 17:38:12 +00:00
|
|
|
}
|
|
|
|
}
|
2008-05-09 20:09:23 +00:00
|
|
|
}
|
|
|
|
find(\&isnetdriver, <$installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/$kernelver/*>);
|
2008-09-11 22:03:01 +00:00
|
|
|
|
2008-02-12 19:10:33 +00:00
|
|
|
foreach (@filestoadd) {
|
|
|
|
if (ref($_)) {
|
2008-09-11 22:03:01 +00:00
|
|
|
#print "$_->[0], $_->[1]\n";
|
2008-02-12 19:10:33 +00:00
|
|
|
my $srcpath = "$installroot/netboot/$osver/$arch/$profile/rootimg/".$_->[0];
|
2008-09-11 22:03:01 +00:00
|
|
|
if (-f "$customdir/".$_->[0]) {
|
|
|
|
$srcpath="$customdir/".$_->[0];
|
|
|
|
} elsif (-f "$pathtofiles/".$_->[0]) {
|
2008-02-12 19:10:33 +00:00
|
|
|
$srcpath="$pathtofiles/".$_->[0];
|
|
|
|
}
|
2008-06-02 15:41:50 +00:00
|
|
|
mkpath(dirname("/tmp/xcatinitrd.$$/".$_->[1]));
|
2008-02-12 19:10:33 +00:00
|
|
|
copy($srcpath,"/tmp/xcatinitrd.$$/".$_->[1]);
|
|
|
|
chmod 0755,"/tmp/xcatinitrd.$$/".$_->[1];
|
|
|
|
} else {
|
2008-09-11 22:03:01 +00:00
|
|
|
#print "$_\n";
|
2008-02-12 19:10:33 +00:00
|
|
|
my $srcpath = "$installroot/netboot/$osver/$arch/$profile/rootimg/$_";
|
2008-09-11 22:03:01 +00:00
|
|
|
if (-f "$customdir/$_") {
|
|
|
|
$srcpath = "$customdir/$_";
|
|
|
|
} elsif (-f "$pathtofiles/$_") {
|
2008-09-09 23:52:04 +00:00
|
|
|
$srcpath = "$pathtofiles/$_";
|
2008-02-12 19:10:33 +00:00
|
|
|
}
|
2008-06-02 15:41:50 +00:00
|
|
|
mkpath(dirname("/tmp/xcatinitrd.$$/$_"));
|
2008-02-12 19:10:33 +00:00
|
|
|
copy("$srcpath","/tmp/xcatinitrd.$$/$_");
|
|
|
|
chmod 0755,"/tmp/xcatinitrd.$$/".$_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#copy("$installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/*d","/tmp/xcatinitrd.$$/$_");
|
|
|
|
system("cd /tmp/xcatinitrd.$$;find .|cpio -H newc -o|gzip -9 -c - > $installroot/netboot/$osver/$arch/$profile/initrd.gz");
|
|
|
|
system("rm -rf /tmp/xcatinitrd.$$");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sub isyumdir {
|
|
|
|
if ($File::Find::name =~ /\/repodata$/) {
|
|
|
|
my $location = $File::Find::name;
|
|
|
|
$location =~ s/\/repodata$//;
|
|
|
|
push @yumdirs,$location;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub isnetdriver {
|
|
|
|
foreach (@ndrivers) {
|
2008-05-09 21:18:42 +00:00
|
|
|
if ($File::Find::name =~ /\/$_/) {
|
2008-02-12 19:10:33 +00:00
|
|
|
my $filetoadd = $File::Find::name;
|
|
|
|
$filetoadd =~ s!$installroot/netboot/$osver/$arch/$profile/rootimg/!!;
|
|
|
|
push @filestoadd,[$filetoadd,"lib/$_"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub postscripts { # TODO: customized postscripts
|
|
|
|
generic_post();
|
|
|
|
if (-d "$installroot/postscripts/hostkeys") {
|
|
|
|
for my $key (<$installroot/postscripts/hostkeys/*key>) {
|
|
|
|
copy ($key,"$installroot/netboot/$osver/$arch/$profile/rootimg/etc/ssh/");
|
|
|
|
}
|
|
|
|
chmod 0600,</$installroot/netboot/$osver/$arch/$profile/rootimg/etc/ssh/*key>;
|
|
|
|
}
|
|
|
|
if (-d "/$installroot/postscripts/.ssh") {
|
|
|
|
mkpath("/$installroot/netboot/$osver/$arch/$profile/rootimg/root/.ssh");
|
|
|
|
chmod(0700,"/$installroot/netboot/$osver/$arch/$profile/rootimg/root/.ssh/");
|
|
|
|
for my $file (</$installroot/postscripts/.ssh/*>) {
|
|
|
|
copy ($file,"/$installroot/netboot/$osver/$arch/$profile/rootimg/root/.ssh/");
|
|
|
|
}
|
|
|
|
chmod(0600,</$installroot/netboot/$osver/$arch/$profile/rootimg/root/.ssh/*>);
|
|
|
|
}
|
2008-04-14 12:32:20 +00:00
|
|
|
|
2008-02-12 19:10:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub generic_post { #This function is meant to leave the image in a state approximating a normal install
|
|
|
|
my $cfgfile;
|
|
|
|
unlink("$installroot/netboot/$osver/$arch/$profile/rootimg/dev/null");
|
|
|
|
system("mknod $installroot/netboot/$osver/$arch/$profile/rootimg/dev/null c 1 3");
|
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/fstab");
|
|
|
|
print $cfgfile "devpts /dev/pts devpts gid=5,mode=620 0 0\n";
|
|
|
|
print $cfgfile "tmpfs /dev/shm tmpfs defaults 0 0\n";
|
|
|
|
print $cfgfile "proc /proc proc defaults 0 0\n";
|
|
|
|
print $cfgfile "sysfs /sys sysfs defaults 0 0\n";
|
2008-02-27 20:32:31 +00:00
|
|
|
if ($tmplimit) {
|
|
|
|
print $cfgfile "tmpfs /tmp tmpfs defaults 0 0\n";
|
|
|
|
print $cfgfile "tmpfs /var/tmp tmpfs defaults 0 0\n";
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
close($cfgfile);
|
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/sysconfig/network");
|
|
|
|
print $cfgfile "NETWORKING=yes\n";
|
|
|
|
close($cfgfile);
|
2008-05-07 19:20:47 +00:00
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/resolv.conf");
|
|
|
|
print $cfgfile "#Dummy resolv.conf to make boot cleaner";
|
|
|
|
close($cfgfile);
|
2008-02-12 19:10:33 +00:00
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/sysconfig/network-scripts/ifcfg-$prinic");
|
|
|
|
print $cfgfile "ONBOOT=yes\nBOOTPROTO=dhcp\nDEVICE=$prinic\n";
|
|
|
|
close($cfgfile);
|
|
|
|
foreach (split /,/,$othernics) {
|
|
|
|
if (/^$/) { next; }
|
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/sysconfig/network-scripts/ifcfg-$_");
|
|
|
|
print $cfgfile "ONBOOT=yes\nBOOTPROTO=dhcp\nDEVICE=$_\n";
|
|
|
|
close($cfgfile);
|
|
|
|
}
|
2008-05-07 14:51:12 +00:00
|
|
|
open($cfgfile,">>","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/securetty");
|
|
|
|
print $cfgfile "ttyS0\n";
|
|
|
|
print $cfgfile "ttyS1\n";
|
|
|
|
close($cfgfile);
|
|
|
|
my @passwd;
|
|
|
|
open($cfgfile,"<","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/passwd");
|
|
|
|
@passwd = <$cfgfile>;
|
|
|
|
close($cfgfile);
|
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/passwd");
|
|
|
|
foreach (@passwd) {
|
|
|
|
if (/^root:/) {
|
|
|
|
s/^root:\*/root:x/
|
|
|
|
}
|
|
|
|
print $cfgfile $_;
|
|
|
|
}
|
|
|
|
close($cfgfile);
|
2008-05-07 15:27:10 +00:00
|
|
|
foreach (<$installroot/netboot/$osver/$arch/$profile/rootimg/etc/skel/.*>) {
|
|
|
|
if (basename($_) eq '.' or basename($_) eq '..') {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
copy $_,"$installroot/netboot/$osver/$arch/$profile/rootimg/root/";
|
|
|
|
}
|
2008-06-07 16:38:08 +00:00
|
|
|
unless ( -r <$installroot/netboot/$osver/$arch/$profile/rootimg/etc/rc3.d/S??network>) {
|
|
|
|
symlink "/etc/init.d/network","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/rc3.d/S10network";
|
|
|
|
}
|
2008-02-12 19:10:33 +00:00
|
|
|
open($cfgfile,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/rc3.d/S60gettyset");
|
|
|
|
print $cfgfile "#!/bin/bash\n";
|
|
|
|
print $cfgfile "for i in `cat /proc/cmdline`; do\n";
|
|
|
|
print $cfgfile ' KEY=`echo $i|cut -d= -f 1`'."\n";
|
|
|
|
print $cfgfile " if [ \"\$KEY\" == \"console\" ]; then\n";
|
|
|
|
print $cfgfile " VALUE=`echo \$i | cut -d= -f 2`\n";
|
|
|
|
print $cfgfile " COTTY=`echo \$VALUE|cut -d, -f 1`\n";
|
|
|
|
print $cfgfile " COSPEED=`echo \$VALUE|cut -d, -f 2|cut -dn -f 1`\n";
|
|
|
|
print $cfgfile " if echo \$VALUE | grep n8r; then\n";
|
|
|
|
print $cfgfile " FLOWFLAG=\"-h\"\n";
|
|
|
|
print $cfgfile " fi\n";
|
2008-06-07 16:38:08 +00:00
|
|
|
print $cfgfile " if [ -x /sbin/initctl ]; then\n"; #Upstart style
|
|
|
|
print $cfgfile " initctl emit --no-wait fedora.serial-console-available \$COTTY \$COSPEED\n";
|
|
|
|
print $cfgfile " else\n";
|
|
|
|
print $cfgfile " echo xco:2345:respawn:/sbin/agetty \$FLOWFLAG \$COTTY \$COSPEED xterm >> /etc/inittab\n";
|
|
|
|
print $cfgfile " init q\n";
|
|
|
|
print $cfgfile " fi\n";
|
2008-02-12 19:10:33 +00:00
|
|
|
print $cfgfile " fi\n";
|
|
|
|
print $cfgfile "done\n";
|
|
|
|
close($cfgfile);
|
|
|
|
chmod(0755,"$installroot/netboot/$osver/$arch/$profile/rootimg/etc/rc3.d/S60gettyset");
|
|
|
|
#link("$installroot/netboot/$osver/$arch/$profile/rootimg/sbin/init","$installroot/netboot/$osver/$arch/$profile/rootimg/init");
|
|
|
|
|
|
|
|
rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz*>,"$installroot/netboot/$osver/$arch/$profile/kernel");
|
|
|
|
}
|
2008-09-09 21:08:48 +00:00
|
|
|
|
2008-09-09 23:52:04 +00:00
|
|
|
#get th extra package name
|
|
|
|
sub get_extra_package_names {
|
2008-09-11 22:03:01 +00:00
|
|
|
my $otherpkglist=get_extra_pkglist_file_name($customdir);
|
|
|
|
if (!$otherpkglist) { $otherpkglist=get_extra_pkglist_file_name($pathtofiles); }
|
2009-07-02 21:41:39 +00:00
|
|
|
my %pkgnames=();
|
|
|
|
my @tmp_array=();
|
|
|
|
|
2008-09-11 22:03:01 +00:00
|
|
|
|
2008-09-09 23:52:04 +00:00
|
|
|
if ($otherpkglist) {
|
|
|
|
my $pkgfile;
|
|
|
|
open($pkgfile,"<","$otherpkglist");
|
|
|
|
while (<$pkgfile>) {
|
|
|
|
chomp;
|
2009-07-02 21:41:39 +00:00
|
|
|
s/\s+$//; #remove trailing white spaces
|
|
|
|
next if /^\s*$/; #-- skip empty lines
|
|
|
|
push(@tmp_array,$_);
|
2008-09-09 23:52:04 +00:00
|
|
|
}
|
|
|
|
close($pkgfile);
|
2009-07-02 21:41:39 +00:00
|
|
|
|
|
|
|
if ( @tmp_array > 0) {
|
|
|
|
my $pkgtext=join(',',@tmp_array);
|
|
|
|
|
|
|
|
#handle the #INLCUDE# tag recursively
|
|
|
|
my $idir = dirname($otherpkglist);
|
|
|
|
my $doneincludes=0;
|
|
|
|
while (not $doneincludes) {
|
|
|
|
$doneincludes=1;
|
|
|
|
if ($pkgtext =~ /#INCLUDE:[^#]+#/) {
|
|
|
|
$doneincludes=0;
|
|
|
|
$pkgtext =~ s/#INCLUDE:([^#]+)#/include_file($1,$idir)/eg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#print "pkgtext=$pkgtext\n";
|
|
|
|
my @tmp=split(',', $pkgtext);
|
|
|
|
foreach (@tmp) {
|
|
|
|
my $idir=dirname($_);
|
|
|
|
my $fn=basename($_);
|
|
|
|
if (exists($pkgnames{$idir})) {
|
|
|
|
my $pa=$pkgnames{$idir};
|
|
|
|
push(@$pa, $fn);
|
|
|
|
} else {
|
|
|
|
$pkgnames{$idir}=[$fn];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-09-09 23:52:04 +00:00
|
|
|
}
|
|
|
|
|
2009-07-02 21:41:39 +00:00
|
|
|
return %pkgnames;
|
2008-09-09 23:52:04 +00:00
|
|
|
}
|
|
|
|
|
2009-07-02 21:41:39 +00:00
|
|
|
|
|
|
|
sub include_file
|
|
|
|
{
|
|
|
|
my $file = shift;
|
|
|
|
my $idir = shift;
|
|
|
|
my @text = ();
|
|
|
|
unless ($file =~ /^\//) {
|
|
|
|
$file = $idir."/".$file;
|
|
|
|
}
|
|
|
|
|
|
|
|
open(INCLUDE,$file) || \
|
|
|
|
return "#INCLUDEBAD:cannot open $file#";
|
|
|
|
|
|
|
|
while(<INCLUDE>) {
|
|
|
|
chomp($_);
|
|
|
|
s/\s+$//; #remove trailing spaces
|
|
|
|
next if /^\s*$/; #-- skip empty lines
|
|
|
|
push(@text, $_);
|
|
|
|
}
|
|
|
|
|
|
|
|
close(INCLUDE);
|
|
|
|
|
|
|
|
return join(',', @text);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-09-11 22:03:01 +00:00
|
|
|
sub get_extra_pkglist_file_name {
|
|
|
|
my $base=shift;
|
|
|
|
if (-r "$base/$profile.$osver.$arch.otherpkgs.pkglist") {
|
|
|
|
return "$base/$profile.$osver.$arch.otherpkgs.pkglist";
|
|
|
|
} elsif (-r "$base/$profile.$arch.otherpkgs.pkglist") {
|
|
|
|
return "$base/$profile.$arch.otherpkgs.pkglist";
|
|
|
|
} elsif (-r "$base/$profile.$osver.otherpkgs.pkglist") {
|
|
|
|
return "$base/$profile.$osver.otherpkgs.pkglist";
|
|
|
|
} elsif (-r "$base/$profile.otherpkgs.pkglist") {
|
|
|
|
return "$base/$profile.otherpkgs.pkglist";
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub get_pkglist_file_name {
|
|
|
|
my $base=shift;
|
|
|
|
if (-r "$base/$profile.$osver.$arch.pkglist") {
|
|
|
|
return "$base/$profile.$osver.$arch.pkglist";
|
|
|
|
} elsif (-r "$base/$profile.$arch.pkglist") {
|
|
|
|
return "$base/$profile.$arch.pkglist";
|
|
|
|
} elsif (-r "$base/$profile.$osver.pkglist") {
|
|
|
|
return "$base/$profile.$osver.pkglist";
|
|
|
|
} elsif (-r "$base/$profile.pkglist") {
|
|
|
|
return "$base/$profile.pkglist";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2008-09-09 21:08:48 +00:00
|
|
|
|