1
0

Add script for generate kernels with docker

This commit is contained in:
dump_stack() 2018-10-06 06:37:54 +00:00
parent a662e77f48
commit 4e898b421a

View File

@ -0,0 +1,10 @@
#!/bin/sh
mkdir output
find | grep Docker | sed 's/Dockerfile//' | while read DOCKER; do
CONTAINER_NAME=$(echo $DOCKER | sed -e 's;/;;g' -e 's;\.;;g' -e 's;\(.*\);\L\1;')
docker build -t ${CONTAINER_NAME} ${DOCKER}
CONTAINER_ID=$(docker ps -a | grep ${CONTAINER_NAME} | awk '{print $1}' | head -n 1)
docker cp ${CONTAINER_ID}:/boot/. output/
done
find output -type f | grep -v init | grep -v '/vmlinuz' | xargs rm
find output/* -type d | xargs rm -rf