Makefile 1.99 KB
Newer Older
Michael Shigorin's avatar
Michael Shigorin committed
1 2
# step 4: build stage1 subprofile (installer bootstrap)

3 4 5 6
ifndef GLOBAL_BUILDDIR
$(error GLOBAL_BUILDDIR not defined)
endif

7
include $(GLOBAL_BUILDDIR)/distcfg.mk
8 9
include $(GLOBAL_BUILDDIR)/functions.mk
include $(MKIMAGE_PREFIX)/config.mk
Michael Shigorin's avatar
Michael Shigorin committed
10

11 12 13
ifndef BOOTLOADER
$(error BOOTLOADER not defined)
endif
14
GLOBAL_BOOTLOADER := $(BOOTLOADER)
Michael Shigorin's avatar
Michael Shigorin committed
15 16

MKI_PACK_RESULTS = data
Michael Shigorin's avatar
Michael Shigorin committed
17
COPY_TREE = ./files
Michael Shigorin's avatar
Michael Shigorin committed
18 19 20

include $(MKIMAGE_PREFIX)/targets.mk

21
# here we try and come up with the installer kernel/modules, if any;
22
# only a single kernel might be needed (STAGE1_KFLAVOUR sets explicitly);
23 24
# kernel image copied from instrumental chroot into .work/syslinux/alt0/

25
STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS))
26

27
# propagator needed iff stage1 kernel installed (not for e.g. syslinux.iso)
28
ifneq "$(STAGE1_KFLAVOUR)" ""
Michael Shigorin's avatar
Michael Shigorin committed
29 30 31
PROPAGATOR_VERSION = ALT Linux
PROPAGATOR_MAR_MODULES = ./modules
PROPAGATOR_INITFS = ./initfs
32
BUILD_PROPAGATOR = build-propagator
33
INFO_STAGE1_KFLAVOUR := $(STAGE1_KFLAVOUR)
34 35
CHROOT_PACKAGES_REGEXP := $(call kpackages, \
	$(STAGE1_KMODULES_REGEXP),$(STAGE1_KFLAVOUR))
36 37
endif

38
CHROOT_PACKAGES_REGEXP += $(STAGE1_PACKAGES_REGEXP)
39
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(SYSTEM_PACKAGES)
40

41 42 43
# pass for use/stage2
GLOBAL_SQUASHFS := $(SQUASHFS)

Michael Shigorin's avatar
Michael Shigorin committed
44
-include $(sort $(wildcard lib/*.mk))
45

46
# scripts prepare bootloader configuration, too
47
# NB: we pass tested squashfs options for ../stage2/Makefile to include
48
all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \
49
	copy-$(BOOTLOADER) $(COPY_SQUASHCFG) pack-image $(GLOBAL_CLEAN_WORKDIR)
50
	@if [ -s $(OUTDIR)/squashcfg.mk ]; then \
51 52
		cp $(OUTDIR)/squashcfg.mk $(GLOBAL_BUILDDIR)/; \
	fi
53 54

debug:
55
	@if [ -n "$(GLOBAL_VERBOSE)" ]; then \
56 57
		echo "** BRANDING: $(BRANDING)"; \
		echo "** IMAGE_INIT_LIST: $(IMAGE_INIT_LIST)"; \
58
		echo "** STAGE1_PACKAGES: $(STAGE1_PACKAGES)"; \
59
		echo "** STAGE1_PACKAGES_REGEXP: $(STAGE1_PACKAGES_REGEXP)"; \
60 61 62 63
		echo "** CHROOT_PACKAGES: $(CHROOT_PACKAGES)"; \
		echo "** CHROOT_PACKAGES_REGEXP: $(CHROOT_PACKAGES_REGEXP)"; \
		echo "** BOOTLOADER: $(BOOTLOADER)"; \
	fi