added umount to remove the mount on rootimg/proc in genimage and packimage, made two calls to zypper instead of one call so that os gets installed first before other packages.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3249 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
2d53a1e841
commit
a6a3fef0af
@ -94,6 +94,10 @@ sub process_request {
|
||||
$callback->({error=>["$installroot/netboot/$osver/$arch/$profile/rootimg does not exist, run genimage -o $osver -p $profile on a server with matching architecture"]});
|
||||
return;
|
||||
}
|
||||
|
||||
#some rpms like atftp mount the rootimg/proc to /proc, we need to make sure rootimg/proc is free of junk
|
||||
#before packaging the image
|
||||
`umount $installroot/netboot/$osver/$arch/$profile/rootimg/proc`;
|
||||
copybootscript($installroot, $osver, $arch, $profile, $callback);
|
||||
my $passtab = xCAT::Table->new('passwd');
|
||||
if ($passtab) {
|
||||
|
@ -119,7 +119,7 @@ unless ($onlyinitrd) {
|
||||
|
||||
#this is for extra packages
|
||||
my $srcdir_otherpkgs = "$installroot/post/otherpkgs/$osver/$arch";
|
||||
my $pkgnames=get_extra_package_names();
|
||||
my $extrapkgnames=get_extra_package_names();
|
||||
|
||||
|
||||
mkpath "$installroot/netboot/$osver/$arch/$profile/rootimg/etc";
|
||||
@ -141,7 +141,7 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
|
||||
#for extra packages
|
||||
if ($pkgnames) {
|
||||
if ($extrapkgnames) {
|
||||
if($osver_host == 11) { #SLES11
|
||||
if(-e "$installroot/netboot/$osver/$arch/$profile/rootimg/etc/zypp/repos.d/otherpkg.repo") {
|
||||
system("rm -rf $installroot/netboot/$osver/$arch/$profile/rootimg/etc/zypp/repos.d/otherpkg.repo");
|
||||
@ -192,26 +192,35 @@ unless ($onlyinitrd) {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $pkgnames;
|
||||
open($yumconfig,"<","$pkglist");
|
||||
while (<$yumconfig>) {
|
||||
chomp;
|
||||
s/\s*#.*//; #-- remove comments
|
||||
next if /^\s*$/; #-- skip empty lines
|
||||
$yumcmd .= $_ . " ";
|
||||
$pkgnames .= $_ . " ";
|
||||
}
|
||||
close($yumconfig);
|
||||
|
||||
|
||||
#append extra package names to zypper command
|
||||
if ($pkgnames) {
|
||||
$yumcmd .= " $pkgnames ";
|
||||
}
|
||||
|
||||
$yumcmd =~ s/ $/\n/;
|
||||
my $rc = system($yumcmd);
|
||||
#$yumcmd =~ s/ $/\n/;
|
||||
#print "$yumcmd $pkgnames\n";
|
||||
my $rc = system("$yumcmd $pkgnames");
|
||||
if ($rc) {
|
||||
print "zypper invocation failed\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
#add extra packages in the list
|
||||
if ($extrapkgnames) {
|
||||
#print "$yumcmd $extrapkgnames\n";
|
||||
$rc = system("$yumcmd $extrapkgnames");
|
||||
if ($rc) {
|
||||
print "zypper invocation failed\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
postscripts(); #run 'postscripts'
|
||||
}
|
||||
unlink "/tmp/genimage.$$.yum.conf";
|
||||
@ -230,9 +239,13 @@ if (($postinstall_filename) && (-x $postinstall_filename)) {
|
||||
}
|
||||
}
|
||||
|
||||
#some rpms mounts the imageroot/proc on the /proc, need to release it,
|
||||
#otherwise got kernal panic when installing
|
||||
`umount $installroot/netboot/$osver/$arch/$profile/rootimg/proc`;
|
||||
|
||||
mkinitrd();
|
||||
|
||||
|
||||
sub getlibs {
|
||||
my $file = shift;
|
||||
my $liblist = `chroot $installroot/netboot/$osver/$arch/$profile/rootimg ldd $file`;
|
||||
|
Loading…
Reference in New Issue
Block a user