diff --git a/centos7/Makefile b/centos7/Makefile index 6f2bf5a2..436a1e31 100644 --- a/centos7/Makefile +++ b/centos7/Makefile @@ -4,8 +4,18 @@ include ../scripts/check.mk PACKER ?= packer PACKER_LOG ?= 0 -KS_MIRROR ?= http://mirrorlist.centos.org -export PACKER_LOG KS_PROXY KS_MIRROR + +ifneq (${KS_MIRROR},) +KS_OS_REPOS := --url="${KS_MIRROR}/os/x86_64" +KS_UPDATES_REPOS := --baseurl="${KS_MIRROR}/updates/x86_64" +KS_EXTRA_REPOS := --baseurl="${KS_MIRROR}/extras/x86_64" +else +KS_OS_REPOS := --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os" +KS_UPDATES_REPOS := --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates" +KS_EXTRA_REPOS := --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras" +endif + +export PACKER_LOG KS_PROXY KS_OS_REPOS KS_UPDATES_REPOS KS_EXTRA_REPOS .PHONY: all clean check-deps @@ -17,7 +27,7 @@ centos7.tar.gz: clean check-deps http/centos7.ks ${PACKER} init centos7.pkr.hcl && ${PACKER} build centos7.pkr.hcl http/centos7.ks: http/centos7.ks.in - envsubst '$${KS_PROXY} $${KS_MIRROR}' < $< | tee $@ + envsubst '$${KS_PROXY} $${KS_OS_REPOS} $${KS_UPDATES_REPOS} $${KS_EXTRA_REPOS}' < $< | tee $@ clean: ${RM} -rf output-centos7 centos7.tar.gz http/centos7.ks diff --git a/centos7/http/centos7.ks.in b/centos7/http/centos7.ks.in index 92ff3d58..8c618790 100644 --- a/centos7/http/centos7.ks.in +++ b/centos7/http/centos7.ks.in @@ -1,4 +1,4 @@ -url --mirrorlist="${KS_MIRROR}/?release=7&arch=x86_64&repo=os" ${KS_PROXY} +url ${KS_OS_REPOS} ${KS_PROXY} poweroff firewall --enabled --service=ssh firstboot --disable @@ -12,8 +12,8 @@ timezone UTC --isUtc bootloader --location=mbr --driveorder="vda" --timeout=1 rootpw --plaintext password -repo --name="Updates" --mirrorlist="${KS_MIRROR}/?release=7&arch=x86_64&repo=updates" ${KS_PROXY} -repo --name="Extras" --mirrorlist="${KS_MIRROR}/?release=7&arch=x86_64&repo=extras" ${KS_PROXY} +repo --name="Updates" ${KS_UPDATES_REPOS} ${KS_PROXY} +repo --name="Extras" ${KS_EXTRA_REPOS} ${KS_PROXY} zerombr clearpart --all --initlabel