2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 11:42:05 +00:00

Refine hack_uname() in mlnxofed_ib_install.v2

This commit is contained in:
hu-weihua 2016-10-18 23:15:19 -04:00
parent 05b9dcdeea
commit a6c910467e
7 changed files with 14 additions and 4 deletions

View File

@ -96,6 +96,7 @@ linuximage Attributes:
IMG_ARCH(The architecture of the osimage, such as "ppc64le","x86_64"),
IMG_NAME(The name of the osimage, such as "rhels7.3-ppc64le-netboot-compute"),
IMG_OSVER(The os release of the osimage, such as "rhels7.3","sles11.4"),
IMG_KERNELVERSION(the "kernelver" attribute of the osimage),
IMG_PROFILE(the profile of the osimage, such as "service","compute"),
IMG_PKGLIST(the "pkglist" attribute of the osimage),
IMG_PKGDIR(the "pkgdir" attribute of the osimage),

View File

@ -317,6 +317,7 @@ osimage Attributes:
IMG_ARCH(The architecture of the osimage, such as "ppc64le","x86_64"),
IMG_NAME(The name of the osimage, such as "rhels7.3-ppc64le-netboot-compute"),
IMG_OSVER(The os release of the osimage, such as "rhels7.3","sles11.4"),
IMG_KERNELVERSION(the "kernelver" attribute of the osimage),
IMG_PROFILE(the profile of the osimage, such as "service","compute"),
IMG_PKGLIST(the "pkglist" attribute of the osimage),
IMG_PKGDIR(the "pkgdir" attribute of the osimage),

View File

@ -778,6 +778,7 @@ passed as argument rather than by table value',
IMG_ARCH(The architecture of the osimage, such as "ppc64le","x86_64"),
IMG_NAME(The name of the osimage, such as "rhels7.3-ppc64le-netboot-compute"),
IMG_OSVER(The os release of the osimage, such as "rhels7.3","sles11.4"),
IMG_KERNELVERSION(the "kernelver" attribute of the osimage),
IMG_PROFILE(the profile of the osimage, such as "service","compute"),
IMG_PKGLIST(the "pkglist" attribute of the osimage),
IMG_PKGDIR(the "pkgdir" attribute of the osimage),

View File

@ -157,7 +157,11 @@ function hack_uname()
echo "\$ARCH"
;;
"-r")
cd /lib/modules && for d in * ; do : ; done && echo \$d
if [ -n "\$KERNELVERSION" ]; then
echo \$KERNELVERSION
else
for d in \$(ls /lib/modules | sort -V) ; do : ; done && echo \$d
fi
;;
"-s"|"")
echo "Linux"

View File

@ -722,6 +722,7 @@ if ($postinstall_filename) {
$ENV{IMG_NAME}=$imagename if("" ne $imagename);
$ENV{IMG_ARCH}=$arch if("" ne $arch);
$ENV{IMG_OSVER}=$osver if("" ne $osver);
$ENV{IMG_KERNELVERSION} = $kernelver if("" ne $kernelver);
$ENV{IMG_PROFILE}=$profile if("" ne $profile);
$ENV{IMG_PKGLIST}=$pkglist if("" ne $pkglist);
$ENV{IMG_PKGDIR}=$srcdir if("" ne $srcdir);
@ -745,7 +746,7 @@ if ($postinstall_filename) {
}
#delete the osimage attributes from environment variable
delete @ENV{qw(IMG_ARCH IMG_NAME IMG_OSVER IMG_PROFILE IMG_PKGLIST IMG_PKGDIR IMG_OTHERPKGLIST IMG_OTHERPKGDIR IMG_ROOTIMGDIR)};
delete @ENV{qw(IMG_ARCH IMG_NAME IMG_OSVER IMG_KERNELVERSION IMG_PROFILE IMG_PKGLIST IMG_PKGDIR IMG_OTHERPKGLIST IMG_OTHERPKGDIR IMG_ROOTIMGDIR)};
unuse_hackuname();
}

View File

@ -729,6 +729,7 @@ EOS_UNAME
$ENV{IMG_NAME}=$imagename if("" ne $imagename);
$ENV{IMG_ARCH}=$arch if("" ne $arch);
$ENV{IMG_OSVER}=$osver if("" ne $osver);
$ENV{IMG_KERNELVERSION} = $kernelver if("" ne $kernelver);
$ENV{IMG_PROFILE}=$profile if("" ne $profile);
$ENV{IMG_PKGLIST}=$pkglist if("" ne $pkglist);
$ENV{IMG_PKGDIR}=$srcdir if("" ne $srcdir);
@ -749,7 +750,7 @@ EOS_UNAME
}
#delete the osimage attributes from environment variable
delete @ENV{qw(IMG_ARCH IMG_NAME IMG_OSVER IMG_PROFILE IMG_PKGLIST IMG_PKGDIR IMG_OTHERPKGLIST IMG_OTHERPKGDIR IMG_ROOTIMGDIR)};
delete @ENV{qw(IMG_ARCH IMG_NAME IMG_OSVER IMG_KERNELVERSION IMG_PROFILE IMG_PKGLIST IMG_PKGDIR IMG_OTHERPKGLIST IMG_OTHERPKGDIR IMG_ROOTIMGDIR)};
# restore the orig uname
system("mv $rootimg_dir/bin/orig_uname $rootimg_dir/bin/uname");

View File

@ -622,6 +622,7 @@ if ($postinstall_filename) {
$ENV{IMG_ARCH}=$arch if("" ne $arch);
$ENV{IMG_NAME}=$imagename if("" ne $imagename);
$ENV{IMG_OSVER}=$osver if("" ne $osver);
$ENV{IMG_KERNELVERSION} = $kernelver if("" ne $kernelver);
$ENV{IMG_PROFILE}=$profile if("" ne $profile);
$ENV{IMG_PKGLIST}=$pkglist if("" ne $pkglist);
$ENV{IMG_PKGDIR}=$srcdir if("" ne $srcdir);
@ -642,7 +643,7 @@ if ($postinstall_filename) {
}
#delete the osimage attributes from environment variable
delete @ENV{qw(IMG_ARCH IMG_NAME IMG_OSVER IMG_PROFILE IMG_PKGLIST IMG_PKGDIR IMG_OTHERPKGLIST IMG_OTHERPKGDIR IMG_ROOTIMGDIR)};
delete @ENV{qw(IMG_ARCH IMG_NAME IMG_OSVER IMG_KERNELVERSION IMG_PROFILE IMG_PKGLIST IMG_PKGDIR IMG_OTHERPKGLIST IMG_OTHERPKGDIR IMG_ROOTIMGDIR)};
}