Commit 5f881522 authored by Michael Shigorin's avatar Michael Shigorin

.base rehashed, DISK_LISTS renamed, etc

In particular: - .base is now generated from pieces (see image.in/Makefile) - s/DISTROS/IMAGES/g; s/CONFIGS/DISTROS/g (for clarity) - s/DISK_LISTS/MAIN_LISTS/g ("disk" was early m-p-d legacy) - introduced BASE_PACKAGES to complement BASE_LISTS - minor tweaks to Makefile (ARCH and DATE moved elsewhere) - libdistro.mk: dropped overlooked IMAGE_INIT_LIST copy - clean.mk: silly cleanup
parent a9e4934b
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
all help: all help:
@echo '** available distribution targets:' @echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t @echo $(IMAGES) | fmt -sw"$$((COLUMNS>>1))" | column -t
# most of the actual work done elsewhere # most of the actual work done elsewhere
include clean.mk include clean.mk
...@@ -19,12 +19,10 @@ include log.mk ...@@ -19,12 +19,10 @@ include log.mk
include iso.mk include iso.mk
# we can't use implicit rules for top-level targets, only for prereqs # we can't use implicit rules for top-level targets, only for prereqs
CONFIGS := $(shell sed -n 's,^distro/\([^:.]\+\):.*$$,\1,p' distro.mk) # NB: what about static pattern rules?
DISTROS := $(addsuffix .iso,$(CONFIGS)) # TODO: move into libdistro?
ARCH ?= $(shell arch | sed 's/i686/i586/') DISTROS := $(shell sed -n 's,^distro/\([^:.]\+\):.*$$,\1,p' distro.mk)
DATE = $(shell date +%Y%m%d) IMAGES := $(addsuffix .iso,$(DISTROS))
export ARCH DATE
# to be passed into distcfg.mk # to be passed into distcfg.mk
IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \ IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
...@@ -32,7 +30,7 @@ IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \ ...@@ -32,7 +30,7 @@ IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
|| echo "$(BUILDDIR)/out" ) || echo "$(BUILDDIR)/out" )
IMAGENAME ?= mkimage-profiles-$(ARCH).iso IMAGENAME ?= mkimage-profiles-$(ARCH).iso
$(DISTROS): %.iso: | profile/init distro/% boot/isolinux profile/populate iso $(IMAGES): %.iso: | profile/init distro/% boot/isolinux profile/populate iso
@# TODO: run automated tests (e.g. iso size) @# TODO: run automated tests (e.g. iso size)
@OUTNAME="$(@:.iso=)-$(DATE)-$(ARCH).iso"; \ @OUTNAME="$(@:.iso=)-$(DATE)-$(ARCH).iso"; \
OUTPATH="$(IMAGEDIR)/$$OUTNAME"; \ OUTPATH="$(IMAGEDIR)/$$OUTNAME"; \
......
...@@ -15,7 +15,6 @@ clean: ...@@ -15,7 +15,6 @@ clean:
# and BUILDLOG can be specified by hand either # and BUILDLOG can be specified by hand either
distclean: clean distclean: clean
@if [ -L build -a -d build/ ]; then \ @if [ -L build -a -d build/ ]; then \
$(MAKE) -C build $@ GLOBAL_BUILDDIR=$(shell readlink build) $(LOG); \
rm -rf build/.git; \ rm -rf build/.git; \
$(MAKE) -C build $@ GLOBAL_BUILDDIR=$(shell readlink build) $(LOG) && \ $(MAKE) -C build $@ GLOBAL_BUILDDIR=$(shell readlink build) $(LOG) && \
rm -r $(shell readlink build); \ rm -r $(shell readlink build); \
......
...@@ -47,7 +47,7 @@ distro/server-ovz: distro/server-base use/hdt use/firmware/server ...@@ -47,7 +47,7 @@ distro/server-ovz: distro/server-base use/hdt use/firmware/server
@$(call add,KMODULES,bcmwl e1000e igb ndiswrapper rtl8168 rtl8192) @$(call add,KMODULES,bcmwl e1000e igb ndiswrapper rtl8168 rtl8192)
@$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons) @$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,KMODULES,drbd83 kvm) @$(call add,KMODULES,drbd83 kvm)
@$(call add,DISK_LISTS,kernel-wifi) @$(call add,MAIN_LISTS,kernel-wifi)
@$(call add,BASE_LISTS,ovz-server) @$(call add,BASE_LISTS,ovz-server)
@$(call add,BASE_LISTS,$(call tags,base server)) @$(call add,BASE_LISTS,$(call tags,base server))
@$(call add,GROUPS,dns-server http-server ftp-server kvm-server) @$(call add,GROUPS,dns-server http-server ftp-server kvm-server)
......
...@@ -3,4 +3,5 @@ use/installer: sub/install2 use/syslinux/install2.cfg ...@@ -3,4 +3,5 @@ use/installer: sub/install2 use/syslinux/install2.cfg
@$(call set,INSTALL2_PACKAGES,installer-distro-$$(INSTALLER)-stage2) @$(call set,INSTALL2_PACKAGES,installer-distro-$$(INSTALLER)-stage2)
@$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator) @$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator)
@$(call add,MAIN_PACKAGES,branding-$$(BRANDING)-release) @$(call add,MAIN_PACKAGES,branding-$$(BRANDING)-release)
@$(call set,BASE_LISTS,base) # @$(call set,BASE_LISTS,base)
@$(call add,BASE_LISTS,$(call tags,basesystem))
...@@ -39,21 +39,20 @@ ifeq "$(INSTALLER_KFLAVOUR)$(KFLAVOURS)" "" ...@@ -39,21 +39,20 @@ ifeq "$(INSTALLER_KFLAVOUR)$(KFLAVOURS)" ""
metadata: metadata:
@echo "** skipping metadata target, no stage1 kernel installed" @echo "** skipping metadata target, no stage1 kernel installed"
else else
metadata: metadata: dot-base
@mkdir -p files/Metadata @mkdir -p files/Metadata
@rm -f files/Metadata/pkg-groups.tar @rm -f files/Metadata/pkg-groups.tar
@echo -e "\n# auto-added in image.in/Makefile" >> $(call list,.base)
@echo "$(call kpackages,$(KMODULES),$(KFLAVOURS))" >> $(call list,.base)
@echo "$(COMMON_PACKAGES)" | tr ' ' '\n\n' >> $(call list,.base)
@echo "branding-$(BRANDING)-release" >> $(call list,.base)
# see also alterator-pkg (backend3/pkg-install); we only tar up what's up to it # see also alterator-pkg (backend3/pkg-install); we only tar up what's up to it
@tar -cvf files/Metadata/pkg-groups.tar -C $(PKGDIR) \ @tar -cvf files/Metadata/pkg-groups.tar -C $(PKGDIR) \
$$(echo $(call list,.base) \ $$(echo $(call list,$(GROUPS) .base) \
$(call list,$(GROUPS)) \
$(call group,$(GROUPS)) \ $(call group,$(GROUPS)) \
| sed 's,$(PKGDIR)/*,,g') | sed 's,$(PKGDIR)/*,,g')
endif endif
dot-base:
@echo -e "# auto-added in image.in/Makefile" >> $(call list,.base)
@echo "$(call kpackages,$(KMODULES),$(KFLAVOURS))" >> $(call list,.base)
prep: $(GLOBAL_DEBUG) dot-disk metadata $(IMAGEDIR) prep: $(GLOBAL_DEBUG) dot-disk metadata $(IMAGEDIR)
$(IMAGEDIR): $(IMAGEDIR):
......
...@@ -3,6 +3,8 @@ ifndef BUILDDIR ...@@ -3,6 +3,8 @@ ifndef BUILDDIR
$(error BUILDDIR not defined) $(error BUILDDIR not defined)
endif endif
export ARCH ?= $(shell arch | sed 's/i686/i586/')
# step 4 is kicked off here but actually done by image.in/Makefile # step 4 is kicked off here but actually done by image.in/Makefile
# #
# adding boot/isolinux to prereqs is too late here, # adding boot/isolinux to prereqs is too late here,
......
...@@ -24,7 +24,6 @@ distro/.branding: distro/.init ...@@ -24,7 +24,6 @@ distro/.branding: distro/.init
# NB: the last flavour in KFLAVOURS gets to be the default one; # NB: the last flavour in KFLAVOURS gets to be the default one;
# the kernel packages regexp evaluation has to take place at build stage # the kernel packages regexp evaluation has to take place at build stage
distro/.base: distro/.branding sub/stage1 use/syslinux use/syslinux/localboot.cfg distro/.base: distro/.branding sub/stage1 use/syslinux use/syslinux/localboot.cfg
@$(call set,IMAGE_INIT_LIST,+branding-$$(BRANDING)-release)
@$(call set,KFLAVOURS,std-def) @$(call set,KFLAVOURS,std-def)
# pick up release manager's config # pick up release manager's config
......
...@@ -23,4 +23,6 @@ LOG = 2>>$(BUILDLOG) >/dev/null ...@@ -23,4 +23,6 @@ LOG = 2>>$(BUILDLOG) >/dev/null
GLOBAL_DEBUG := debug GLOBAL_DEBUG := debug
endif endif
export BUILDLOG DEBUG GLOBAL_DEBUG GLOBAL_VERBOSE LOG MAKE SHELL DATE = $(shell date +%Y%m%d)
export BUILDLOG DATE DEBUG GLOBAL_DEBUG GLOBAL_VERBOSE LOG MAKE SHELL
basesystem # basesystem packages, see Makefile
udev
interactivesystem
apt-conf-sisyphus
apt
alterator-grub
alterator-root
alterator-users
alterator-net-eth
...@@ -9,19 +9,30 @@ include $(BUILDDIR)/distcfg.mk ...@@ -9,19 +9,30 @@ include $(BUILDDIR)/distcfg.mk
SUFFIX := pkg/lists SUFFIX := pkg/lists
TARGET := $(BUILDDIR)/$(SUFFIX) TARGET := $(BUILDDIR)/$(SUFFIX)
# env | sort -u | grep _LISTS | xargs cp
all: $(TARGET) $(GLOBAL_DEBUG) all: $(TARGET) $(GLOBAL_DEBUG)
# env | sort -u | grep _LISTS | xargs cp
@$(foreach V, \ @$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \ $(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\ $(if $(filter environment% file,$(origin $V)),\
$(shell cp --parents -at $(TARGET) \ $(shell cp --parents -at $(TARGET) \
-- $(value $V)))) -- $(value $V))))
@cp -a .base $(GROUPS) $(TARGET) # construct .base packagelist for alterator-pkg
@( \
echo "### generated via pkg.in/lists/Makefile" && \
echo "### BASE_LISTS" && \
cat $(BASE_LISTS) /dev/null && \
echo "### branding" && \
echo "branding-$(BRANDING)-release" && \
echo "### COMMON_PACKAGES" && \
echo "$(COMMON_PACKAGES)" && \
echo "### BASE_PACKAGES" && \
echo "$(BASE_PACKAGES)" \
) | sed -re '/^[^[:space:]#]/ s/[[:space:]]+/\n/g' >$(TARGET)/.base
@[ -z $(GROUPS) ] || cp -at $(TARGET) $(GROUPS)
@type -t git >&/dev/null && \ @type -t git >&/dev/null && \
cd $(TARGET) && \ cd $(TARGET) && \
git add . && \ git add . && \
git commit -qam "$(SUFFIX)"; \ git commit -qam "$(SUFFIX)";
cd - >&/dev/null; \
# do beforehand as foreach gets expanded before recipe execution # do beforehand as foreach gets expanded before recipe execution
$(TARGET): $(TARGET):
......
interactivesystem interactivesystem
apt-conf-sisyphus apt-conf
apt apt
alterator-lilo alterator-grub
alterator-root alterator-root
alterator-users alterator-users
alterator-net-eth alterator-net-eth
...@@ -14,8 +14,10 @@ CHROOT_PACKAGES = apt-utils rsync ...@@ -14,8 +14,10 @@ CHROOT_PACKAGES = apt-utils rsync
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS)) \ IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS)) \
$(MAIN_PACKAGES_REGEXP) $(MAIN_PACKAGES_REGEXP)
IMAGE_PACKAGES = $(call map,list,.base $(BASE_LISTS) $(DISK_LISTS) $(GROUPS)) \
IMAGE_PACKAGES = $(call map,list,$(BASE_LISTS) $(MAIN_LISTS) $(GROUPS)) \
$(COMMON_PACKAGES) \ $(COMMON_PACKAGES) \
$(BASE_PACKAGES) \
$(MAIN_PACKAGES) $(MAIN_PACKAGES)
MKI_DESTDIR = ALTLinux/RPMS.main MKI_DESTDIR = ALTLinux/RPMS.main
......
Этот каталог содержит субпрофиль main, собирающий пакетную базу, Этот каталог содержит субпрофиль main, собирающий пакетную базу,
которая затем укладывается в образ. которая затем укладывается в образ.
Подбирает MAIN_PACKAGES, а также BASE_LISTS (в установку) Подбирает:
и DISK_LISTS (дополнительные пакеты). - COMMON_PACKAGES, BASE_PACKAGES, BASE_LISTS: в установку по умолчанию;
- MAIN_PACKAGES, MAIN_LISTS: дополнительные пакеты.
В image-scripts.d/* смысла нет, только scripts.d/* -- В image-scripts.d/* смысла нет, только scripts.d/* --
рабочий чрут не содержит исполняемых файлов. рабочий чрут не содержит исполняемых файлов.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment