Make script is now modular, create a directory for your appliance, drop
some files in it and "make APPLIANCE=..."
This commit is contained in:
parent
a2cd06b30f
commit
22f53efe34
25
Makefile
25
Makefile
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
HOSTNAME=gentoo
|
APPLIANCE=base
|
||||||
|
HOSTNAME=$(APPLIANCE)
|
||||||
RAW_IMAGE=$(HOSTNAME).img
|
RAW_IMAGE=$(HOSTNAME).img
|
||||||
QCOW_IMAGE=$(HOSTNAME).qcow
|
QCOW_IMAGE=$(HOSTNAME).qcow
|
||||||
VMDK_IMAGE=$(HOSTNAME).vmdk
|
VMDK_IMAGE=$(HOSTNAME).vmdk
|
||||||
|
@ -22,6 +23,11 @@ PORTAGE=/portage
|
||||||
DISTFILES=/var/portage/distfiles
|
DISTFILES=/var/portage/distfiles
|
||||||
STAGE3=ftp://ftp.osuosl.org/pub/gentoo/releases/$(ARCH)/autobuilds/current-stage3/stage3-$(ARCH)-*.tar.bz2
|
STAGE3=ftp://ftp.osuosl.org/pub/gentoo/releases/$(ARCH)/autobuilds/current-stage3/stage3-$(ARCH)-*.tar.bz2
|
||||||
KERNEL=gentoo-sources
|
KERNEL=gentoo-sources
|
||||||
|
PACKAGE_FILES=$(APPLIANCE)/package.*
|
||||||
|
WORLD=$(APPLIANCE)/world
|
||||||
|
CRITICAL=$(APPLIANCE)/critical
|
||||||
|
PREINSTALL=$(APPLIANCE)/preinstall
|
||||||
|
POSTINSTALL=$(APPLIANCE)/postinstall
|
||||||
|
|
||||||
|
|
||||||
all: image
|
all: image
|
||||||
|
@ -74,13 +80,14 @@ stage3: chroot
|
||||||
fi
|
fi
|
||||||
touch stage3
|
touch stage3
|
||||||
|
|
||||||
compile_options: make.conf package.use package.keywords locale.gen
|
compile_options: make.conf locale.gen $(PACKAGE_FILES)
|
||||||
cp make.conf $(CHROOT)/etc/make.conf
|
cp make.conf $(CHROOT)/etc/make.conf
|
||||||
cp locale.gen $(CHROOT)/etc/locale.gen
|
cp locale.gen $(CHROOT)/etc/locale.gen
|
||||||
chroot $(CHROOT) locale-gen
|
chroot $(CHROOT) locale-gen
|
||||||
mkdir -p $(CHROOT)/etc/portage
|
mkdir -p $(CHROOT)/etc/portage
|
||||||
cp package.use $(CHROOT)/etc/portage/package.use
|
for f in $(PACKAGE_FILES) ; do \
|
||||||
cp package.keywords $(CHROOT)/etc/portage/package.keywords
|
cp $$f $(CHROOT)/etc/portage/ ; \
|
||||||
|
done
|
||||||
touch compile_options
|
touch compile_options
|
||||||
|
|
||||||
base_system: mounts compile_options
|
base_system: mounts compile_options
|
||||||
|
@ -128,12 +135,12 @@ grub: systools grub.conf kernel
|
||||||
fi
|
fi
|
||||||
touch grub
|
touch grub
|
||||||
|
|
||||||
software: systools issue etc-update.conf critical world preinstall postinstall
|
software: systools issue etc-update.conf $(CRITICAL) $(WORLD) $(PREINSTALL) $(POSTINSTALL)
|
||||||
./preinstall "$(CHROOT)"
|
./$(PREINSTALL) "$(CHROOT)"
|
||||||
chroot $(CHROOT) emerge -DN $(USEPKG) system
|
chroot $(CHROOT) emerge -DN $(USEPKG) system
|
||||||
cp etc-update.conf $(CHROOT)/etc/
|
cp etc-update.conf $(CHROOT)/etc/
|
||||||
chroot $(CHROOT) etc-update
|
chroot $(CHROOT) etc-update
|
||||||
chroot $(CHROOT) emerge -DNn $(USEPKG) `cat world`
|
chroot $(CHROOT) emerge -DNn $(USEPKG) `cat $(WORLD)`
|
||||||
chroot $(CHROOT) emerge -1n app-portage/gentoolkit
|
chroot $(CHROOT) emerge -1n app-portage/gentoolkit
|
||||||
chroot $(CHROOT) revdep-rebuild -i
|
chroot $(CHROOT) revdep-rebuild -i
|
||||||
cp issue $(CHROOT)/etc/issue
|
cp issue $(CHROOT)/etc/issue
|
||||||
|
@ -141,9 +148,9 @@ software: systools issue etc-update.conf critical world preinstall postinstall
|
||||||
chroot $(CHROOT) gcc-config 1
|
chroot $(CHROOT) gcc-config 1
|
||||||
chroot $(CHROOT) passwd -d root
|
chroot $(CHROOT) passwd -d root
|
||||||
chroot $(CHROOT) passwd -e root
|
chroot $(CHROOT) passwd -e root
|
||||||
./postinstall "$(CHROOT)"
|
./$(POSTINSTALL) "$(CHROOT)"
|
||||||
if [ "$(PRUNE_CRITICAL)" = "YES" ] ; then \
|
if [ "$(PRUNE_CRITICAL)" = "YES" ] ; then \
|
||||||
chroot $(CHROOT) emerge -C `cat critical` ; \
|
chroot $(CHROOT) emerge -C `cat $(CRITICAL)` ; \
|
||||||
fi
|
fi
|
||||||
touch software
|
touch software
|
||||||
|
|
||||||
|
|
2
fstab
2
fstab
|
@ -1,4 +1,4 @@
|
||||||
# <fs> <mountpoint> <type> <opts> <dump/pass>
|
# <fs> <mountpoint> <type> <opts> <dump/pass>
|
||||||
/dev/vda1 / ext4 noatime 1 1
|
/dev/sda1 / ext4 noatime 1 1
|
||||||
/.swap none swap sw 0 0
|
/.swap none swap sw 0 0
|
||||||
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
|
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
|
||||||
|
|
Loading…
Reference in New Issue