Commit Graph

106 Commits

Author SHA1 Message Date
Anton Midyukov
ecbed4b23a image.in/functions.mk: protect the code from spontaneous execution
The new make-4.4 does not reset '$(1)', '$(2)', etc. when do recursively
expanding. So the functions fire spontaneously. The reason for recursive
expanding might be to use $(shell ...).

To protect the code from spontaneous execution, we add a match check
'$(0)' to the function name. The '$(0)' variable must always have the
name of our function at the time of the call. If this is not the case,
then we are out of the $(call ...) context.

From make documentation:

| The syntax of the 'call' function is:
|
|      $(call VARIABLE,PARAM,PARAM,...)
|
| When 'make' expands this function, it assigns each PARAM to temporary
| variables '$(1)', '$(2)', etc.  The variable '$(0)' will contain
| VARIABLE.

Fix ALT bug 44561

See also:
60afcd997a
2022-12-30 22:31:39 +07:00
Anton Midyukov
41b065336f check conditions of make for equality of variables with an empty value
check conditions of  make  for equality of variables with an empty value
instead of check definition.
A defined but empty variable under all these conditions results errors.
2022-12-30 19:39:43 +07:00
Anton Midyukov
61b1832a4f image.in/functions.mk: add multiple lists support in X-Alterator-PackageList
This will allow to add multiple lists to the X-Alterator-PackageList through
the character ";".
See also: https://bugzilla.altlinux.org/43186
2022-07-12 12:39:43 +07:00
Anton Midyukov
44d6d3e037 Revert "image.in/Makefile: fix save-profile (exclude .work)"
This reverts commit 4682e8d18e.
2022-03-02 11:04:45 +07:00
Anton Midyukov
f722e494fb add .work to .gitignore for profile and subprofiles 2022-03-02 11:04:45 +07:00
Anton Midyukov
450a6303eb image.in/Makefile: show $(CURDIR) also, if debug mode 2022-02-20 22:17:34 +07:00
Anton Midyukov
87baeb3d4b image.in: remove /.empty from rootfs instead /.gitignore
.gitignore was replaced to .empty
See also commit 44c60e5ca7
2022-02-02 16:36:07 +07:00
Anton Midyukov
44c60e5ca7 rename empty .gitignore to .empty
When building the rpm package .gitignore is deleted. These files
are necessary in order for saved profiles when building the image
from git repository and from installed rpm package have been
identical.
2022-01-19 20:28:51 +07:00
Anton Midyukov
317a19f8af image.in, sub.in: remove .gitignore with --force 2021-12-30 23:31:15 +07:00
Anton Midyukov
c8322e069d image.in, sub.in: fix cleanup .gitignore from stage1, stage2 2021-12-10 20:50:33 +07:00
Anton Midyukov
4682e8d18e image.in/Makefile: fix save-profile (exclude .work)
When the save-profile is executed, the .work directory already exists.
2021-08-15 19:26:42 +07:00
Anton Midyukov
9fba17972c Makefile, params.txt: add new parametr NO_SYMLINK
NO_SYMLINK disables the creation of symlinks for the builded image.
2021-06-06 19:55:23 +07:00
Anton Midyukov
366f6a6ba5 build-vm, image.in: Fix parameter VM_SAVE_TAR -> VM_SAVE_TARBALL
The code is given in accordance with the documentation
See-also: commit 2987fa8f61
2021-05-20 20:41:35 +07:00
Anton Midyukov
2987fa8f61 build-vm, image.in: add VM_SAVE_TARBALL parameter
The parameter is used to save the intermediate tarball used to
build the virtual machine image.
2021-05-01 01:39:54 +07:00
Anton Midyukov
b085be40de image.in/Makefile: Disable sort subprofiles
Sorting profiles was a mistake. stage1 must run ahead of the stage2
subprofiles, as this is the stage where the squash compression
settings are configured.
See-also:
commit da65dc2fd9
https://lists.altlinux.org/pipermail/devel-distro/2021-March/002319.html
2021-04-03 22:10:01 +07:00
Michael Shigorin
f1cc7f0c31 image.in: add include-once check
This is following mkimage's approach;
better late than never.
2020-09-26 23:08:21 +07:00
Michael Shigorin
9e2e5c0c1f image.in: no more functions for (dist)clean
`make clean' and `make distclean' use none of these,
no reason to spend extra forks, i/o and time.
2020-09-26 23:08:21 +07:00
Gleb Fotengauer-Malinovskiy
15845d51e5 Stop treating all ppc* architectures as ppc 2019-08-19 23:30:38 +03:00
Gleb Fotengauer-Malinovskiy
2f0bffda8b image.in: add INSTALL_LANGS variable to setup rpm _install_langs
This option allows to make smallest images even smaller by reducing
amount of installed locales.
2018-12-24 20:06:57 +03:00
Mikhail Efremov
2af6d0be75 image: Add DISTRO_VERSION variable support
Use it in the image filename, so we'll know what version of a distro
it is.
2018-07-16 20:52:16 +03:00
Michael Shigorin
d5f71b3716 image.in, build-*: generalize SUBDIRS
This is a fix to previous failures of
ve/vm + use/repo/main build attempts
(in fact, any non-distro/ targets).

SUBDIRS were just optimized away...
2018-02-15 17:03:19 +03:00
Michael Shigorin
0f2411ec34 image.in, build-vm: handle qemu-img absence properly
This isn't a warning cause, this is a error cause!
2017-12-04 19:41:51 +03:00
Michael Shigorin
319fdfc5ee image.in, main.mk: align debug targets
Weird but the last round of image builds on e2k started complaining:

  Makefile:95: *** target file `debug' has both : and :: entries.  Stop.

Looks like these should have been fixed indeed.
But why didn't this surface before then?
2017-08-07 21:51:17 +03:00
Michael Shigorin
cbbc23edfb image.in: added groups2lists()
NB: PKGDIR might be overridden now so that these functions
can be used within both metaprofile and generated profile
contexts; this isn't clean but I couldn't come up with
anything better so far.
2016-06-27 13:50:07 +03:00
Michael Shigorin
caf25f0279 image.in: pkg profile handling functions
These are alike to lists/groups ones.
2016-04-01 14:28:04 +03:00
Michael Shigorin
a40a07253e image.in: cosmetic fix
Bring the stage/step prefix into line for those greppin' through.
2016-02-08 22:52:05 +03:00
Michael Shigorin
5427f3afdc image.in, stage2: reworked TCB fixup hook
The issue at hand is that:

/etc/tcb/USER/shadow gets USER:auth ownership (OK);
/etc/tcb/USER/shadow- backup file is root:root (broken);
/etc/tcb/USER/shadow.lock file is also root:root (broken).

This is observed for all pseudousers created by package installation
process within working chroots as well as for users created by deflogin
feature; the problem is that e.g. echo USER:PASS | chpasswd will break.

Looks like the cuplrit might be fakeroot/faked.
2015-11-16 20:24:25 +03:00
Michael Shigorin
c83b1f105b image.in, branding: comment fixups
(rather cosmetic changes)
2015-08-07 16:55:34 +03:00
Denis Smirnov
8df9c40d34 Fix /etc/tcb/*/shadow* permissions
Looks like there's some issue with fakeroot as pseudousers
created with useradd during package installation have their
/etc/tcb/*/shadow files with proper permissions ($user:auth)
but shadow- and shadow.lock belong to root:root which makes
passwd(1) fail.
2015-02-02 14:01:42 +03:00
Michael Shigorin
b5ff2b24b4 initial l10n feature
Aimed at live images at first but should cover installers as well.

This has been brewing for quite some time and while the proper
implementation is considerably more complex (and hard to do)
looks like there's demand for the particular important use case,
namely LiveCDs for Russian users, so this code has been shared
with a few people before merge.
2014-11-14 15:07:09 +03:00
Michael Shigorin
6f452182fd fix kpackages() API
This function's got its argument order chosen for "aesthetical"
reason of $(2) following $(1) in the macros but the logical order
is exactly the opposite: we care for kernel flavour much more than
for module set (which is dependent upon it).

So while silent dropout of kernel-image if KFLAVOURS is set
but KMODULES is empty could be fixed by testing for $(2) only,
it looks like a good time to fix this discrepancy altogether.
2014-09-19 20:53:25 +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
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
ec8bcac5ff image.in: extended .gitignore a bit
These generated directories aren't part of a profile itself.
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
47c4dea456 image.in: bump optimal mkimage version
0.2.6 has fixes for xorriso and support for refind.
2013-01-21 13:49:21 +02:00
Denis Smirnov
7f805cdf79 Rename all scripts in */image-scripts.d to format \d\d-scriptname 2013-01-06 12:05:32 +04:00
Michael Shigorin
5a61e2d4cc efi: employ mkimage
The initial approach required some quite involved postprocessing
as described in http://www.altlinux.org/UEFI#HOWTO; after having
ironed out the kinks so that initial EFI support could be merged
into mkimage proper we're better off just using it, eh?
2012-12-17 14:40:55 +04:00
Mike Radyuk
85217cd11d added asciidoc support 2012-10-31 21:22:06 +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
83fa2544bc fix root directory permissions
hsh-initroot leaves the chroot's root directory permissions
as 1775 while these should really be 755 at most; let's fix it
(important for both VE and VM images, useful for rescue/livecd
ones as well -- especially those with an installer onboard).
2012-09-03 19:16:50 +03:00
Michael Shigorin
0d859e70fc image.in/Makefile: support image STATUS
Another feature suggested by Michael Radyuk (torabora):
some images are known alpha/beta quality, it's more handy
to just state this at the build time than to rename by hand.
2012-08-06 23:58:26 +04: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
24edc620d8 prep optimization
There was some extra duplication, just clean it up.
2012-07-16 18:24:18 +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
Mikhail Efremov
1a7940c86f Change link to the image format.
$(IMAGE_NAME).$(IMAGE_TYPE) -> $(IMAGE_NAME)-latest-$(ARCH).$(IMAGE_TYPE)
2012-06-21 17:12:27 +04: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
8989fc2771 added plymouth feature
An initial draft of it was done half a year ago but several tricky
thingies had kept the code from showing up as it was rather brittle
and incomplete.

This implementation involves quite a few changes all over the place
but finally works good enough for live and installer images.

Please pay attention to the versions of these packages:
- installer-feature-setup-plymouth (0.3.2-alt1+)
- branding-altlinux-sisyphus (20110706-alt2+ if used)
- plymouth (0.8.3-alt20.git20110406+)

See also:
- http://www.altlinux.org/Branding
- http://www.altlinux.org/Plymouth
2012-06-14 17:15:24 +03:00
Michael Shigorin
c83cc111a6 initial kernel and metadata features
This further refines the modular build by making
metadata being a clearly separated feature rather
than having to rely on runtime tests, and also by
moving the code which cares for kernel bits of base
installation (.base list) in a feature of its own.

There's more to it but let's get the ball rolling first.
2012-05-10 21:18:02 +03:00