Skip to content

Commit

Permalink
Expose dependencies during runtime (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
SK1Y101 authored Oct 18, 2023
1 parent b4df245 commit 7404ec6
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 28 deletions.
3 changes: 1 addition & 2 deletions centos6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export PACKER_LOG KS_PROXY

all: centos6.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

centos6.tar.gz: check-deps clean http/centos6.ks
${PACKER} init centos6.pkr.hcl && ${PACKER} build centos6.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions centos7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export PACKER_LOG KS_PROXY

all: centos7.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

centos7.tar.gz: clean check-deps http/centos7.ks
${PACKER} init centos7.pkr.hcl && ${PACKER} build centos7.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions centos8-stream/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export PACKER_LOG KS_PROXY

all: centos8-stream.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

centos8-stream.tar.gz: check-deps clean http/centos8-stream.ks
${PACKER} init centos8-stream.pkr.hcl && ${PACKER} build centos8-stream.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions centos8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export PACKER_LOG KS_PROXY

all: centos8.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

centos8.tar.gz: check-deps clean http/centos8.ks
${PACKER} init centos8.pkr.hcl && ${PACKER} build centos8.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions rhel7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export PACKER_LOG KS_PROXY

all: rhel7.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

rhel7.tar.gz: check-deps clean http/rhel7.ks
${PACKER} init rhel7.pkr.hcl && ${PACKER} build -var "rhel7_iso_path=${ISO}" rhel7.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions rhel8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export PACKER_LOG KS_PROXY

all: rhel8.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

rhel8.tar.gz: check-deps clean http/rhel8.ks
${PACKER} init rhel8.pkr.hcl && ${PACKER} build -var "rhel8_iso_path=${ISO}" rhel8.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions rhel9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export PACKER_LOG KS_PROXY

all: rhel9.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

rhel9.tar.gz: check-deps clean http/rhel9.ks
${PACKER} init rhel9.pkr.hcl && ${PACKER} build -var "rhel9_iso_path=${ISO}" rhel9.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions rocky8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export PACKER_LOG KS_PROXY

all: rocky8.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

rocky8.tar.gz: check-deps clean http/rocky.ks
${PACKER} init rocky8.pkr.hcl && ${PACKER} build rocky8.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions rocky9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export PACKER_LOG KS_PROXY

all: rocky9.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

rocky9.tar.gz: check-deps clean http/rocky.ks
${PACKER} init rocky9.pkr.hcl && ${PACKER} build rocky9.pkr.hcl
Expand Down
15 changes: 13 additions & 2 deletions scripts/check.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
define check_packages_deps
_current_deps := libnbd-bin nbdkit packer fuse2fs $(1)
_focal_deps := libnbd0 nbdkit packer fuse2fs $(2)

print-deps:
@if [ $(shell lsb_release -sr|cut -d. -f1) -ge 22 ];then \
dpkg -s libnbd-bin nbdkit packer fuse2fs $(1) > /dev/null; \
echo $$(_current_deps); \
else \
dpkg -s libnbd0 nbdkit packer fuse2fs $(2)> /dev/null; \
echo $$(_focal_deps); \
fi

check-deps:
@if [ $(shell lsb_release -sr|cut -d. -f1) -ge 22 ];then \
dpkg -s $$(_current_deps) > /dev/null; \
else \
dpkg -s $$(_focal_deps) > /dev/null; \
fi
endef
3 changes: 1 addition & 2 deletions sles12/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ ISO ?= SLES12-SP5-JeOS.x86_64-12.5-OpenStack-Cloud-GM.qcow2

all: sles12.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

sles12.tar.gz: check-deps clean
${PACKER} init sles.pkr.hcl && ${PACKER} build -var "sles12_iso_path=${ISO}" -on-error=ask sles.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions sles15/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ ISO ?= SLE-15-SP4-Full-x86_64-GM-Media1.iso

all: sles15.tar.gz

check-deps:
$(call check_packages_deps)
$(eval $(call check_packages_deps))

sles15.tar.gz: check-deps clean
${PACKER} init sles.pkr.hcl && ${PACKER} build -var "sles15_iso_path=${ISO}" -on-error=ask sles.pkr.hcl
Expand Down
3 changes: 1 addition & 2 deletions ubuntu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export PACKER_LOG

all: custom-cloudimg.tar.gz

check-deps:
$(call check_packages_deps,cloud-image-utils ovmf,cloud-image-utils ovmf)
$(eval $(call check_packages_deps,cloud-image-utils ovmf,cloud-image-utils ovmf))

lint:
packer validate .
Expand Down
3 changes: 1 addition & 2 deletions vmware-esxi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ VENV := .ve

all: vmware-esxi.dd.gz

check-deps:
$(call check_packages_deps,fusefat,fusefat )
$(eval $(call check_packages_deps,fusefat,fusefat ))

scripts.tar.xz:
export TMP_DIR=$$(mktemp -d /tmp/packer-maas-XXXX);\
Expand Down

0 comments on commit 7404ec6

Please sign in to comment.