From 76be9a9aa0e60f9bc3491b2da589e9704215ba4c Mon Sep 17 00:00:00 2001 From: Albert Hopkins Date: Sun, 19 Dec 2010 23:04:11 -0500 Subject: [PATCH] Makefile: make changing of root password and removing or portage tree both optional --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4a6e649..2bba853 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ SWAP_FILE = $(CHROOT)/.swap ARCH = amd64 MAKEOPTS = -j4 PRUNE_CRITICAL = NO +REMOVE_PORTAGE_TREE = YES +CHANGE_PASSWORD = YES HEADLESS = NO ACCEPT_KEYWORDS = amd64 @@ -45,6 +47,14 @@ else COPY_LOOP = rsync -ax --exclude-from=rsync-excludes gentoo/ loop/ endif +ifeq ($(CHANGE_PASSWORD),YES) + change_password = chroot $(CHROOT) passwd -d root; chroot $(CHROOT) passwd -e root +endif + +ifeq ($(REMOVE_PORTAGE_TREE),YES) + COPY_LOOP += --exclude=usr/portage +endif + ifeq ($(VIRTIO),YES) VIRTIO_FSTAB = sed -i 's/sda/vda/' $(CHROOT)/etc/fstab VIRTIO_GRUB = sed -i 's/sda/vda/' $(CHROOT)/boot/grub/grub.conf @@ -193,8 +203,7 @@ software: systools issue etc-update.conf $(CRITICAL) $(WORLD) $(gcc_config) chroot $(CHROOT) etc-update $(MAKE) -C $(APPLIANCE) postinstall - chroot $(CHROOT) passwd -d root - chroot $(CHROOT) passwd -e root + $(change_password) $(UNMERGE_CRITICAL) touch software