diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index c424284fa..367459c70 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -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]}); diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index f297717e3..e3ea969a9 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -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}],