Commit Graph

96 Commits

Author SHA1 Message Date
Anton Midyukov
1c777c8ad4 base+rescue: added udpcast and partclone
These two should improve rescue image usability
for system provisioning.
2018-04-23 13:20:54 +03:00
Michael Shigorin
fb750abaa9 profile.mk: update default branding
Should be ALT instead of ALT Linux now following
the update of the branding itself; ALT Linux Team
stays ALT Linux Team of course.
2016-11-29 20:35:57 +03:00
Michael Shigorin
15f0b520f1 build.mk: added AUTOCLEAN variable
This performs distclean upon successful image build.

Suggested-by: Andrey Cherepanov <cas@altlinux.org>
2016-09-12 18:48:48 +03:00
Michael Shigorin
d2fedf6d1e distro.mk: updated default distro prefix
s/ALT Linux/ALT/gc
2016-07-26 17:46:19 +03:00
Michael Shigorin
b214d5c18e vm.mk: fixed thinko regarding lilo arches
A classic brown paper bag bug: this was typed in a hospital
and that commit was a sick one indeed, the condition should
have been the opposite.

Reported-by: Ildar Mulyukov <ildar@altlinux.org>
Closes: #31982
2016-04-15 16:16:57 +03:00
Michael Shigorin
27c912ed0f vm.mk: don't install lilo for non-x86
...as it's x86-specific.
2016-03-15 09:37:00 +03:00
Michael Shigorin
3b3cf4cc93 QUICKSTART, mktmpdir, build.mk: hasher's /proc
Either /etc/hasher-priv/system or /etc/hasher-priv/user.d/$USER
must contain at least "allowed_mountpoints=/proc" for mkimage
to work for mkimage-profiles; thanks Daniil Golovanov for
providing feedback indicating the lack of the corresponding
checks.
2016-01-10 13:08:03 +03:00
Michael Shigorin
21883b057f build.mk: drop an extra space
Spotted when working on http://linuxpiter.ru slides.
2015-11-30 16:49:52 +03:00
Michael Shigorin
5c49535c59 build.mk: get rid of GREP_OPTIONS
It was superfluous in the first place indeed,
and new grep(1) considers the option deprecated.
2015-10-09 16:40:02 +03:00
Michael Shigorin
ac5dbb4bba pkg.in/lists: archdep suffices for pkglists
This is an initial implementation of architecture dependent
contents handling for package lists more or less in the vein
of mkimage-profiles-desktop's one *but* using suffix part to
filter words in or out *not* prefix part to replace it with
a comment marker (thus filtering out lines).

The syntax should be pretty obvious:

  a b@i586 c@x86_64

will get "a b" given ARCH=i586 and "a c" given ARCH=x86_64;
please see doc/archdep.txt for a more elaborate description
and a conversion script.
2015-04-20 23:09:55 +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
ec3d40cc1b help.mk, clean.mk: drop __frontend for tty test
The __frontend variable was introduced to address the needs
of alterator-mkimage module: list the images available in
one column, purge the builddir.

Looks like we should consider other cases with redirected
stdout (cron builds, piped calls, etc) like fundamentally
non-interactive and behave the same.

So commit 3a8af6b55d888d25c1d97561ed2ecf37ff28ad71's
description is wrong now; the current cleanup rules are:

- if CLEAN=0 or DEBUG>1, don't do it;
- if CHECK or REPORT is set, don't do it;
- otherwise if at least one of the following conditions is true:
  + there's more than one target being built in a row;
  + stdout was redirected (cronjob, alterator-mkimage...);
  + metaprofile directory is read-only
  ...then do a distclean.

If that doesn't suit your needs, describe the particular
situation please.

Thanks cas@ for wondering aloud whether greppable output
is unsupported with `make help'.
2015-04-02 20:46:35 +03:00
Michael Shigorin
b2cfbc3f1f boot.mk: factor out boot/% from distro.mk
Yes these bits are related to distro/ prefixed images
still the overgeneralization in distro.mk didn't pay off
but rather hid a bug with the only boot/isolinux in use
having no dependency on use/syslinux (which is required).

Maybe this will get revisited when we have other kinds
of bootable images with other bootloaders (vm/ ones care
for themselves as of today).
2015-03-29 20:41:32 +03:00
Michael Shigorin
c293dd141c lib/functions.mk: tiny but important note
There's a particular problem with lazy evaluation
in case of BOOT_LANG: mkimage uses internal variable,
BOOT_LANG = $(GLOBAL_BOOT_LANG) (note the lack of
immediate assignment there), and if we set up

  export GLOBAL_BOOT_LANG = $(BOOT_LANG)

in the same namespace we end up with recursively
defined pair of variables; a ":=" in either place
would save the day _but_ it's not there in m-p due to
accumulator variables, e.g. USERS, which are defined
and exported by a corresponding feature and then get
populated *after* having been declared for export,
_and_ it's not in mkimage as of 0.2.16 for some reason
that might even be good (I don't know yet).
2014-11-14 15:07:09 +03:00
Michael Shigorin
a3ddce7a81 functions.mk: allow setting to an empty value
set() is a function of two variables but the and()
check for *both* is incorrect as one might need to
override a previously set variable with empty string;
this has manifested itself with a case like this:

  @$(call set,ROOTPW_EMPTY,1)
  # ...
  @$(call set,ROOTPW_EMPTY,)
2014-09-19 21:01:08 +04:00
Michael Shigorin
851b441378 profile.mk: defer RC expansion
Just spotted that .disk/profile.tgz would hold
distcfg.mk with pre-expanded $(HOME) from build
host which is both info leak (user account that
was used to build the particular image) and just
wrong given that the in-image profile archive was
conceived as a means to pass that part of build
environment over instead of tying it to vendor.

Morale: premature optimization is premature.
2014-08-27 22:30:59 +04:00
Michael Shigorin
3f547e2504 documentation: use paths relative to toplevel dir
This change is done to reduce ambiguity in some cases;
the previous intention has been to ease navigation when
staying in a particular directory, now it's been changed
in favour of convenient toplevel `git grep' in fact.

Both variants have their pros and cons, I just find myself
leaning to this one by now hence the commit.  Feel free to
provide constructive criticism :)

Some path-related bitrot has also been fixed while at that.
2014-03-05 21:36:30 +04:00
Michael Shigorin
674f7db26e clean.mk: allow to forbid cleanup explicitly
The behaviour that sort of settled didn't actually follow
the principle of the least surprise when one really wanted
to have BUILDDIR available for inspection; DEBUG=2 would be
effective to achieve that but CLEAN=0 would not.

Thanks led@ for spotting and reporting this.
2013-08-13 22:32:27 +04:00
Michael Shigorin
a18295f223 {lib,conf.d}/{ve,vm}.mk: shift the real targets
lib/*.mk aren't going to be parsed for build targets
in the near future; and the early placement of those
targets was superseded by a dedicated configuration
snippet directory so just move these bits there.
2013-06-19 16:52:02 +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
b337e72ead initial init feature
This one is finally there and should help reduce the
systemd-induced mess in package lists and specifications.
2013-06-17 14:03:54 +04:00
Michael Shigorin
67adab492f initial rootfs subprofile and services feature
This subprofile is akin to THE_* variables family: the configuration
bits and script hooks sitting there influence whatever chroot is
declared to be the user facing one in the end, whether it comes
from vm image or live subprofile.

The services feature ought to be a changeset of its own which would
be based on rootfs and become the base for ve/vm changes but I chose
to just do it atomically; some pre-existing duplicates are pruned now.
2013-06-17 14:03:53 +04:00
Michael Shigorin
5b21100bed README update
These have been proofread somewhat to correspond
to the current state of affairs; a missing one
was added for fonts feature.
2013-06-10 19:43:31 +04:00
Michael Shigorin
7b76c73472 install2: introduced +installer mixin
This one is a part of a larger rewrite to move away from
distro-centric build-up to configuration-centric one with
the particular packaging being of secondary importance
compared to actual functionality.
2013-05-24 17:45:25 +04:00
Michael Shigorin
5fda2afe1f profile.mk: fixed arch test for "bulk repo" case
It happens when there are no separate arch/noarch subrepositories
but everything is dumped into a single directory like in installer
or live-builder environment (at least as of today).
2013-02-19 22:12:51 +04:00
Michael Shigorin
ad264c7033 fixed mp-commit and its use
Now this is ugly: instead of commoditizing the repetitive code
the result ended up working differently by creating several
repositories for the target subdirs instead of the single one
for the generated subprofile as a whole.

This results in .disk/profile.tgz being basically useless
in every image since c4311108ea.
2013-02-11 21:29:15 +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
2d3e5f2b1c kernel: factor the former lib/kernel.mk in
It wasn't spotted when introducing the distinct kernel feature;
will need fixup as we meet packaged ARM/PPC kernels.
2013-02-04 22:18:26 +04:00
Michael Shigorin
bd606e6c60 build.mk: extended error regex yet again
This time it's

  xorriso : FAILURE : -volid: Text too long (33 > 32)

and todo-- as well.
2012-12-31 18:10:12 +04:00
Evgeny Sinelnikov
36b36faf55 lib/log.mk: fix hasher check 2012-12-03 17:19:35 +02: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
6711fd92db lib/profile.mk: slightly improved arch test
ildar@ noted that the test involving whitespace is too
quirky for some quirky enough cases like

  rpm-dir file:/var/cache/apt/archives . x86_64

-- let's introduce word boundaries there.
2012-11-12 00:01:32 +04:00
Mike Radyuk
85217cd11d added asciidoc support 2012-10-31 21:22:06 +02:00
Michael Shigorin
02791834f9 distro/installer, use/live/x11 += use/firmware
This is thanks to the fact that alterator-based install2 needs
alterator-browser-qt which needs X11 which needs working device drivers
-- and at least AMD C60 APU would only yield a nice dotted white screen
without that firmware.

Roughly the same for X11 bearing LiveCD images.
2012-10-27 22:27:22 +03:00
Michael Shigorin
2f357e44d6 clean.mk: skip if REPORT requested either
The problem would manifest itself like this:

..:..:.. cleaning up after build
sed: can't read .../build.log: No such file or directory
2012-09-24 11:07:45 +04:00
Michael Shigorin
e52e21781f actually useful vm/icewm
See http://www.opennet.ru/openforum/vsluhforumID3/86239.html#1
for a query that has led to this one; in particular,
- xdm dropped (won't log in root and there are no users yet);
- network is brought up and configured via DHCP by default;
- apt-get works out-of-box;
- default image size is twice the chroot size.
2012-09-03 19:16:50 +03:00
Michael Shigorin
23175f0020 merged experimental support for opensuse
This isn't ready for general consumption (just as centos one)
but the notion of REPO is floating around along with apt-conf
thoughts, and it might still be useful to someone poking around
conf.d/test.mk.

Request hasher-pkg-init.spec from mike@ or led@ if interested;
the experiments were carried out using openSUSE 11.4 repository
and slightly patched hasher (cpio blacklist for devices).
2012-08-11 23:24:23 +03:00
Michael Shigorin
b21353a00c complex subprofile delimiter changed ("/" -> "@")
That sub/stage2/install2 was somewhat clumsy actually as it looked
like a hierarchical thing while being a substitution thing:
generic stage2 would get put in place renamed as install2.

This could only get worse with hierarchical features which have
already been both requested and considered for quite a time,
and "stage2 at install2" reads much more naturally.
2012-08-11 20:11:17 +03:00
Michael Shigorin
c4311108ea git usage refactoring
There were heaps of "if type -t git" there already;
it wasn't an unintentional mishap but rather a moderate
copy-paste to get the use cases, and now these seem to
have essentially settled.

So time to scrap some dups.

NB: the scripts in the generated profile can't rely on
the contents of the metaprofile (these need to be able
to work in standalone case either), so a bit of crap
still lurks there.
2012-08-10 00:12:46 +03:00
Michael Shigorin
3a8af6b55d lib/clean.mk: post-build cleanup revisited
The prerequisites for a cleanup after a successful build
were somewhat weird at this point; now the rules are:
- if DEBUG level is more than 1 or CHECK is set, don't do it;
- otherwise if at least one of the following conditions is true:
  + there's more than one target being built in a row;
  + the build was run by e.g. alterator-mkimage;
  + metaprofile directory is read only
  ...then do a distclean.

If these are still weird or feel unsuitable for profile hacking,
drop me a note (or a patch).
2012-07-30 19:59:41 +04:00
Michael Shigorin
cb6a71d97f lib/ve.mk: whoops, ve/bare misses /sbin/init
Actually the templates pretending to be usable missed the whole
interactivesystem (sysvinit would get pulled in by services as well).

Fixed somewhat but time and practice will tell.
2012-07-21 19:15:24 +03:00
Michael Shigorin
d31a2555bd non-native ARM support via qemu
mkimage and hasher can make use of qemu to run
non-native binaries while working on the chroots;
thanks kas@, manowar@ and sbolshakov@ for implementing
this functionality as well as providing nice examples
through mkimage-profiles-arm and mkimage-profile-armrootfs.

This required the architecture check to be added since baking
a tarball with "arm" as its specified arch and x86_64 inside
isn't particularly good thing to let slip through; however
the implementation is quite fragile, bugreports and patches
are seriously welcome.

NB: APTCONF evaluation order between lazy make and nimble shell
turned out to be quite a delicate issue in this particular case.
2012-07-16 18:20:55 +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
7683532ea2 lib/kernel.mk: single byte bugfix
Whoops, an overlooked character didn't bring too many
things down but was a BUG indeed :-/
2012-07-06 18:52:46 +03:00
Michael Shigorin
e36792ac90 lib/functions.mk: initial xport()
A few too many downstream makefiles employed the pattern
of "export GLOBAL_VAR := $(VAR)"; macroize that.
2012-07-02 16:14:34 +03:00
Michael Shigorin
3f21b6b01c factor out openssh packages
There's no need to repeat the typical openssh-* triade
all over the place; those who need server and client
are better off pulling in "openssh" pkglist, and those
needing a particular package should specify it.
2012-06-25 19:29:38 +03:00
Michael Shigorin
90be07fbf8 initial conf.d/vm.mk
After we have built a bare virtual machine image successfully
some variations are due, and these are to be described here.
2012-06-25 19:29:38 +03:00
Mikhail Efremov
9bd853e88c Add LIBDIR variable.
Allow to put the log files and reports in a custom directory instead
of IMIGEDIR.
2012-06-21 17:11:02 +04: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
860e20c62d lib/common.mk: avoid using uninitialized variables
It somehow managed to evade me that $(TMP) might be uninitialized;
definitely should be checked before stuffing into sed substitution
command.

NB: this could be done in pure make but my take was less readable.

Thanks shadowsbrother/gmail for hitting and reporting this.
2012-05-26 14:08:19 +03:00