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
2021-06-17 00:48:23 +03:00
i f n e q ( , $( filter -out $ ( DIRECT_TARGETS ) ,$ ( MAKECMDGOALS ) ) )
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-04-06 21:13:32 +04:00
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
2021-06-17 00:48:23 +03:00
e n d i f
2012-01-10 18:00:56 +04:00
2011-06-12 19:06:36 +04:00
# even smart caching only hurts when every build goes from scratch
NO_CACHE ?= 1
2012-04-06 21:13:32 +04:00
export BUILDDIR NO_CACHE
2011-05-11 23:40:47 +04:00
2011-10-06 12:46:31 +04:00
CONFIG := $( BUILDDIR) /distcfg.mk
2014-08-27 22:26:12 +04:00
RC = $( HOME) /.mkimage/profiles.mk
2011-10-06 12:46:31 +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)
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 ; \
2015-04-02 20:46:48 +03:00
if [ -z $( QUIET) ] ; then \
echo -n " $( TIME) initializing BUILDDIR: " ; \
fi ; \
2012-03-19 15:42:10 +04:00
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
@{ \
2012-08-10 00:32:00 +04:00
mp-showref $( LOG) ; \
2012-03-19 15:42:10 +04:00
{ \
2012-07-09 22:50:57 +04:00
APTCONF = " $( wildcard $( APTCONF) ) " ; \
echo " ** using $$ {APTCONF:-system apt configuration}: " ; \
eval ` apt-config shell $$ { APTCONF:+-c= $$ APTCONF} \
2011-11-04 02:14:18 +04:00
SOURCELIST Dir::Etc::sourcelist/f \
SOURCEPARTS Dir::Etc::sourceparts/d` ; \
2018-06-05 18:22:01 +03:00
find " $$ SOURCEPARTS " -mindepth 1 -maxdepth 1 -name '*.list' \
2018-05-22 21:47:06 +03:00
| xargs egrep -hv -e '^#|^[[:blank:]]*$$' -- " $$ SOURCELIST " \
2012-07-09 22:50:57 +04:00
| tee $( BUILDDIR) /sources.list; \
2011-11-04 02:14:18 +04:00
echo; \
2012-03-19 15:42:10 +04:00
} $( LOG) ; \
2012-11-11 20:47:34 +04:00
if ! grep -q " \< $( ARCH) \> " $( BUILDDIR) /sources.list; then \
2013-02-19 21:46:18 +04:00
if grep -q " noarch " $( BUILDDIR) /sources.list; then \
echo -n " requested arch ' $$ ARCH' unavailable " >& 2; \
if [ -z " $( APTCONF) " ] ; then \
echo " (no APTCONF)" ; \
else \
echo; \
fi >& 2; \
exit 1; \
fi ; \
2012-07-09 22:50:57 +04:00
fi ; \
2013-02-06 10:54:00 +04:00
mp-commit -i " $( BUILDDIR) " "derivative profile initialized" ; \
2012-03-19 15:42:10 +04:00
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) " && \
2015-04-02 20:46:48 +03:00
if [ -z $( QUIET) ] ; then \
echo " $( SYMLINK) / " ; \
fi ; \
2011-10-31 12:34:15 +04:00
else \
2015-04-02 20:46:48 +03:00
if [ -z $( QUIET) ] ; then \
echo " $( BUILDDIR) / " ; \
fi ; \
2012-03-19 15:42:10 +04:00
fi $( SHORTEN) ; \
} >& 2
2010-09-09 13:50:29 +04:00
2020-02-16 18:24:04 +03:00
profile/bare : profile /init use /pkgpriorities
2012-03-19 15:42:10 +04:00
@{ \
NOTE = " $$ {GLOBAL_VERBOSE:+: $( CONFIG) } " ; \
2015-04-02 20:46:48 +03:00
if [ -z " $( QUIET) " ] ; then \
echo " $( TIME) preparing distro config $$ NOTE " $( SHORTEN) ; \
fi ; \
2012-03-19 15:42:10 +04:00
} >& 2
2011-10-06 12:46:31 +04:00
@$( call try,MKIMAGE_PREFIX,/usr/share/mkimage)
2021-05-17 06:13:54 +03:00
@$( call try,GLOBAL_PREFIX,$( MKIMAGE_PREFIX) )
2011-10-06 12:46:31 +04:00
@$( call try,GLOBAL_VERBOSE,)
2013-02-04 19:18:06 +04:00
@$( call try,IMAGEDIR,$( wildcard $( IMAGEDIR) ) )
@$( call try,LOGDIR,$( wildcard $( LOGDIR) ) )
2016-11-29 20:35:57 +03:00
@$( call try,BRANDING,alt-sisyphus)
2020-02-16 18:24:04 +03:00
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -alterator:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -bootsplash:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -bootloader:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -graphics:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -indexhtml:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -notes:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -release:Essential)
@$( call add,PINNED_PACKAGES,branding-$$ ( BRANDING) -slideshow:Essential)
2011-12-29 23:19:03 +04:00
ifeq (,$(REPO : altlinux %=))
2011-10-06 12:46:31 +04:00
@$( call set,IMAGE_INIT_LIST,+branding-$$ ( BRANDING) -release)
2011-12-29 23:19:03 +04:00
e n d i f
2015-01-22 18:27:07 +03:00
@$( call xport,ARCH)
2012-08-10 00:32:00 +04:00
@mp-commit " $( BUILDDIR) " "image configuration defaults set"
2011-10-06 12:46:31 +04:00
2012-07-10 13:20:15 +04:00
# put the derived SUBPROFILE_DIRS here to get it logged in clear text by the way
2011-10-06 12:46:31 +04:00
profile/finalize :
2012-07-10 13:20:15 +04:00
@$( call put,SUBPROFILE_DIRS = $$ ( notdir $$ ( subst @,/,$$ ( SUBPROFILES) ) ) )
2014-08-27 22:26:12 +04:00
@if [ -s $( RC) ] ; then $( call put,-include $( value RC) ) ; fi
2011-10-06 12:46:31 +04:00
@$( call put,endif)
2012-08-10 00:32:00 +04:00
@mp-commit " $( BUILDDIR) " "image configuration finalized"
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