Commit Graph

12 Commits

Author SHA1 Message Date
Michael Shigorin
f147927522 main.mk: bail out if no image type was specified
e.g., `make distro/icewm' instead of `make distro/icewm.iso'
would be "successful" as there's a corresponding target indeed
but the "success" would just mean building the configuration
without running the actual build.

Thanks cas@ for hitting this issue and reporting it.

PS: note that the initial flagless implementation turned out
    to produce false positives for e.g. `make distclean'.
2015-04-09 21:18:40 +03:00
Michael Shigorin
768df7e9e9 main.mk: target refactoring
The issue with the original hasty code that stuck around
was that it bluntly ignored any ifdef/ifeq constructs due to
an obvious reason of being essentially a grep, not a makefile
interpreter.

It's now fixed so that e.g. arch-specific targets won't pop up
for no good reason.

Thanks ldv@ for discussion and a reminder about the dump mode
(make -p).
2013-06-20 13:42:20 +04:00
Michael Shigorin
ccc6486417 main.mk, build.mk: tweaks for error reporting
I've finally moved away from LC_MESSAGES=C on my main
development system half a year ago and finally spotted
that a grep for "Stop\.$" stopped to yield anything now.
2013-06-17 19:29:12 +04:00
Michael Shigorin
e46c259a90 ensure that IMAGEDIR exists (thus globbable)
It appears that manually specified IMAGEDIR, e.g. by adding

  IMAGEDIR = ~/out/$(shell date +%Y%m%d)

to ~/.mkimage/profiles.mk, might be problematic due to
missing globbing.  Let's make sure the paths are globbed
and directories are created -- since make's wildcard()
returns an empty string when there's nothing there [yet].
2013-02-04 22:18:27 +04:00
Michael Shigorin
40adf4ccf3 main.mk: escalate the comment to a warning
The problem manifests itself when the naive parser ignores
any conditions that might have been set in the makefiles
included with subsequent attempt to run a target which has
its actual rule defined within e.g. "ifdef DEBUG" clause
(as is the case for conf.d/test.mk); that will fail with
no proper diagnostics currently.

Maybe this would be of some use (but then again maybe not):
http://stackoverflow.com/questions/3063507/list-goals-targets-in-gnu-make
2012-12-03 17:18:27 +02:00
Michael Shigorin
6f5be91827 make-3.82 adaptation
The issue actually hit image.in/Makefile: "metadata" target
in features.in/metadata/lib/50-metadata.mk wasn't reached
even if features.in/build-distro/lib/90-build-distro.mk
would ACK that the "whatever" actions included "metadata";
thus Metadata/pkg-groups.tar wasn't created and the installer
silently failed to install the .base system.

Let's armour the rest of the cases where the order of inclusion
might be important as well.
2012-10-10 16:18:35 +03:00
Michael Shigorin
cb764516eb build-vm: standalone build is a must, too
The problem was spotted by Alexander Bandura:
bin/tar2vm wasn't present in the generated profile.

I considered extending features.in/Makefile to include
bin/ alongside lib/ but that would make the helper's location
unpredictable (unless BUILDDIR is specified explicitly) so
restricting sudoers would be harder; worse yet, the copied file
would come with write access for the user building an image.

The implications in restricted case are complex enough anyways
so the recommended implementation would only include a fixed
readonly location like /usr/share/mkimage-profiles/bin/tar2vm
as laid out in doc/vm.txt, and that means it's in the metaprofile
not a generated profile.
2012-07-18 16:06:15 +03:00
Michael Shigorin
75f7c62bd1 initial build-vm feature
Yes, mkimage-profiles is now able to build VM disk images.
So far the support is pretty basic:

- a single hard drive image with a single partition/FS
- only stock root password is configurable
- LILO is hardwired as a bootloader

The resulting images tend to boot under qemu/kvm though.

Please see doc/vm.txt for the warning regarding additional
privileges and setup required.  This was started back in
February but I still hoped to avoid sudo/privileged helper
(and libguestfs is almost as undistributable as can be)...

Thanks:

- http://blog.quinthar.com/2008/07/building-1gb-bootable-qemu-image-using.html
- Alexey Morarash who reworked that as https://github.com/tuxofil/linsygen
- led@, legion@, vitty@, aen@ for providing advice and inspiration
2012-06-18 21:56:46 +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
5dba27d011 main.mk: factored out help targets
These are better off in their own lib/help.mk
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
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