3f012958dc
Renamed server-light.iso into server-ovz.iso to avoid brand dilution and confusion (rider@'s server-light rather favours kvm, anyways). Introduced KDEFAULT: a reliable default kernel chooser knob since apt's regex ordering proved pretty unreliable. Spelling things explicitly is better anyways. SYSLINUX related features undergone pretty major rewrite (that includes syslinux, hdt and memtest). The problem to tackle was features.in/syslinux/generate.mk assuming syslinux and pciids available in build *host* system; this well might not be the case (or worse yet, those can be just different). So now we're a bit less elegant and a bit more enterprise, stuffing things into chroot and working there. Bunch of other fixes along the road, including ; to name a few: - fixed memtest entry (overlooked while renaming SYSLINUX_ITEMS) - new and shiny doc/CodingStyle - gfxboot, stage1 target chain, hdt tweaks - distro.mk rehashed - README++ - TODO: dropped (integer overflow anyways) + actually moved off-tree to reduce commit spam - s,\.config\.mk,distcfg.mk,g - doc/profiles.mk.sample: sample ~/.mkimage/profiles.mk - ...and assorted fixups/additions Sorry for convoluted commit, this would have been pretty hard to rework into some really readable shape (and you might be interested in the original repo's history horrors then, anyways).
55 lines
1.8 KiB
Makefile
55 lines
1.8 KiB
Makefile
# steps to build a distribution image:
|
|
# --- here
|
|
# 1. initialize new profile (BUILDDIR) as a copy of image.in/
|
|
# 2. configure distro
|
|
# 3. copy subprofiles, script hooks, and package lists/groups
|
|
# from metaprofile to new profile (as needed)
|
|
# --- in BUILDDIR
|
|
# 4. build subprofiles and subsequently image
|
|
|
|
all help:
|
|
@echo '** available distribution targets:'
|
|
@echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t
|
|
|
|
# this could have come from environment;
|
|
# if not, can be symlinked if r/w, or made anew (NB: immediate assignment)
|
|
ifndef BUILDDIR
|
|
PREFIX := mkimage-profiles.build
|
|
BUILDDIR := $(shell [ -s build ] && realpath build || bin/mktmpdir $(PREFIX))
|
|
endif
|
|
|
|
# most of the actual work done elsewhere
|
|
include clean.mk
|
|
include distro.mk
|
|
include profile.mk
|
|
include log.mk
|
|
include iso.mk
|
|
|
|
# we can't use implicit rules for top-level targets, only for prereqs
|
|
CONFIGS := $(shell sed -n 's,^distro/\([^:.]\+\):.*$$,\1,p' distro.mk)
|
|
DISTROS := $(addsuffix .iso,$(CONFIGS))
|
|
ARCH ?= $(shell arch | sed 's/i686/i586/')
|
|
DATE = $(shell date +%Y%m%d)
|
|
|
|
export ARCH BUILDDIR DATE SHELL
|
|
|
|
# to be passed into distcfg.mk
|
|
IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
|
|
&& echo "$$HOME/out" \
|
|
|| echo "$(BUILDDIR)/out" )
|
|
IMAGENAME ?= mkimage-profiles-$(ARCH).iso
|
|
|
|
$(DISTROS): %.iso: | profile/init distro/% boot/isolinux profile/populate iso
|
|
@# TODO: run automated tests (e.g. iso size)
|
|
@OUTNAME="$(@:.iso=)-$(DATE)-$(ARCH).iso"; \
|
|
OUTPATH="$(IMAGEDIR)/$$OUTNAME"; \
|
|
test -s "$(IMAGEDIR)/$(IMAGENAME)" && \
|
|
mv "$(IMAGEDIR)/$(IMAGENAME)" "$$OUTPATH" && \
|
|
echo "** image: $$OUTPATH" && \
|
|
ln -sf "$$OUTNAME" "$(IMAGEDIR)/$@" && \
|
|
ln -sf "$@" "$(IMAGEDIR)/mkimage-profiles.iso"; \
|
|
if [ -n "$(DEBUG)" ]; then \
|
|
cp -a "$(BUILDLOG)" "$$OUTPATH.log"; \
|
|
cp -a "$(CONFIG)" "$$OUTPATH.cfg"; \
|
|
fi
|