2011-10-06 12:46:31 +04:00
i f n d e f M K I M A G E _ P R O F I L E S
$( error this makefile is designed to be included in toplevel one )
e n d i f
2011-06-12 19:06:36 +04:00
2011-09-02 00:01:52 +04:00
SYMLINK = build
2011-06-12 19:06:36 +04:00
# this could have come from environment;
# if not, can be symlinked if r/w, or made anew
2011-08-16 00:30:20 +04:00
# NB: immediate assignment matters
2011-09-13 19:54:43 +04:00
# NB: PATH has no effect here
2011-06-12 19:06:36 +04:00
i f n d e f B U I L D D I R
2011-09-02 00:01:52 +04:00
BUILDDIR := $( shell [ -s " $( SYMLINK) " ] \
&& realpath " $( SYMLINK) " \
2011-10-31 12:34:15 +04:00
|| bin/mktmpdir mkimage-profiles)
2011-06-12 19:06:36 +04:00
e n d i f
# even smart caching only hurts when every build goes from scratch
NO_CACHE ?= 1
2011-09-13 19:54:43 +04:00
PATH := $( CURDIR) /bin:$( PATH)
export BUILDDIR NO_CACHE PATH
2011-05-11 23:40:47 +04:00
2011-10-06 12:46:31 +04:00
CONFIG := $( BUILDDIR) /distcfg.mk
RC := $( HOME) /.mkimage/profiles.mk
2011-08-22 20:29:22 +04:00
# holds a postprocessor; shell test executes in particular situation
# NB: not exported, for toplevel use only
2011-10-31 12:34:15 +04:00
SHORTEN = $( shell \
if [ -s " $( SYMLINK) " ] ; then \
echo " | sed 's, $( BUILDDIR) , $( SYMLINK) ,' " ; \
else \
echo " | sed 's, $( TMP) ,\$ $TMP ,' " ; \
fi ; )
2011-08-22 20:29:22 +04:00
server-ovz; KDEFAULT; syslinux features reworked
Renamed server-light.iso into server-ovz.iso to avoid brand dilution
and confusion (rider@'s server-light rather favours kvm, anyways).
Introduced KDEFAULT: a reliable default kernel chooser knob
since apt's regex ordering proved pretty unreliable.
Spelling things explicitly is better anyways.
SYSLINUX related features undergone pretty major rewrite
(that includes syslinux, hdt and memtest).
The problem to tackle was features.in/syslinux/generate.mk
assuming syslinux and pciids available in build *host* system;
this well might not be the case (or worse yet, those can be
just different). So now we're a bit less elegant and a bit
more enterprise, stuffing things into chroot and working there.
Bunch of other fixes along the road, including ; to name a few:
- fixed memtest entry (overlooked while renaming SYSLINUX_ITEMS)
- new and shiny doc/CodingStyle
- gfxboot, stage1 target chain, hdt tweaks
- distro.mk rehashed
- README++
- TODO: dropped (integer overflow anyways)
+ actually moved off-tree to reduce commit spam
- s,\.config\.mk,distcfg.mk,g
- doc/profiles.mk.sample: sample ~/.mkimage/profiles.mk
- ...and assorted fixups/additions
Sorry for convoluted commit, this would have been pretty hard to
rework into some really readable shape (and you might be interested
in the original repo's history horrors then, anyways).
2011-05-31 02:05:33 +04:00
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
2011-05-11 23:40:47 +04:00
profile/init : distclean
@echo -n "** initializing BUILDDIR: "
2010-09-09 13:50:29 +04:00
@rsync -qaH --delete image.in/ " $( BUILDDIR) " /
2011-10-31 12:34:15 +04:00
@mkdir " $( BUILDDIR) " /.mki # mkimage toplevel marker
2011-10-06 12:46:31 +04:00
@$( call put,ifndef DISTCFG_MK)
@$( call put,DISTCFG_MK = 1)
2011-10-31 12:34:15 +04:00
@if type -t git >& /dev/null; then \
if [ -d .git ] ; then \
git show-ref --head -d -s -- HEAD && \
git status -s && \
echo; \
fi $( LOG) ; \
if cd $( BUILDDIR) ; then \
git init -q && \
git add . && \
git commit -qam 'derivative profile initialized' ; \
fi ; \
2011-10-21 20:17:57 +04:00
fi
2011-10-31 12:34:15 +04:00
@if [ -w . ] ; then \
rm -f " $( SYMLINK) " && \
ln -sf " $( BUILDDIR) " " $( SYMLINK) " && \
echo " $( SYMLINK) / " ; \
else \
echo " $( BUILDDIR) / " $( SHORTEN) ; \
fi $( SHORTEN)
2010-09-09 13:50:29 +04:00
2011-10-06 12:46:31 +04:00
profile/bare : profile /init
2011-10-31 12:34:15 +04:00
@echo " ** preparing distro config $$ {DEBUG:+: see $( CONFIG) } " \
$( SHORTEN)
2011-10-06 12:46:31 +04:00
@$( call try,MKIMAGE_PREFIX,/usr/share/mkimage)
@$( call try,GLOBAL_VERBOSE,)
@$( call try,IMAGEDIR,$( IMAGEDIR) )
@$( call try,BRANDING,altlinux-sisyphus)
@$( call set,IMAGE_INIT_LIST,+branding-$$ ( BRANDING) -release)
2011-10-21 20:17:57 +04:00
@if type -t git >& /dev/null && cd $( BUILDDIR) ; then \
git init -q && \
git add . && \
git commit -qam 'image configuration defaults set' ; \
fi
2011-10-06 12:46:31 +04:00
profile/finalize :
@if [ -s $( RC) ] ; then $( call put,-include $( RC) ) ; fi
@$( call put,endif)
2011-10-21 20:17:57 +04:00
@if type -t git >& /dev/null && cd $( BUILDDIR) ; then \
git init -q && \
git add . && \
git commit -qam 'image configuration finalized' ; \
fi
2011-09-14 00:45:57 +04:00
2011-09-02 00:01:52 +04:00
# requires already formed distcfg.mk for useful output
profile/dump-vars :
@if [ -s " $( SYMLINK) " ] ; then \
$( MAKE) --no-print-directory -C " $( SYMLINK) / " -f vars.mk; \
echo; \
fi $( LOG)
server-ovz; KDEFAULT; syslinux features reworked
Renamed server-light.iso into server-ovz.iso to avoid brand dilution
and confusion (rider@'s server-light rather favours kvm, anyways).
Introduced KDEFAULT: a reliable default kernel chooser knob
since apt's regex ordering proved pretty unreliable.
Spelling things explicitly is better anyways.
SYSLINUX related features undergone pretty major rewrite
(that includes syslinux, hdt and memtest).
The problem to tackle was features.in/syslinux/generate.mk
assuming syslinux and pciids available in build *host* system;
this well might not be the case (or worse yet, those can be
just different). So now we're a bit less elegant and a bit
more enterprise, stuffing things into chroot and working there.
Bunch of other fixes along the road, including ; to name a few:
- fixed memtest entry (overlooked while renaming SYSLINUX_ITEMS)
- new and shiny doc/CodingStyle
- gfxboot, stage1 target chain, hdt tweaks
- distro.mk rehashed
- README++
- TODO: dropped (integer overflow anyways)
+ actually moved off-tree to reduce commit spam
- s,\.config\.mk,distcfg.mk,g
- doc/profiles.mk.sample: sample ~/.mkimage/profiles.mk
- ...and assorted fixups/additions
Sorry for convoluted commit, this would have been pretty hard to
rework into some really readable shape (and you might be interested
in the original repo's history horrors then, anyways).
2011-05-31 02:05:33 +04:00
# step 3 entry point: copy the needed parts into BUILDDIR
2011-09-14 00:45:57 +04:00
profile/populate : profile /init profile /finalize profile /dump -vars
2010-09-14 14:18:53 +04:00
@for dir in sub.in features.in pkg.in; do \
2011-05-11 23:40:47 +04:00
$( MAKE) -C $$ dir $( LOG) ; \
2010-09-09 13:50:29 +04:00
done