Skip to content

Commit

Permalink
improve pre-reqs checking (#140)
Browse files Browse the repository at this point in the history
some packages changed name between Focal and Jammy


Co-authored-by: craig bender <[email protected]>
  • Loading branch information
alexsander-souza and ThinGuy authored Sep 14, 2023
1 parent b27071c commit 7b3aadc
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 13 deletions.
6 changes: 5 additions & 1 deletion centos6/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0

Expand All @@ -8,7 +12,7 @@ export PACKER_LOG KS_PROXY
all: centos6.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion centos7/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0

Expand All @@ -8,7 +12,7 @@ export PACKER_LOG KS_PROXY
all: centos7.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion centos8-stream/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0

Expand All @@ -8,7 +12,7 @@ export PACKER_LOG KS_PROXY
all: centos8-stream.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion centos8/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0

Expand All @@ -8,7 +12,7 @@ export PACKER_LOG KS_PROXY
all: centos8.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion rhel7/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
ISO ?= ${RHEL7_ISO_PATH}
Expand All @@ -9,7 +13,7 @@ export PACKER_LOG KS_PROXY
all: rhel7.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion rhel8/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
ISO ?= ${RHEL8_ISO_PATH}
Expand All @@ -9,7 +13,7 @@ export PACKER_LOG KS_PROXY
all: rhel8.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion rhel9/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
ISO ?= rhel-baseos-9.1-x86_64-dvd.iso
Expand All @@ -9,7 +13,7 @@ export PACKER_LOG KS_PROXY
all: rhel9.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion rocky8/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0

Expand All @@ -8,7 +12,7 @@ export PACKER_LOG KS_PROXY
all: rocky8.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion rocky9/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0

Expand All @@ -8,7 +12,7 @@ export PACKER_LOG KS_PROXY
all: rocky9.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
7 changes: 7 additions & 0 deletions scripts/check.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define check_packages_deps
@if [ $(shell lsb_release -sr|cut -d. -f1) -ge 22 ];then \
dpkg -s libnbd-bin nbdkit packer fuse2fs $(1) > /dev/null; \
else \
dpkg -s libnbd0 nbdkit packer fuse2fs $(2)> /dev/null; \
fi
endef
6 changes: 5 additions & 1 deletion sles12/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
export PACKER_LOG
Expand All @@ -8,7 +12,7 @@ ISO ?= SLES12-SP5-JeOS.x86_64-12.5-OpenStack-Cloud-GM.qcow2
all: sles12.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion sles15/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
export PACKER_LOG
Expand All @@ -8,7 +12,7 @@ ISO ?= SLE-15-SP4-Full-x86_64-GM-Media1.iso
all: sles15.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs > /dev/null
$(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
6 changes: 5 additions & 1 deletion ubuntu/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
export PACKER_LOG
Expand All @@ -7,7 +11,7 @@ export PACKER_LOG
all: custom-cloudimg.tar.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fuse2fs cloud-image-utils ovmf > /dev/null
$(call check_packages_deps,cloud-image-utils ovmf,cloud-image-utils ovmf)

lint:
packer validate .
Expand Down
6 changes: 5 additions & 1 deletion vmware-esxi/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make -f

include ../scripts/check.mk

PACKER ?= packer
PACKER_LOG ?= 0
export PACKER_LOG
Expand All @@ -10,7 +14,7 @@ VENV := .ve
all: vmware-esxi.dd.gz

check-deps:
dpkg -s libnbd-bin nbdkit packer fusefat > /dev/null
$(call check_packages_deps,fusefat,fusefat )

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

0 comments on commit 7b3aadc

Please sign in to comment.