# ____
# INFO
# ~~~~
# 			This is rescue image. All its content will be loaded to /dev/ram3.
# 			CD-ROM can be ejected.

# ______________________________________________
# INCLUDE GENERAL OPTIONS. COMMON FOR ALL STAGES
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

include ../../general.mk

# _____________________________
# INCLUDE DEFAULT CONFIGURATION
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

include $(GLOBAL_PREFIX)/config.mk

MKI_STAGE = rescue

	# packages list for install to work-chroot
IMAGE_PACKAGES += init3-rescue.pkgs
IMAGE_PACKAGES += kernel.pkgs

	# make squashfs image
MKI_PACK_RESULTS = squash:rescue
	# directory for instrumental chroot scripts
MKI_SCRIPTDIR = hooks-instrumental-chroot
	# directory for work-chroot (image) scrips
MKI_IMAGE_SCRIPTDIR = hooks-work-chroot
COPY_TREE = copy-tree.d

# _______________________
# INCLUDE MKIMAGE TARGETS
# ~~~~~~~~~~~~~~~~~~~~~~~
include $(GLOBAL_PREFIX)/targets.mk

	# * Install to work chroot packages defined at IMAGE_PACKAGES
	# * Run hooks for instrumental-chroot
	# * Run hooks for work-chroot
	# * Pack work chroot to image with filesystem and name defined at MKI_PACK_RESULTS
all: build-image copy-tree run-scripts run-image-scripts pack-image
