c2996cc493
This kind of test was proposed by led@ to gather statistics on chroot's contents going to become squashfs (the script optimizations lowering added overhead from ~10 sec down to a subsecond range were also proposed by him). Intentionally not documented in doc/variables.txt due to the rather lowlevel nature of the probe (at least so far). The knobs involved are SQUASHFS (the additional effort kicks in only for "tight" case) and GLOBAL_SQUASHFS_SORT (must be non-empty for this extra overhead to occur). Additional experimentation is needed to find out whether the difference in squashfs size and performance is worth the trouble (seems the impact is non-zero but pretty minor).
61 lines
1.6 KiB
Makefile
61 lines
1.6 KiB
Makefile
# step 4: build a stage2 subprofile (custom livecd)
|
|
|
|
# NB: stage2 is not standalone but rather a common base
|
|
# for all livecd images (installer, live, rescue)
|
|
|
|
ifndef GLOBAL_BUILDDIR
|
|
$(error GLOBAL_BUILDDIR not defined)
|
|
endif
|
|
|
|
default: all
|
|
|
|
include $(GLOBAL_BUILDDIR)/distcfg.mk
|
|
include $(GLOBAL_BUILDDIR)/functions.mk
|
|
include $(MKIMAGE_PREFIX)/config.mk
|
|
|
|
# this might have been prepared by ../stage1/scripts.d/03-test-kernel
|
|
-include $(GLOBAL_BUILDDIR)/squashcfg.mk
|
|
|
|
# this should be brought in by corresponding specific stage2 feature
|
|
include stage2cfg.mk
|
|
|
|
# requisite stuff
|
|
IMAGE_PACKAGES += $(SYSTEM_PACKAGES)
|
|
|
|
# here we also try and come up with the stage1 kernel/modules, if any;
|
|
# no kernel flavour specified will result in no modules for stage1 vmlinuz
|
|
STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS))
|
|
|
|
ifeq (,$(STAGE1_KFLAVOUR))
|
|
$(error STAGE1_KFLAVOUR is utterly empty; cannot guess either)
|
|
endif
|
|
|
|
# need kernel modules only (which require corresponding kernel-image);
|
|
# these go into work chroot; NB: no vmlinuz there (unless live-install)
|
|
IMAGE_PACKAGES_REGEXP = $(call kpackages, \
|
|
$(STAGE1_KMODULES) $(STAGE2_KMODULES), \
|
|
$(STAGE1_KFLAVOUR))
|
|
|
|
# see also scripts.d/99-elf-stats
|
|
ifdef GLOBAL_SQUASHFS_SORT
|
|
ifeq (tight,$(SQUASHFS))
|
|
CHROOT_PACKAGES += file
|
|
pack-image: PACK_SQUASHFS_OPTS += -sort /.our/elf.lst
|
|
pack-image: CLEANUP_OUTDIR=
|
|
endif
|
|
endif
|
|
|
|
GLOBAL_SQUASHFS := $(SQUASHFS)
|
|
|
|
include $(MKIMAGE_PREFIX)/targets.mk
|
|
|
|
# NB: it's a collector variable, add()ing to a GLOBAL_ results in lost hair
|
|
GLOBAL_CLEANUP_PACKAGES := $(CLEANUP_PACKAGES)
|
|
|
|
all: | $(GLOBAL_DEBUG) \
|
|
build-image run-image-scripts run-scripts pack-image \
|
|
$(GLOBAL_CLEAN_WORKDIR)
|
|
|
|
# dummy
|
|
debug:: ;
|