diff --git a/README b/README index 6f0c285d..f0729f42 100644 --- a/README +++ b/README @@ -1,4 +1,17 @@ -see also http://www.altlinux.org/Mkimage/Profiles/next +see also http://www.altlinux.org/Mkimage/Profiles/next; +quickstart: + +make distclean server-light.iso + +Концепция: +- метапрофиль служит репозиторием всего возможно нужного для + построения индивидуального профиля, по которому создаётся + итоговый дистрибутив + +Особенности: +- метапрофиль может быть полностью read-only +- для сборки подыскивается предпочтительно tmpfs +- в профиль копируются только нужные объекты Объекты: - дистрибутивы: distro.mk, могут основываться один на другом; diff --git a/clean.mk b/clean.mk index 4e7f5605..2aed2fe4 100644 --- a/clean.mk +++ b/clean.mk @@ -1,13 +1,13 @@ clean: @echo '** cleaning up...' @[ -d build/ ] && \ - make -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) \ + $(MAKE) -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) \ ||: distclean: clean @[ -d build/ ] && \ rm -rf build/.git; \ - make -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) && \ + $(MAKE) -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) && \ rm -r $(shell readlink build) && \ rm build \ ||: diff --git a/configure b/configure deleted file mode 100755 index 136d3215..00000000 --- a/configure +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# this is a chinese configure script: -# it would take any parameters, -# nod the head intelligently, -# and hide 'em beneath the clothes -# (until time comes) - -PARAMS="$@" -# TODO: grep/validate? - -# create suitable temporary directory for this build, then -# copy profiles there to configure a copy, not master tree -# keeping profile itself completely readonly would be nice - -#export BUILDDIR="$(bin/mktmpdir mkimage-profiles.build)" -#ls -ld $BUILDDIR - -#find image.in -type f -print0 | xargs -r0 cp -at "$BUILDDIR"/ -- -#rsync -qaH --delete image.in/ "$BUILDDIR"/ -#rm -f "$BUILDDIR"/.config.mk -#touch "$BUILDDIR"/.config.mk -#mkdir "$BUILDDIR"/.mki -#rm -f build -#[ -w . ] \ -#&& ln -sf "$BUILDDIR" build \ -#|| echo "profile directory readonly: skipping symlinks, env only" - -# remember all those --with-*? we'll pass them downstream, honestly -#echo "$PARAMS" > "$BUILDDIR"/.with diff --git a/distro.mk b/distro.mk index c38a14be..e0938030 100644 --- a/distro.mk +++ b/distro.mk @@ -5,13 +5,8 @@ CONFIG = $(BUILDDIR)/.config.mk -include features.in/*/config.mk # put(), add(), set(), tags() -include functions.mk - -# request particular image subprofile inclusion -sub/%: - $(call put,SUBPROFILES+=$(@:sub/%=%)) - -# package list names are relative to pkg/lists/ +# +# package list names are considered relative to pkg/lists/ # # $(VAR) will be substituted before writing them to $(CONFIG); # $$(VAR) will remain unsubstituted util $(CONFIG) is included @@ -19,7 +14,12 @@ sub/%: # can change its value during configuration _before_ # it's actually used) # -# tags do boolean expressions: (tag1 && !(tag2 || tag3)) +# tags can do boolean expressions: (tag1 && !(tag2 || tag3)) +include functions.mk + +# request particular image subprofile inclusion +sub/%: + $(call add,SUBPROFILES,$(@:sub/%=%)) distro/init: @echo "** starting distro configuration build process" diff --git a/features.in/Makefile b/features.in/Makefile index 6f1e1152..4bf8f1fa 100644 --- a/features.in/Makefile +++ b/features.in/Makefile @@ -2,18 +2,16 @@ include $(BUILDDIR)/.config.mk # make rsync backups all: - for dir in $(FEATURES); do \ + @for dir in $(FEATURES); do \ for sub in $(SUBPROFILES); do \ dest=$${sub%stage1}; \ - echo "dir/sub: [$$dir/$$sub/]" && \ [ -d $$dir/$$sub/ ] && \ - echo rsync -ab $$dir/$$sub/ $(BUILDDIR)/$$dest/ && \ rsync -ab $$dir/$$sub/ $(BUILDDIR)/$$dest/ && \ cd $(BUILDDIR)/$$dest/ && \ git add . && \ git commit -qam "$@/$$dir/$$sub" && \ cd ->&/dev/null; \ done; \ - done; \ - find $(BUILDDIR) -name '*~' + done @# these might signal of file clashes (or plain dirt) + @find $(BUILDDIR) -name '*~' diff --git a/image.in/globals.mk.in b/image.in/globals.mk.in index ea4f569c..39611c96 100644 --- a/image.in/globals.mk.in +++ b/image.in/globals.mk.in @@ -1,4 +1,4 @@ export -MKIMAGE_PREFIX=@MKIMAGE_PREFIX@ -GLOBAL_HSH_APT_CONFIG=@APTCONF@ -GLOBAL_VERBOSE=0 +MKIMAGE_PREFIX = @MKIMAGE_PREFIX@ +GLOBAL_HSH_APT_CONFIG = @APTCONF@ +GLOBAL_VERBOSE ?= 0 diff --git a/iso.mk b/iso.mk index e0212f3a..97dcd8c9 100644 --- a/iso.mk +++ b/iso.mk @@ -1,6 +1,4 @@ iso: @echo "** starting image build process" - @### setup GLOBAL_BOOT_TYPE, etc (cd $(BUILDDIR)/; autoconf; ./configure --with-aptconf=$(HOME)/apt/apt.conf) ### $(MAKE) -C $(BUILDDIR)/ GLOBAL_BUILDDIR=$(BUILDDIR) - @# check iso size diff --git a/profile.mk b/profile.mk index 55177084..5094ac2a 100644 --- a/profile.mk +++ b/profile.mk @@ -1,6 +1,5 @@ profile/init: @echo "** BUILDDIR: $(BUILDDIR)" -# ls -ld $(BUILDDIR) @rsync -qaH --delete image.in/ "$(BUILDDIR)"/ @touch "$(BUILDDIR)"/.config.mk @mkdir "$(BUILDDIR)"/.mki diff --git a/sub.in/Makefile b/sub.in/Makefile index b4682ce8..97098a47 100644 --- a/sub.in/Makefile +++ b/sub.in/Makefile @@ -1,10 +1,7 @@ include $(BUILDDIR)/.config.mk all: - ls -l $(BUILDDIR)/.config.mk - echo -- SUBPROFILES: $(SUBPROFILES) - for dir in $(SUBPROFILES); do \ - echo -- rsync -a $$dir/ $(BUILDDIR)/$$dir/ && \ + @for dir in $(SUBPROFILES); do \ rsync -a $$dir/ $(BUILDDIR)/$$dir/ && \ cd $(BUILDDIR)/$$dir/ && \ git add . && \ @@ -13,7 +10,7 @@ all: done clean: - for dir in $(SUBPROFILES); do \ + @for dir in $(SUBPROFILES); do \ [ -n "$$dir" ] && \ rm -rf $(BUILDDIR)/$$dir && \ mkdir -p $(BUILDDIR)/$$dir ||:; \