Commit Graph

51 Commits

Author SHA1 Message Date
Anton Midyukov
187d0a5d51 Makefile, reports.mk: use variable REPORT from ~/.mkimage/profiles.mk
You must use the GNU MAKE variable, not a shell variable, and must
pass the REPORT variable to reports.mk.
2021-06-06 19:55:23 +07:00
Anton Midyukov
8dbd0a0fee Makefile, lib/build.mk: fix usage AUTOCLEAN with DEBUG
make distclean should be launched after copying the log when
debugging is enabled.
2021-06-06 19:55:23 +07:00
Ivan A. Melnikov
caee317e3e Ensure non-zero exit code on make failure
Before this change, we could have 0 exit code from the main
make process even when some targets failed to build on some
architectures:

$ make ARCH=mipsel [...] vm/tavolga-regular-mate-ex.recovery.tar
** ARCH: mipsel
10:15:06 cleaning up
10:15:06 initializing BUILDDIR: build/
10:15:06 preparing distro config: build/distcfg.mk
make[1]: *** No rule to make target 'use/systemd-coredump', needed by 'profile/.extra'.  Stop.
[nightly-mipsel@loongson5 mkimage-profiles]$ echo $?
0

Use `make -k' to get the old behaviour.
2019-09-23 19:41:46 +03:00
Gleb Fotengauer-Malinovskiy
15845d51e5 Stop treating all ppc* architectures as ppc 2019-08-19 23:30:38 +03:00
Michael Shigorin
3cb4d9ae6a introduce QUIET variable
This one reduces the amount of output that's only
interesting when one is actually watching the console
during builds (at least the early stage) -- these tend
to look boilerplate and be useless when inspecting the
output of a large batch build like [[regular]] one.
2015-04-02 20:48:42 +03:00
Michael Shigorin
e0004a2621 added docs-publish toplevel goal
This one is long overdue as I keep forgetting to update
the published copy of generated documentation all the time.

Note that you must pass DOCS_PUBLISH (as a local directory
or host:dir suitable for rsync/ssh) via make arguments,
environment or ~/.mkimage/profiles.mk file.
2014-06-24 15:29:10 +04:00
Michael Shigorin
84ad4092dc Makefile: fixed an interbug
This inobvious buglet has been spotted shortly after
1.1.0 refactoring was roughly over; the problem is
that armh-specific targets would get ignored without
explicit ARCH=armh.

It's commit 768df7e9e9
which streamlined introspection within main.mk
and a bug in Makefile which left ARCH empty
even upon having autodetected it for ARCHES.

The current version is more straightforward as a bonus.
2013-08-05 11:21:35 +00:00
Michael Shigorin
969d1eb6b2 Makefile: don't try to report on distclean
...and on other direct non-build actions like clean or help.
How could this stay overlooked for so long?
2013-06-18 00:36:55 +04:00
Michael Shigorin
e179176b28 initial armh support
Somewhat kludgy unfortunately and might need even more tweaking,
I have only armv7l board handy at the moment to verify that
the transformation is going to work.

QEMU is bailing out here and now ("Exec format error").

Example sources.list.sisyphus.armh of the season:

  rpm http://ftp.altlinux.ru/pub/people/asdus/sisyphus armh classic
  rpm http://ftp.altlinux.ru/pub/people/asdus/sisyphus noarch classic
2012-11-19 23:26:51 +02:00
Michael Shigorin
4e0cd6bdf6 asciidoc: moved support files into doc/
Docs should live happily together, after all,
and toplevel should be more or less uncluttered :)

Adjusted/rewrote as appropriate as well.
2012-11-05 17:20:12 +04:00
Michael Shigorin
a680ea2862 Makefile: fix default target to provide help again
`help' used to be the default target described at the very top
of the toplevel makefile but that got broken with g2f307ff;
spotted while discussing m-p with enp@.
2012-07-28 13:26:08 +04:00
Michael Shigorin
f3e923ad61 Makefile: drop extra >&2
say() redirects to stderr already.
2012-07-17 20:43:06 +03:00
Michael Shigorin
1ee997e832 initial PowerPC support
As it happens, adding another architecture required almost no changes;
native 32-bit ppc build took only ARCH and a repo, qemu-ppc one still
has problems (/.host/entry hangs while unpacking setup for fakedata).

Proof of concept on a QS22:

  $ make ve/bare.tar.gz
  ** ARCH: ppc
  /bin/sh: rpmvercmp: command not found
  21:41:01 cleaning up
  21:41:03 initializing BUILDDIR: build/
  21:41:03 preparing distro config
  21:41:05 starting image build (coffee time)
  21:42:48 done (1:42)
  ** image: $TMP/out/bare-20120716-ppc.tar.gz [21M]
2012-07-16 21:20:12 +03:00
Michael Shigorin
3c26cc869d initial native ARM support
The only thing to be fixed was setarch(8) symlinks assumption
that is correct for x86 but not for ARM.

There's also some hasher(7) setup to be done:

  mkdir -p ~/.hasher
  echo >> ~/.hasher/config <<-EOF
  def_target=arm
  #cache_dir=$HOME/tmp	# depends on RAM/storage configuration
  EOF

...and of course apt(8) should be properly set up too.

An example PoC build on a CM-A510 board (tmpfs):

  $ make BRANDING=altlinux-centaurus ve/bare.tar.gz
  ** ARCH: arm
  18:10:45 initializing BUILDDIR: build/
  18:10:45 preparing distro config: build/distcfg.mk
  18:10:46 starting image build: tail -f build/build.log
  18:14:49 done (4:02)
  ** image: $TMP/out/bare-20120706-arm.tar.gz [23M]
2012-07-09 21:32:54 +03:00
Michael Shigorin
698c5e314a Makefile: drop noise when no config is found
~/.mkimage/profiles.mk is useful but not requisite by any margin;
no need to make noise trying to make it either.
2012-07-09 21:31:37 +03:00
Michael Shigorin
8a04d9b656 initial specific VM formats support
Raw disk images are convenient and universal
but there are custom formats like Qemu's qcow2
providing additional features, e.g. copy-on-write
or space savings.  All of this ultimately belongs
to mkimage but in the mean time has been implemented
here as well.
2012-06-25 19:29:38 +03:00
Michael Shigorin
d190e6ef1c Makefile: include ~/.mkimage/profile.mk as well
It appears that while splitting off main.mk we've lost
the ability to pass e.g. ARCHES via custom configuration;
thanks dkr@ for spotting this.
2012-05-21 21:04:00 +03:00
Michael Shigorin
d1922af0dd initial frontend support 2012-05-14 20:48:21 +03:00
Michael Shigorin
454e7162f3 no build means *no* build (and less reports), really
It's hard to tell a successful build from a failed one
if downstream hides the exit code; it's useless to continue
a `for' loop if a pipe shoves that to a subshell; well it seems
that a bashism is worth a thousand quirks with extra fds here.
Minor regexp enhancements are also due.

reports.mk made a bit more resilient/prudent either.
2012-05-06 19:17:10 +03:00
Michael Shigorin
57d31b9c94 initial `make check'
Thanks glebfm@ yet again :)
2012-04-24 11:11:04 +03:00
Michael Shigorin
7221c53ccf Makefile: no build means no reports
Trying to extract reports for a failed build is a bad idea.
2012-04-23 23:28:32 +03:00
Michael Shigorin
665c70a444 use PATH instead of hardwired pathlets
bin/ prefix tried to become a permatemp(tm).  No way.
2012-04-07 15:45:40 +03:00
Michael Shigorin
788cad885e initial target tracing support and reporting
The purpose is being able to examine particular target interdependency
graph for a given image having been configured to avoid convoluted
dependencies (loops in particular).

The implementation is based on SHELL hook hint by John Graham-Cumming:
http://cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
2012-03-19 19:23:38 +02:00
Michael Shigorin
9304c12c58 fix toplevel arch/distro loops
There was a somewhat subtle Makefile->main.mk rename leftover
lurking in "everything" target: the default Makefile got used,
not the supposed main.mk -- which resulted in an attempt to
get way too much job done (the number of builds per target
became $ARCH squared, not just $ARCH).

Huge thanks to led@ for being an inspiring pedantic!
2012-01-17 00:32:54 +04:00
Michael Shigorin
df0861ad02 Makefile: dummy commit
The point is to give Colin S. Miller the credit for
a hack to get the current goal's word-in-a-list position:
http://lists.gnu.org/archive/html/help-gnu-utils/2010-05/msg00004.html
2012-01-11 12:23:12 +02:00
Michael Shigorin
2f307ffffb main.mk introduced, lib/*.mk partially rewritten
The former toplevel Makefile is now toplevel main.mk;
this change allows for multi-target, multi-arch processing
in the current toplevel Makefile.

As the "build" symlink semantics change quite considerably
when one is doing bulk builds (several pruned builddirs might
be useful for comparison), BUILDDIR is now much more likely
to be recreated: the cases when it will persist are when it's
either a single-image build or when the prefix hasn't changed.

There are some more or less subtle bugfixes and enhancements
all over the map as well.

Done within 20111230..20120102 timeframe, actually...
2012-01-02 21:01:09 +02:00
Michael Shigorin
3d982dabba conf/live.mk: minor refactoring
distro/live-builder target used to employ a few duplicated
packages that might make it to a list but as the list would
have only a single user so far these were moved to a target-
specific variable (hm, weird but "private" modifier broke).
2011-12-02 17:45:41 +02:00
Michael Shigorin
7e78670e4b added support for cpio and xz
Actually this is the proper rewrite that was looming ever since
tgz support was introduced: there are multiple archive formats
supported by mkimage, and there are multiple compression methods
available as well.

So the bullet got bitten yet again along with the "goal parser"
which should be more straightforward by now.

Thanks dkr@ and mithraen@ for the inspiration of this evening.
2011-11-24 22:19:32 +02:00
Michael Shigorin
041d57542a Makefile: get help back up
Partially reverts "Makefile: presume a distro by default" commit:
plain `make' should better help the user to decide the target
rather than rush to build them all upon her.
2011-11-24 22:09:15 +02:00
Michael Shigorin
10b9e293b0 Makefile: presume a distro by default
When ve/ support was introduced, a simple "make icewm.iso"
had to turn into the more elaborate "make distro/icewm.iso".
This latter one involves several keystrokes more, which is
not even (environ)mentally friendly.

This was supposed to get fixed somewhere down the road with
a fallback but the elegance of IMAGE_* setup waterfall barred
me from tweaking IMAGE_TARGET at once (and the downstream fixup
would imply re-tweaking the consequent variables as well which
is blatantly anti-mkimage-profilic being a brute fork).

OTOH testing for a "directory" part of the goal is going to
either deadlock on IMAGE_CLASS or duplicate its assignment.

So now when I've had enough typing an extra "distro/",
I'm going to just bite the bullet and tweak IMAGE_TARGET
with a test duplicating IMAGE_CLASS assignment indeed
(testing for e.g. "/" results in a different test,
which would be worse yet).

Please suggest a more elegant solution if you invent one!
2011-11-21 14:25:06 +02:00
Michael Shigorin
cc8982dd7e tweaked variable logging
Preferences might be somewhat interesting too: while the official
ones shouldn't influence the build result at all, there's no whitelist
so all kinds of weirdness can be stuffed into local config in principle.
That should be diagnosable at least.
2011-11-07 00:01:36 +02:00
Michael Shigorin
30b1aa9be6 toplevel build report now timestamped
Thanks torabora@ for yet again seemingly obvious feature request
which strangely managed to evade implementation before.

On an afterthought, mass builds would suggest too much coffee
instead of a progress indicator -- so implemented the latter.

NB: the actual downstream-make-calling rule would expand the "naive"
$(shell date) too early: the rule is evaluated before starting its
execution, and as it's the time consuming one the shell evaluation
was in need, not make's.  The result is less generally available
(needs to be double quoted and won't work inside e.g. awk programs)
but way more precise.
2011-11-07 00:01:36 +02:00
Michael Shigorin
e8306860f1 introduced conf.d/ for distro, ve config snippets
This was asked for by Leo-sp50 and torabora, and seems quite reasonable:
let's provide means to keep at least some distribution configurations
a bit apart, so that these can be considered more standalone in terms
of hard warranted functionality but at the same time enjoying the common
infrastructure.

Considering lib/distro.mk: it's now experimentally pulled apart so that
parallel development of different distro families can go on without
major merge hassles.  *Please* don't abuse with massive copy-paste.

And before you ask: this might get extended to allow for "private"
out-of-tree configurations being included since apparently there
are goals with no meaning outside of some very particular context...
but otherwise I'd like to encourage getting reusable bits in-tree.
2011-11-04 16:54:41 +02:00
Michael Shigorin
d5a5941f96 official {distro,ve}/* support
This is quite a large-scale change since mkimage-profiles got used to
baking distributions over the last year, and virtual environments are
quite different, so e.g. image.in/Makefile had to be split in two with
the main part of it moved into features.in/iso/lib/.

Short overview:

- features.in/Makefile: lib/ support
  (supporting VE images requires dynamic modifications
  to image.in/Makefile before starting the build;
  the most natural way to achieve that seems to use
  features mechanism along with makefile include dir)

- packaging format related part moved into features.in/pack
  (should be better prepared for diversity either)
- features.in/iso renamed to features.in/build-distro
- features.in/ve  renamed to features.in/build-ve
  + NB: these could not be merged as e.g. features.in/build
    due to completely different script hooks

- lib/image.mk renamed to lib/build.mk
- image, config, log postprocessing moved downstream
- added a sort of a topping in the form of lib/sugar.mk
- assorted style fixups (like ifeq usage)

- clean.mk: reliability fix (the problem was observed by Oleg Ivanov
  and me too but finally it did get the attention quantum)

- reviewed, updated and extended docs
  + QUICKSTART: should be[come] a step-by-step guide
    (thanks Leo-sp50 for prodiving feedback)
2011-11-04 16:54:41 +02:00
Michael Shigorin
3373a7bc89 Makefile: make everything
$(IMAGES) in prerequisites definitely won't work,
so let's do it straightforward.
2011-11-04 16:15:30 +02:00
Michael Shigorin
7f555ed7a1 ensure that image output directory does exist
It turned out that ~/out masked the broken execution path
when it's absent (which was handled incompletely).  Sigh.
2011-11-04 16:15:30 +02:00
Michael Shigorin
5f88152223 .base rehashed, DISK_LISTS renamed, etc
In particular:
- .base is now generated from pieces (see image.in/Makefile)
- s/DISTROS/IMAGES/g; s/CONFIGS/DISTROS/g (for clarity)
- s/DISK_LISTS/MAIN_LISTS/g ("disk" was early m-p-d legacy)
- introduced BASE_PACKAGES to complement BASE_LISTS
- minor tweaks to Makefile (ARCH and DATE moved elsewhere)
- libdistro.mk: dropped overlooked IMAGE_INIT_LIST copy
- clean.mk: silly cleanup
2011-11-04 16:15:30 +02:00
Michael Shigorin
b69a8a63b7 README update
reword 'em, structurize 'em, facelift 'em too
2011-11-04 16:15:30 +02:00
Michael Shigorin
c2f70e5c10 kernel and BUILDDIR fixes
- image.in/functions.mk: rework kpackage()
  + it takes two arguments explicitly now: this adds some noise
    for "generic" invocations but is rather less messy with recently
    introduced STAGE1_KFLAVOUR (which in its turn is rather cleaner
    than messing with KFLAVOURS, especially since soemthing changed
    in presumably apt and we can't rely on kernel packages being
    installed in the order formed).
- BUILDDIR/DEBUG related fixes
  + Makefile: BUILDDIR initialization moved to distro.mk
- build.log += git info
2011-11-04 16:15:29 +02:00
Michael Shigorin
3f012958dc 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-11-04 16:15:29 +02:00
Michael Shigorin
d93989a3ff initial logging subsystem
Now we don't dump all the gory details onto thee
but rather log them handsomely and present only
the most important details by default; use DEBUG=1
and/or BUILDLOG=/path/to/file to tweak.

Also introduced IMAGEDIR and IMAGENAME.

The rest:
- ovz-smp is no more
- base-l10n pkglist (suggested by Alexander Kuprin)
- clean.mk:
  + fixed an oversight: the test result erroneously applied
    only to the first command of several ones that should be
    run iff build/ is a symlink
  + drop implicit rules (it's no C code)
- Makefile: more reasonable iso names
- image.in/Makefile: .disk/date too
2011-11-04 16:15:29 +02:00
Michael Shigorin
ace5cb0ff6 assorted fixups
- more thorough build stages inline doc
- quieter BUILDDIR instantiation
- branding-altlinux-sisyphus by default
- prettify installer selection somewhat
- mkimage #24669 fixed upstream
- sub.in/stage1/modules: +drm (as in m-p-d, for KMS)
- tags2lists: generalize a bit
2011-11-04 16:15:29 +02:00
Michael Shigorin
d77e1d8dc8 drop autoconf, a few vars in .mk suffice
A major change in approach largely thanks to discussions
with Alexey Cheusov but also well aligned with my own findings:
autoconf doesn't let the variables to form an inheritance.

And data flow described at http://www.altlinux.org/WhiteLabel
(which in its turn was born thanks to Gavin Henrick of Diva Telecom
and to Alexander Bokovoy of SaM-Solutions) is really dependent on
the existence of such an inheritance.

Also:
- distro.mk += try()
- "hide" special targets
- fixed wrt distro/.{base,init,metaconf}, thx gns@
- README updates
  + added metaconf.mk
  + clarifications
- updated pci.ids location for hdt
2011-11-04 16:15:29 +02:00
Michael Shigorin
a9e161b40d gfxboot brought to reasonable shape
Also included:
- reworked syslinux feature inclusion
- syslinux: s/textprompt/prompt/
- README++
2011-11-03 20:41:49 +02:00
Michael Shigorin
c8b578dd9a features' day
- get rid of $dest
- work on features.in/syslinux
- README++
2011-11-03 20:39:01 +02:00
Michael Shigorin
9a8f8ef7cd distro.mk: functionalization
- set(), add(), log()
  + special thanks to rider@ for log format feedback
- simple debug facility
- builds, installs and runs... again
2011-11-03 20:39:00 +02:00
Michael Shigorin
c91a2a0994 syslinux and features
- syslinux: menu.c32 works
- features: initial draft
  + memtest
- mv pkg/ pkg.in/
  + server-base: include openssh-blacklist by default
- mv isodata/ copy/
- README: changed to utf8, added an URL
2011-11-03 20:38:35 +02:00
Michael Shigorin
2cc81b7e75 r/o profile build
Building m-p-d stuff in-tree was plagued by accidental
generated file commits, and it wasn't nice at all anyways.
2011-11-03 20:38:35 +02:00
Michael Shigorin
d91a3564ac working installer iso image
- s/stage2/install2/g
- added pkg/lists
- initial README (ru_RU.KOI8-R)
- mkimage topdir is in image.in/, really (off-tree build)
  + initial bin/mktmpdir
  + BUILDDIR (works)
- s/cd/iso/
- drop --with-distro (considered harmful)
2011-11-03 20:38:34 +02:00
Michael Shigorin
8dc5159e9b it forks!
Initial profile lacking any real stuff but presenting the idea;
autoconf-based like m-p-d.
2011-11-03 20:38:06 +02:00