refactor how /etc/portage files are handled

This commit is contained in:
Albert Hopkins 2018-12-01 20:46:12 -08:00
parent 8f79ddc951
commit b4b167b462
6 changed files with 28 additions and 11 deletions

View File

@ -1,7 +1,7 @@
build\/.* build\/.*
loop\/.* loop\/.*
packages\/.* packages\/.*
portage\/.* ^portage\/.*
distfiles\/.* distfiles\/.*
^images\/.* ^images\/.*
.*\.cfg .*\.cfg

View File

@ -1,6 +1,6 @@
APPLIANCE ?= base APPLIANCE ?= base
VABUILDER_OUTPUT := $(CURDIR) VABUILDER_OUTPUT := $(CURDIR)
CHROOT = $(VABUILDER_OUTPUT)/build/$(APPLIANCE) CHROOT := $(VABUILDER_OUTPUT)/build/$(APPLIANCE)
VA_PKGDIR = $(VABUILDER_OUTPUT)/packages VA_PKGDIR = $(VABUILDER_OUTPUT)/packages
DISTDIR = $(CURDIR)/distfiles DISTDIR = $(CURDIR)/distfiles
PORTAGE_DIR = $(CURDIR)/portage PORTAGE_DIR = $(CURDIR)/portage
@ -44,10 +44,17 @@ M4C = $(M4) $(M4_DEFS)
USEPKG = --usepkg --binpkg-respect-use=y USEPKG = --usepkg --binpkg-respect-use=y
RSYNC_MIRROR = rsync://rsync.gtlib.gatech.edu/gentoo/ RSYNC_MIRROR = rsync://rsync.gtlib.gatech.edu/gentoo/
KERNEL_PKG = gentoo-sources KERNEL_PKG = gentoo-sources
PACKAGE_FILES = $(wildcard appliances/$(APPLIANCE)/package.*)
WORLD = appliances/$(APPLIANCE)/world WORLD = appliances/$(APPLIANCE)/world
EXTRA_WORLD = EXTRA_WORLD =
# /etc/portage targets
base_etc_portage := $(wildcard configs/portage/*)
etc_portage := $(patsubst configs/portage/%,$(CHROOT)/etc/portage/%,$(base_etc_portage))
appliance_package_files := $(wildcard appliances/$(APPLIANCE)/package.*)
portage_package_files = $(patsubst appliances/$(APPLIANCE)/package.%,$(CHROOT)/etc/portage/package.%/01$(APPLIANCE),$(appliance_package_files))
appliance_make_conf = $(wildcard appliances/$(APPLIANCE)/make.conf)
portage_make_conf_local = $(CHROOT)/etc/portage/make.conf.local
# Allow appliance to override variables # Allow appliance to override variables
-include appliances/$(APPLIANCE)/$(APPLIANCE).cfg -include appliances/$(APPLIANCE)/$(APPLIANCE).cfg
@ -106,7 +113,10 @@ $(PORTAGE_DIR):
@print Grabbing the portage tree @print Grabbing the portage tree
git clone --depth=1 git://github.com/gentoo/gentoo.git $(PORTAGE_DIR) git clone --depth=1 git://github.com/gentoo/gentoo.git $(PORTAGE_DIR)
$(PREPROOT): $(STAGE3) $(PORTAGE_DIR) configs/fstab $(CHROOT)/etc/portage/%: configs/portage/%
COPY --recursive $< /etc/portage/
$(PREPROOT): $(STAGE3) $(PORTAGE_DIR) configs/fstab $(etc_portage) $(portage_package_files)
mkdir -p $(VA_PKGDIR) $(DISTDIR) mkdir -p $(VA_PKGDIR) $(DISTDIR)
COPY configs/fstab /etc/fstab COPY configs/fstab /etc/fstab
ifeq ($(VIRTIO),YES) ifeq ($(VIRTIO),YES)
@ -143,17 +153,18 @@ endif
rm -f $(CHROOT)/etc/localtime rm -f $(CHROOT)/etc/localtime
touch $(STAGE3) touch $(STAGE3)
$(COMPILE_OPTIONS): $(STAGE3) $(PORTAGE_DIR) configs/make.conf.$(VA_ARCH) configs/locale.gen $(PACKAGE_FILES) $(CHROOT)/etc/portage/package.%/01$(APPLIANCE): appliances/$(APPLIANCE)/package.% $(STAGE3)
mkdir -p `dirname $@`
cp $< $@
$(portage_make_conf_local): $(appliance_make_conf)
COPY $< $@ || touch $@
$(COMPILE_OPTIONS): $(STAGE3) $(PORTAGE_DIR) configs/make.conf.$(VA_ARCH) configs/locale.gen $(portage_package_files) $(portage_make_conf_local)
COPY configs/make.conf.$(VA_ARCH) /etc/portage/make.conf COPY configs/make.conf.$(VA_ARCH) /etc/portage/make.conf
echo ACCEPT_KEYWORDS=$(ACCEPT_KEYWORDS) >> $(CHROOT)/etc/portage/make.conf echo ACCEPT_KEYWORDS=$(ACCEPT_KEYWORDS) >> $(CHROOT)/etc/portage/make.conf
-[ -f "appliances/$(APPLIANCE)/make.conf" ] && cat "appliances/$(APPLIANCE)/make.conf" >> $(CHROOT)/etc/portage/make.conf
COPY configs/locale.gen /etc/locale.gen COPY configs/locale.gen /etc/locale.gen
RUN locale-gen RUN locale-gen
for f in $(PACKAGE_FILES); do \
base=`basename $$f` ; \
mkdir -p $(CHROOT)/etc/portage/$$base; \
COPY $$f /etc/portage/$$base/virtual-appliance-$$base; \
done
touch $(COMPILE_OPTIONS) touch $(COMPILE_OPTIONS)
$(KERNEL): $(COMPILE_OPTIONS) $(KERNEL_CONFIG) scripts/build-kernel $(KERNEL): $(COMPILE_OPTIONS) $(KERNEL_CONFIG) scripts/build-kernel

View File

@ -12,3 +12,5 @@ EMERGE_DEFAULT_OPTS="--jobs=2 --autounmask=n"
FEATURES="noinfo -test nodoc noman nostrip unmerge-orphans buildpkg notitles parallel-fetch binpkg-multi-instance cgroup" FEATURES="noinfo -test nodoc noman nostrip unmerge-orphans buildpkg notitles parallel-fetch binpkg-multi-instance cgroup"
CURL_SSL="openssl" CURL_SSL="openssl"
PYTHON_TARGETS="python3_6" PYTHON_TARGETS="python3_6"
source make.conf.local

View File

@ -13,3 +13,5 @@ FEATURES="noinfo -test nodoc noman nostrip unmerge-orphans buildpkg notitles par
CURL_SSL="openssl" CURL_SSL="openssl"
PYTHON_TARGETS="python3_6" PYTHON_TARGETS="python3_6"
ABI_X86="32" ABI_X86="32"
source make.conf.local

View File

@ -0,0 +1,2 @@
dev-lang/python ssl xml
sys-process/procps kill