Rob Austein 6 years ago
parent
commit
d83e17dcd6
1 changed files with 18 additions and 18 deletions
  1. 18 18
      Makefile

+ 18 - 18
Makefile

@@ -1,44 +1,44 @@
-XILINX_TARBALL		:= Xilinx_ISE_DS_Lin_14.7_1015_1.tar
-XILINX_LICENSE		:= Xilinx.lic
-XILINX_PKGDIR		:= fs/$(basename ${XILINX_TARBALL})
+XILINX_TARBALL	:= Xilinx_ISE_DS_Lin_14.7_1015_1.tar
+XILINX_LICENSE	:= Xilinx.lic
+XILINX_PKGDIR	:= fs/$(basename ${XILINX_TARBALL})
 
-BOOTSTRAP_IMAGE		:= cryptech-builder:bootstrap
-BOOTSTRAP_CONTAINER	:= cryptech-builder-bootstrap
-BASE_IMAGE		:= cryptech-builder:base
+BOOT_IMAGE	:= cryptech-builder:boot
+BOOT_CONTAINER	:= cryptech-builder-boot
+BASE_IMAGE	:= cryptech-builder:base
 
 ifneq (./,$(sort $(dir ${XILINX_TARBALL} ${XILINX_LICENSE})))
 $(error XILINX_TARBALL and XILINX_LICENSE must be in this directory for bind mount)
 endif
 
-# all: $(if $(shell docker image ls -q ${NAME}:${VERS}),,Dockerfile ${DEB})
-
 all:
 ifeq (,$(shell docker image ls -q ${BASE_IMAGE}))
-	-docker container rm -f ${BOOTSTRAP_CONTAINER}
-	-docker image     rm -f ${BOOTSTRAP_IMAGE}
+	-docker container rm -f ${BOOT_CONTAINER}
+	-docker image     rm -f ${BOOT_IMAGE}
 	rm -rf fs
 	mkdir fs
-	sudo /usr/sbin/debootstrap --foreign jessie fs
-	sudo tar -C fs -c . | docker import - ${BOOTSTRAP_IMAGE}
+	sudo /usr/sbin/deboot --foreign jessie fs
+	sudo tar -C fs -c . | docker import - ${BOOT_IMAGE}
 	sudo rm -rf fs
 	mkdir fs
 	tar -C fs -xf ${XILINX_TARBALL}
 	test -d ${XILINX_PKGDIR}
-	docker run -it --name ${BOOTSTRAP_CONTAINER} \
+	docker run -it --name ${BOOT_CONTAINER} \
 		--mount type=bind,source=$(abspath .),target=/cryptech-builder \
 		--env 'XILINX_PKGDIR=/cryptech-builder/${XILINX_PKGDIR}' \
 		--env 'XILINX_LICENSE=${XILINX_LICENSE}' \
-		${BOOTSTRAP_IMAGE} \
+		${BOOT_IMAGE} \
 		/cryptech-builder/Builder
 	rm -rf fs
-	-mogrify -verbose -format png *.xwd && rm *.xwd
-	docker ${BOOTSTRAP_CONTAINER} ${BASE_IMAGE}
-	docker container rm -f ${BOOTSTRAP_CONTAINER}
+ifneq (,$(wildcard /usr/bin/mogrify))
+	-mogrify -verbose -format png *.xwd && rm -f *.xwd
+endif
+	docker commit ${BOOT_CONTAINER} ${BASE_IMAGE}
+	docker container rm -f ${BOOT_CONTAINER}
 endif
 	docker build -t cryptech-builder .
 
 clean:
 	git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
-	-docker container rm -f ${BOOTSTRAP_CONTAINER}
+	-docker container rm -f ${BOOT_CONTAINER}
 
 .PHONY: all clean