mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	Refine hack_uname() in mlnxofed_ib_install.v2
This commit is contained in:
		| @@ -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),  | ||||
|   | ||||
| @@ -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),  | ||||
|   | ||||
| @@ -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),  | ||||
|   | ||||
| @@ -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" | ||||
|   | ||||
| @@ -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(); | ||||
| } | ||||
|   | ||||
| @@ -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"); | ||||
|   | ||||
| @@ -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)}; | ||||
|    | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user