Commit c2f70e5c authored by Michael Shigorin's avatar Michael Shigorin

kernel and BUILDDIR fixes

- image.in/functions.mk: rework kpackage() + it takes two arguments explicitly now: this adds some noise for "generic" invocations but is rather less messy with recently introduced STAGE1_KFLAVOUR (which in its turn is rather cleaner than messing with KFLAVOURS, especially since soemthing changed in presumably apt and we can't rely on kernel packages being installed in the order formed). - BUILDDIR/DEBUG related fixes + Makefile: BUILDDIR initialization moved to distro.mk - build.log += git info
parent 3f012958
*~ *~
.*.swp
build build
...@@ -11,17 +11,10 @@ all help: ...@@ -11,17 +11,10 @@ all help:
@echo '** available distribution targets:' @echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t @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 # most of the actual work done elsewhere
include clean.mk include clean.mk
include distro.mk
include profile.mk include profile.mk
include distro.mk
include log.mk include log.mk
include iso.mk include iso.mk
...@@ -31,7 +24,7 @@ DISTROS := $(addsuffix .iso,$(CONFIGS)) ...@@ -31,7 +24,7 @@ DISTROS := $(addsuffix .iso,$(CONFIGS))
ARCH ?= $(shell arch | sed 's/i686/i586/') ARCH ?= $(shell arch | sed 's/i686/i586/')
DATE = $(shell date +%Y%m%d) DATE = $(shell date +%Y%m%d)
export ARCH BUILDDIR DATE SHELL 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" ] \
......
# this makefile is designed to be included in toplevel one # this makefile is designed to be included in toplevel one
ifdef BUILDDIR ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
# step 2: build up distribution's configuration # step 2: build up distribution's configuration
...@@ -47,7 +49,9 @@ distro/server-ovz: distro/server-base use/hdt ...@@ -47,7 +49,9 @@ distro/server-ovz: distro/server-base use/hdt
@$(call set,KFLAVOURS,std-def ovz-el) @$(call set,KFLAVOURS,std-def ovz-el)
@$(call set,KDEFAULT,ovz-el) @$(call set,KDEFAULT,ovz-el)
@$(call set,STAGE1_KMODULES_REGEXP,drm.*) @$(call set,STAGE1_KMODULES_REGEXP,drm.*)
@$(call add,KMODULES,igb ipset kvm ndiswrapper pf_ring rtl8192 xtables-addons) @$(call add,KMODULES,bcmwl e1000e igb ndiswrapper rtl8168 rtl8192)
@$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,KMODULES,drbd83 kvm)
@$(call add,DISK_LISTS,kernel-wifi) @$(call add,DISK_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))
...@@ -56,10 +60,7 @@ distro/server-ovz: distro/server-base use/hdt ...@@ -56,10 +60,7 @@ distro/server-ovz: distro/server-base use/hdt
@$(call add,GROUPS,monitoring diag-tools) @$(call add,GROUPS,monitoring diag-tools)
distro/minicd: distro/server-base distro/minicd: distro/server-base
@$(call set,KFLAVOURS,un-def) # we might need the most recent drivers @$(call set,KFLAVOURS,pure-emerald) # we might need the most recent drivers
@$(call add,MAIN_PACKAGES,etcnet-full) @$(call add,MAIN_PACKAGES,etcnet-full)
# if there are too many screens above, it might make sense to distro.d/ # if there are too many screens above, it might make sense to distro.d/
else
$(error BUILDDIR not defined)
endif
ifdef BUILDDIR
# step 3: copy the needed features to $(BUILDDIR) # step 3: copy the needed features to $(BUILDDIR)
# (only regarding the needed subprofiles) # (only regarding the needed subprofiles)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
-include $(BUILDDIR)/distcfg.mk -include $(BUILDDIR)/distcfg.mk
# first rsync what's static, and make backups -- # first rsync what's static, and make backups --
...@@ -11,7 +13,7 @@ ifdef BUILDDIR ...@@ -11,7 +13,7 @@ ifdef BUILDDIR
all: all:
@echo "** starting feature configuration" @echo "** starting feature configuration"
@if test -n "$(DEBUG)"; then echo "** requested: $(FEATURES)"; fi @if test -n "$(GLOBAL_DEBUG)"; then echo "** requested: $(FEATURES)"; fi
@for dir in $(FEATURES); do \ @for dir in $(FEATURES); do \
for sub in $(SUBPROFILES); do \ for sub in $(SUBPROFILES); do \
if test -d $$dir/$$sub/; then \ if test -d $$dir/$$sub/; then \
...@@ -38,7 +40,3 @@ all: ...@@ -38,7 +40,3 @@ all:
help: help:
@echo "** available features:" @echo "** available features:"
@grep -h '^use/' */config.mk @grep -h '^use/' */config.mk
else
$(error BUILDDIR not defined)
endif
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# #
# NB: this metaprofile directory forms the initial BUILDDIR/ # NB: this metaprofile directory forms the initial BUILDDIR/
ifndef GLOBAL_BUILDDIR
$(error GLOBAL_BUILDDIR not defined)
endif
include functions.mk include functions.mk
include $(GLOBAL_BUILDDIR)/functions.mk include $(GLOBAL_BUILDDIR)/functions.mk
include $(GLOBAL_BUILDDIR)/distcfg.mk include $(GLOBAL_BUILDDIR)/distcfg.mk
...@@ -31,9 +35,9 @@ include $(MKIMAGE_PREFIX)/targets.mk ...@@ -31,9 +35,9 @@ 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
# Metadata/ needed only for installer (and not for e.g. syslinux.iso) # Metadata/ needed only for installer (and not for e.g. syslinux.iso)
ifeq "$(KFLAVOURS)" "" ifeq "$(STAGE1_KFLAVOUR)$(KFLAVOURS)" ""
metadata: metadata:
@echo "** skipping metadata target, no kernel installed" @echo "** skipping metadata target, no stage1 kernel installed"
else else
# see also alterator-pkg (backend3/pkg-install) # see also alterator-pkg (backend3/pkg-install)
# FIXME: if we copy --as-needed, maybe just tar . ? # FIXME: if we copy --as-needed, maybe just tar . ?
...@@ -41,8 +45,8 @@ else ...@@ -41,8 +45,8 @@ else
metadata: metadata:
@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\n$(call kpackages)" \ @echo -e "\n# auto-added in image.in/Makefile" >> $(call list,.base)
>> $(call list,.base) @echo "$(call kpackages,$(KMODULES),$(KFLAVOURS))" >> $(call list,.base)
@echo "branding-$(BRANDING)-release" >> $(call list,.base) @echo "branding-$(BRANDING)-release" >> $(call list,.base)
@tar -cvf files/Metadata/pkg-groups.tar \ @tar -cvf files/Metadata/pkg-groups.tar \
-C $(PKGDIR) \ -C $(PKGDIR) \
...@@ -53,7 +57,7 @@ metadata: ...@@ -53,7 +57,7 @@ metadata:
endif endif
# FIXME: scripts.d/? # FIXME: scripts.d/?
prep: debug dot-disk metadata $(IMAGEDIR) prep: $(GLOBAL_DEBUG) dot-disk metadata $(IMAGEDIR)
$(IMAGEDIR): $(IMAGEDIR):
mkdir -p "$(IMAGEDIR)" mkdir -p "$(IMAGEDIR)"
...@@ -62,11 +66,9 @@ $(IMAGEDIR): ...@@ -62,11 +66,9 @@ $(IMAGEDIR):
pack-image: OUTDIR = $(IMAGEDIR) pack-image: OUTDIR = $(IMAGEDIR)
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
dot-disk: dot-disk:
@mkdir -p files/.disk @mkdir -p files/.disk
...@@ -75,5 +77,5 @@ dot-disk: ...@@ -75,5 +77,5 @@ dot-disk:
@echo "$(DATE)" >files/.disk/date @echo "$(DATE)" >files/.disk/date
@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 -d -s -- HEAD 2>/dev/null; \
) >files/.disk/commit ) >files/.disk/commit
...@@ -12,6 +12,6 @@ map = $(foreach a,$(2),$(call $(1),$(a))) ...@@ -12,6 +12,6 @@ map = $(foreach a,$(2),$(call $(1),$(a)))
# kernel package list generation; see also #24669 # kernel package list generation; see also #24669
NULL := NULL :=
SPACE := $(NULL) # the officially documented way of getting a space SPACE := $(NULL) # the officially documented way of getting a space
# NB: sort() shouldn't be applied here as kernel image order matters
list2re = $(subst $(SPACE),|,$(strip $(1))) list2re = $(subst $(SPACE),|,$(strip $(1)))
kpackages = ^kernel-(image|modules-($(call list2re,$(KMODULES))))-($(call list2re,$(KFLAVOURS)))$$ # args: KMODULES, KFLAVOURS
kpackages = ^kernel-(image|modules-($(call list2re,$(1))))-($(call list2re,$(2)))$$
...@@ -11,6 +11,7 @@ verbose started ...@@ -11,6 +11,7 @@ verbose started
[ -d "$WORKDIR/ALTLinux" ] || exit 0 [ -d "$WORKDIR/ALTLinux" ] || exit 0
cd "$WORKDIR/ALTLinux" cd "$WORKDIR/ALTLinux"
# FIXME: m-p-d legacy
set -- contrib-main addon-main ltsp-main set -- contrib-main addon-main ltsp-main
for pair; do for pair; do
slave=${pair%-*} slave=${pair%-*}
......
# this makefile is designed to be included in toplevel one # this makefile is designed to be included in toplevel one
ifdef BUILDDIR ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
# 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
# #
...@@ -28,5 +30,3 @@ iso: ...@@ -28,5 +30,3 @@ iso:
fi; \ fi; \
tail -100 "$(BUILDLOG)" | grep "^E:"; \ tail -100 "$(BUILDLOG)" | grep "^E:"; \
fi fi
endif
...@@ -23,7 +23,6 @@ distro/.branding: distro/.init ...@@ -23,7 +23,6 @@ distro/.branding: 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/.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,IMAGE_INIT_LIST,+branding-$$(BRANDING)-release)
@$(call set,BRANDING,altlinux-sisyphus)
@$(call set,KFLAVOURS,std-def) @$(call set,KFLAVOURS,std-def)
# pick up release manager's config # pick up release manager's config
......
# this makefile is designed to be included in toplevel one # this makefile is designed to be included in toplevel one
ifdef BUILDDIR ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
# simple logging switch inspired by netch@'s advice: # simple logging switch inspired by netch@'s advice:
# you can add plain $(LOG) to a rule recipe line to moderate it # you can add plain $(LOG) to a rule recipe line to moderate it
...@@ -16,8 +18,8 @@ LOG = >>$(BUILDLOG) 2>&1 ...@@ -16,8 +18,8 @@ LOG = >>$(BUILDLOG) 2>&1
else else
MAKE += -s MAKE += -s
LOG = 2>>$(BUILDLOG) >/dev/null LOG = 2>>$(BUILDLOG) >/dev/null
# 1) makefile target; 2) also passed to script hooks
GLOBAL_DEBUG := debug
endif endif
export BUILDLOG DEBUG GLOBAL_VERBOSE LOG MAKE SHELL export BUILDLOG DEBUG GLOBAL_DEBUG GLOBAL_VERBOSE LOG MAKE SHELL
endif
# step 3: copy package lists and groups referenced in distro configuration # step 3: copy package lists and groups referenced in distro configuration
# (and only those!) over to $(BUILDDIR) # (and only those!) over to $(BUILDDIR)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
all: all:
for dir in lists groups; do \ for dir in lists groups; do \
$(MAKE) -C $$dir BUILDDIR=$(BUILDDIR); \ $(MAKE) -C $$dir BUILDDIR=$(BUILDDIR); \
......
# step 3: copy package groups referenced in distro configuration # step 3: copy package groups referenced in distro configuration
# (and only those!) over to $(BUILDDIR) # (and only those!) over to $(BUILDDIR)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
include $(BUILDDIR)/distcfg.mk include $(BUILDDIR)/distcfg.mk
SUFFIX := pkg/groups SUFFIX := pkg/groups
TARGET := $(BUILDDIR)/$(SUFFIX) TARGET := $(BUILDDIR)/$(SUFFIX)
all: debug all: $(GLOBAL_DEBUG)
@if [ -n "$(GROUPS)" ]; then \ @if [ -n "$(GROUPS)" ]; then \
mkdir -p $(TARGET) && \ mkdir -p $(TARGET) && \
cp -at $(TARGET) -- $(addsuffix .directory,$(GROUPS)); \ cp -at $(TARGET) -- $(addsuffix .directory,$(GROUPS)); \
...@@ -17,6 +21,4 @@ all: debug ...@@ -17,6 +21,4 @@ all: debug
fi fi
debug: debug:
ifdef GLOBAL_VERBOSE
@echo "** GROUPS: $(GROUPS)" @echo "** GROUPS: $(GROUPS)"
endif
# step 3: copy package lists referenced in distro configuration # step 3: copy package lists referenced in distro configuration
# (and only those!) over to $(BUILDDIR) # (and only those!) over to $(BUILDDIR)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
include $(BUILDDIR)/distcfg.mk include $(BUILDDIR)/distcfg.mk
SUFFIX := pkg/lists SUFFIX := pkg/lists
TARGET := $(BUILDDIR)/$(SUFFIX) TARGET := $(BUILDDIR)/$(SUFFIX)
# env | sort -u | grep _LISTS | xargs cp # env | sort -u | grep _LISTS | xargs cp
all: $(TARGET) debug all: $(TARGET) $(GLOBAL_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)),\
...@@ -24,11 +28,9 @@ $(TARGET): ...@@ -24,11 +28,9 @@ $(TARGET):
@mkdir -p $(TARGET) @mkdir -p $(TARGET)
debug: debug:
ifdef GLOBAL_VERBOSE
@$(foreach V, \ @$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \ $(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\ $(if $(filter environment% file,$(origin $V)),\
$(warning $V=$(value $V)))) $(warning $V=$(value $V))))
@echo "** LISTS: -- see above" @echo "** LISTS: -- see above"
@echo "** GROUPS: $(GROUPS)" @echo "** GROUPS: $(GROUPS)"
endif
# this makefile is designed to be included in toplevel one # this makefile is designed to be included in toplevel one
ifdef BUILDDIR
# this could have come from environment;
# if not, can be symlinked if r/w, or made anew
# NB: immediate assignment
ifndef BUILDDIR
BUILDDIR := $(shell [ -s build ] \
&& realpath build \
|| bin/mktmpdir mkimage-profiles.build)
endif
# even smart caching only hurts when every build goes from scratch
NO_CACHE ?= 1
export BUILDDIR NO_CACHE
# step 1: initialize the off-tree mkimage profile (BUILDDIR) # step 1: initialize the off-tree mkimage profile (BUILDDIR)
profile/init: distclean profile/init: distclean
@echo -n "** initializing BUILDDIR: " @echo -n "** initializing BUILDDIR: "
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/ @rsync -qaH --delete image.in/ "$(BUILDDIR)"/
@:> "$(BUILDDIR)"/distcfg.mk @:> "$(BUILDDIR)"/distcfg.mk
@:> "$(BUILDLOG)" @{ \
git show-ref --head -d -s -- HEAD && \
git status -s && \
echo; \
} 2>/dev/null >> "$(BUILDLOG)"
@mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker @mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker
@type -t git >&/dev/null && \ @type -t git >&/dev/null && \
cd $(BUILDDIR) && \ cd $(BUILDDIR) && \
...@@ -26,5 +43,3 @@ profile/populate: profile/init distro/.rc ...@@ -26,5 +43,3 @@ profile/populate: profile/init distro/.rc
@for dir in sub.in features.in pkg.in; do \ @for dir in sub.in features.in pkg.in; do \
$(MAKE) -C $$dir $(LOG); \ $(MAKE) -C $$dir $(LOG); \
done done
endif
# step 3: copy the needed subprofiles to $(BUILDDIR) # step 3: copy the needed subprofiles to $(BUILDDIR)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
include $(BUILDDIR)/distcfg.mk include $(BUILDDIR)/distcfg.mk
all: all:
......
# step 4: build install2 subprofile (installer "live" part) # step 4: build install2 subprofile (installer "live" part)
ifndef GLOBAL_BUILDDIR
$(error GLOBAL_BUILDDIR not defined)
endif
default: all default: all
include $(GLOBAL_BUILDDIR)/distcfg.mk include $(GLOBAL_BUILDDIR)/distcfg.mk
include $(GLOBAL_BUILDDIR)/functions.mk include $(GLOBAL_BUILDDIR)/functions.mk
include $(MKIMAGE_PREFIX)/config.mk include $(MKIMAGE_PREFIX)/config.mk
# kernel-modules only (but these require corresponding kernel-image) # need kernel modules only (which require corresponding kernel-image);
IMAGE_PACKAGES_REGEXP = $(call kpackages) # these go into work chroot; NB: no vmlinuz there
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS))
IMAGE_PACKAGES = $(COMMON_PACKAGES) \ IMAGE_PACKAGES = $(COMMON_PACKAGES) \
$(INSTALL2_PACKAGES) \ $(INSTALL2_PACKAGES) \
./packages ./packages
...@@ -16,11 +21,4 @@ MKI_PACK_RESULTS = squash:altinst ...@@ -16,11 +21,4 @@ MKI_PACK_RESULTS = squash:altinst
include $(MKIMAGE_PREFIX)/targets.mk include $(MKIMAGE_PREFIX)/targets.mk
# pass it to script hooks all: build-image run-image-scripts pack-image
ifneq "$(KDEFAULT)" ""
INFO_KDEFAULT := $(KDEFAULT)
else
INFO_KDEFAULT := $(lastword $(KFLAVOURS))
endif
all: build-image run-image-scripts run-scripts pack-image
#!/bin/sh
# symlink default kernel iff requested but not yet done
KDEFAULT="$INFO_KDEFAULT"
if [ -n "$GLOBAL_VERBOSE" ]; then
echo "** KDEFAULT: $KDEFAULT"
fi
# kernel-image in instrumental chroot
VMLINK=/boot/vmlinuz
# better bail out early rather than make a silly symlink
shopt -s failglob
if [ -L "$VMLINK" ]; then
echo "** $VMLINK -> $(readlink "$VMLINK")"
fi
if [ -n "$KDEFAULT" ]; then
VMLINUZ="$(cd /boot; echo vmlinuz-*-$KDEFAULT-*)"
if [ -n "$VMLINUZ" ]; then
ln -sf "$VMLINUZ" "$VMLINK"
echo "** overriding $VMLINK with $VMLINUZ"
fi
fi
# step 4: build main subprofile (requisite + optional packages for media) # step 4: build main subprofile (requisite + optional packages for media)
ifndef GLOBAL_BUILDDIR
$(error GLOBAL_BUILDDIR not defined)
endif
default: all default: all
include $(GLOBAL_BUILDDIR)/distcfg.mk include $(GLOBAL_BUILDDIR)/distcfg.mk
...@@ -8,7 +12,7 @@ include $(MKIMAGE_PREFIX)/config.mk ...@@ -8,7 +12,7 @@ include $(MKIMAGE_PREFIX)/config.mk
CHROOT_PACKAGES = apt-utils rsync CHROOT_PACKAGES = apt-utils rsync
IMAGE_PACKAGES_REGEXP = $(call kpackages) IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS))
IMAGE_PACKAGES = $(call map,list,.base $(BASE_LISTS) $(DISK_LISTS) $(GROUPS)) \ IMAGE_PACKAGES = $(call map,list,.base $(BASE_LISTS) $(DISK_LISTS) $(GROUPS)) \
$(COMMON_PACKAGES) \ $(COMMON_PACKAGES) \
$(MAIN_PACKAGES) $(MAIN_PACKAGES)
...@@ -18,7 +22,7 @@ MKI_PACK_RESULTS = data ...@@ -18,7 +22,7 @@ MKI_PACK_RESULTS = data
include $(MKIMAGE_PREFIX)/targets.mk include $(MKIMAGE_PREFIX)/targets.mk
all: debug copy-packages pack-image all: $(GLOBAL_DEBUG) copy-packages pack-image
debug: debug:
@echo "IMAGE_PACKAGES: $(IMAGE_PACKAGES)" @echo "IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
# step 4: build stage1 subprofile (installer bootstrap) # step 4: build stage1 subprofile (installer bootstrap)
ifndef GLOBAL_BUILDDIR
$(error GLOBAL_BUILDDIR not defined)
endif
include $(GLOBAL_BUILDDIR)/distcfg.mk include $(GLOBAL_BUILDDIR)/distcfg.mk
include $(GLOBAL_BUILDDIR)/functions.mk include $(GLOBAL_BUILDDIR)/functions.mk
include $(MKIMAGE_PREFIX)/config.mk include $(MKIMAGE_PREFIX)/config.mk
ifdef BOOTLOADER ifndef BOOTLOADER
$(error BOOTLOADER not defined)
endif
MKI_PACK_RESULTS = data MKI_PACK_RESULTS = data
# FIXME: un-hardwire description # FIXME: un-hardwire description
...@@ -17,29 +23,23 @@ include $(MKIMAGE_PREFIX)/targets.mk ...@@ -17,29 +23,23 @@ include $(MKIMAGE_PREFIX)/targets.mk
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(COMMON_PACKAGES) CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(COMMON_PACKAGES)
ifeq "$(KFLAVOURS)" "" # here we try and come up with the installer kernel/modules, if any;
# only a single kernel might be needed (STAGE1_KFLAVOUR sets explicitly);
# kernel image copied from instrumental chroot into .work/syslinux/alt0/
STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS))
# propagator needed iff stage1 kernel installed (not for e.g. syslinux.iso) # propagator needed iff stage1 kernel installed (not for e.g. syslinux.iso)
ifeq "$(STAGE1_KFLAVOUR)" ""
build-propagator: build-propagator:
@echo "** skipping build-propagator target, no kernel installed" @echo "** skipping build-propagator target, no kernel installed"
else else
# kernel image copied from instrumental chroot into .work/syslinux/alt0/ CHROOT_PACKAGES_REGEXP := $(call kpackages,$(STAGE1_KMODULES_REGEXP),$(STAGE1_KFLAVOUR))
# NB: installer only needs a single kernel, no use for multiple ones INFO_STAGE1_KFLAVOUR := $(STAGE1_KFLAVOUR)
ifneq "$(STAGE1_KFLAVOUR)" ""
KFLAVOURS := $(STAGE1_KFLAVOUR)
else
KFLAVOURS := $(lastword $(KFLAVOURS))
endif
ifneq "$(STAGE1_KMODULES_REGEXP)" ""
KMODULES := $(STAGE1_KMODULES_REGEXP)
endif
# set up kernel related part, pass to hooks
CHROOT_PACKAGES_REGEXP := $(call kpackages)
BUILD_PROPAGATOR = build-propagator
INFO_STAGE1_KFLAVOUR := $(KFLAVOURS)
endif endif
# scripts prepare bootloader configuration, too # scripts prepare bootloader configuration, too
all: prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \ all: debug prepare-workdir copy-tree run-scripts build-propagator \
copy-$(BOOTLOADER) pack-image copy-$(BOOTLOADER) pack-image
debug: debug:
...@@ -49,7 +49,3 @@ debug: ...@@ -49,7 +49,3 @@ debug:
echo "** CHROOT_PACKAGES_REGEXP: $(CHROOT_PACKAGES_REGEXP)"; \ echo "** CHROOT_PACKAGES_REGEXP: $(CHROOT_PACKAGES_REGEXP)"; \
echo "** BOOTLOADER: $(BOOTLOADER)"; \ echo "** BOOTLOADER: $(BOOTLOADER)"; \
fi fi
else
$(error BOOTLOADER undefined)
endif
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