mirror of
				https://github.com/flatcar/scripts.git
				synced 2025-10-31 08:11:03 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			468 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			468 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| set -euo pipefail
 | |
| rootfs="${1}"
 | |
| 
 | |
| pushd "${rootfs}"
 | |
| 
 | |
| rm -rf ./usr/{lib/debug,share,include,lib64/pkgconfig}
 | |
| 
 | |
| # Remove test stuff from python - it's quite large.
 | |
| for p in ./usr/lib/python*; do
 | |
|     if [[ ! -d ${p} ]]; then
 | |
|         continue
 | |
|     fi
 | |
|     # find directories named tests or test and remove them (-prune
 | |
|     # avoids searching below those directories)
 | |
|     find "${p}" \( -name tests -o -name test \) -type d -prune -exec rm -rf '{}' '+'
 | |
| done
 | |
| 
 | |
| popd
 |