# ALTLINUX LIVE CD MKIMAGE MAKEFILE

#### LC_ALL=C MKI_PREFIX=/home/stanv/tmp2 GLOBAL_HSH_APT_CONFIG=/home/stanv/apt/apt.conf.sisyphus.x86_64 make distclean


MKI_STAGE = live-cd

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

include ./general.mk

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

include $(GLOBAL_PREFIX)/config.mk


# ______________________________________________
# PERSONAL CONFIGURATION AND VARIABLES FOR HOOKS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	# notation about current part (32 characters max)
INFO_LABEL = Linux Lite Live CD
	# Graphical boot logo for lilo and syslinux
	# design-bootloader-$(INFO_GFXBOOT_FLAVOUR)-$(INFO_GFXBOOT_VARIANT)
	# INFO_GFXBOOT_FLAVOUR can be on of the: ``livecd'' ``installer'' ``system''
	# INFO_GFXBOOT_FLAVOUR = livecd
	# INFO_GFXBOOT_VARIANT can be on of the: ``desktop'' ``junior'' ...
	# INFO_GFXBOOT_VARIANT = lite
	# Theme for splash animations during bootup
	# design-bootsplash-$(INFO_BOOTSPLASH_THEME)
    # INFO_BOOTSPLASH_THEME = lite
# XXX: hooks variable fot 03-gfxboot
INFO_THEME = lite-school-livecd

# _________________
# MKIMAGE BEHAVIOUR
# ~~~~~~~~~~~~~~~~~

	# no remote builds all SUBDIRS are local
NO_REMOTES=1
	# XXX: unknown variables
GLOBAL_HSH_LANGS="en_US:ru_RU:be_BY:uk_UA:ru_UA:tt_RU"
	# define packages will be installed to instrumental chroot
	# licenses under wich this product released and can be distributed
	# there are several packages for each ALTLinux distribution
	# search fot alt-license in apt-shell
CHROOT_PACKAGES = alt-license-junior-sl
	# Memory test for x86 architecture
	# call from [sys|iso]linux menu at boot time
CHROOT_PACKAGES += memtest86+
	# Graphical boot logo for lilo and syslinux
	#XXX: CHROOT_PACKAGES += design-bootloader-$(INFO_GFXBOOT_FLAVOUR)-$(INFO_GFXBOOT_VARIANT)
	# Console splash animations during bootup
CHROOT_PACKAGES += bootsplash
	# Theme for splash animations during bootup
	# XXX: CHROOT_PACKAGES += design-bootsplash-$(INFO_BOOTSPLASH_THEME)
CHROOT_PACKAGES += design-bootloader-livecd-lite-school
CHROOT_PACKAGES += design-bootsplash-lite-school
	# for propagator
CHROOT_PACKAGES += kernel-image-std-smp
CHROOT_PACKAGES += kernel-modules-atl1-std-smp
CHROOT_PACKAGES += kernel-modules-atl2-std-smp
#CHROOT_PACKAGES += docs-issue-school_user
#CHROOT_PACKAGES += docs-install-desktop_personal

CHROOT_PACKAGES += rsync
	# apt-utils
	# CHROOT_PACKAGES += kernel-modules-atl1-std-smp
	# kernel-modules-atl2-std-smp
	# findutils
	# docs-issue-desktop_$(DESKTOP_FLAVOUR)
	# docs-install-desktop_$(DESKTOP_FLAVOUR)
	# make bootable cdrom with propagator
MKI_PACK_RESULTS = boot:cd.iso
#MKI_OUTNAME = cd.iso
	# don't use propagator and make
#MKI_PACKTYPE = isodata
	# add to work chroot next files
COPY_TREE = ./isofiles
	# we can build several distribution modifications at once,
	# don't automatically delete `OUTDIR' after each stage
CLEANUP_OUTDIR=
	# In case MKI_PACK_RESULTS == boot:cdname.iso, specify parameters for propagator
INFO_DISTRO = ALT Linux
INFO_BRANCH = 4.0
INFO_NAME = Live
INFO_CODENAME = Ajuga
PROPAGATOR_VERSION = $(INFO_DISTRO) $(INFO_BRANCH) $(INFO_NAME) \
					     ($(INFO_CODENAME)) build $(shell date +%F)
	# list kernel modules that will be inserted to propagator image (stage1)
PROPAGATOR_MAR_MODULES = ./modules-propagator
	# files list put to propagator image (stage1) see gencpio
PROPAGATOR_INITFS = ./initfs
	# specify boot method for this image
	# may be ``isolinux'' or ``pxelinux''
BOOT_TYPE = isolinux
	# variables used by mkisofs: APPI, COPY, ABST, BIBL, PREP, PUBL, SYSI, VOLI, VOLS
	# refer to mkisofs(8)
	# Specifies  a  text  string that will be written into the volume header. 128 characters.
BOOT_PUBL = ALT Linux
	# specifies the volset ID. 128 characters.
BOOT_VOLI = $(INFO_LABEL)
	# describe the application that will  be  on  the disc. 128 characters.
BOOT_APPI = Linux distrubution for $(GLOBAL_TARGET)
	# copyright file name. 37  characters.
BOOT_COPY = LICENSE
	# describe the preparer of the CDROM, usually with a mailing address and phone number. 128 characters.
BOOT_PREP = ALT Linux
	# directory for instrumental chroot scripts
MKI_SCRIPTDIR = hooks-instrumental-chroot
	# directory for work-chroot (image) scrips
#MKI_IMAGE_SCRIPTDIR = hooks-work-chroot


SUBDIRS = $(addprefix ./stages/, squashfs)
include $(GLOBAL_PREFIX)/targets.mk

# _______
# TARGETS
# ~~~~~~~
	# * Use COPY_TREE file list to copy them to work chroot
	# * Copy to work chroot results lower-level targets (.out/* from each $(SUBDIRS) )
	# * Exec hooks into instrumental chroot
	# * Copy files used by isolinux
	# * Packing work chroot see MKI_PACK_RESULTS
all: copy-tree copy-subdirs copy-isolinux run-scripts run-image-scripts pack-image
