mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-10-31 01:57:48 +00:00 
			
		
		
		
	[kvm] improve the handling of compact_memory during kvm image build (#9184)
Build failed on a Ubuntu 20.04 system with kvm kernel, which does not have the /proc/sys/vm/compact_memory Should check if compact_memory is writeable before doing it. Signed-off-by: Chris Ward <tjcw@uk.ibm.com>
This commit is contained in:
		| @@ -59,7 +59,11 @@ free -m | ||||
| if [[ "$vs_build_prepare_mem" == "yes" ]]; then | ||||
|     # Force o.s. to drop cache and compact memory so that KVM can get 2G memory | ||||
|     bash -c 'echo 1 > /proc/sys/vm/drop_caches' | ||||
|     # Not all kernels support compact_memory | ||||
|     if [[ -w '/proc/sys/vm/compact_memory' ]] | ||||
|     then	     | ||||
|         bash -c 'echo 1 > /proc/sys/vm/compact_memory' | ||||
|     fi | ||||
|     free -m | ||||
| fi | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chris Ward
					Chris Ward