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-12-30 14:46:58 +04:00
# this could have come from env; or could be symlinked; or is made anew
# (the reuse rationale is avoiding extra tmpdir lookups)
2011-08-16 00:30:20 +04:00
# NB: immediate assignment matters
2011-06-12 19:06:36 +04:00
i f n d e f B U I L D D I R
2011-12-30 14:46:58 +04:00
BUILDLINK := $( realpath $( SYMLINK) )
BUILDDIR := $( shell \
i f [ - s "$(SYMLINK)" - a "$(NUM_TARGETS)" = 1 ] & & \
[ -n " $( findstring $( BUILDDIR_PREFIX) .,$( BUILDLINK) ) " ] ; \
t h e n \
echo " $( BUILDLINK) " ; \
e l s e \
2012-03-27 09:36:23 +04:00
bin/mktmpdir $( BUILDDIR_PREFIX) || exit 200; \
2011-12-30 14:46:58 +04:00
f i ; )
2011-06-12 19:06:36 +04:00
e n d i f
2012-01-10 18:00:56 +04:00
i f e q ( , $( BUILDDIR ) )
$( error suitable BUILDDIR unavailable )
e n d i f
2011-06-12 19:06:36 +04:00
# 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
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)
2012-03-19 15:42:10 +04:00
# NB: our output MUST go into stderr to escape POSTPROC
2011-05-11 23:40:47 +04:00
profile/init : distclean
2012-03-19 15:42:10 +04:00
@{ \
if [ "`realpath " $( BUILDDIR) /"`" = / ] ; then \
2011-12-31 23:09:59 +04:00
echo " $( TIME) ERROR: invalid BUILDDIR: \` $( BUILDDIR) ' " ; \
exit 128; \
2012-03-19 15:42:10 +04:00
fi ; \
echo -n " $( TIME) initializing BUILDDIR: " ; \
rsync -qaxH --delete-after image.in/ " $( BUILDDIR) " /; \
mkdir " $( BUILDDIR) " /.mki; \
} >& 2
2011-10-06 12:46:31 +04:00
@$( call put,ifndef DISTCFG_MK)
@$( call put,DISTCFG_MK = 1)
2012-03-19 15:42:10 +04:00
@{ \
if type -t git >& /dev/null; then \
2011-10-31 12:34:15 +04:00
if [ -d .git ] ; then \
git show-ref --head -d -s -- HEAD && \
git status -s && \
echo; \
fi $( LOG) ; \
2012-03-19 15:42:10 +04:00
fi ; \
{ \
2011-11-04 02:14:18 +04:00
eval ` apt-config shell $$ { APTCONF:+-c= $( wildcard $( APTCONF) ) } \
SOURCELIST Dir::Etc::sourcelist/f \
SOURCEPARTS Dir::Etc::sourceparts/d` ; \
find " $$ SOURCEPARTS " -name '*.list' \
| xargs egrep -Rhv '^#|^[[:blank:]]*$$' " $$ SOURCELIST " && \
echo; \
2012-03-19 15:42:10 +04:00
} $( LOG) ; \
if type -t git >& /dev/null; then \
2011-10-31 12:34:15 +04:00
if cd $( BUILDDIR) ; then \
git init -q && \
git add . && \
git commit -qam 'derivative profile initialized' ; \
2012-03-19 15:42:10 +04:00
cd ->& /dev/null; \
2011-10-31 12:34:15 +04:00
fi ; \
2012-03-19 15:42:10 +04:00
fi ; \
if [ -w . ] ; then \
2011-10-31 12:34:15 +04:00
rm -f " $( SYMLINK) " && \
2011-12-30 14:46:58 +04:00
ln -s " $( BUILDDIR) " " $( SYMLINK) " && \
2011-10-31 12:34:15 +04:00
echo " $( SYMLINK) / " ; \
else \
2012-03-19 15:42:10 +04:00
echo " $( BUILDDIR) / " ; \
fi $( SHORTEN) ; \
} >& 2
2010-09-09 13:50:29 +04:00
2011-10-06 12:46:31 +04:00
profile/bare : profile /init
2012-03-19 15:42:10 +04:00
@{ \
NOTE = " $$ {GLOBAL_VERBOSE:+: $( CONFIG) } " ; \
echo " $( TIME) preparing distro config $$ NOTE " $( SHORTEN) ; \
} >& 2
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
2012-03-19 15:42:10 +04:00
profile/populate : 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