made the nodeset work with old images, backward compaitible

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7579 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2010-09-22 15:21:16 +00:00
parent ed66c9013c
commit e700e1a6fb
2 changed files with 68 additions and 18 deletions

View File

@ -310,22 +310,46 @@ sub mknetboot
$suffix = 'sfs' if (-r "$rootimgdir/rootimg.sfs");
# statelite images are not packed.
if ($statelite) {
unless ( -r "$rootimgdir/kernel" and -r "$rootimgdir/initrd-statelite.gz" ) {
unless ( -r "$rootimgdir/kernel") {
$callback->({
error=>[qq{Did you run "genimage" before running "liteimg"? kernel or initial ramdisk cannot be found...}],
error=>[qq{Did you run "genimage" before running "liteimg"? kernel cannot be found...}],
errorcode=>[1]
});
next;
}
if (!-r "$rootimgdir/initrd-statelite.gz") {
if (! -r "$rootimgdir/initrd.gz") {
$callback->({
error=>[qq{Did you run "genimage" before running "liteimg"? initrd.gz or initrd-statelite.gz cannot be found}],
errorcode=>[1]
});
next;
}
else {
copy("$rootimgdir/initrd.gz", "$rootimgdir/initrd-statelite.gz");
}
}
} else {
unless ( -r "$rootimgdir/kernel" and -r "$rootimgdir/initrd-stateless.gz" ) {
unless ( -r "$rootimgdir/kernel") {
$callback->({
error => [qq{Did you run "genimage" before running "packimage"? kernel or initial ramdisk cannot be found...}],
errorcode => [1]
});
error=>[qq{Did you run "genimage" before running "packimage"? kernel cannot be found}],
errorcode=>[1]
});
next;
}
if (!-r "$rootimgdir/initrd-stateless.gz") {
if (! -r "$rootimgdir/initrd.gz") {
$callback->({
error=>[qq{Did you run "genimage" before running "packimage"? initrd.gz or initrd-stateless.gz cannot be found}],
errorcode=>[1]
});
next;
}
else {
copy("$rootimgdir/initrd.gz", "$rootimgdir/initrd-stateless.gz");
}
}
unless ( -r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.sfs" ) {
unless ( -r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.sfs" ) {
$callback->({
error=>["No packed image for platform $osver, architecture $arch, and profile $profile, please run packimage (i.e. packimage -o $osver -p $profile -a $arch"],
errorcode => [1]});

View File

@ -180,22 +180,48 @@ sub mknetboot
#statelite images are not packed
if ($statelite) {
unless ( -r "$rootimgdir/kernel" and -r "$rootimgdir/initrd-statelite.gz") {
unless ( -r "$rootimgdir/kernel") {
$callback->({
error=>[qq{Did you run "genimage" before running "liteimg"? kernel or initrd-statelite.gz cannot be found}],
error=>[qq{Did you run "genimage" before running "liteimg"? kernel cannot be found}],
errorcode => [1]
});
next;
}
} else {
unless ( -r "$rootimgdir/kernel" and -r "$rootimgdir/initrd-stateless.gz" ) {
$callback->({
error=>[qq{Did you run "genimage" before running "packimage"? kernel or initrd-stateless.gz cannot be found}],
errorcode=>[1]
});
next;
}
}
if (!-r "$rootimgdir/initrd-statelite.gz") {
if (! -r "$rootimgdir/initrd.gz") {
$callback->({
error=>[qq{Did you run "genimage" before running "liteimg"? initrd.gz or initrd-statelite.gz cannot be found}],
errorcode=>[1]
});
next;
}
else {
copy("$rootimgdir/initrd.gz", "$rootimgdir/initrd-statelite.gz");
}
}
} else {
unless ( -r "$rootimgdir/kernel") {
$callback->({
error=>[qq{Did you run "genimage" before running "packimage"? kernel cannot be found}],
errorcode=>[1]
});
next;
}
if (!-r "$rootimgdir/initrd-stateless.gz") {
if (! -r "$rootimgdir/initrd.gz") {
$callback->({
error=>[qq{Did you run "genimage" before running "packimage"? initrd.gz or initrd-stateless.gz cannot be found}],
errorcode=>[1]
});
next;
}
else {
copy("$rootimgdir/initrd.gz", "$rootimgdir/initrd-stateless.gz");
}
}
unless ( -r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.sfs" ) {
$callback->({
error=>[qq{No packed image for platform $osver, architecture $arch, and profile $profile, please run packimage before nodeset}],