Compare commits

...

98 Commits

Author SHA1 Message Date
Michael Shigorin
edfdeca311 0.6.1-alt1
- ISO9660 metadata support
- initial alien VE image
2012-03-26 23:23:30 +03:00
Michael Shigorin
b6e640bd8d slimmer webkiosk with Russian layout
Thanks someone for review and feedback:
http://www.opennet.ru/openforum/vsluhforumID3/83728.html#136

Better cleanup and i18n controls are due but in the meantime,
let's at least build something actually useful.
2012-03-26 23:17:41 +03:00
Michael Shigorin
0c41e39ec0 initial alien image support
"Alien" rather means "CentOS-based" than "xenophilic" here;
in case you still wonder: http://www.altlinux.org/Hasher/CentOS
2012-03-26 22:40:40 +03:00
Michael Shigorin
ed7bf0db9f initial ISO9660 metadata support
As was noted by Alexey Shabalin in libosinfo context,
current ALT Linux images tend to lack ISO9660 metadata
-- which they did have back in the day of Master 2.4.

Please note that the data collection occurs this way
due to mkimage's config.mk resetting the values to be
empty; this was worked around by using another config
file, $(BUILDDIR)lib/iso.mk, and including it later
but that would require a separate target with per-target
CONFIG variable which isn't elegant at all given the need
to actually build up the metadata set.

So the variables were changed (to be more readable anyways)
and then proxied back to BOOT_*.  This might be cleaned up
some day after the inclusion order is tweaked or mkimage
defaults get set-if-unset-yet (?=).
2012-03-26 22:23:28 +03:00
Michael Shigorin
17bd880e19 ve/generic += openssh suite
openssh-server is in need indeed on almost any server instance;
thanks Aleksey Cheusov for reporting the shortage.

This might be amended in the future but is reasonable right now.
2012-03-25 21:46:45 +03:00
Michael Shigorin
80090d1f1a minor tweaks (no functional changes)
Mostly multiline compactions, but also use/install2/net
got factored out from distro/server-ovz for future reuse.
2012-03-21 15:55:24 +02:00
Michael Shigorin
7ffd600076 gear-store-tags 2012-03-19 19:26:10 +02:00
Michael Shigorin
1b7ce25f10 0.6.0-alt1
- reports (targets graph)
2012-03-19 19:23:38 +02: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
79bb3f8d6e plant SHELL beacons into all config-forming rules
As noted in doc/assumptions.txt, the SHELL based target tracing
only works for rules with recipes, even empty but present ones.

The simplest thing to do is hooking "; @:" onto the rule's tail
(one-liner with a non-printing shell builting "true" command).
2012-03-19 19:23:38 +02: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
a52b7476a4 initial "+shortcut" support and refactoring
It looks like the intermediate targets aren't all equal:
some define a finished feature while some create a common
lower level piece of configuration.

Let's do shortcuts for the former so that a distro line can be
more terse and descriptive; help targets in features.in/ tweaked
accordingly.
2012-03-19 13:14:07 +02:00
Michael Shigorin
deb63e0d63 gear-store-tags 2012-03-12 22:15:54 +02:00
Michael Shigorin
3f85ed2b19 0.5.7-alt1
- distro tweaks
2012-03-12 22:15:06 +02:00
Michael Shigorin
a07959e2f5 hide intermediate distro targets
There are pseudo-distro targets that are useful to combine
the needed bits and pieces for a few more different end-user
images but that are useless themselves (e.g. desktop-base
wouldn't even start X session before someone would have
installed a window manager).

Let's just hide these under the hood so that `make help',
`make everything' and potential frontends don't bother.
2012-03-12 22:07:18 +02:00
Michael Shigorin
af6b9940de initial TDE distros
A minimal live, tiny desktop system and a test LTSP installer;
all of these work.
2012-03-12 11:52:44 +02:00
Michael Shigorin
71f44090c5 initial TDE (KDE3 descendant) support
The package list taken from mkimage-profiles-desktop
and trimmed down due to current TDE packaging difference
as well as extras being defined elsewhere.
2012-03-12 11:52:44 +02:00
Michael Shigorin
872afb3c0c refactored base part from distro/ltsp-icewm
ltsp-icewm used to be the only ALTSP (testbed) distro over here
but now its terminal server part works good enough to seperate
it from the UI part.

A few additions to facilitate testing, tweaking and benchmarking:
iftop, openssh-server, mplayer
2012-03-12 11:49:48 +02:00
Michael Shigorin
191388d7cf tweak razor-qt extras list
ptbatterysystemtray is a bit annoying out-of-box,
should run only if battery found and should not
throw up a dialog upfront for no real reason.
2012-03-07 16:00:40 +02:00
Michael Shigorin
70f2a70fca conf.d/live.mk: autologin rehash
If we have a supported display manager, we should rather autoconfigure
that one for autologin instead of configuring autologin package:
those tend to play better with "modern" session management in terms
of runlevel control etc.

xdm doesn't really differ though.

TODO: maybe skip autologin *package* configuration if any dm found
in the live image-script?
2012-03-07 15:57:07 +02:00
Michael Shigorin
dc9b706619 features.in/live: implemented lightdm autologin
The main part is done as per
https://wiki.archlinux.org/index.php/LightDM#Enable_Autologin;
there's an issue that the lightdm developer insist that autologin
user belongs to "nopasswdlogin" group though.
2012-03-07 15:57:07 +02:00
Michael Shigorin
50c27a1782 ltsp += alsa-utils
alsamixer *is* useful :)
2012-03-07 14:21:57 +02:00
Michael Shigorin
3aaa45dd23 conf.d/live.mk: add firmware to all X11 livecds
GPU firmware might have been missing otherwise...
2012-03-05 18:16:46 +02:00
Michael Shigorin
a0af945d7f essentially added firefox to live-icewm
(via a specially crafted pkglist name)
2012-03-05 18:16:46 +02:00
Michael Shigorin
a681b4bd98 features.in/README: un-document tagged scripts
These are gone for now, this fix should have been done before.
2012-02-21 11:54:35 +02:00
Michael Shigorin
b7a395c012 gear-store-tags 2012-02-20 22:44:16 +02:00
Michael Shigorin
a8e70fd4e6 0.5.6-alt1
- minor fixups
2012-02-20 22:43:10 +02:00
Michael Shigorin
cff036c212 doc/assumptions.txt: specify minimal gmake version
From what I've read so far, most of the code should run on 3.80;
there seem to have been some bits that are dependent on 3.81
features, but there is not a bit that depends on 3.82+ features
so far.
2012-02-18 09:48:38 +02:00
Michael Shigorin
482e7bc9f3 features.in/x11: add lightdm support
It's preferred for Razor-qt's logout app to be able to turn
the system off or reboot it; xdm lacks consolekit support.

Thanks Alexander Sokoloff for the hint.
2012-02-17 12:11:11 +02:00
Michael Shigorin
e1ef65b410 live-razorqt: adapted for razor-qt 0.4.1 packages
The main package has been renamed from razorqt to razor-qt
to fit upstream brand better.
2012-02-16 13:42:42 +02:00
Michael Shigorin
a62cdfa69e 50-etcnet-dhcp: moved from dev to live feature
If there's an ethernet interface, a DHCP client, and these
can result in connectivity out-of-box, then it's rather
a feature for almost any LiveCD.

Thus the configuration script is moved from dev feature
to live one with the addition of dhcpcd/dhclient test.
This is asking for some more neat solution though...
2012-02-16 13:42:42 +02:00
Michael Shigorin
045ae269b2 updated ltsp pkglist
alterator-ltsconf needs further testing,
and aplay is handy for remote audio tests.
2012-02-14 20:25:12 +02:00
Michael Shigorin
345319805d 10bootloader: replace both grub and lilo
As it happens, I've stumbled upon a successfully built image
with alterator-grub in BASE and lilo in install2's installer-steps.
Of course the installer bailed out after dealing with packages :-/

Thanks Leo-sp50 for pointing out the (hopefully) right direction.
2012-02-09 17:47:10 +02:00
Michael Shigorin
9c6824ea57 grub by default in "production" targets
There's still an annoying problem (a race?) manifesting itself
as installer bailing out between packages installation and lilo
setup with X segfault in logs; while the culprit is not known yet,
let's avoid that for most images by moving the bootloader request
from the former "leaf" target (which noe became a "node") into an
experimental server-systemd one.

Thanks Leo-sp50 for bringing that to my attention again; see also
http://forum.russ2.com/index.php?showtopic=3310&pid=31364&st=0&#entry31364
2012-02-09 09:41:12 +02:00
Michael Shigorin
62ab13cc77 distro/installer related graph cleanup
As was duly noted by Leo-sp50, both server.mk and desktop.mk
duplicate a few bits layered over bare distro/installer which
happened to be both a dependency (thus should reduce redundancy)
and a "real distro" target (well, it doesn't just work yet, need
to provide networking and sources.list in install2 by hand).

Fixed by moving a "node" to distro/.installer along with typical
additions and leaving a bare installer as is by now; there's a
need to get it working at least for DHCP/ftp.altlinux.org case.
2012-02-09 09:33:39 +02:00
Michael Shigorin
4355f401db image.in/Makefile: introduced save-profile
From now on, non-empty SAVE_PROFILE variable will indicate
the need to carry the particular generated profile inside
the image built from it.

Thanks gns@ for this feature in liveflash.eeepc.
2012-02-07 22:21:33 +02:00
Michael Shigorin
3dd020338b "untag" install2 tagged scripts
So far the tagged scripts concept is too fragile,
and these were used unconditionally anyways.

features.in/Makefile is broken regarding copying
tagged scripts right now...
2012-02-07 22:19:17 +02:00
Michael Shigorin
402b6e080b pkg.in/lists/Makefile: fixed committing what's copied
Was broken during dot-base introduction
by wrong recipe split...
2012-02-06 21:49:31 +02:00
Michael Shigorin
ca67a20952 renamed base+server+disk pkglist to server+extra
This is to fit base/extra separation better
and to avoid lvm2 creeping into VE images.
2012-02-06 20:18:14 +02:00
Michael Shigorin
5c5c4a6a6b gear-store-tags 2012-02-06 17:10:41 +02:00
Michael Shigorin
0ad3c6b8bd 0.5.5-alt1
- live-related tweaks (including live.hooks support)
- terminal server and webkiosk images
2012-02-06 17:09:33 +02:00
Michael Shigorin
f044bdbc33 xorg: added xorg-dri-intel explicitly
xorg-drv-intel doesn't pull it in at the moment:
https://bugzilla.altlinux.org/25044
2012-02-06 13:14:35 +02:00
Michael Shigorin
202f473499 conf.d/live.mk: live-webkiosk += live.hooks
Rather convenient for native flash images but can also be
beneficial with usual ISO by editing one before burning it.
2012-02-06 12:58:20 +02:00
Michael Shigorin
97e1be6a31 features.in/live: introduced live.hooks support
The implementation builds upon liveflash.eeepc by gns@;
thanks <sol/codis.ru> who suggested adding it to live-webkiosk
2012-02-06 12:58:20 +02:00
Michael Shigorin
c39c100cdc conf.d/live.mk: initial live-webkiosk
This one starts up a Firefox session in kiosk mode
(there are several extensions, I find hsv@'s one
preferable) and tries to browse /image/index.html
which corresponds to index.html in the image root
(could be edited by means of e.g. isomaster).
2012-02-06 12:58:20 +02:00
Michael Shigorin
bc091ab919 conf.d/live.mk: factor commons into distro/.live-x11
It's rather unexpected that someone would do an X11 LiveCD
without user autologin -- but even if that's the case,
then this waypoint is just not used for it.
2012-02-06 12:58:20 +02:00
Michael Shigorin
8b39c4af27 lists/tagged/rescue+extra += chntpw
Thanks ildar@ for the reminder:
http://www.altlinux.org/Talk:ALT_Linux_5.0_Rescue
2012-02-06 12:58:20 +02:00
Michael Shigorin
6cd6a0ff0d features.in/bootloader: mind the make
Document the one-way nature of bootloader type switching.
2012-02-06 12:58:20 +02:00
Michael Shigorin
7a3ab55db4 image.in/Makefile: fixed thinko regression
MKI_VERSION was tested against even before the config.mk
that defines it got included.  Ouch.
2012-02-06 12:58:20 +02:00
Michael Shigorin
0c97aaf80b ltsp-icewm += firefox
That way it's at least marginally useful...
2012-02-06 12:58:20 +02:00
Michael Shigorin
01a03d037b features.in/ltsp: support x86_64 clients
Courtesy of prividen@, there's actual x86_64 client support in ALTSP.
Although led@ tells that it's i586 optimization that hurts on i686+
and should be replaced with either i486 or i686 for that matter...
2012-02-06 12:58:20 +02:00
Michael Shigorin
33fe8cbd1f initial ltsp feature
Sort of builds on current Sisyphus with ltsp-related packages
fixed up in a pocket but the latter are rather in need of some
proper face-lift.
2012-02-06 12:58:20 +02:00
Michael Shigorin
178a700e6e 03-test-kernel: tweak squashfs compression
A larger block size was recommended by led@;
gns@ seems to concur as the 512k value was borrowed
from liveflash.eeepc profile (along with -noI).

The other issue is with binary specific compressors:
x86 was clearly assumed while the data for an educated
guess are pretty handy.  Please note that using filters
incurs additional compression attempts for the utility
to choose the best result.
2012-01-18 23:33:29 +02:00
Michael Shigorin
3fcbed3378 features.in/live: added 90-cleanup-boot script
Spotted /boot/vmlinuz* in a live environment,
and wondered why waste a few megs of potentially
precious space...
2012-01-18 23:11:04 +02:00
Michael Shigorin
d9a0d305ee gear-store-tags 2012-01-16 22:38:37 +02:00
Michael Shigorin
8473fda02d 0.5.4-alt1
- better diags for initial deployment
2012-01-17 00:36:43 +04: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
b95caa9b73 lib/ve.mk: introduced ve/bare
A minimal chroot supporting extension via apt-get;
vitals if built on Sisyphus as of Jan 16, 2012:

  i586: 13M tar.xz, 58M chroot (33M w/o /usr/share/{doc,locale,man})
x86_64: 14M tar.xz, 60M chroot (35M w/o /usr/share/{doc,locale,man})

Trivial fixups (extra checks) added to two script hooks.
2012-01-16 20:10:16 +04:00
Michael Shigorin
804cedbca5 features.in/build-distro: initial isosort implementation
mkisofs can use hints on file disposition; this needs some
support on mkimage side but that's pretty trivial (hope to
see it in 0.2.2+).
2012-01-15 23:00:19 +02:00
Michael Shigorin
efa73b97f0 sub.in/stage1/Makefile: comment fixup
Referring to install2 subprofile after it got generalized
and renamed to stage2 is an omission, better fix it late
than never.
2012-01-11 15:54:59 +02:00
Michael Shigorin
5a7b6b5739 icewm.iso: use desktop installer
It's burdensome for testing but at least the result
is somewhat useful then.
2012-01-11 15:54:55 +02: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
37f050d227 features.in/bootloader: README update
The dependency is actually long gone since the current hack
is to just replace hardwired "grub" in an installer-steps
with whatever got configured...
2012-01-11 10:35:52 +02:00
Michael Shigorin
5a1065c33e bin/mktmpdir: check for filesystem mount options
As was found out by Vladimir Karpinsky (thanks for patience!),
the autochosen directory might still have too restrictive mount
options -- nodev and/or noexec.  Hopefully the diags are a bit
better and faster by now.
2012-01-10 16:00:56 +02:00
Michael Shigorin
87bfa3f65d check vigorously the autochosen path prefix either
It happens that if the host environment isn't particularly
tuned up for package builds already then bin/mktmpdir might
come up with a directory outside hasher-allowed prefix list;
now that's a shame and not a Christmas gift, clearly.

Thanks Vladimir Karpinsky for pointing this problem out too.
2012-01-06 19:15:07 +02:00
Michael Shigorin
0ec7d7cd01 check vigorously for installed mkimage
It was briefly mentioned in QUICKSTART but somehow managed
to evade the commandlines provided.  And while at it, let's
make errors like this more explicit to avoid extra lookups.
Oh, and fix QUICKSTART so that readers miss the hassle. :)

Thanks Vladimir Karpinsky for pointing this problem out.
2012-01-04 22:33:53 +02:00
Michael Shigorin
426c985da3 syslinux: piggybacking cleanups
Avoid extra files where a variable would suffice; and use
the more specific "syslinux.list" rather than a "files.list".
2012-01-04 15:50:01 +02:00
Michael Shigorin
8fbf3585b0 40-autologin: don't do runlevel 5 if X is absent
We can do textmode live images, after all.
Some sort of autologin would be useful there too
but doing it right is less obvious to me at the moment...
2012-01-03 15:09:33 +02:00
Michael Shigorin
a7ac4f236c gear-store-tags 2012-01-02 21:01:33 +02:00
Michael Shigorin
672125b9e5 0.5.3-alt1
- multi-target, multi-arch, single-job builds
2012-01-02 21:01:09 +02:00
Michael Shigorin
e93d6cabca docs: minor updates
doc/variables.txt was missing the already-existing BUILDLOG
variable description, and ARCHES got added during multi-target
toplevel rewrite.  Other minor fixes come as appropriate.
2012-01-02 21:01:09 +02:00
Michael Shigorin
7738c6a67d bin/mktmpdir tweaks
The fallback case of building in a brother directory moved
from the last line of code to the first one becoming more
explicit along the way.

Support for slash-containing argument (being a tmpdir name
template prefix) has been added.
2012-01-02 21:01:09 +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
3d2f69f112 lib/{clean,profile}.mk: robustness improvements
First, let's not do rsync --delete on an unverified target dir
again: the lesson was learned during a subway hacking session
and I must say that SSDs are frightening fast (even if it was
more than a second to realize what happens and terminate the
extermination before it got /home, thanks xterm).

Second, let's use a variable for common name and make's own
realpath function instead of external binary.
2012-01-02 21:01:09 +02:00
Michael Shigorin
abfd88e262 06syslog: more durability
At least it shouldn't bail out when the anticipated file
just isn't there...
2011-12-26 18:36:37 +02:00
Michael Shigorin
96e89d0062 s/subst/sed -i/g
Initial openSUSE package base taming effort has shown that
relatively few things should be fixed; subst has been generalized
as -i option to sed(1) since its introduction, so let's just fix it.
2011-12-26 18:21:22 +02:00
Michael Shigorin
643d4a753d p/l/Makefile: refactor repetitive actions
*_PACKAGES and *_LISTS shouldn't inflict copypasted blocks;
we can iterate over these just fine.

NB: dump-*, not dump_*, due to namespace pollution hurting
debug target if done the latter way (in case someone misses
the morning tea as wel).
2011-12-26 16:34:20 +02:00
Michael Shigorin
90d7a6142a rescue: drop evms by default
As current devmapper doesn't allow for simultaneous
mounts of virtually the same device by different names
(signalled by "Device or resource busy" when trying to
e.g. mount /dev/sda2 but with /dev/evms/sda2 being just
fine), EVMS triggering such behaviour but rarely needed
should be avoided altogether until a hook to disable it
is in place.
2011-12-21 21:13:38 +02:00
Michael Shigorin
180ed5359c "if test ..." replaced by "if [ ... ]"
Fixed up the remnants of the early style mix
to correspond to the proposed doc/style.txt;
the rationale being that

	if [ ... ]; then
		...
		...
	fi

is the more readable construct among itself,

	if test ...; then
		...
		...
	fi

and

	[ ... ] && {
		...
		...
	}

due to the condition being more distinguishable
when bracketed and the body more apparent as the
one inside "if" and not any other block; the less
obvious difference is that the final construct of
the latter form is prone to the whole script exit
status being non-zero if the condition isn't met.
2011-12-21 12:14:03 +02:00
Michael Shigorin
a8ccfb3d41 firmware related fixups
- it wasn't firmware-carl9170 but firmware-carl9170-1.9.4
- firmware-linux Obsoletes: firmware-iwl* since 20110520-alt1
2011-12-20 16:13:14 +02:00
Michael Shigorin
d3351bb8b7 server, rescue pkglists: minor additions
screen(1) is definitely the part of a server;
tmux(1) can also be installed of course.

Thanks vvk@ (#15887).
2011-12-20 14:03:05 +02:00
Michael Shigorin
d9585b48fb gear-store-tags 2011-12-19 22:50:34 +02:00
Michael Shigorin
e97c111f33 0.5.2-alt1
- THE_{KMODULES,PACKAGES,LISTS,GROUPS}
- incremental development, refactoring and bugfixing
2011-12-19 22:46:20 +02:00
Michael Shigorin
41a0b63051 conf.d/desktop.mk: split out distro/desktop-mini
Let's prepare some moderately sane base for future desktop
installers, it's not only icewm around anymore.
2011-12-19 22:32:59 +02:00
Michael Shigorin
f0414f8208 initial razorqt desktop support
As 0.4.0 just came out and seems to be quite interesting,
why not add it to the collection? :)

Package base advice is welcome, of course.
2011-12-19 22:32:59 +02:00
Michael Shigorin
c5e559b7b9 stop abusing use/live/*
Some parts of *image* configuration started slipping down
into the *feature* configuration, and that was wrong; fixed.

Also introduced proper use/live/x11 (via use/x11/xorg with added
wacom support for the sake of #26723/#26724) and rebased the
pre-existing descendants onto it.
2011-12-19 22:32:59 +02:00
Michael Shigorin
d6972a39bf introduced THE_{KMODULES,PACKAGES,LISTS,GROUPS}
As too many things started duplicating between distros proper
and (e.g. corresponding) LiveCDs, it became apparent that a class
of entities which end up working for THE_USER (not a sysadmin,
and not a developer, just a Linux user) is in need.

So THE_KMODULES will power installed basesystem and live image,
while THE_PACKAGES, THE_LISTS and THE_GROUPS will participate
in building those.
2011-12-19 22:32:59 +02:00
Michael Shigorin
dbed41bf81 syslinux: *.cfg tweaks
- parameter order fixed to "simple first, then those with args"
  and documented as the preferred one (might be debatable, okay)
- added "lowmem" to live so it avoids a ramdisk but works off media
  (it's a knob for propagator)
- added "fastboot" everywhere (but failsafe install) to make use
  of Linux 2.6.29+ async controller initialization
- every snippet got a trailing newline so that isolinux.cfg is readable

And a fancy makefile to check for shortcut dups!
2011-12-19 22:32:59 +02:00
Michael Shigorin
1d07b8f11b live-rescue: use rescue+fs (but drop ntfsprogs)
Some more filesystem related utilities inspired by PLD rescue
are due indeed; but ntfsprogs are obsoleted by ntfs-3g, in fact.

iotop and iperf were suggested by stalker@.
2011-12-19 22:32:30 +02:00
Michael Shigorin
16a06f51d0 cleanup dependency dups
Several targets were used in a duplicated way
that made no harm but no sense either.
2011-12-16 15:28:41 +02:00
Michael Shigorin
1b3b38b7c5 subprofiles: minor docs extension
"sub/stage2/live" might seem a bit cryptic and not readily
traceable, so let's expand on explanations accordingly.
2011-12-16 15:28:41 +02:00
Michael Shigorin
6fadf7e0e9 initial isohybrid support
Here we go with postprocessing priorities along the way
as ISO hybridization has to occur before implanting
final MD5 sum (which must happen earlier than e.g. some
external MD5SUM file generation).

Unfortunately proper dependencies aren't applicable here
(though I'd like to be proved wrong on this one).

Please note that this needs propagator > 20101130-alt9
for automatic mode to work (has also been worked around
in gfxboot case with design-bootloader-source-6.0-alt1).

Thanks rom_as@ for asking about the hybrid image status
and helping out with testing.
2011-12-16 15:22:28 +02:00
Michael Shigorin
1d66879681 live/stage2cfg.mk: rather LIVE_GROUPS
This one used to use LIVE_MAIN_GROUPS which seems to be
overlooked substitution artifact from walking over
GLOBAL_PKG_GROUPS and GLOBAL_LIVE_PKG_GROUPS of m-p-d...
(not that LIVE_GROUPS are defined anywhere yet)
2011-12-08 09:33:52 +02:00
Michael Shigorin
e89a0f1c62 lib/build.mk: tweak the optimizer
$(SHORTEN) is better in the midst of the pipe
so that greps are terminal and can sense the tty
(or the lack thereof in case we're logging further).
2011-12-08 09:30:06 +02:00
Michael Shigorin
c400ba59df build-distro.mk, pkg.in/lists/Makefile: fixups
Actually there's an added duplication in the form of the
test that was previously missing in pkg.in/lists/Makefile
-- that has to be done properly when it's clear how.

This fully omits pkg/lists/.base generation in environments
that won't make use of it.
2011-12-06 19:16:04 +02:00
Michael Shigorin
ed0842b745 features.in/Makefile: cosmetic rewrite
The outmost shell loop got replaced with a (hidden) bunch
of targets -- it's somewhat controversial as the inner loops
are still there (but at least don't wrap around my SXGA+).

Full targetization might be beneficial in terms of parallelism
achievable *but* that would ruin git history being generated,
and building a distro configuration takes a few seconds at most.

(upon reading http://stackoverflow.com/questions/5414418/)
2011-12-06 19:08:30 +02:00
Michael Shigorin
390f4f6bc8 lib/build.mk: add basic CHECK support
The idea is to check:
- the reachability of every target
  used to build the image in question;
- the availability of all the package lists
  and subsequently packages for that image;
- the lack of "dangling" intermediate targets,
  features, pkglists, hooks etc.

So far only the first step is implemented --
it's easy and somewhat helpful already for
  make CHECK=1 all
2011-12-06 14:22:20 +02:00
Michael Shigorin
a1d0b4a7c0 gear-store-tags 2011-12-02 20:09:07 +02:00
121 changed files with 1218 additions and 424 deletions

View File

@@ -1,5 +1,5 @@
Name: mkimage-profiles
Version: 0.5.1
Version: 0.6.1
Release: alt1
Summary: ALT Linux based distribution metaprofile
@@ -15,6 +15,8 @@ Requires: rsync git-core
Requires: time schedutils
Requires: mkimage >= 0.2.0
# Recommends: graphviz
%define mpdir %_datadir/%name
%add_findreq_skiplist %mpdir/*.in/*
@@ -37,7 +39,7 @@ Virtual environment template caches (OpenVZ/LXC) can be made either.
In short, setup hasher (http://en.altlinux.org/hasher) and here we go:
cd %mpdir
head README
make distro/syslinux.iso
make syslinux.iso
But if you're into regular distro hacking and are not afraid of make
and modest metaprogramming (some code generation and introspection),
@@ -59,6 +61,33 @@ cp -a * %buildroot%mpdir
%doc README QUICKSTART
%changelog
* Mon Mar 26 2012 Michael Shigorin <mike@altlinux.org> 0.6.1-alt1
- ISO9660 metadata support
- initial alien VE image
* Mon Mar 19 2012 Michael Shigorin <mike@altlinux.org> 0.6.0-alt1
- reports (targets graph)
* Mon Mar 12 2012 Michael Shigorin <mike@altlinux.org> 0.5.7-alt1
- distro tweaks
* Mon Feb 20 2012 Michael Shigorin <mike@altlinux.org> 0.5.6-alt1
- minor fixups
* Mon Feb 06 2012 Michael Shigorin <mike@altlinux.org> 0.5.5-alt1
- live-related tweaks (including live.hooks support)
- terminal server and webkiosk images
* Mon Jan 16 2012 Michael Shigorin <mike@altlinux.org> 0.5.4-alt1
- better diags for initial deployment
* Mon Jan 02 2012 Michael Shigorin <mike@altlinux.org> 0.5.3-alt1
- multi-target, multi-arch, single-job builds
* Mon Dec 19 2011 Michael Shigorin <mike@altlinux.org> 0.5.2-alt1
- THE_{KMODULES,PACKAGES,LISTS,GROUPS}
- incremental development, refactoring and bugfixing
* Fri Dec 02 2011 Michael Shigorin <mike@altlinux.org> 0.5.1-alt1
- generic VE archive type (added cpio and xz either)
- minor additions/fixes

View File

@@ -1,6 +0,0 @@
object 48272c7119328f0c68142087edba1494c6442cbc
type commit
tag v0.5.0
tagger Michael Shigorin <mike@altlinux.org> 1321878408 +0200
add_feature

View File

@@ -0,0 +1,6 @@
object 1b7ce25f10d8e3faede66d8c66d3f3bb43f59ceb
type commit
tag v0.6.0
tagger Michael Shigorin <mike@altlinux.org> 1332177960 +0200
reports/targets

View File

@@ -1 +1 @@
851085a67914bd2f9470cf81f552b06a9b98d83d v0.5.0
9f3938b732545a20e4acfd547c5a002fbca54b21 v0.6.0

116
Makefile
View File

@@ -1,75 +1,47 @@
# steps to build a distribution image:
# --- here
# 1. initialize new profile (BUILDDIR) as a copy of image.in/
# 2. configure distro
# 3. copy the needed bits from metaprofile to a new profile
# --- in BUILDDIR
# 4. build subprofiles and subsequently an image
# umbrella mkimage-profiles makefile:
# iterate over multiple goals/arches,
# collect proceedings
help:
@echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t
@echo
@echo '** available virtual environment targets:'
@echo $(VES) | fmt -sw"$$((COLUMNS>>1))" | column -t
MKIMAGE_PROFILES = $(dir $(lastword $(MAKEFILE_LIST)))
# only process the first target (inter-target cleanup is tricky)
IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz
ifeq (./,$(dir $(IMAGE_TARGET)))# convenience fallback
IMAGE_TARGET := distro/$(IMAGE_TARGET)# for omitted "distro/"
# for immediate assignment
ifndef ARCHES
ifdef ARCH
ARCHES := $(ARCH)
else
ARCHES := $(shell arch | sed 's/i686/i586/')
endif
IMAGE_CONF := $(firstword $(subst ., ,$(IMAGE_TARGET)))# ve/generic
IMAGE_CLASS := $(firstword $(subst /, ,$(IMAGE_TARGET)))# ve
IMAGE_FILE := $(lastword $(subst /, ,$(IMAGE_TARGET)))# generic.tar.gz
IMAGE_NAME := $(firstword $(subst ., ,$(IMAGE_FILE)))# generic
IMAGE_TYPE := $(subst $(IMAGE_NAME).,,$(IMAGE_FILE))# tar.gz
# preferences
-include $(HOME)/.mkimage/profiles.mk
# most of the actual work done elsewhere
include lib/*.mk
include conf.d/*.mk
include features.in/*/config.mk
DISTRO_TARGETS := $(shell sed -n 's,^\(distro/[^:.]\+\):.*$$,\1,p' \
lib/distro.mk $(wildcard conf.d/*.mk) | sort -u)
VE_TARGETS := $(shell sed -n 's,^\(ve/[^:.]\+\):.*$$,\1,p' \
lib/ve.mk $(wildcard conf.d/*.mk) | sort -u)
DISTROS := $(call addsuffices,$(DISTRO_EXTS),$(DISTRO_TARGETS))
VES := $(call addsuffices,$(VE_EXTS),$(VE_TARGETS))
IMAGES := $(DISTROS) $(VES)
.PHONY: $(IMAGES) $(DISTRO_TARGETS) $(VE_TARGETS)
### suboptimal but at least clear, reliable and convenient
all:
@n=1; sum=$(words $(DISTROS)); \
for distro in $(DISTROS); do \
echo "** building $$distro:"; \
$(MAKE) --no-print-directory \
ALL=$$n/$$sum \
BUILDDIR=$(BUILDDIR) \
$$distro; \
echo; \
n=$$(($$n+1)); \
done
$(IMAGES): debug \
config/with/$(IMAGE_CONF) \
config/like/$(IMAGE_CLASS) \
config/name/$(IMAGE_NAME) \
config/pack/$(IMAGE_TYPE) \
build; @:
# convenience shortcut
$(DISTROS:distro/%=%): %: distro/%
debug:
ifeq (2,$(DEBUG))
@$(foreach v,\
$(filter IMAGE_%,$(sort $(.VARIABLES))),\
$(warning $v = $($v)))
endif
export ARCHES
# supervise target tracing; leave stderr alone
ifdef REPORT
export REPORT_PATH := $(shell mktemp --tmpdir mkimage-profiles.report.XXXXXXX)
POSTPROC := | bin/report-filter > $(REPORT_PATH)
endif
# recursive make considered useful for m-p
MAKE += -r --no-print-directory
.PHONY: clean distclean help
clean distclean help:
@$(MAKE) -f main.mk $@
export NUM_TARGETS := $(words $(MAKECMDGOALS))
# real targets need real work
%:
@n=1; \
say() { echo "$$@" >&2; }; \
if [ "$(NUM_TARGETS)" -gt 1 ]; then \
n="`echo $(MAKECMDGOALS) \
| tr '[[:space:]]' '\n' \
| grep -nx "$@" \
| cut -d: -f1`"; \
say "** goal: $@ [$$n/$(NUM_TARGETS)]"; \
fi; \
for ARCH in $(ARCHES); do \
if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then say; fi; \
say "** ARCH: $$ARCH" >&2; \
$(MAKE) -f main.mk ARCH=$$ARCH $@ $(POSTPROC); \
$(MAKE) -f reports.mk ARCH=$$ARCH; \
done; \
if [ "$$n" -lt "$(NUM_TARGETS)" ]; then say; fi

View File

@@ -15,12 +15,13 @@
команды
~~~~~~~
- от имени root:
# apt-get install hasher git-core
# apt-get install mkimage hasher git-core
# hasher-useradd USER
- от имени пользователя (после повторного входа):
$ git config --global user.email "my@email"
$ git config --global user.name "My Name"
$ mkdir ~/out
- тестовая сборка (см. тж. lib/distro.mk, doc/variables.txt):
$ make distro/icewm.iso

View File

@@ -1,20 +1,53 @@
#!/bin/sh
# analyze free space, preferring tmpfs over really many gigaz
# and taking into account configured hasher workdir prefices
# hope there aren't spaces in RM's $HOME are they?
DIRS="$TMP $TMPDIR $HOME/hasher /tmp /var/tmp"
DIRS="$TMP $TMPDIR $HOME/hasher /tmp /var/tmp .."
MINSIZE=262144 # face control criterion
# poor man's SourceIfExists()
try_source() { [ -f "$1" ] && . "$1"; }
# hasher accepted ones
get_prefices()
{
try_source /etc/hasher-priv/system
try_source `/usr/libexec/hasher-priv/getconf.sh`
echo "$prefix" | tr ':' '\n' | while read i; do realpath "$i"; done
}
# drop candidates that hasher won't handle anyways
# NB: doesn't take --number into account,
# prefix lists are defined by the primary configuration
contemplate_dirs()
{
for d in "$@"; do
D="`realpath "$d"`";
for p in `get_prefices`; do
[ "${D#$p}" = "$D" ] || echo "$D";
done;
done \
| uniq # _not_ sort -u
}
# hasher emits no meaningful errors regarding those, sigh
check_options()
{
! egrep -q "^$1 $2 .*no(dev|exec)" /proc/mounts
}
# pick existing, writeable, >256M free space dirs
# rank them wrt type: tmpfs > realfs > rootfs
choose_tmpdir() {
for i in $DIRS; do
for i in "$@"; do
[ -d "$i" -a -w "$i" ] || continue
echo -n "$i "
df -Tl "$i" | tail -1
done \
| sort -unk6 \
| while read dir dev fstype size used free percent mnt; do
check_options "$dev" "$mnt" || continue
[ "$free" -gt "$MINSIZE" ] || continue
[ "$fstype" = "tmpfs" ] && { echo "2 $dir $free"; continue; }
[ "$mnt" = "/" ] && { echo "0 $dir $free"; continue; }
@@ -25,5 +58,24 @@ choose_tmpdir() {
| cut -f2 -d' '
}
DIR="`choose_tmpdir`"
mktemp -d "${1:-tmpdir}.XXXXXXX" --tmpdir="${DIR:-`realpath ..`}"
# bringing it all together
TMPDIRS="`contemplate_dirs $DIRS`"
if [ -z "$TMPDIRS" ]; then
echo "error: no suitable directories found;" >&2
echo "please check docs, filesystem and hasher setup" >&2
echo "(mount enough tmpfs into /tmp or fix hasher-priv prefix?)" >&2
exit 1
fi
TEMP="`choose_tmpdir $TMPDIRS`"
if [ -z "$TEMP" ]; then
echo "error: no suitable directories found;" >&2
echo "please check hasher docs and filesystem setup" >&2
echo "(nodev and/or noexec on an otherwise suitable filesystem?)" >&2
exit 1
fi
DIR="$TEMP/`dirname "$1"`"
NAME="`basename "${1:-tmpdir}"`"
mkdir -p "$DIR" # in case $1 contains slash(es)
mktemp -d "$NAME.XXXXXXX" --tmpdir="${DIR%/.}"

4
bin/report-filter Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
# filter worker make stdout for report scripts
grep '^trace:building ' | uniq

33
bin/report-targets Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
echo "digraph {"
echo " { node [fontname=Helvetica,fontsize=20];"
while read first second third rest; do
FROM=; TO=
case "$first" in
"trace:building")
case "$third" in
"->")
FROM="$second"; TO="$rest";;
*)
continue;;
esac
;;
*)
continue;;
esac
[ -n "$FROM" -a -n "$TO" ] || continue
for to in $TO; do
out=" \"$FROM\" -> \"$to\""
case $to in
*distro/*)
echo "$out [weight=10];";;
*)
echo "$out";;
esac
done
done
echo " }"
echo "}"

52
bin/report-targets2vars Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
DISTCFG=build/distcfg.mk
[ -s "$DISTCFG" ] || exit 1
VARIABLES=
echo "graph { rankdir=LR;"
echo " { node [height=.1,width=.3,fontname=Helvetica,fontsize=10];"
feat_vars()
{
FEATURE=
while read first second rest; do
case "$first" in
\#[A-Z]*)
continue;; # overridden feature
\#) # feature mark
case "$second" in
profile/*)
FEATURE=;;
*)
FEATURE="$second";;
esac
;;
*)
case "$second" in
=|+=|?=)
case "$first" in
DISTCFG_MK|SUBPROFILES|FEATURES|IMAGE*|MKIMAGE_*)
continue;;
*)
VAR="$first"
VARIABLES="$VARIABLES; $VAR"
;;
esac
;;
*)
continue;;
esac
;;
esac
[ -n "$FEATURE" -a -n "$VAR" ] || continue
echo " \"$FEATURE\" -- \"$VAR\";"
done < "$DISTCFG"
echo " { node [shape=box]$VARIABLES; }"
}
feat_vars | LC_COLLATE=C sort -ru
echo " }"
echo "}"

View File

@@ -11,15 +11,24 @@
Попросту говоря, copy-paste -- тревожный признак.
По переменным:
* SYSTEM_PACKAGES стоит применять крайне осторожно -- эти пакеты попадут
- SYSTEM_PACKAGES стоит применять крайне осторожно -- эти пакеты попадут
во все стадии, в том числе в образ чувствительной к объёму install2
(в stage1 -- только в инструментальный чрут); применяйте для того,
что обязано быть и в инсталяторе, и в готовой системе;
* для "обычного общего" (main, live, rescue) есть COMMON_PACKAGES
(NB: попадают в базовую систему).
что обязано быть и в инсталяторе, и в готовой системе
- для "обычного общего" (live, main, rescue) есть COMMON_PACKAGES
(NB: попадают в базовую систему)
- для "пользовательского" (live, main) есть THE_GROUPS, THE_LISTS
и THE_PACKAGES
- аналогично по модулям ядра:
+ STAGE1_KMODULES доступны в производных от stage2 (install2, live, rescue)
+ BASE_KMODULES попадут в установку по умолчанию
+ MAIN_KMODULES будут доступны для установки с носителя
+ LIVE_KMODULES предназначены для LiveCD/LiveFlash
+ THE_KMODULES попадут в "пользовательские" окружения
(live и установленную систему)
По подстановкам:
* $(VAR) подставляются перед их записью в $(CONFIG), который distcfg.mk;
* $$(VAR) раскрываются позже, при включении $(CONFIG) и востребовании
значений -- таким образом их значения могут изменяться до окончания
конфигурации, а также зависеть от значений других переменных;
- $(VAR) подставляются перед их записью в $(CONFIG), который distcfg.mk
- $$(VAR) раскрываются позже, при включении $(CONFIG) и востребовании
значений; в этом случае их значения могут изменяться до окончания
конфигурации, а также зависеть от значений других переменных

6
conf.d/alien.mk Normal file
View File

@@ -0,0 +1,6 @@
ve/.centos-base: ve/.bare
@$(call set,IMAGE_INIT_LIST,hasher-pkg-init)
ve/centos: ve/.centos-base
@$(call add,BASE_PACKAGES,openssh-server)

View File

@@ -1,15 +1,18 @@
# desktop distributions
ifeq (distro,$(IMAGE_CLASS))
distro/desktop-base: distro/installer use/repo/main \
use/syslinux/ui-vesamenu use/x11/xorg use/bootloader/grub
distro/.desktop-base: distro/.installer use/syslinux/ui-vesamenu use/x11/xorg
@$(call set,INSTALLER,desktop)
distro/icewm: distro/desktop-base \
use/lowmem use/x11/xdm use/x11/runlevel5 \
use/bootloader/lilo use/power/acpi/button \
use/cleanup/alterator
@$(call add,BASE_LISTS,$(call tags,icewm desktop))
distro/.desktop-mini: distro/.desktop-base use/lowmem use/x11/xdm \
use/power/acpi/button use/cleanup/alterator; @:
distro/desktop-systemd: distro/icewm use/systemd
distro/tde: distro/.desktop-mini +tde
@$(call add,BASE_LISTS,$(call tags,(base || desktop) && network))
distro/icewm: distro/.desktop-mini +icewm; @:
distro/ltsp-icewm: distro/icewm +ltsp; @:
distro/ltsp-tde: distro/tde +ltsp; @:
distro/desktop-systemd: distro/icewm use/systemd; @:
endif

View File

@@ -1,31 +1,43 @@
# live images
ifeq (distro,$(IMAGE_CLASS))
distro/dos: distro/.init use/dos use/syslinux/ui-menu
distro/rescue: distro/.base use/rescue use/syslinux/ui-menu
distro/live: distro/.base use/live/base use/power/acpi/cpufreq
distro/live-systemd: distro/.base use/live/base use/systemd
distro/live-install: distro/.base use/live/install use/syslinux/localboot.cfg
distro/live-icewm: distro/live use/live/icewm
distro/syslinux: distro/.init \
use/syslinux/localboot.cfg use/syslinux/ui-vesamenu use/hdt; @:
distro/live-rescue: distro/live-icewm
@$(call add,LIVE_LISTS,$(call tags,rescue && (live || x11)))
@$(call add,LIVE_LISTS, \
$(call tags,(base || extra) && (archive || rescue || network)))
distro/dos: distro/.init use/dos use/syslinux/ui-menu; @:
distro/rescue: distro/.base use/rescue use/syslinux/ui-menu; @:
distro/live-systemd: distro/.base use/live/base use/systemd; @:
distro/.live-base: distro/.base use/live/base use/power/acpi/button; @:
distro/.live-desktop: distro/.base use/syslinux/ui-vesamenu +live; @:
distro/live-isomd5sum: distro/.base use/live/base use/isomd5sum
@$(call add,LIVE_PACKAGES,livecd-isomd5sum)
distro/live-builder: pkgs := livecd-tmpfs livecd-online-repo mkimage-profiles
distro/live-builder: distro/.base use/repo/main \
use/live/base use/dev/mkimage use/power/acpi/button
distro/live-builder: distro/.live-base use/dev/mkimage use/dev/repo
@$(call add,LIVE_LISTS,$(call tags,base && (server || builder)))
@$(call add,LIVE_PACKAGES,zsh sudo)
@$(call add,LIVE_PACKAGES,$(pkgs))
@$(call add,LIVE_PACKAGES,zsh sudo apt-repo)
@$(call add,MAIN_PACKAGES,rpm-build basesystem)
@$(call add,MAIN_PACKAGES,fakeroot sisyphus_check)
@$(call add,MAIN_PACKAGES,syslinux pciids memtest86+ mkisofs)
@$(call add,MAIN_PACKAGES,file make-initrd make-initrd-propagator)
@$(call add,MAIN_PACKAGES,$(pkgs))
@$(call add,MAIN_PACKAGES,syslinux pciids memtest86+ mkisofs)
distro/live-install: distro/.live-base use/syslinux/localboot.cfg
@$(call add,LIVE_PACKAGES,live-install)
distro/live-icewm: distro/.live-desktop use/live/autologin +icewm; @:
distro/live-razorqt: distro/.live-desktop +razorqt; @:
distro/live-tde: distro/.live-desktop +tde; @:
distro/live-rescue: distro/live-icewm
@$(call add,LIVE_LISTS,$(call tags,rescue && (fs || live || x11)))
@$(call add,LIVE_LISTS, \
$(call tags,(base || extra) && (archive || rescue || network)))
distro/live-webkiosk: distro/.live-desktop use/live/autologin \
use/live/hooks use/live/ru use/cleanup
@$(call add,LIVE_PACKAGES,livecd-webkiosk)
@$(call add,LIVE_PACKAGES,fonts-ttf-dejavu fonts-ttf-droid)
@$(call add,CLEANUP_PACKAGES,'installer*' 'alterator*' 'libqt4*')
endif

View File

@@ -1,27 +1,27 @@
# server distributions
ifeq (distro,$(IMAGE_CLASS))
distro/server-base: distro/installer use/repo/main \
use/syslinux/ui-menu use/memtest use/bootloader/grub
distro/.server-base: distro/.installer use/syslinux/ui-menu use/memtest
@$(call add,BASE_LISTS,server-base)
distro/server-mini: distro/server-base use/cleanup/x11-alterator
distro/server-mini: distro/.server-base use/cleanup/x11-alterator
@$(call set,KFLAVOURS,el-smp)
@$(call add,KMODULES,e1000e igb)
@$(call add,THE_KMODULES,e1000e igb)
@$(call add,STAGE1_KMODULES,e1000e igb)
@$(call add,BASE_LISTS,\
$(call tags,base && (server || network || security || pkg)))
@$(call add,BASE_LISTS,$(call tags,extra network))
@$(call add,BASE_LISTS,$(call tags,extra (server || network)))
distro/server-systemd: distro/server-mini use/systemd
distro/server-systemd: distro/server-mini use/systemd use/bootloader/lilo; @:
distro/server-ovz: distro/server-mini \
distro/server-ovz: distro/server-mini use/install2/net \
use/hdt use/rescue use/firmware/server use/power/acpi/button
@$(call set,STAGE1_KFLAVOUR,std-def)
@$(call set,KFLAVOURS,std-def ovz-el)
@$(call add,KMODULES,bcmwl ndiswrapper rtl8168 rtl8192)
@$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,KMODULES,drbd83 kvm)
@$(call add,INSTALL2_PACKAGES,curl) ### should become curl-mini
@$(call add,BASE_KMODULES,rtl8168 rtl8192)
@$(call add,MAIN_KMODULES,bcmwl ndiswrapper)
@$(call add,MAIN_KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,MAIN_KMODULES,drbd83 kvm)
@$(call add,BASE_LISTS,ovz-server)
@$(call add,MAIN_LISTS,kernel-wifi)
@$(call add,MAIN_GROUPS,dns-server http-server ftp-server kvm-server)

View File

@@ -1,5 +1,14 @@
предположения фрагментов кода об окружении
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NB: пути приводятся от верхнего уровня; проект в целом предполагает
GNU make 3.81 (с использованием которого и разрабатывается).
- lib/report.mk
+ ожидает, что каждая подлежащая трассированию цель каждого
makefile при сборке конфигурации образа содержит непустой
recipe -- хотя бы "; @:" -- т.к. зависит от запуска $(SHELL)
+ характерный признак пропуска -- разрыв графа (report-targets.png)
- pkg.in/lists/Makefile
+ ожидает, что названия пакаджлистов указываются в переменных
вида *_LISTS, и копирует в генерируемый профиль только их

View File

@@ -9,12 +9,18 @@
+ см. ../image.in/Makefile, apt.conf.sample
- ARCH
+ задаёт целевую архитектуру образа
+ задаёт целевую архитектуру образов
+ значение: пусто (по умолчанию авто), i586 или x86_64
+ см. ../lib/build.mk
- ARCHES
+ задаёт набор целевых архитектур образов
+ значение: пусто (по умолчанию авто) либо список через пробел
+ см. ../Makefile
- BELL
+ подаёт сигнал после завершения сборки
+ значение: пусто (по умолчанию нет) либо любая строка
+ см. ../lib/build.mk
- BUILDDIR
@@ -22,6 +28,21 @@
+ значение: пусто (по умолчанию авто) либо строка
+ см. ../lib/profile.mk
- BUILDDIR_PREFIX
+ задаёт префикс каталога генерируемого профиля и сборки
+ значение: строка; по умолчанию выбирается алгоритмически
+ см. ../main.mk
- BUILDLOG
+ задаёт путь к файлу журнала сборки/очистки
+ значение: по умолчанию $(BUILDDIR)/build.log либо строка
+ см. ../lib/log.mk
- CHECK
+ включает режим проверки сборки конфигурации
+ значение: пусто (по умолчанию) либо любая строка
+ см. ../lib/build.mk
- CLEAN
+ экономия RAM+swap при сборке в tmpfs, иначе места на диске
+ очистка рабочего каталога после успешной сборки очередной стадии
@@ -34,11 +55,26 @@
+ значение: пусто (по умолчанию), 1 или 2
+ см. ../lib/log.mk
- ISOHYBRID
+ включает постобработку ISO-образа isohybrid
+ значение: пусто (по умолчанию) либо любая строка
+ см. ../features.in/pack/config.mk
- NICE
+ понижает нагрузку системы сборочной задачей
+ значение: пусто (по умолчанию) либо любая строка
+ см. ../lib/build.mk
- REPORT
+ запрашивает создание отчёта о собранном образе
+ значение: пусто (по умолчанию) либо любая строка
+ см. ../Makefile, ../report.mk, ../lib/report.mk
- SAVE_PROFILE
+ сохраняет архив сгенерированного профиля в .disk/
+ значение: пусто (по умолчанию) либо любая строка
+ см. ../image.in/Makefile
пример
~~~~~~
make DEBUG=1 CLEAN=1 distro/syslinux.iso

View File

@@ -2,15 +2,29 @@
# (only regarding the needed subprofiles)
ifndef BUILDDIR
help all:
help/plus all: banner
@$(call grepper,'^+')
help/features: banner
@$(call grepper,'^use/')
banner:
@echo "** BUILDDIR not defined; available features:"
grepper = $(and $(1),$(grepper_body))
define grepper_body
@for dir in */; do \
echo -n "$$dir: "; \
grep -h '^use/' $$dir/config.mk \
out="`grep -h $(1) $$dir/config.mk \
| cut -f1 -d: \
| tr ' ' '\n\n' \
| grep $(1) \
| tr '\n' ' ' \
| sort -u; \
| sort -u`"; \
[ -z "$$out" ] || echo "$$dir: $$out"; \
done
endef
else
include $(BUILDDIR)/distcfg.mk
@@ -25,88 +39,99 @@ include $(BUILDDIR)/distcfg.mk
# still both pieces go into a single destination
### sorry for somewhat complicated and overly long lines
all:
TARGETS := prep $(FEATURES) finalize
.PHONY: $(TARGETS)
all: | $(TARGETS)
prep:
@echo "** starting feature configuration"
@if [ -n "$(GLOBAL_DEBUG)" ]; then \
echo "** target subprofiles: $(SUBPROFILES)"; \
echo "** requested features: $(FEATURES)"; \
fi
@for feat in $(FEATURES); do \
if [ -n "$(GLOBAL_DEBUG)" ]; then \
echo "** adding $$feat feature"; \
fi; \
pushd "$$feat" >/dev/null && \
for sub in / $(SUBPROFILES); do \
dirtags=; \
if [ "$$sub" = / ]; then \
parts=lib; \
srcdirs="."; \
dst="."; \
else \
parts=; \
src="$${sub%/*}"; \
dst="$${sub#*/}"; \
srcdirs=; \
if [ -d "$$src" ]; then \
srcdirs="$$src"; \
dirtags="&& $$src"; \
fi; \
if [ -d "$$dst" -a "$$dst" != "$$src" ]; then \
srcdirs="$$srcdirs $$dst"; \
dirtags="&& ($$src || $$dst)"; \
fi; \
for srcdir in $$srcdirs; do \
rsync -qab --exclude tagged \
"$$srcdir/" "$(BUILDDIR)/$$dst/"; \
done; \
# feat
$(FEATURES):
@feat=$@; \
if [ -n "$(GLOBAL_DEBUG)" ]; then \
echo "** adding $$feat feature"; \
fi; \
pushd "$$feat" >/dev/null && \
for sub in / $(SUBPROFILES); do \
dirtags=; \
if [ "$$sub" = / ]; then \
parts=lib; \
srcdirs="."; \
dst="."; \
else \
parts=; \
src="$${sub%/*}"; \
dst="$${sub#*/}"; \
srcdirs=; \
if [ -d "$$src" ]; then \
srcdirs="$$src"; \
dirtags="&& $$src"; \
fi; \
if [ -n "$(GLOBAL_DEBUG)" ]; then \
echo "** src=[$$src] dst=[$$dst] srcdirs=[$$srcdirs]"; \
if [ -d "$$dst" -a "$$dst" != "$$src" ]; then \
srcdirs="$$srcdirs $$dst"; \
dirtags="&& ($$src || $$dst)"; \
fi; \
for srcdir in $$srcdirs; do \
[ -d "$$srcdir" ] || continue; \
pushd "$$srcdir" >&/dev/null; \
for part in $$parts {image-,}scripts.d; do \
destdir="$(BUILDDIR)/$$dst/$$part"; \
[ -d "$$destdir" ] || continue; \
if [ "$$sub" = / -a -d "$$part" ]; then \
rsync -qab "$$part/" "$$destdir/"; \
fi; \
[ -d "tagged/$$part" ] || continue; \
[ "$$srcdir" != "." ] || continue; \
pushd "tagged/$$part" >/dev/null; \
echo "$$feat $$dirtags" \
| tags2lists . \
| xargs -r cp -vpLt "$$destdir" --; \
popd >/dev/null; \
done; \
popd >&/dev/null; \
rsync -qab --exclude tagged \
"$$srcdir/" "$(BUILDDIR)/$$dst/"; \
done; \
if type -t git >&/dev/null && \
pushd "$(BUILDDIR)/$$dst/" >/dev/null; then \
test -n "`git status -s`" && \
git add . && \
if [ -n "$$dst" ]; then \
the="$$sub subprofile"; \
else \
the="toplevel"; \
fi && \
git commit -qam "$$feat feature: $$the part added"; \
fi; \
if [ -n "$(GLOBAL_DEBUG)" ]; then \
echo "** src=[$$src] dst=[$$dst] srcdirs=[$$srcdirs]"; \
fi; \
for srcdir in $$srcdirs; do \
[ -d "$$srcdir" ] || continue; \
pushd "$$srcdir" >&/dev/null; \
for part in $$parts {image-,}scripts.d; do \
destdir="$(BUILDDIR)/$$dst/$$part"; \
[ -d "$$destdir" ] || continue; \
if [ "$$sub" = / -a -d "$$part" ]; then \
rsync -qab "$$part/" "$$destdir/"; \
fi; \
[ -d "tagged/$$part" ] || continue; \
[ "$$srcdir" != "." ] || continue; \
pushd "tagged/$$part" >/dev/null; \
echo "$$feat $$dirtags" \
| tags2lists . \
| xargs -r cp -vpLt "$$destdir" --; \
popd >/dev/null; \
fi; \
done; \
popd >&/dev/null; \
done; \
if [ -x "generate.sh" ]; then sh generate.sh; fi; \
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
if type -t git >&/dev/null && \
pushd "$(BUILDDIR)/" >/dev/null; then \
if test -n "`git status -s`"; then \
git add . && \
git commit -qam "$$feat feature generation complete"; \
fi; \
pushd "$(BUILDDIR)/$$dst/" >/dev/null; then \
test -n "`git status -s`" && \
git add . && \
if [ -n "$$dst" ]; then \
the="$$sub subprofile"; \
else \
the="toplevel"; \
fi && \
git commit -qam "$$feat feature: $$the part added"; \
popd >/dev/null; \
fi; \
done; \
if [ -x "generate.sh" ]; then sh generate.sh; fi; \
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
if type -t git >&/dev/null && \
pushd "$(BUILDDIR)/" >/dev/null; then \
if [ -n "`git status -s`" ]; then \
git add . && \
git commit -qam "$$feat feature generation complete"; \
fi; \
popd >/dev/null; \
done
fi; \
popd >/dev/null
finalize:
@find "$(BUILDDIR)/" -name '*~' \
| sed "s,$(BUILDDIR)/,** warning: file clash: ," >&2
endif

View File

@@ -4,7 +4,7 @@
Каждая фича должна содержать задействуемый при построении
конфигурации будущего образа файл config.mk, включаемый
в ../Makefile; он может описывать одну или более целей
в ../main.mk; он может описывать одну или более целей
вида use/*, дополняющих конфигурацию, и при наличии
дополнительных хуков для копирования или generate.*
обязан добавить имя фичи в $(FEATURES), для чего
@@ -14,17 +14,18 @@
после инициализации профиля (см. ../image.in/) и копирования
субпрофилей (см. ../sub.in/). Для каждой фичи, указанной
в $(FEATURES), копируются подкаталоги сообразно субпрофилям,
а также производится обработка {tagged/,}{image-,}scripts.d/;
затем выполняется скрипт generate.sh и задействуется generate.mk
а также производится обработка {image-,}scripts.d/; затем
выполняется скрипт generate.sh и задействуется generate.mk
(при их наличии).
NB: тегированные скрипты являются экспериментальными,
возможны недоработки и существенные изменения!
Если фича дополняет хуками семейство целевых субпрофилей,
построенных на одном базовом, можно воспользоваться подкаталогом
с именем исходного базового субпрофиля (см. $src, $dst в Makefile).
Наиболее употребительные цели можно снабжать "ярлычками" вроде
"+icewm" с тем, чтобы сделать более краткими и выразительными
использующие их правила. Просьба не злоупотреблять количеством.
Каталог lib/ является специфическим для фич, определяющих
построение конкретного вида образа -- см. build-*/.

View File

@@ -5,6 +5,10 @@
систему (он НЕ должен требоваться пакету installer-distro-*)
и требует пакет выбранного загрузчика.
Реализация экспериментальная (нужно модуляризовать installer-steps),
пока завязана на installer-distro-altlinux-generic (TODO). Возможно,
с использованием alterator-lilo связаны проблемы времени установки.
Обратите внимание: в процессе конфигурирования дистрибутива
"переключение" загрузчика может происходить только в одну сторону
-- если выставлен grub, произведено переключение на lilo и затем
произведена ещё одна попытка переключения на grub, то в конфигурации
останется lilo как последняя "новая" цель с точки зрения make.
Реализация экспериментальная (нужно модуляризовать installer-steps).

View File

@@ -1,5 +1,7 @@
# TODO: invent something prettier (think "lilo+grub" -- or error out?)
# - add,BASE_PACKAGES,alterator-$* is overly additive
# NB: due to make target becoming having been made,
# the last different one wins
# - remember .base if adding yet another *_PACKAGES
use/bootloader: use/install2 sub/main

View File

@@ -1,4 +1,5 @@
Эта фича конфигурирует создание образа дистрибутива, включая работу
с субпрофилями -- которая сейчас нужна только дистрибутивным целям.
Дополняет финальную стадию сборки (lib/, scripts.d/).
Дополняет финальную стадию сборки (lib/, scripts.d/)
и тесно с ней связана.

View File

@@ -1,2 +1,3 @@
use/build-distro: boot/isolinux
# hooked from ../../lib/sugar.mk
use/build-distro:
@$(call add_feature)

View File

@@ -4,14 +4,28 @@
# take the latter part
SUBDIRS = $(notdir $(SUBPROFILES))
BOOT_TYPE = isolinux
# proxy over the ISO metadata collected; see also genisoimagerc(5)
BOOT_SYSI := $(META_SYSTEM_ID)
BOOT_PUBL := $(META_PUBLISHER)
BOOT_PREP := $(META_PREPARER)
BOOT_APPI := $(META_APP_ID)
BOOT_VOLI := $(META_VOL_ID)
BOOT_VOLS := $(META_VOL_SET)
BOOT_BIBL := $(META_BIBLIO)
BOOT_ABST := $(META_ABSTRACT)
BOOT_TYPE := isolinux
# Metadata/ needed only for installers (and not for e.g. syslinux.iso)
# FIXME: installable live needs it too, don't move to install2 feature
### see also .../pkg.in/lists/Makefile
ifneq (,$(findstring install2,$(FEATURES)))
METADATA = metadata
endif
# see also ../scripts.d/01-isosort; needs mkimage-0.2.2+
MKI_SORTFILE := /tmp/isosort
all: $(GLOBAL_DEBUG) prep copy-subdirs copy-tree run-scripts pack-image \
postprocess $(GLOBAL_CLEAN_WORKDIR)
@@ -27,10 +41,8 @@ metadata: dot-base
| sed 's,$(PKGDIR)/*,,g')
dot-base:
@{ \
echo -e "\n## added by image.in/Makefile"; \
echo "$(call kpackages,$(KMODULES),$(KFLAVOURS))"; \
} >> $(call list,.base)
@p="$(call kpackages,$(THE_KMODULES) $(BASE_KMODULES),$(KFLAVOURS))"; \
echo -e "\n## added by build-distro.mk\n$$p" >> $(call list,.base)
dot-disk:
@mkdir -p files/.disk

View File

@@ -0,0 +1,14 @@
#!/bin/sh
# provide mkisofs with image contents sort order hints
### split over features or leave in a single piece?
# NB: only a single space/tab in between, no trailing whitespace
cat > /tmp/isosort <<__EOF__
ALTLinux 0
Metadata 100
altinst 700
rescue 800
live 900
syslinux 1000
__EOF__

View File

@@ -1,3 +1,4 @@
Эта фича конфигурирует создание образа виртуального окружения (VE).
Дополняет финальную стадию сборки (lib/, image-scripts.d/).
Дополняет финальную стадию сборки (lib/, image-scripts.d/)
и тесно с ней связана.

View File

@@ -1,2 +1,3 @@
# hooked from ../../lib/sugar.mk
use/build-ve:
@$(call add_feature)

View File

@@ -6,6 +6,8 @@
# candidates:
# off: keytable
[ -x /sbin/chkconfig ] || exit 0
for i in network random syslogd random; do chkconfig $i on; done
for i in fbsetfont netfs rawdevices; do chkconfig $i off; done
:

View File

@@ -1,3 +1,4 @@
#!/bin/sh -e
# we don't need no gettys in OpenVZ VEs (might need one in LXC though)
subst 's,^[0-9]\+:[0-9]\+:respawn:/sbin/mingetty.*,#&,' /etc/inittab
[ -s /etc/inittab ] || exit 0
sed -i 's,^[0-9]\+:[0-9]\+:respawn:/sbin/mingetty.*,#&,' /etc/inittab

View File

@@ -5,9 +5,12 @@
# remote syslog if you do care for reliable data anyways)
# credits: vvk@, thresh@ (2010)
sed -i \
-e 's,/dev/tty12,/var/log/syslog/console,' \
-e 's,^.*/var/log/syslog/console$,#&,' \
-e 's,-/var/log/,/var/log/,g' \
-e 's,/var/log/,-/var/log/,g' \
/etc/syslog.conf
CONFIG=/etc/syslog.conf
[ ! -f "$CONFIG" ] || \
sed -i \
-e 's,/dev/tty12,/var/log/syslog/console,' \
-e 's,^.*/var/log/syslog/console$,#&,' \
-e 's,-/var/log/,/var/log/,g' \
-e 's,/var/log/,-/var/log/,g' \
"$CONFIG"

View File

@@ -0,0 +1,6 @@
#!/bin/sh
[ -s /etc/fstab ] || cat >> /etc/fstab <<-EOF
proc /proc proc nosuid,noexec,gid=proc 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
EOF

View File

@@ -0,0 +1,11 @@
#!/bin/sh
# FIXME: there should be less brutal i18n tuning
cd /usr/share/locale
for i in */; do
case "$i" in
be*|en*|ru*|uk*) continue;;
esac
rm -r "$i"
done
:

View File

@@ -0,0 +1,6 @@
#!/bin/sh -efu
# remove extra packages from a bare livecd
list="$(rpmquery -a --qf='%{NAME}\n' $GLOBAL_CLEANUP_PACKAGES)"
[ -z "$list" ] || apt-get remove -f -y -- $list
:

View File

@@ -0,0 +1,3 @@
#!/bin/sh
# remove rpm, apt databases and cache
find /var/lib/rpm /var/lib/apt /var/cache/apt -type f -delete

View File

@@ -1,7 +1,12 @@
use/dev:
@$(call add_feature)
@$(call add,COMMON_PACKAGES,git-core hasher gear)
@$(call add,THE_PACKAGES,git-core hasher gear)
use/dev/mkimage: use/dev
@$(call add,COMMON_PACKAGES,mkimage)
@$(call add,LIVE_PACKAGES,shadow-change)
@$(call add,THE_PACKAGES,mkimage shadow-change)
use/dev/repo: use/dev use/repo/main
@$(call add,THE_PACKAGES,apt-repo)
@$(call add,MAIN_PACKAGES,rpm-build basesystem)
@$(call add,MAIN_PACKAGES,fakeroot sisyphus_check)
@$(call add,MAIN_PACKAGES,file make-initrd make-initrd-propagator)

View File

@@ -29,7 +29,7 @@ fi
# $TMP
TMP="/tmp/.private/$USER"
control pam_mktemp enabled
subst '/^%_tmppath.*tmp$/d' "$HOME/.rpmmacros"
sed -i '/^%_tmppath.*tmp$/d' "$HOME/.rpmmacros"
echo "%_tmppath $TMP" >> "$HOME/.rpmmacros"
# ~/hasher

View File

@@ -1,5 +1,9 @@
# tries to fill in ISO metadata in case it's the only inhabitant
use/dos: use/syslinux
@$(call add_feature)
@$(call add,SYSLINUX_CFG,dos)
@$(call add,SYSLINUX_FILES,/usr/lib/syslinux/memdisk)
@$(call add,STAGE1_PACKAGES,make-freedos-floppy glibc-gconv-modules)
@$(call try,META_SYSTEM_ID,DOS)
@$(call try,META_VOL_ID,FreeDOS 2.88M)
@$(call try,META_VOL_SET,FreeDOS)

View File

@@ -12,8 +12,8 @@ use/firmware/server: use/firmware
use/firmware/wireless: use/firmware
@$(call add,MAIN_PACKAGES,firmware-acx100)
@$(call add,MAIN_PACKAGES,firmware-i2400m)
@$(call add,MAIN_PACKAGES,firmware-carl9170)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-carl9170.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-ipw.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-iwl.*)
@#$(call add,MAIN_PACKAGES_REGEXP,firmware-iwl.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-rt.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-zd.*)

View File

@@ -1,4 +1,5 @@
use/hdt: use/syslinux use/memtest
# optimized out use/syslinux due to use/memtest
use/hdt: use/memtest
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,pciids)
@$(call add,SYSLINUX_MODULES,hdt)

View File

@@ -2,5 +2,9 @@ use/install2: use/stage2 sub/stage2/install2 use/cleanup/installer
@$(call add_feature)
@$(call set,INSTALL2_PACKAGES,installer-distro-$$(INSTALLER)-stage2)
@$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator)
@$(call add,MAIN_PACKAGES,branding-$$(BRANDING)-release)
@$(call add,BASE_PACKAGES,branding-$$(BRANDING)-release)
@$(call add,BASE_LISTS,$(call tags,basesystem))
### FR: curl-mini
use/install2/net: use/install2
@$(call add,INSTALL2_PACKAGES,curl)

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# FIXME: test run for installer-distro-altlinux-generic 6.0-alt2
# NB: grub is currently the default in ALT Linux
sed -i "s/^grub$/$GLOBAL_BASE_BOOTLOADER/" /usr/share/install2/installer-steps
sed -ri "s/^(grub|lilo)$/$GLOBAL_BASE_BOOTLOADER/" \
/usr/share/install2/installer-steps

View File

@@ -1,6 +1,3 @@
# remove rpm database
rm -rf /var/lib/rpm/*
# remove apt data files
rm -rf /var/cache/apt /var/lib*/apt
#!/bin/sh
# remove rpm, apt databases and cache
find /var/lib/rpm /var/lib/apt /var/cache/apt -type f -delete

View File

View File

@@ -0,0 +1,9 @@
Эта фича производит постобработку ISO-образа утилитой isohybrid
с целью обеспечения возможности его загрузки как с CD/DVD,
так и с USB-флэшки.
Можно указать в цепочке зависимостей дистрибутива явно с тем,
чтобы гарантировать гибридный вид образа; в экспериментальном
порядке сделана возможность запросить включение этой фичи при
сборке конфигурации произвольного дистрибутива
(ISOHYBRID=1, см. ../pack/config.mk).

View File

@@ -0,0 +1,3 @@
use/isohybrid:
@$(call add_feature)
@$(call add,POSTPROCESS_TARGETS,80isohybrid)

View File

@@ -0,0 +1,4 @@
CHROOT_PACKAGES += syslinux
postprocess-80isohybrid:
@isohybrid "$(IMAGEDIR)/$(IMAGE_OUTFILE)"

View File

@@ -1,3 +1,3 @@
use/isomd5sum:
@$(call add_feature)
@$(call add,POSTPROCESS_TARGETS,isomd5sum)
@$(call add,POSTPROCESS_TARGETS,90isomd5sum)

View File

@@ -1,4 +1,4 @@
CHROOT_PACKAGES += isomd5sum
postprocess-isomd5sum:
postprocess-90isomd5sum:
@implantisomd5 "$(IMAGEDIR)/$(IMAGE_OUTFILE)"

View File

@@ -1,18 +1,25 @@
+live: use/live/desktop; @:
# copy stage2 as live
use/live: use/stage2 sub/stage2/live
@$(call add_feature)
use/live/base: use/live use/syslinux/ui-menu
@$(call add,LIVE_LISTS,$(call tags,base && (live || network)))
use/live/desktop: use/live/base use/x11/xorg use/x11/wacom \
use/firmware use/virtualbox/guest \
use/power/acpi/button use/power/acpi/cpufreq
@$(call add,LIVE_LISTS,$(call tags,desktop && (live || network)))
# NB: there's an unconditional live/image-scripts.d/40-autologin script
# *but* it only configures some of the *existing* means; let's add one
use/live/autologin: use/live/base
# for the cases when there should be no display manager
use/live/autologin: use/live/desktop
@$(call add,LIVE_PACKAGES,autologin xinit)
use/live/icewm: use/live/autologin
@$(call add,LIVE_LISTS, \
$(call tags,(base || desktop) && (live || network || icewm)))
use/live/hooks: use/live
@$(call add,LIVE_PACKAGES,livecd-run-hooks)
# this is a manual installation script (text-based)
use/live/install: use/live/base
@$(call add,LIVE_PACKAGES,live-install)
use/live/ru: use/live
@$(call add,LIVE_PACKAGES,livecd-ru)

View File

@@ -0,0 +1,5 @@
#!/bin/sh
# if we're configured for running live hooks,
# there should be a place for them either
chkconfig livecd-run-hooks on >&/dev/null && mkdir /live.hooks ||:

View File

@@ -1,7 +1,10 @@
#!/bin/sh
#!/bin/sh -x
# * reset password for root
# * add user `altlinux' (without password)
NPG="nopasswdlogin"
GRPLIST="users scanner audio radio proc cdrom cdwriter wheel fuse $NPG"
verbose()
{
if [ -n "$GLOBAL_VERBOSE" ]; then
@@ -12,8 +15,9 @@ verbose()
add_user()
{
verbose "Add $1 user"
groupadd -r "$NPG"
local groups=
for g in users scanner audio radio proc cdrom cdwriter wheel fuse; do
for g in $GRPLIST; do
if groupmod $g 2>/dev/null; then
if [ -n "$groups" ]; then
groups="$groups,$g"

View File

@@ -1,11 +1,17 @@
#!/bin/sh -ef
if [ ! -x /usr/bin/X ]; then
echo "warning: autologin feature requested but X not installed" >&2
exit 0
fi
USER=altlinux
# setup runlevel
INITTAB=/etc/inittab
if [ -f "$INITTAB" ]; then
[ -z "$runlevel" ] && runlevel=5
subst "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
sed -i "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
fi
# autologin^2
@@ -16,6 +22,15 @@ AUTOLOGIN=yes
E_O_F
fi
# lightdm autologin
LIGHTDM_CONF=/etc/lightdm/lightdm.conf
if [ -f "$LIGHTDM_CONF" ]; then
sed -i \
-e "s/^#\(autologin-user=\).*$/\1$USER/" \
-e "s/^#\(autologin-user-timeout=0\)/\1/" \
"$LIGHTDM_CONF"
fi
# gdm2 autologin
GDM_CONF=/etc/X11/gdm/custom.conf
if [ -f "$GDM_CONF" ]; then

View File

@@ -1,6 +1,13 @@
#!/bin/sh -efu
# attempt to autoconfigure ethernet
[ -x /sbin/dhcpcd -o -x /sbin/dhclient ] || {
echo "NOT configuring DHCP for eth0" >&2
exit 0
}
echo "configuring DHCP for eth0" >&2
mkdir -p /etc/net/ifaces/eth0 && {
echo TYPE=eth
echo BOOTPROTO=dhcp

View File

@@ -0,0 +1,6 @@
#!/bin/sh
# we don't really need the kernel in live root,
# it's been booted already
rm -f /boot/*
:

View File

@@ -1,8 +1,11 @@
# stage2 mod: livecd
IMAGE_PACKAGES = $(COMMON_PACKAGES) \
$(LIVE_PACKAGES) \
$(call map,list,$(LIVE_LISTS) $(LIVE_MAIN_GROUPS)) \
STAGE2_KMODULES = $(THE_KMODULES) $(LIVE_KMODULES)
IMAGE_PACKAGES = $(COMMON_PACKAGES) $(THE_PACKAGES) $(LIVE_PACKAGES) \
$(call map,list, \
$(THE_LISTS) $(THE_GROUPS) \
$(LIVE_LISTS) $(LIVE_GROUPS)) \
interactivesystem
MKI_PACK_RESULTS = squash:live

View File

@@ -0,0 +1,10 @@
<html>
<head>
<meta http-equiv="refresh" content="3;url=http://www.altlinux.org/">
<title>Welcome to ALT Linux!</title>
</head>
<body>
<h1>Welcome to ALT Linux!</h1>
<p>You will be redirected to <a href="http://www.altlinux.org/">the home page</a> shortly.</p>
</body>
<html>

5
features.in/ltsp/README Normal file
View File

@@ -0,0 +1,5 @@
Эта фича обеспечивает добавление функций терминального сервера:
- загрузку бездисковых тонких клиентов по сети;
- предоставление им доступа к серверу приложений.
На данный момент является совсем экспериментальной.

View File

@@ -0,0 +1,10 @@
+ltsp: use/ltsp/base; @:
use/ltsp:
@$(call add,INSTALL2_PACKAGES,installer-feature-ltsp-stage2)
@$(call add,MAIN_LISTS,ltsp-client ltsp-client.$(ARCH))
@$(call add,BASE_LISTS,ltsp)
use/ltsp/base: use/ltsp use/firmware
@$(call add,BASE_LISTS,$(call tags,base network))
@$(call add,BASE_PACKAGES,apt-repo firefox)

View File

@@ -3,7 +3,9 @@ DISTRO_EXTS := .iso
use/pack:
@$(call add_feature)
use/pack/iso: use/pack boot/isolinux
# conventional ISO9660 image hybridization
# for direct bootable usbflash imaging
use/pack/iso: use/pack boot/isolinux $(ISOHYBRID:%=use/isohybrid)
ifeq (distro,$(IMAGE_CLASS))
@$(call set,IMAGE_PACKTYPE,isoboot)
else

View File

@@ -1,6 +1,9 @@
#!/bin/sh
# check relevant kernel features availability
GZ_OPTS="-comp gzip"
XZ_OPTS="-comp xz -b 524288 -noI"
# test for installer-required filesystems support
for opt in CONFIG_SQUASHFS CONFIG_AUFS_FS; do
if grep -q "^$opt=[my]$" /boot/config-*; then
@@ -16,7 +19,14 @@ done
# squashfs options: not really neccessary but better than none
# NB: this config file should be carried over into install2
if grep -q '^CONFIG_SQUASHFS_XZ=y$' /boot/config-*; then
echo "PACK_SQUASHFS_OPTS=-comp xz -Xbcj x86" > /.image/squashcfg.mk
# TODO: figure out if it's generally worth it even on x86:
# if binaries account for less than ~70% of blocks,
# the decompression filter overhead might hurt
# NB: there are arm, powerpc and some other filters too
if grep -q "^CONFIG_X86" /boot/config-*; then
XZ_OPTS="$XZ_OPTS -Xbcj x86"
fi
echo "PACK_SQUASHFS_OPTS=$XZ_OPTS" > /.image/squashcfg.mk
else
echo "PACK_SQUASHFS_OPTS=-comp gzip" >> /.image/squashcfg.mk
echo "PACK_SQUASHFS_OPTS=$GZ_OPTS" > /.image/squashcfg.mk
fi

View File

@@ -2,5 +2,5 @@
# prepare base make-initrd configuration for stage1
# see also http://www.altlinux.org/Make-initrd-propagator
subst 's/AUTODETECT/#AUTODETECT/' /etc/initrd.mk
sed -i 's/AUTODETECT/#AUTODETECT/' /etc/initrd.mk
echo 'FEATURES += propagator' >> /etc/initrd.mk

View File

@@ -5,7 +5,7 @@
# FIXME: move to plymouth feature
#if [ -f /etc/plymouth/plymouthd.conf ];then
# subst 's/#\([T\[]\)/\1/' /etc/plymouth/plymouthd.conf
# sed -i 's/#\([T\[]\)/\1/' /etc/plymouth/plymouthd.conf
# echo 'FEATURES += plymouth' >> /etc/initrd.mk
#fi

View File

@@ -1 +1,2 @@
timeout 200

View File

@@ -1,4 +1,5 @@
label live
menu label ^LiveCD (no hard disk needed)
kernel alt0/vmlinuz
append initrd=alt0/full.cz live ramdisk_size=@live_size@ fastboot stagename=live showopts automatic=method:cdrom
append initrd=alt0/full.cz fastboot live lowmem showopts automatic=method:cdrom ramdisk_size=@live_size@ stagename=live

View File

@@ -1,3 +1,4 @@
label harddisk
menu label ^Boot from hard drive as usual
localboot 0x80

View File

@@ -1,3 +1,4 @@
label removable
menu label Boot from ^removable drive
menu label Boot from removable ^drive
localboot 0x00

View File

@@ -1,8 +1,10 @@
label linux
menu label ^Install ALT Linux
kernel alt0/vmlinuz
append initrd=alt0/full.cz ramdisk_size=@altinst_size@ changedisk vga=0x314 quiet=1 showopts automatic=method:cdrom
append initrd=alt0/full.cz changedisk fastboot showopts automatic=method:cdrom quiet=1 ramdisk_size=@altinst_size@ vga=0x314
label noapic
menu label ^Failsafe install
kernel alt0/vmlinuz
append initrd=alt0/full.cz ramdisk_size=@altinst_size@ changedisk showopts nolapic noapic
append initrd=alt0/full.cz changedisk lowmem noapic nolapic showopts ramdisk_size=@altinst_size@

View File

@@ -1,6 +1,6 @@
label linux
menu label Install server-ovz via internet
label netinst
menu label Install server-ovz via inter^net
kernel alt0/vmlinuz
append initrd=alt0/full.cz ramdisk_size=131072 vga=0x314 quiet=1 showopts automatic=method:http,network:dhcp,server:ftp.linux.kiev.ua,directory:/pub/Linux/ALT/people/mike/iso/mkimage-profiles/netinst/server-ovz/x86_64
### ramdisk_size=@altinst_size@
### $(IMAGE_NAME)
append initrd=alt0/full.cz fastboot showopts automatic=method:http,network:dhcp,server:ftp.linux.kiev.ua,directory:/pub/Linux/ALT/people/mike/iso/mkimage-profiles/netinst/server-ovz/x86_64 quiet=1 ramdisk_size=131072 vga=0x314
### hardwired parameters and strings should become dynamic someday

View File

@@ -1,4 +1,5 @@
label rescue
menu label ^Rescue LiveCD
kernel alt0/vmlinuz
append initrd=alt0/full.cz live ramdisk_size=@rescue_size@ fastboot stagename=rescue showopts automatic=method:cdrom
append initrd=alt0/full.cz fastboot live showopts automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue

View File

@@ -1,4 +1,5 @@
label freedos
menu label Live ^FreeDOS
menu label Live Free^DOS
kernel memdisk
append initrd=freedos.img

View File

@@ -6,3 +6,4 @@ label hdt
com32 hdt.c32
append quiet
# no reed for "append pciids=pci.ids memtest=memtest", defaults are fine

View File

@@ -1,3 +1,4 @@
label memtest
menu label ^Memory Test
linux memtest.bin

View File

@@ -0,0 +1,3 @@
# check for shortcut overlaps
check:
@sed -n 's/^.*\^\(.\).*$$/\1/p' *.cfg | sort | uniq -c

View File

@@ -0,0 +1,16 @@
Здесь хранятся кусочки конфигурации для syslinux,
нужные из которых копируются с подстановкой значений
из метапрофиля в профиль и уже там в зависимости от
доступных модулей собираются в конфигурационный файл.
При изменении или добавлении просьба по оформлению
с тем, чтобы легче было отсматривать и сводить:
- параметры append перечисляются в следующем порядке:
+ initrd=...
+ по алфавиту те, что без аргументов
+ по алфавиту те, что имеют аргументы
- в конце файла пустая строка
Для проверки уникальности клавиатурных сокращений
служит команда "make check".

View File

@@ -2,6 +2,7 @@
use/syslinux: sub/stage1
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,syslinux)
@$(call try,META_SYSTEM_ID,SYSLINUX)
# UI is overwritten
use/syslinux/ui-%: use/syslinux

View File

@@ -51,14 +51,13 @@ all: prep debug
@### proper text branding should be implemented
@sed -i 's,@mkimage-profiles@,$(IMAGE_NAME),' $(DSTDIR)/*.cfg
@echo $(SYSLINUX_MODULES) > $(DSTDIR)/modules.list
@echo $(SYSLINUX_FILES) > $(DSTDIR)/files.list
@echo $(BOOTLOADER) > $(DSTDIR)/bootloader
@echo $(SYSLINUX_FILES) > $(DSTDIR)/syslinux.list
prep:
@mkdir -p $(DSTDIR)
debug:
@if test -n "$(DEBUG)"; then \
@if [ -n "$(DEBUG)" ]; then \
echo "** BOOTLOADER: $(BOOTLOADER)"; \
echo "** SYSLINUX_UI: $(SYSLINUX_UI)"; \
echo "** SYSLINUX_CFG: $(SYSLINUX_CFG)"; \

View File

@@ -7,33 +7,33 @@ MODDIR="/usr/lib/syslinux"
mkdir -p "$WORKDIR/syslinux"
cd "$WORKDIR/syslinux"
# validate just in case (written by ../../generate.mk)
BOOTLOADER="$(cat .in/bootloader)"
case "$BOOTLOADER" in
# validate just in case (see also stage1 Makefile)
case "$GLOBAL_BOOTLOADER" in
isolinux|syslinux) ;;
*) echo "$0: error: weird BOOTLOADER: $BOOTLOADER" >&2; exit 1;;
*) echo "error: weird GLOBAL_BOOTLOADER: \`$GLOBAL_BOOTLOADER'" >&2;
exit 1;;
esac
# copy extra files, if any
SYSLINUX_FILES="$(cat .in/files.list)"
if test -n "${SYSLINUX_FILES% }"; then
SYSLINUX_FILES="$(cat .in/syslinux.list)"
if [ -n "${SYSLINUX_FILES% }" ]; then
cp -a $SYSLINUX_FILES .
fi
# prune module-specific config snippets; skip built-in one
SYSLINUX_MODULES="$(cat .in/modules.list)"
if test -n "$SYSLINUX_MODULES"; then
if [ -n "$SYSLINUX_MODULES" ]; then
for module in $SYSLINUX_MODULES; do
if test "$modules" == "prompt"; then continue; fi
if [ "$modules" == "prompt" ]; then continue; fi
cp -a $MODDIR/$module.c?? . || rm .in/[0-9][0-9]$module.cfg
done
fi
# number ordering sponsored by shell's pathname expansion
grep -hv '^#' .in/[0-9][0-9]*.cfg > "$BOOTLOADER.cfg"
grep -hv '^#' .in/[0-9][0-9]*.cfg > "$GLOBAL_BOOTLOADER.cfg"
# snippets are not going into the actual image
if test "$DEBUG" != 2; then rm -r .in/; fi
if [ "$DEBUG" != 2 ]; then rm -r .in/; fi
# NB: there will be final macro expansion based on actual image sizes
# (done by ../../scripts.d/10-propagator-ramdisk)

View File

@@ -1,4 +1,4 @@
use/virtualbox/guest:
@$(call add_feature)
@$(call add,KMODULES,virtualbox-addition)
@$(call add,BASE_PACKAGES,virtualbox-guest-additions)
@$(call add,THE_KMODULES,virtualbox-addition)
@$(call add,THE_PACKAGES,virtualbox-guest-additions)

View File

@@ -1,10 +1,34 @@
+icewm: use/x11/icewm; @:
+razorqt: use/x11/razorqt use/x11/lightdm; @:
+tde: use/x11/tde use/x11/kdm; @:
use/x11/xorg:
@$(call add,BASE_LISTS,xorg)
@$(call add,THE_LISTS,xorg)
@$(call add,THE_KMODULES,drm)
use/x11/wacom: use/x11/xorg
@$(call add,THE_PACKAGES,xorg-drv-wacom)
### strictly speaking, runlevel5 should require a *dm, not vice versa
use/x11/runlevel5: use/x11/xorg
@$(call add,BASE_PACKAGES,installer-feature-runlevel5-stage3)
@$(call add,THE_PACKAGES,installer-feature-runlevel5-stage3)
### xdm: see also #23108
use/x11/xdm: use/x11/runlevel5
@$(call add,BASE_PACKAGES,xdm installer-feature-no-xconsole)
@$(call add,THE_PACKAGES,xdm installer-feature-no-xconsole)
### : some set()-like thing might be better?
use/x11/lightdm: use/x11/runlevel5
@$(call add,THE_PACKAGES,lightdm)
use/x11/kdm: use/x11/runlevel5
@$(call add,THE_PACKAGES,kdebase-kdm)
use/x11/icewm: use/x11/xorg
@$(call add,THE_LISTS,$(call tags,icewm desktop))
use/x11/razorqt: use/x11/xorg
@$(call add,THE_LISTS,$(call tags,razorqt desktop))
use/x11/tde: use/x11/xorg
@$(call add,THE_LISTS,$(call tags,tde desktop))

View File

@@ -10,6 +10,11 @@ MKI_VER_OPTIMAL = 0.2.0
include distcfg.mk
include functions.mk
ifeq (,$(realpath $(MKIMAGE_PREFIX)/config.mk))
$(error please apt-get install mkimage and have a look at QUICKSTART as well)
endif
include $(MKIMAGE_PREFIX)/config.mk
ifeq (-,$(shell rpmvercmp $(MKI_VERSION) $(MKI_VER_MINIMAL) | tr -d [0-9]))
@@ -42,12 +47,19 @@ include $(MKIMAGE_PREFIX)/targets.mk
pack-image: OUTDIR = $(IMAGEDIR)
pack-image: imagedir
copy-tree: $(SAVE_PROFILE:%=save-profile)
save-profile:
@mkdir -p files/.disk; \
git archive --prefix=mkimage-profile/ HEAD \
| gzip -9 > files/.disk/profile.tgz
.PHONY: imagedir postprocess debug
imagedir:
@mkdir -p "$(IMAGEDIR)"
postprocess: $(addprefix postprocess-,$(POSTPROCESS_TARGETS))
postprocess: | $(addprefix postprocess-,$(sort $(POSTPROCESS_TARGETS)))
@OUTPATH="$(IMAGEDIR)/$(IMAGE_OUTFILE)"; \
echo "** image: $$OUTPATH" >&2 && \
ln -sf "$(IMAGE_OUTFILE)" "$(IMAGEDIR)/$(IMAGE_LINK)" && \
@@ -60,5 +72,6 @@ postprocess: $(addprefix postprocess-,$(POSTPROCESS_TARGETS))
debug:
@echo "TOPDIR=$(TOPDIR)"
@echo "IMAGEDIR=$(IMAGEDIR)"
@echo "ARCH=$(ARCH)"
@echo "GLOBAL_HSH_APT_CONFIG=$(GLOBAL_HSH_APT_CONFIG)"

View File

@@ -1,7 +1,7 @@
# globals
PKGDIR := $(GLOBAL_BUILDDIR)/pkg
### duplicated from toplevel build.mk, log.mk for sake of "local" builds
# duplicated from metaprofile makefiles for the sake of "local" builds
ARCH ?= $(shell arch | sed 's/i686/i586/')
DATE ?= $(shell date +%Y%m%d)

View File

@@ -10,7 +10,7 @@ PREFS := $(.VARIABLES)
DISTCFG := $(.VARIABLES)
# a separator variable
-- := --
-- = --
.PHONY: dump-vars

View File

@@ -3,5 +3,5 @@
конфигурации образа и генерации соответствующего
профиля для сборки; см. тж. ../conf.d/.
Следует помнить, что будучи включаемыми в ../Makefile,
Следует помнить, что будучи включаемыми в ../main.mk,
они работают в каталоге верхнего уровня.

View File

@@ -6,8 +6,6 @@ ifndef MKIMAGE_PROFILES
$(error this makefile is designed to be included in toplevel one)
endif
export ARCH ?= $(shell arch | sed 's/i686/i586/')
# try not to bog down the system, both CPU and I/O wise
ifdef NICE
START := nice $(shell ionice -c3 echo "ionice -c3" 2>/dev/null)
@@ -22,37 +20,48 @@ START += time -f "%E %PCPU %Mk"
# /usr/bin/{i586,x86_64} are setarch(8) symlinks
START += $(ARCH)
# to be passed into distcfg.mk
IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
&& echo "$$HOME/out" \
|| echo "$(BUILDDIR)/out" )
# to be passed into distcfg.mk; suggestions are welcome
IMAGEDIR ?= $(shell \
if [ -d "$$HOME/out" -a -w "$$HOME/out" ]; then \
echo "$$HOME/out"; \
else \
dir="`dirname $(BUILDDIR)`/out"; \
mkdir -p "$$dir" && echo "$$dir" || echo "/tmp"; \
fi; \
)
# poehali
build: profile/populate
@echo -n "$(TIME) starting image build"
@if [ -n "$(DEBUG)" ]; then \
# actual build starter
# NB: our output MUST go into stderr to escape POSTPROC
build-image: profile/populate
@{ \
if [ -n "$(CHECK)" ]; then \
echo "$(TIME) skipping actual image build (CHECK is set)"; \
exit; \
fi; \
echo -n "$(TIME) starting image build"; \
if [ -n "$(DEBUG)" ]; then \
echo ": tail -f $(BUILDLOG)" $(SHORTEN); \
else \
if [ -n "$(ALL)" ]; then \
echo " [$(ALL)]"; \
else \
echo " (coffee time)"; \
fi; \
fi
@if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
echo " (coffee time)"; \
fi; \
if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
echo "$(TIME) done (`tail -1 $(BUILDLOG) | cut -f1 -d.`)"; \
tail -200 "$(BUILDLOG)" \
| GREP_COLOR="$(ANSI_OK)" \
grep --color=always '^\*\* image: .*' $(SHORTEN) ||:; \
tail -200 "$(BUILDLOG)" $(SHORTEN) \
| GREP_COLOR="$(ANSI_OK)" GREP_OPTIONS="--color=auto" \
grep '^\*\* image: .*' ||:; \
else \
echo "$(TIME) failed, see log: $(BUILDLOG)" $(SHORTEN); \
echo -n "$(TIME) failed, see log"; \
if [ -z "$(DEBUG)" ]; then \
echo "$(TIME) (you might want to re-run with DEBUG=1)"; \
echo ": $(BUILDLOG)" $(SHORTEN); \
echo "$(TIME) (you might want to rerun with DEBUG=1)"; \
else \
echo " above"; \
fi; \
tail -200 "$(BUILDLOG)" \
| GREP_COLOR="$(ANSI_FAIL)" \
egrep --color=always "^(E:|[Ee]rror|[Ww]arning).*"; \
| GREP_COLOR="$(ANSI_FAIL)" GREP_OPTIONS="--color=auto" \
egrep "^((E:|[Ee]rror|[Ww]arning).*)|(.* Stop\.)$$"; \
df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \
{ print "NB: low space on "$$6" ("$$5" used)"}}'; \
fi
@if [ -n "$(BELL)" ]; then echo -ne '\a' >&2; fi
fi; \
if [ -n "$(BELL)" ]; then echo -ne '\a'; fi; \
} >&2

View File

@@ -3,6 +3,8 @@
# drop stock predefined rules
.DEFAULT:
SYMLINK = build
# tmpfs-sparing extra rule: cleanup workdir after completing each stage
# (as packed results are saved this only lowers RAM pressure)
# NB: it's useful enough to be enabled by default in DEBUG abscence
@@ -17,23 +19,45 @@ endif
endif
# ordinary clean: destroys workdirs but not the corresponding results
# NB: our output MUST go into stderr to escape POSTPROC
clean:
@echo "$(TIME) cleaning up $(WARNING)"
@find -name '*~' -delete >&/dev/null ||:
@if [ -L build -a -d build/ ]; then \
$(MAKE) -C build $@ \
GLOBAL_BUILDDIR=$(shell readlink build) $(LOG) ||:; \
fi
@{ \
find -name '*~' -delete >&/dev/null ||:; \
if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
echo "$(TIME) cleaning up $(WARNING)"; \
$(MAKE) -C "$(SYMLINK)" $@ \
GLOBAL_BUILDDIR="$(realpath $(SYMLINK))" $(LOG) ||:; \
fi; \
} >&2
# there can be some sense in writing log here even if normally
# $(BUILDDIR)/ gets purged: make might have failed,
# and BUILDLOG can be specified by hand either
distclean: clean
@if [ -L build -a -d build/ ]; then \
rm -rf build/.git; \
$(MAKE) -C build $@ \
GLOBAL_BUILDDIR=$(shell readlink build) $(LOG) || \
rm -rf build/; \
rm -rf $(shell readlink build); \
fi
@rm -f build ||:
@{ \
if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
build="$(realpath $(SYMLINK)/)"; \
if [ "$$build" = / ]; then \
echo "** ERROR: invalid \`"$(SYMLINK)"' symlink" >&2; \
exit 128; \
else \
$(MAKE) -C "$(SYMLINK)" $@ \
GLOBAL_BUILDDIR="$$build" $(LOG) ||: \
rm -rf "$$build"; \
fi; \
fi; \
rm -f "$(SYMLINK)"; \
} >&2
# builddir existing outside read-only metaprofile is less ephemeral
# than BUILDDIR is -- usually it's unneeded afterwards so just zap it
postclean: build-image
@{ \
if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" ] || \
[ ! -L "$(SYMLINK)" -a "0$(DEBUG)" -lt 2 ]; then \
echo "$(TIME) cleaning up after build"; \
$(MAKE) -C "$(BUILDDIR)" distclean \
GLOBAL_BUILDDIR="$(BUILDDIR)" $(LOG) ||:; \
rm -rf "$(BUILDDIR)"; \
fi; \
} >&2

View File

@@ -11,22 +11,23 @@ sub/%:
@$(call add,SUBPROFILES,$(@:sub/%=%))
# install media bootloader
boot/%: profile/bare use/syslinux
boot/%:
@$(call set,BOOTLOADER,$*)
# fundamental targets
distro/.init: profile/bare
@$(call try,META_PREPARER,mkimage-profiles)
@$(call try,META_APP_ID,$(IMAGE_NAME))
@$(call set,META_PUBLISHER,ALT Linux Team)
# NB: the last flavour in KFLAVOURS gets to be the default one;
# the kernel packages regexp evaluation has to take place at build stage
distro/.base: distro/.init
@$(call set,KFLAVOURS,std-def)
# bootloader test target
distro/syslinux: distro/.init \
use/syslinux use/syslinux/localboot.cfg \
use/syslinux/ui-vesamenu use/hdt use/memtest
@$(call set,META_SYSTEM_ID,LINUX)
@$(call set,META_VOL_ID,ALT Linux $(ARCH))
@$(call set,META_VOL_SET,ALT Linux)
# something marginally useful (as a network-only installer)
# NB: doesn't carry stage3 thus cannot use/bootloader
@@ -34,4 +35,6 @@ distro/installer: distro/.base use/install2 use/syslinux/localboot.cfg
@$(call set,INSTALLER,altlinux-generic)
@$(call set,STAGE1_KMODULES_REGEXP,drm.*) # for KMS
distro/.installer: distro/installer use/bootloader/grub use/repo/main; @:
endif

View File

@@ -25,7 +25,7 @@ endef
set = $(and $(1),$(2),$(set_body))
define set_body
{ $(log_body); \
subst 's|^$(1)[ ]*[+?]*=.*$$|#& # overridden by $@|' "$(CONFIG)"; \
sed -i 's|^$(1)[ ]*[+?]*=.*$$|#& # overridden by $@|' "$(CONFIG)"; \
printf '%s = %s\n' '$(1)' '$(2)' >> "$(CONFIG)"; }
endef

12
lib/help.mk Normal file
View File

@@ -0,0 +1,12 @@
# this makefile holds the most helpful bits for the toplevel one
help/distro:
@echo '** available distribution targets:'; \
echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t
help/ve:
@echo '** available virtual environment targets:'; \
echo $(VES) | fmt -sw"$$((COLUMNS>>1))" | column -t
help: | help/distro help/space help/ve; @:
help/space:; @echo

View File

@@ -8,7 +8,7 @@ endif
BUILDLOG ?= $(BUILDDIR)/build.log
# LOG holds a postprocessor
# LOG holds a redirecting postprocessor
ifdef DEBUG
# 1) makefile target; 2) also passed to script hooks
GLOBAL_DEBUG := debug
@@ -27,3 +27,12 @@ DATE = $(shell date +%Y%m%d)
TIME = `date +%H:%M:%S`
export BUILDLOG DATE GLOBAL_DEBUG GLOBAL_VERBOSE LOG MAKE SHELL
# brevity postprocessor; not exported, for toplevel use only
SHORTEN = $(shell \
echo -n "| sed"; \
if [ -s "$(SYMLINK)" ]; then \
echo -n " -e 's,$(BUILDDIR),$(SYMLINK),'"; \
fi; \
echo -n " -e 's,$(TMP),\$$TMP,' -e 's,$(HOME),~,'"; \
)

View File

@@ -4,14 +4,23 @@ endif
SYMLINK = build
# this could have come from environment;
# if not, can be symlinked if r/w, or made anew
# this could have come from env; or could be symlinked; or is made anew
# (the reuse rationale is avoiding extra tmpdir lookups)
# NB: immediate assignment matters
# NB: PATH has no effect here
ifndef BUILDDIR
BUILDDIR := $(shell [ -s "$(SYMLINK)" ] \
&& realpath "$(SYMLINK)" \
|| bin/mktmpdir mkimage-profiles)
BUILDLINK := $(realpath $(SYMLINK))
BUILDDIR := $(shell \
if [ -s "$(SYMLINK)" -a "$(NUM_TARGETS)" = 1 ] && \
[ -n "$(findstring $(BUILDDIR_PREFIX).,$(BUILDLINK))" ]; \
then \
echo "$(BUILDLINK)"; \
else \
bin/mktmpdir $(BUILDDIR_PREFIX) || exit 127; \
fi; )
endif
ifeq (,$(BUILDDIR))
$(error suitable BUILDDIR unavailable)
endif
# even smart caching only hurts when every build goes from scratch
@@ -24,56 +33,58 @@ export BUILDDIR NO_CACHE PATH
CONFIG := $(BUILDDIR)/distcfg.mk
RC := $(HOME)/.mkimage/profiles.mk
# holds a postprocessor; shell test executes in particular situation
# NB: not exported, for toplevel use only
SHORTEN = $(shell \
if [ -s "$(SYMLINK)" ]; then \
echo "| sed 's,$(BUILDDIR),$(SYMLINK),'"; \
else \
echo "| sed 's,$(TMP),\$$TMP,'"; \
fi;)
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
# NB: our output MUST go into stderr to escape POSTPROC
profile/init: distclean
@echo -n "$(TIME) initializing BUILDDIR: "
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
@mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker
@{ \
if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \
echo "$(TIME) ERROR: invalid BUILDDIR: \`$(BUILDDIR)'"; \
exit 128; \
fi; \
echo -n "$(TIME) initializing BUILDDIR: "; \
rsync -qaxH --delete-after image.in/ "$(BUILDDIR)"/; \
mkdir "$(BUILDDIR)"/.mki; \
} >&2
@$(call put,ifndef DISTCFG_MK)
@$(call put,DISTCFG_MK = 1)
@if type -t git >&/dev/null; then \
@{ \
if type -t git >&/dev/null; then \
if [ -d .git ]; then \
git show-ref --head -d -s -- HEAD && \
git status -s && \
echo; \
fi $(LOG); \
fi
@{ \
fi; \
{ \
eval `apt-config shell $${APTCONF:+-c=$(wildcard $(APTCONF))} \
SOURCELIST Dir::Etc::sourcelist/f \
SOURCEPARTS Dir::Etc::sourceparts/d`; \
find "$$SOURCEPARTS" -name '*.list' \
| xargs egrep -Rhv '^#|^[[:blank:]]*$$' "$$SOURCELIST" && \
echo; \
} $(LOG)
@if type -t git >&/dev/null; then \
} $(LOG); \
if type -t git >&/dev/null; then \
if cd $(BUILDDIR); then \
git init -q && \
git add . && \
git commit -qam 'derivative profile initialized'; \
cd ->&/dev/null; \
fi; \
fi
@if [ -w . ]; then \
fi; \
if [ -w . ]; then \
rm -f "$(SYMLINK)" && \
ln -sf "$(BUILDDIR)" "$(SYMLINK)" && \
ln -s "$(BUILDDIR)" "$(SYMLINK)" && \
echo "$(SYMLINK)/"; \
else \
echo "$(BUILDDIR)/" $(SHORTEN); \
fi $(SHORTEN)
echo "$(BUILDDIR)/"; \
fi $(SHORTEN); \
} >&2
profile/bare: profile/init
@NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \
echo "$(TIME) preparing distro config$$NOTE" \
$(SHORTEN)
@{ \
NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \
echo "$(TIME) preparing distro config$$NOTE" $(SHORTEN); \
} >&2
@$(call try,MKIMAGE_PREFIX,/usr/share/mkimage)
@$(call try,GLOBAL_VERBOSE,)
@$(call try,IMAGEDIR,$(IMAGEDIR))
@@ -102,7 +113,7 @@ profile/dump-vars:
fi $(LOG)
# step 3 entry point: copy the needed parts into BUILDDIR
profile/populate: profile/init profile/finalize profile/dump-vars
profile/populate: profile/finalize profile/dump-vars
@for dir in sub.in features.in pkg.in; do \
$(MAKE) -C $$dir $(LOG); \
done

9
lib/report.mk Normal file
View File

@@ -0,0 +1,9 @@
# enable make target tracing
ifdef REPORT
TRACE_PREFIX := trace:building
OLD_SHELL := $(SHELL)
SHELL = $(info $(TRACE_PREFIX) $@$(if $^$|, -> $^ $|))$(OLD_SHELL)
# piggyback BUILDDIR back into supervising environment
$(info $(TRACE_PREFIX) BUILDDIR = $(BUILDDIR))
endif

View File

@@ -13,3 +13,6 @@ config/pack/%: use/pack/%
# just preconfigure
config/name/%:
@$(call set,IMAGE_NAME,$*)
# the final thing will pull the rest in
build: postclean; @:

View File

@@ -9,7 +9,11 @@ ifeq (ve,$(IMAGE_CLASS))
ve/.bare: profile/bare
@$(call add,BASE_PACKAGES,basesystem)
ve/bare: ve/.bare
@$(call add,BASE_PACKAGES,apt)
ve/generic: ve/.bare
@$(call add,BASE_PACKAGES,openssh-server openssh-blacklist openssh-clients)
@$(call add,BASE_LISTS,\
$(call tags,base && (server || network || security || pkg)))

74
main.mk Normal file
View File

@@ -0,0 +1,74 @@
# steps to build an image:
# --- here
# 1. initialize new profile (BUILDDIR) as a copy of image.in/
# 2. configure distro
# 3. copy the needed bits from metaprofile to a new profile
# --- in BUILDDIR
# 4. build subprofiles and subsequently an image
MKIMAGE_PROFILES = $(dir $(lastword $(MAKEFILE_LIST)))
# deal with one target at a time
IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz
ifeq (./,$(dir $(IMAGE_TARGET)))# convenience fallback
IMAGE_TARGET := distro/$(IMAGE_TARGET)# for omitted "distro/"
endif
IMAGE_CONF := $(firstword $(subst ., ,$(IMAGE_TARGET)))# ve/generic
IMAGE_CLASS := $(firstword $(subst /, ,$(IMAGE_TARGET)))# ve
IMAGE_FILE := $(lastword $(subst /, ,$(IMAGE_TARGET)))# generic.tar.gz
IMAGE_NAME := $(firstword $(subst ., ,$(IMAGE_FILE)))# generic
IMAGE_TYPE := $(subst $(IMAGE_NAME).,,$(IMAGE_FILE))# tar.gz
# readjustable
ifeq (1,$(NUM_TARGETS))
BUILDDIR_PREFIX ?= mkimage-profiles.build
else
BUILDDIR_PREFIX ?= mkimage-profiles.build/$(IMAGE_CONF).$(ARCH)
endif
# preferences
-include $(HOME)/.mkimage/profiles.mk
# most of the actual work done elsewhere
include lib/*.mk
include conf.d/*.mk
include features.in/*/config.mk
DISTRO_TARGETS := $(shell sed -n 's,^\(distro/[^:.]\+\):.*$$,\1,p' \
lib/distro.mk $(wildcard conf.d/*.mk) | sort -u)
VE_TARGETS := $(shell sed -n 's,^\(ve/[^:.]\+\):.*$$,\1,p' \
lib/ve.mk $(wildcard conf.d/*.mk) | sort -u)
DISTROS := $(call addsuffices,$(DISTRO_EXTS),$(DISTRO_TARGETS))
VES := $(call addsuffices,$(VE_EXTS),$(VE_TARGETS))
IMAGES := $(DISTROS) $(VES)
.PHONY: $(IMAGES) $(DISTRO_TARGETS) $(VE_TARGETS)
.PHONY: debug everything help space
### duplicate but still needed
everything:
@n=1; sum=$(words $(DISTROS)); \
for distro in $(DISTROS); do \
echo "** building $$distro [$$n/$$sum]:"; \
$(MAKE) -f main.mk --no-print-directory $$distro; \
[ "$$n" -lt "$$sum" ] && echo; \
n=$$(($$n+1)); \
done
# config/with/ve/generic config/like/ve config/name/generic config/pack/tar.gz
$(IMAGES): debug \
config/with/$(IMAGE_CONF) \
config/like/$(IMAGE_CLASS) \
config/name/$(IMAGE_NAME) \
config/pack/$(IMAGE_TYPE) \
build; @:
# convenience shortcut
$(DISTROS:distro/%=%): %: distro/%; @:
debug:
ifeq (2,$(DEBUG))
@$(foreach v,\
$(filter IMAGE_%,$(sort $(.VARIABLES))),\
$(warning $v = $($v)))
endif

View File

@@ -10,9 +10,10 @@ SUFFIX := pkg/groups
TARGET := $(BUILDDIR)/$(SUFFIX)
all: $(GLOBAL_DEBUG)
@if [ -n "$(MAIN_GROUPS)" ]; then \
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
mkdir -p $(TARGET) && \
cp -at $(TARGET) -- $(addsuffix .directory,$(MAIN_GROUPS)); \
cp -at $(TARGET) -- \
$(addsuffix .directory,$(THE_GROUPS) $(MAIN_GROUPS)); \
if type -t git >&/dev/null && cd $(TARGET); then \
if [ -n "`git status -s`" ]; then \
git add . && \
@@ -23,4 +24,5 @@ all: $(GLOBAL_DEBUG)
fi
debug:
@echo "** THE_GROUPS: $(THE_GROUPS)"
@echo "** MAIN_GROUPS: $(MAIN_GROUPS)"

View File

@@ -9,35 +9,14 @@ include $(BUILDDIR)/distcfg.mk
SUFFIX := pkg/lists
TARGET := $(BUILDDIR)/$(SUFFIX)
all: $(TARGET) $(GLOBAL_DEBUG)
@# env | sort -u | grep _LISTS | xargs cp
@$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\
$(shell cp --parents -at $(TARGET) \
-- $(value $V))))
@# construct .base packagelist for alterator-pkg
@{ \
echo "## generated by pkg.in/lists/Makefile"; \
if [ -n "$(BRANDING)" ]; then \
echo "branding-$(BRANDING)-release"; \
fi; \
if [ -n "$(SYSTEM_PACKAGES)" ]; then \
echo -e "\n## SYSTEM_PACKAGES\n$(SYSTEM_PACKAGES)"; \
fi; \
if [ -n "$(COMMON_PACKAGES)" ]; then \
echo -e "\n## COMMON_PACKAGES\n$(COMMON_PACKAGES)"; \
fi; \
if [ -n "$(BASE_PACKAGES)" ]; then \
echo -e "\n## BASE_PACKAGES\n$(BASE_PACKAGES)"; \
fi; \
if [ -n "$(BASE_LISTS)" ]; then \
echo -e "\n## BASE_LISTS"; cat $(BASE_LISTS); \
fi; \
} | sed -re '/^[^[:space:]#]/ s/[[:space:]]+/\n/g' >$(TARGET)/.base
@if [ -n "$(MAIN_GROUPS)" ]; then \
cp -at $(TARGET) -- $(MAIN_GROUPS); \
fi
# Metadata/ needed only for installers (and not for e.g. syslinux.iso)
# FIXME: installable live needs it too, don't move to install2 feature
### see also .../features.in/build-distro/lib/build-distro.mk
ifneq (,$(findstring install2,$(FEATURES)))
DOTBASE := dot-base
endif
all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE) copy-lists copy-groups
@if type -t git >&/dev/null && cd $(TARGET); then \
if [ -n "`git status -s`" ]; then \
git add . && \
@@ -46,6 +25,35 @@ all: $(TARGET) $(GLOBAL_DEBUG)
cd - >&/dev/null; \
fi
copy-lists:
@# env | sort -u | grep _LISTS | xargs cp
@$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\
$(shell cp --parents -at $(TARGET) \
-- $(value $V))))
copy-groups:
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
cp -at $(TARGET) -- $(THE_GROUPS) $(MAIN_GROUPS); \
fi
# args: name, suffix, command
define dump-THEM
if [ -n "$($(1)_$(2))" ]; then echo -e "\n## $(1)_$(2)"; $(3) $($(1)_$(2)); fi;
endef
dump-PACKAGES = $(call dump-THEM,$(1),PACKAGES,echo)
dump-LISTS = $(call dump-THEM,$(1),LISTS,cat)
dot-base:
@# construct .base packagelist for alterator-pkg
@{ \
echo "## generated by pkg.in/lists/Makefile"; \
$(foreach p,SYSTEM COMMON THE BASE,$(call dump-PACKAGES,$(p))) \
$(foreach l,THE BASE,$(call dump-LISTS,$(l))) \
} | sed -re '/^[^[:space:]#]/ s/[[:space:]]+/\n/g' >$(TARGET)/.base
# do beforehand as foreach gets expanded before recipe execution
$(TARGET):
@mkdir -p $(TARGET)

Some files were not shown because too many files have changed in this diff Show More