assorted fixups
- more thorough build stages inline doc - quieter BUILDDIR instantiation - branding-altlinux-sisyphus by default - prettify installer selection somewhat - mkimage #24669 fixed upstream - sub.in/stage1/modules: +drm (as in m-p-d, for KMS) - tags2lists: generalize a bit
This commit is contained in:
parent
16e763e9ea
commit
ace5cb0ff6
12
Makefile
12
Makefile
@ -1,8 +1,11 @@
|
|||||||
|
# steps to build a distribution image:
|
||||||
# --- here
|
# --- here
|
||||||
# 1. configure distro
|
# 1. initialize new profile (BUILDDIR) as a copy of image.in/
|
||||||
# 2. configure subprofiles, prepare package lists/groups and hooks
|
# 2. configure distro
|
||||||
|
# 3. copy subprofiles, package lists/groups and script hooks
|
||||||
|
# from metaprofile to new profile (as needed)
|
||||||
# --- in BUILDDIR
|
# --- in BUILDDIR
|
||||||
# 3. build subprofiles and subsequently image
|
# 4. build subprofiles and subsequently image
|
||||||
|
|
||||||
all help:
|
all help:
|
||||||
@echo '** available distribution targets:'
|
@echo '** available distribution targets:'
|
||||||
@ -16,7 +19,8 @@ include iso.mk
|
|||||||
# this could have come from environment;
|
# this could have come from environment;
|
||||||
# if not, can be symlinked if r/w, or made anew (NB: immediate assignment)
|
# if not, can be symlinked if r/w, or made anew (NB: immediate assignment)
|
||||||
ifndef BUILDDIR
|
ifndef BUILDDIR
|
||||||
BUILDDIR := $(shell realpath build || bin/mktmpdir mkimage-profiles.build)
|
PREFIX := mkimage-profiles.build
|
||||||
|
BUILDDIR := $(shell [ -s build ] && realpath build || bin/mktmpdir $(PREFIX))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
|
3
README
3
README
@ -15,8 +15,9 @@ configurables: ~/.mkimage/metaconf.mk, see distro.mk
|
|||||||
- в профиль копируются только нужные объекты
|
- в профиль копируются только нужные объекты
|
||||||
|
|
||||||
Стадии работы:
|
Стадии работы:
|
||||||
|
- инициализация дистрибутивного профиля
|
||||||
- сборка конфигурации дистрибутива
|
- сборка конфигурации дистрибутива
|
||||||
- порождение дистрибутивного профиля
|
- наполнение дистрибутивного профиля
|
||||||
- сборка дистрибутива
|
- сборка дистрибутива
|
||||||
|
|
||||||
Объекты:
|
Объекты:
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# NB: tags are processed using word boundaries,
|
# NB: tags are processed using word boundaries,
|
||||||
# so avoid using "-" in tag names
|
# so avoid using "-" in tag names
|
||||||
|
|
||||||
DIR="${1:-pkg.in/lists/tagged}"
|
DIR="${1:?need base directory}"
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
echo "$0: WARNING: $*" >&2
|
echo "$0: WARNING: $*" >&2
|
||||||
@ -20,11 +20,13 @@ warn() {
|
|||||||
[ -d "$DIR" ] || warn "$DIR nonexistent"
|
[ -d "$DIR" ] || warn "$DIR nonexistent"
|
||||||
cd "$DIR" || warn "cannot change to $DIR"
|
cd "$DIR" || warn "cannot change to $DIR"
|
||||||
|
|
||||||
find $(sed \
|
# NB: care with quoting
|
||||||
-e "s,\([^&|! ()']\+\),-regex ^.*\\\\<\1\\\\>.*$,g" \
|
transformed="$(sed \
|
||||||
-e "s, *&& *, -a ,g" \
|
-e "s,\([^&|! ()']\+\),-regex ^.*\\\\<\1\\\\>.*$,g" \
|
||||||
-e "s, *|| *, -o ,g" \
|
-e "s, *&& *, -a ,g" \
|
||||||
-e "s, *! *, ! ,g" \
|
-e "s, *|| *, -o ,g" \
|
||||||
-e "s, *( *, ( ,g" \
|
-e "s, *! *, ! ,g" \
|
||||||
-e "s, *) *, ) ,g" \
|
-e "s, *( *, ( ,g" \
|
||||||
) | sed 's,^\./,,'
|
-e "s, *) *, ) ,g")"
|
||||||
|
|
||||||
|
[ -z "$transformed" ] || find $transformed | sed 's,^\./,,'
|
||||||
|
12
distro.mk
12
distro.mk
@ -1,4 +1,4 @@
|
|||||||
# build up distribution's configuration
|
# step 2: build up distribution's configuration
|
||||||
#
|
#
|
||||||
# NB: distro/ targets should be defined here,
|
# NB: distro/ targets should be defined here,
|
||||||
# see toplevel Makefile's $(DISTRO) assignment
|
# see toplevel Makefile's $(DISTRO) assignment
|
||||||
@ -34,14 +34,15 @@ distro/.init:
|
|||||||
# 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/.init sub/stage1 use/syslinux use/syslinux/localboot.cfg
|
distro/.base: distro/.init sub/stage1 use/syslinux use/syslinux/localboot.cfg
|
||||||
@$(call set,IMAGE_INIT_LIST,+branding-$$(BRANDING)-release)
|
@$(call set,IMAGE_INIT_LIST,+branding-$$(BRANDING)-release)
|
||||||
@$(call set,BRANDING,altlinux-desktop) ###
|
@$(call set,BRANDING,altlinux-sisyphus)
|
||||||
@$(call set,KFLAVOURS,std-def)
|
@$(call set,KFLAVOURS,std-def)
|
||||||
@$(call set,KMODULES,drm)
|
|
||||||
|
|
||||||
distro/installer: distro/.base sub/install2 use/syslinux/install2.cfg
|
distro/installer: distro/.base sub/install2 use/syslinux/install2.cfg
|
||||||
@#$(call put,BRANDING=altlinux-sisyphus) ###
|
@$(call set,INSTALLER,server-light)
|
||||||
|
@$(call set,INSTALL2_PACKAGES,installer-distro-$$(INSTALLER)-stage2)
|
||||||
|
@$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator)
|
||||||
|
@$(call add,MAIN_PACKAGES,branding-$$(BRANDING)-release)
|
||||||
@$(call set,BASE_LISTS,base)
|
@$(call set,BASE_LISTS,base)
|
||||||
@$(call set,INSTALL2_PACKAGES,installer-distro-server-light-stage2) ###
|
|
||||||
|
|
||||||
distro/server-base: distro/installer sub/main use/syslinux/ui-menu use/memtest
|
distro/server-base: distro/installer sub/main use/syslinux/ui-menu use/memtest
|
||||||
@$(call add,BASE_LISTS,server-base)
|
@$(call add,BASE_LISTS,server-base)
|
||||||
@ -59,7 +60,6 @@ distro/server-light: distro/server-base use/hdt
|
|||||||
distro/minicd: distro/server-base
|
distro/minicd: distro/server-base
|
||||||
@$(call set,KFLAVOURS,un-def) # we might need the most recent drivers (NB: std-ng lacks aufs2)
|
@$(call set,KFLAVOURS,un-def) # we might need the most recent drivers (NB: std-ng lacks aufs2)
|
||||||
@$(call add,MAIN_PACKAGES,etcnet-full)
|
@$(call add,MAIN_PACKAGES,etcnet-full)
|
||||||
@$(call set,BRANDING,sisyphus-server-light)
|
|
||||||
|
|
||||||
# bootloader test target
|
# bootloader test target
|
||||||
distro/syslinux: distro/.base use/syslinux/ui-gfxboot use/hdt use/memtest
|
distro/syslinux: distro/.base use/syslinux/ui-gfxboot use/hdt use/memtest
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# step 3: copy the needed features to $(BUILDDIR)
|
||||||
|
# (only regarding the needed subprofiles)
|
||||||
|
|
||||||
-include $(BUILDDIR)/.config.mk
|
-include $(BUILDDIR)/.config.mk
|
||||||
|
|
||||||
# first rsync what's static, and make backups --
|
# first rsync what's static, and make backups --
|
||||||
|
@ -41,4 +41,4 @@ define log_body
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
# convert tag list into a list of relative package list paths
|
# convert tag list into a list of relative package list paths
|
||||||
tags = $(addprefix tagged/,$(shell echo "$(1)" | bin/tags2lists))
|
tags = $(and $(strip $(1)),$(addprefix tagged/,$(shell echo "$(1)" | bin/tags2lists pkg.in/lists/tagged)))
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# step 4: build image (final stage)
|
||||||
|
#
|
||||||
|
# NB: this metaprofile directory forms the initial BUILDDIR/
|
||||||
|
|
||||||
include functions.mk
|
include functions.mk
|
||||||
include $(GLOBAL_BUILDDIR)/functions.mk
|
include $(GLOBAL_BUILDDIR)/functions.mk
|
||||||
include $(GLOBAL_BUILDDIR)/.config.mk
|
include $(GLOBAL_BUILDDIR)/.config.mk
|
||||||
@ -23,16 +27,19 @@ include $(MKIMAGE_PREFIX)/targets.mk
|
|||||||
all: prep copy-subdirs copy-tree run-scripts pack-image
|
all: prep copy-subdirs copy-tree run-scripts pack-image
|
||||||
|
|
||||||
# FIXME: scripts.d/?
|
# FIXME: scripts.d/?
|
||||||
prep: debug disk-info metadata
|
prep: debug dot-disk metadata
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
|
ifdef DEBUG
|
||||||
@echo "TOPDIR=$(TOPDIR)"
|
@echo "TOPDIR=$(TOPDIR)"
|
||||||
@echo "ARCH=$(ARCH)"
|
@echo "ARCH=$(ARCH)"
|
||||||
@echo "GLOBAL_HSH_APT_CONFIG=$(GLOBAL_HSH_APT_CONFIG)"
|
@echo "GLOBAL_HSH_APT_CONFIG=$(GLOBAL_HSH_APT_CONFIG)"
|
||||||
|
endif
|
||||||
|
|
||||||
disk-info:
|
dot-disk:
|
||||||
@mkdir -p files/.disk
|
@mkdir -p files/.disk
|
||||||
@echo "FIXME" >files/.disk/info ### +$(ARCH)
|
@echo "ALT Linux based" >files/.disk/info
|
||||||
|
@echo "$(ARCH)" >files/.disk/arch
|
||||||
@type -t git >&/dev/null && ( \
|
@type -t git >&/dev/null && ( \
|
||||||
cd $(TOPDIR) && \
|
cd $(TOPDIR) && \
|
||||||
git show-ref --head --dereference -s -- HEAD 2>/dev/null; \
|
git show-ref --head --dereference -s -- HEAD 2>/dev/null; \
|
||||||
@ -43,10 +50,8 @@ disk-info:
|
|||||||
metadata:
|
metadata:
|
||||||
@mkdir -p files/Metadata
|
@mkdir -p files/Metadata
|
||||||
@rm -f files/Metadata/pkg-groups.tar
|
@rm -f files/Metadata/pkg-groups.tar
|
||||||
# FIXME: KERNEL_PACKAGES deprecated, this is broken now! -- or not?..
|
|
||||||
@echo "DEBUG: image.in/Makefile" >&2
|
|
||||||
@echo -e "\n# auto-added in image.in/Makefile\n$(call kpackages)" >> $(call list,.base)
|
@echo -e "\n# auto-added in image.in/Makefile\n$(call kpackages)" >> $(call list,.base)
|
||||||
tar -cvf files/Metadata/pkg-groups.tar \
|
@echo "branding-$(BRANDING)-release" >> $(call list,.base)
|
||||||
|
@tar -cvf files/Metadata/pkg-groups.tar \
|
||||||
-C $(PKGDIR) \
|
-C $(PKGDIR) \
|
||||||
$$(echo $(call list,.base) $(call list,$(GROUPS)) $(call group,$(GROUPS)) | sed 's,$(PKGDIR)/*,,g')
|
$$(echo $(call list,.base) $(call list,$(GROUPS)) $(call group,$(GROUPS)) | sed 's,$(PKGDIR)/*,,g')
|
||||||
|
|
||||||
|
4
iso.mk
4
iso.mk
@ -1,5 +1,7 @@
|
|||||||
|
# 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,
|
||||||
# since profile/populate has already finished by now
|
# since profile/populate target is already done by now
|
||||||
#
|
#
|
||||||
# NB: /usr/bin/{i586,x86_64} are setarch(8) symlinks
|
# NB: /usr/bin/{i586,x86_64} are setarch(8) symlinks
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# step 3: copy package lists and groups referenced in distro configuration
|
||||||
|
# (and only those!) over to $(BUILDDIR)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
for dir in lists groups; do \
|
for dir in lists groups; do \
|
||||||
$(MAKE) -C $$dir BUILDDIR=$(BUILDDIR); \
|
$(MAKE) -C $$dir BUILDDIR=$(BUILDDIR); \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# copy package lists referenced in distro configuration
|
# step 3: copy package groups referenced in distro configuration
|
||||||
# over to build dir
|
# (and only those!) over to $(BUILDDIR)
|
||||||
|
|
||||||
include $(BUILDDIR)/.config.mk
|
include $(BUILDDIR)/.config.mk
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
# copy package lists referenced in distro configuration
|
# step 3: copy package lists referenced in distro configuration
|
||||||
# over to build dir
|
# (and only those!) over to $(BUILDDIR)
|
||||||
|
|
||||||
include $(BUILDDIR)/.config.mk
|
include $(BUILDDIR)/.config.mk
|
||||||
|
TARGET := $(BUILDDIR)/pkg/lists/
|
||||||
|
|
||||||
# env | sort -u | grep _LISTS | xargs cp
|
# env | sort -u | grep _LISTS | xargs cp
|
||||||
all: prep debug
|
all: prep debug
|
||||||
@$(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 $(BUILDDIR)/pkg/lists/ \
|
$(shell cp --parents -at $(TARGET) \
|
||||||
-- $(value $V))))
|
-- $(value $V))))
|
||||||
@cp -a .base $(GROUPS) $(BUILDDIR)/pkg/lists/
|
@cp -a .base $(GROUPS) $(TARGET)
|
||||||
|
|
||||||
# moving this into 'all' spoils execution order (clobbers results)
|
# moving this into 'all' spoils execution order (clobbers results)
|
||||||
prep:
|
prep:
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# step 1: initialize the off-tree mkimage profile
|
||||||
profile/init:
|
profile/init:
|
||||||
@echo "** BUILDDIR: $(BUILDDIR)"
|
@echo "** BUILDDIR: $(BUILDDIR)"
|
||||||
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
|
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
|
||||||
@ -15,6 +16,7 @@ profile/init:
|
|||||||
echo "** profile directory readonly: skipping symlinks, env only"; \
|
echo "** profile directory readonly: skipping symlinks, env only"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# this is done after step 2, see toplevel Makefile
|
||||||
profile/populate: profile/init distro/.metaconf
|
profile/populate: profile/init distro/.metaconf
|
||||||
@for dir in sub.in features.in pkg.in; do \
|
@for dir in sub.in features.in pkg.in; do \
|
||||||
$(MAKE) -C $$dir; \
|
$(MAKE) -C $$dir; \
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# step 3: copy the needed subprofiles to $(BUILDDIR)
|
||||||
|
|
||||||
include $(BUILDDIR)/.config.mk
|
include $(BUILDDIR)/.config.mk
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
|
# step 4: build install2 subprofile (installer "live" part)
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
include $(GLOBAL_BUILDDIR)/.config.mk
|
include $(GLOBAL_BUILDDIR)/.config.mk
|
||||||
include $(GLOBAL_BUILDDIR)/functions.mk
|
include $(GLOBAL_BUILDDIR)/functions.mk
|
||||||
include $(MKIMAGE_PREFIX)/config.mk
|
include $(MKIMAGE_PREFIX)/config.mk
|
||||||
|
|
||||||
# FIXME: hardwired
|
IMAGE_PACKAGES_REGEXP = $(call kpackages)
|
||||||
#IMAGE_PACKAGES_REGEXP = $(call kimage)
|
|
||||||
# NB: due to #24669, IMAGE_PACKAGES_REGEXP does need quoting here
|
|
||||||
IMAGE_PACKAGES_REGEXP = "$(call kpackages)"
|
|
||||||
#IMAGE_PACKAGES_REGEXP = "$(KERNEL_PACKAGES_REGEXP)"
|
|
||||||
#IMAGE_PACKAGES_REGEXP = ^kernel-image-(std-def|el-smp)$$
|
|
||||||
IMAGE_PACKAGES = $(COMMON_PACKAGES) \
|
IMAGE_PACKAGES = $(COMMON_PACKAGES) \
|
||||||
$(INSTALL2_PACKAGES) \
|
$(INSTALL2_PACKAGES) \
|
||||||
./packages
|
./packages
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# installation package base (requisite + optional)
|
# step 4: build main subprofile (requisite + optional packages for media)
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
@ -7,21 +7,11 @@ include $(GLOBAL_BUILDDIR)/functions.mk
|
|||||||
include $(MKIMAGE_PREFIX)/config.mk
|
include $(MKIMAGE_PREFIX)/config.mk
|
||||||
|
|
||||||
CHROOT_PACKAGES = apt-utils rsync
|
CHROOT_PACKAGES = apt-utils rsync
|
||||||
PACKAGES_EXPAND_METHOD=regexp
|
|
||||||
|
|
||||||
# FIXME: hardwired
|
IMAGE_PACKAGES_REGEXP = $(call kpackages)
|
||||||
#IMAGE_PACKAGES_REGEXP = "$(KERNEL_PACKAGES_REGEXP)"
|
IMAGE_PACKAGES = $(call map,list,.base $(BASE_LISTS) $(DISK_LISTS) $(GROUPS)) \
|
||||||
# NB: due to #24669, IMAGE_PACKAGES_REGEXP does need quoting here
|
|
||||||
IMAGE_PACKAGES_REGEXP = "$(call kpackages)"
|
|
||||||
#IMAGE_PACKAGES_REGEXP = $(call kimage) $(call kmodules)
|
|
||||||
#IMAGE_PACKAGES_REGEXP = ^kernel-image-(std-def|el-smp)$$ ^kernel-modules-(ipset|kvm|ndiswrapper|pf_ring|xtables-addons)-(el-smp|ovz-smp)$$
|
|
||||||
# TODO: map() list() onto these
|
|
||||||
IMAGE_PACKAGES = $(call list,.base) \
|
|
||||||
$(COMMON_PACKAGES) \
|
$(COMMON_PACKAGES) \
|
||||||
$(MAIN_PACKAGES) \
|
$(MAIN_PACKAGES)
|
||||||
$(call list,$(BASE_LISTS)) \
|
|
||||||
$(call list,$(DISK_LISTS)) \
|
|
||||||
$(call list,$(GROUPS))
|
|
||||||
|
|
||||||
MKI_DESTDIR = ALTLinux/RPMS.main
|
MKI_DESTDIR = ALTLinux/RPMS.main
|
||||||
MKI_PACK_RESULTS = data
|
MKI_PACK_RESULTS = data
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
|
# step 4: build stage1 subprofile (installer bootstrap)
|
||||||
|
|
||||||
include $(GLOBAL_BUILDDIR)/.config.mk
|
include $(GLOBAL_BUILDDIR)/.config.mk
|
||||||
include $(GLOBAL_BUILDDIR)/functions.mk
|
include $(GLOBAL_BUILDDIR)/functions.mk
|
||||||
include $(MKIMAGE_PREFIX)/config.mk
|
include $(MKIMAGE_PREFIX)/config.mk
|
||||||
|
|
||||||
# FIXME: hardwired
|
|
||||||
#CHROOT_PACKAGES_REGEXP = $(call kimage)
|
|
||||||
# NB: see #24669, CHROOT_PACKAGES_REGEXP does NOT need quoting here
|
|
||||||
CHROOT_PACKAGES_REGEXP = $(call kpackages)
|
CHROOT_PACKAGES_REGEXP = $(call kpackages)
|
||||||
#CHROOT_PACKAGES_REGEXP = "$(KERNEL_PACKAGES_REGEXP)"
|
|
||||||
#CHROOT_PACKAGES_REGEXP = ^kernel-image-(std-def|el-smp)$$ ^kernel-modules-(ipset|kvm|ndiswrapper|pf_ring|xtables-addons)-(el-smp|ovz-smp)$$
|
|
||||||
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(COMMON_PACKAGES)
|
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(COMMON_PACKAGES)
|
||||||
|
|
||||||
MKI_PACK_RESULTS = data
|
MKI_PACK_RESULTS = data
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
kernel/drivers/ata
|
kernel/drivers/ata
|
||||||
kernel/drivers/block
|
kernel/drivers/block
|
||||||
|
kernel/drivers/gpu/drm
|
||||||
kernel/drivers/hid
|
kernel/drivers/hid
|
||||||
kernel/drivers/md
|
kernel/drivers/md
|
||||||
kernel/drivers/net/\([^w]\|w[^i]\).\+\.ko
|
kernel/drivers/net/\([^w]\|w[^i]\).\+\.ko
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "file /.VERSION @TMPDIR@/.VERSION 0644 0 0" >"$WORKDIR"/initfs
|
echo "file /.VERSION @TMPDIR@/.VERSION 0644 0 0" >"$WORKDIR"/initfs
|
||||||
# FIXME: broken test, we already do branding
|
# FIXME: broken test, we already do branding
|
||||||
[ -z "$(BRANDING)" ] || \
|
[ -z "$BRANDING" ] || \
|
||||||
echo "file /bootsplash /bootsplash/bootsplash 0644 0 0" >>"$WORKDIR"/initfs
|
echo "file /bootsplash /bootsplash/bootsplash 0644 0 0" >>"$WORKDIR"/initfs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user