2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 17:30:19 +00:00

support sles12 for statelite, nfs and ramdisk (#1774)

This commit is contained in:
penguhyang
2016-09-20 11:08:27 +08:00
committed by yangsong
parent 31c5adb897
commit 7bcf328b0f

View File

@ -527,8 +527,11 @@ sub mknetboot
$nfsdir = $resHash->{nfsdir} . "/netboot/$osver/$arch/$profile";
}
}
$kcmdline =
"NFSROOT=$nfssrv:$nfsdir STATEMNT=";
if (&using_dracut($rootimgdir)) {
$kcmdline = "root=nfs:$nfssrv:$nfsdir/rootimg:ro STATEMNT=";
} else {
$kcmdline = "NFSROOT=$nfssrv:$nfsdir STATEMNT=";
}
} else {
$kcmdline =
"imgurl=$httpmethod://$imgsrv/$rootimgdir/rootimg-statelite.gz STATEMNT=";
@ -703,7 +706,13 @@ sub mknetboot
}
my $initrdstr = "$rtftppath/initrd-stateless.gz";
$initrdstr = "$rtftppath/initrd-statelite.gz" if ($statelite);
# special case for the dracut-enabled OSes
if ($statelite) {
unless (&using_dracut($rootimgdir) && ($rootfstype eq "ramdisk")) {
$initrdstr = "$rtftppath/initrd-statelite.gz";
}
}
if ($statelite)
{
@ -1722,6 +1731,19 @@ erver, if so, stop it first and try again" ],
}
}
# Check whether the dracut is supported by this os
sub using_dracut
{
my $rootimgdir = shift;
my $chkcmd = "chroot $rootimgdir/rootimg dracut --list-modules";
my $rc = system($chkcmd);
if ($rc) {
return 0;
} else {
return 1;
}
}
sub copycd
{
my $request = shift;