Compare commits

...

122 Commits

Author SHA1 Message Date
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
Michael Shigorin
ae85287f97 0.5.1-alt1
- generic VE archive type (added cpio and xz either)
- minor additions/fixes
2011-12-02 20:08:17 +02:00
Michael Shigorin
8790a90cee pkgdups.sh and semi-random tagged pkglists shuffle
The bin/pkgdups.sh script comes from m-p-d in considerably optimized
form and is to be used with the pkglist files of interest passed
as its arguments to produce a "hall of duplicates" among those.

The tagged lists received some updates along the rescue image lines,
most of those are actually inspired by http://rescuecd.pld-linux.org/
and to lesser extent a few articles on rescue/recovery/forensics
software -- so some newcomers are even employed already.
2011-12-02 20:02:55 +02:00
Michael Shigorin
5bc3dc24dd repo: generate RPM-GPG-KEY as well
Just a hook to export alt-gpgkeys pubring data.
2011-12-02 17:46:04 +02:00
Michael Shigorin
3a5740d840 initial virtualbox feature
This sketch quickly pulls virtualbox guest additions in
the installed system; should probably be extended with
other VM support...
2011-12-02 17:46:04 +02:00
Michael Shigorin
e9fea01685 live tweaks for x11 rescue
New stuff:
* distro/live-icewm -- basic icewm livecd with autologin;
* distro/live-rescue -- yet another gparted^Wrescue CD.

A better part of base+rescue tagged pkglist split off into
extra+rescue where the content belongs.

Thanks ruslandh@ for proposing to do a graphical rescue with some
particular tools (albeit qt4-fsarchiver clearly needs more work).
2011-12-02 17:46:04 +02:00
Michael Shigorin
cd998fef41 initial live autologin
use/live/autologin target tries hard to configure any available
autologin means, including a dedicated package and a few DMs.

Thanks gns@ as liveflash.eeepc got robbed somewhat.
2011-12-02 17:46:04 +02:00
Michael Shigorin
3d982dabba conf/live.mk: minor refactoring
distro/live-builder target used to employ a few duplicated
packages that might make it to a list but as the list would
have only a single user so far these were moved to a target-
specific variable (hm, weird but "private" modifier broke).
2011-12-02 17:45:41 +02:00
Michael Shigorin
a543c9d5fb conf.d/README: minor clarification
COMMON_PACKAGES make it into basesystem like BASE_PACKAGES,
not just into RPMS.main like MAIN_PACKAGES.
2011-11-25 09:31:11 +02:00
Michael Shigorin
f9a8aaa4e0 spec: updated Url:
It's official now.
2011-11-24 22:23:10 +02:00
Michael Shigorin
7e78670e4b added support for cpio and xz
Actually this is the proper rewrite that was looming ever since
tgz support was introduced: there are multiple archive formats
supported by mkimage, and there are multiple compression methods
available as well.

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

Thanks dkr@ and mithraen@ for the inspiration of this evening.
2011-11-24 22:19:32 +02:00
Michael Shigorin
041d57542a Makefile: get help back up
Partially reverts "Makefile: presume a distro by default" commit:
plain `make' should better help the user to decide the target
rather than rush to build them all upon her.
2011-11-24 22:09:15 +02:00
Michael Shigorin
7e219c14f1 lib/distro.mk: don't do localboot by default
distro/.base target used to pull in localboot syslinux config
snippet which might be too early for some of the further distros;
it's a quite fragile equilibrium which was shifted a bit by imz@
(see #26606).  Feel free to reopen the discussion though, things
might be tweaked so that localboot might be desirable on almost
every image even if with lower priority...
2011-11-24 15:44:19 +02:00
Michael Shigorin
bc8251f3f8 features.in/syslinux: bump livecd boot priority
As noted by imz@ in #26608, a LiveCD is the more preferred
boot target to a local drive usually (just as was discussed
and implemented for ALT Linux 4.0 IIRC).
2011-11-24 13:11:17 +02:00
Michael Shigorin
3d78fd75e4 introduced live-install support
It was actually trivial given that the script was already
maintained as a package by enp@ and msp@; its usage requires
one to manually partition the target disk and optionally
mkswap in advance.
2011-11-24 13:11:16 +02:00
Michael Shigorin
4f6e1af23b features.in/power: use installer-feature-cpufreq
This tweak follows zerg@'s question whether it's possible
to employ i-f-cpufreq-stage3 (which pulls in cpufreq-simple too
but also tweaks the default governor for AMD CPUs as recommended
by kernel folks); see also this discussion:
http://lists.altlinux.org/pipermail/community/2011-November/thread.html#673459
2011-11-22 14:49:25 +02:00
Michael Shigorin
9626b284ef gear-store-tags 2011-11-21 14:26:54 +02:00
Michael Shigorin
48272c7119 0.5.0-alt1
- add_feature for autoregistration (simple but invasive)
- added features: isomd5sum, repo, systemd
- changed features: powerbutton -> power
2011-11-21 14:25:43 +02:00
Michael Shigorin
10b9e293b0 Makefile: presume a distro by default
When ve/ support was introduced, a simple "make icewm.iso"
had to turn into the more elaborate "make distro/icewm.iso".
This latter one involves several keystrokes more, which is
not even (environ)mentally friendly.

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

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

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

Please suggest a more elegant solution if you invent one!
2011-11-21 14:25:06 +02:00
Michael Shigorin
b52ff4ef91 lib/build.mk: different colours for different outcomes
As was (quite reasonably) asked by someone and me too,
why should a successful build yield a *red* line
(a grep's default)?

So now it's new and improved, 25% free and so forth:
with a successful build you get a green line, while
errors from a broke one result in red ones.

Clinically tested in both b/w and w/b colour schemes;
in case you're not satisfied, please return original
ANSI_OK and ANSI_FAIL values to the colour dealer
and pass your favourite ones instead.
2011-11-21 13:52:41 +02:00
Michael Shigorin
ad68750855 experimental server-ovz-netinst image
It's now possible to:
- make distro/server-ovz.iso;
- make distro/server-ovz-netinst.iso;
- publish the former image's contents on ftp.linux.kiev.ua;
- boot the latter (~17M) image and enjoy the netinstall ;-)

The catch is that the stage2 (altinst file) location has to be
hardwired into syslinux config snippet for things to happen
automatically -- even if it can be specified manually in case
of failure.

The other catch is that currently a netinstall image is somewhat
tied to the particular image it installs since stage1 kernel and
stage2 modules must correspond strictly (the typical symptoms of
the glitch would be missing mouse driver and weird "permission
denied" errors during an attempt to partition the hard drives).

It might be desirable to provide multi-distro netinstall image...
2011-11-19 22:05:11 +02:00
Michael Shigorin
9cedefdba9 introduced add_feature function
The features might get copy-pasted (or even copied-and-pruned)
when initialized; there's an unneccessary duplication of the
function name in the line adding it to FEATURES list, thus
prone to being forgotten and causing some havoc later on.

It was wrong in the first place but tackling this with some
double-colon rules ran into terminality issues, and further
tortures were considered unneccessary.

The current solution isn't perfect (no completely transparent
function name registration upon corresponding target being called)
but at least it is an improvement...
2011-11-19 11:47:29 +02:00
Michael Shigorin
781c98bb3d server-ovz: rebase onto server-mini
The culprit was missing dhcpcd, although the rest
of niceties already in server-mini were welcome to
server-ovz either.
2011-11-19 11:47:19 +02:00
Michael Shigorin
c4a5515b64 tagged scripts breakage partially fixed
It appears that features.in/Makefile functioned a bit
differently by now than was described back then: after
loops and pushds got rearranged for robustness, it stopped
to pick up a cleanup feature tagged script.

That particular script is now better de-tagged and simply
placed as a script to be merged into install2 subprofile.

The tagged scripts still require a bit more comprehension
to understand the use cases (e.g., do we need per-subprofile
tagged script subdirs or just a toplevel one should be looked
at, with script names telling where to put them).

README used to mix up subprofiles and features; fixed.
2011-11-19 11:45:59 +02:00
Michael Shigorin
ae7139f8b6 initial repo feature
We've got some parts of it in build-distro feature,
and some went to dev feature for no real reason.

But a bare installer might go without package base,
and LiveCDs other than live-builder might find local
repository useful given aufs2 root overlay.

Now the overall scheme is more straightforward:
- a distro:
  + asks that a package repo be included
  + cares to further add the packages to it
- a repo feature:
  + pulls in sub/main for it to happen
  + provides genbasedir script to create repo metadata
  + supplements live feature with repo configuration
2011-11-19 11:45:59 +02:00
Michael Shigorin
7964bccb92 initial systemd feature
Thanks shaba@ for both the package and a wiki page,
and dek@ for the inspiration to finally get to it.
2011-11-19 11:45:50 +02:00
Michael Shigorin
7110ba77de minor pkglist/docs tweaks
server-base += openssh-slients
xorg += xorg-drv-wizardpen
2011-11-13 00:37:45 +02:00
Michael Shigorin
52f6897318 initial isomd5sum feature
This is a base for "media check" to become available:
using this feature will implant a checksum into the image
so that it can be verified during install.

Also added a test/demo distro/live-isomd5sum target.
For real distros an alterator module is probably due.
2011-11-11 19:50:54 +02:00
Michael Shigorin
f257b8e9df stage1/modules: added sdhci
This might be needed to install onto an SD card in a "native"
(non-USB-mediated) SD/MMC cardreader; thanks Vladimir Karpinsky
and gns@ for going over it for liveflash.eeepc case.
2011-11-09 21:20:53 +02:00
Michael Shigorin
94d2ca36aa image.in/Makefile: phonytize targets
It is a current convention to prefer clearly phony targets
(see the wiki page) so let's follow it here too.
2011-11-09 21:16:45 +02:00
Michael Shigorin
b85d82c219 features.in/power: renamed++ from powerbutton
This feature was handling powersave already, so the name
should be changed already.  Thanks sem@ for cpufreq-simple,
there's now a compelling reason for that rename.

Tweaked a few distro recipes accordingly.
2011-11-09 17:56:05 +02:00
Michael Shigorin
e2eef6eb71 gear-store-tags 2011-11-08 00:10:48 +02:00
Michael Shigorin
6782808223 0.4.3.2-alt1
- mkimage version required/checked
2011-11-08 00:08:30 +02:00
Michael Shigorin
7a8ac9e7e0 image.in/Makefile: mkimage version check
There's a recommended version (0.2.0+ currently) and also
the minimal version, 0.1.7, which received the important fixes.
It was proposed by nice antique@ folks IIRC.

Unfortunately the "suboptimal version" warning is pretty modest,
and "minimal version" error will be apparent with DEBUG enabled;
still the latter will terminate the downstream build and leave
a clear message in build.log at any rate.
2011-11-08 00:07:38 +02:00
Michael Shigorin
b3e4d9af0c 0.4.3.1-alt1
- CLEAN by default unless DEBUG
2011-11-07 14:56:09 +02:00
Michael Shigorin
ab70588f94 CLEAN by default (unless DEBUG)
CLEAN is so useful and fiddling with .work chroots does
demand knowledge (hsh-shell is handy btw); so unless we
really get our hands dirty, let's spare ours preciouss
tmpfss.
2011-11-07 12:28:09 +02:00
Michael Shigorin
4313629aac 0.4.3-alt2
- include %mpdir/ itself as well
2011-11-07 11:50:23 +02:00
Michael Shigorin
0301f08e87 gear-store-tags 2011-11-07 00:08:29 +02:00
Michael Shigorin
a91acf3de7 0.4.3-alt1
- enhancements to logging
- NICE variable: employ nice(1) and ionice(1) if available
- features.in/syslinux: banner tweaked to include target name
- features.in/live: set up unicode locale/consolefont
2011-11-07 00:06:54 +02:00
Michael Shigorin
ddf0c5b7c7 full-view docs update
- toplevel README received some long-needed refactoring
  + lowlevel detail moved, well, to lowlevel READMEs
- reflected more thoroughly that m-p is not about distros anymore
- dropped features.in/00example/README.en: it's already out-of-date
  a bit, and there's no perceived need in thorough English docs so far
- wiki article got split into parts and somewhat rewritten, links updated
- mv doc/{CodingStyle,style.txt}
2011-11-07 00:01:36 +02:00
Michael Shigorin
73f676f92c live: set up basic unicode locale
This only deals with console output (a text livecd doesn't ask
the user regarding the preferred language so far).

Refer to these discussions if needed:
https://bugzilla.altlinux.org/show_bug.cgi?id=25225
https://lists.altlinux.org/pipermail/devel-conf/2005-August/001785.html
2011-11-07 00:01:36 +02:00
Michael Shigorin
3c1bca535c downstream postprocessing symlinks tweaked
The bigger goal was being able to set up build in a way
that would allow for images (with configs and logs) be
deposited in per-IMAGE_NAME subdirectories of IMAGEDIR;
that's not done yet but a part of it is ready.

NB: in BUILDDIR, symlinking the just-built image is now
replaced with symlinking the IMAGEDIR since its location
is then predictable thus .gitignore-able for further work
on a generated profile, and more documentable as well.
It's not a hard change though, if you miss the image link
just drop me a note (or a commit).
2011-11-07 00:01:36 +02:00
Michael Shigorin
07fdc6dd9b further toplevel logging tweaks
Essentially some more polishing:
- image path extracted from downstream build log;
- extended error/warning regexp a bit so those with
  color grep options get even prettier output.

Notes:
- "1024" a magic number (briefly explained when introduced)
  moved to a sort of variable;
- "100 lines" for tail(1) is a rule-of-thumb taking into account
  typical amount of hasher/mkimage exhaust given GLOBAL_VERBOSE.
2011-11-07 00:01:36 +02:00
Michael Shigorin
cc8982dd7e tweaked variable logging
Preferences might be somewhat interesting too: while the official
ones shouldn't influence the build result at all, there's no whitelist
so all kinds of weirdness can be stuffed into local config in principle.
That should be diagnosable at least.
2011-11-07 00:01:36 +02:00
Michael Shigorin
cd3e47c562 introduced NICE variable
This one regulates the build wrapper: if the value is non-empty
then nice(1) and ionice(1) will be attempted so that the build
behaves better in regard to other tasks running on the system.

A few doc/variables.txt updates along the way.
2011-11-07 00:01:36 +02:00
Michael Shigorin
102aa3851d syslinux *.cfg: replace banner
Back then I didn't come up with anything smarter than
"mkimage-profiles 2.0" (with my tongue in a cheek),
but as m-p has grown up to 0.4 it's time to fix this.

When done properly, all of the string should be brandable
(with some sane default value inheriting from image name),
but let's do it at least bit by bit.
2011-11-07 00:01:36 +02:00
Michael Shigorin
30b1aa9be6 toplevel build report now timestamped
Thanks torabora@ for yet again seemingly obvious feature request
which strangely managed to evade implementation before.

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

NB: the actual downstream-make-calling rule would expand the "naive"
$(shell date) too early: the rule is evaluated before starting its
execution, and as it's the time consuming one the shell evaluation
was in need, not make's.  The result is less generally available
(needs to be double quoted and won't work inside e.g. awk programs)
but way more precise.
2011-11-07 00:01:36 +02:00
Michael Shigorin
813571cb10 dump sources.list to build.log
The seemingly obvious feature was proposed by torabora@.
APTCONF complicates things a bit of course...
(and was slightly kludgy btw; fixed)
2011-11-07 00:01:36 +02:00
Michael Shigorin
67a7f68e79 .gear/mkimage-profiles.spec: initial package
Also added to the live-builder ISO which is now self-hosted
(sans full repo): one can build an image capable of rebuilding
itself (which is not that useful) and of building other goodies
on some temporarily unused RAM-filled hardware (which is the goal).
2011-11-07 00:01:36 +02:00
Michael Shigorin
83392012d4 live-builder distro: your self-hosted livecd
If you make distro/live-builder.iso, the result is an image
containing almost everything (short of actual full enough
repository) to rebuild itself.  It will attempt to configure
eth0 with DHCP and reach http://ftp.altlinux.org for packages.

RAM requirements start with 2Gb, self-build is accomplished
on a 4Gb host with "make CLEAN=1 distro/live-builder.iso".

Packages required for "make distro/syslinux.iso" get included.

(some due fixups all over the place too)
2011-11-06 17:36:09 +02:00
Michael Shigorin
b6438b9c8f bin/mktmpdir: lower the space bar
With not-that-recent mkimage-profiles development,
it's no longer apparent that at least a gigabyte
of free space is required to build something useful
(at least for the tests, like syslinux.iso).

In short, the guesser cutoff margin is now 256M.
2011-11-06 17:36:09 +02:00
Michael Shigorin
08de714970 added doc/apt.conf.sample
Unfortunately apt configuration is not straightforward at all
regarding being overridden: one can't just provide sources.list
but needs a corresponding apt.conf along with it, and that apt.conf
must disable the SysV-style snippet directories to avoid interesting
side effects of all the things getting overlaid.

So it's not surprising that torabora has asked for an example...
(thanks go to boyarsh@ since I asked him for an example long ago)
2011-11-04 16:54:41 +02:00
Michael Shigorin
895fae7d82 BELL support
Implemented opportunistic alarm support as proposed by torabora;
the actual result depends on readline and/or terminal settings
(read up on "visual bell" vs "audible bell" in case it's wrong).

TODO: this ought to be shifted downstream when proper logging
framework is there.
2011-11-04 16:54:41 +02:00
Michael Shigorin
e8306860f1 introduced conf.d/ for distro, ve config snippets
This was asked for by Leo-sp50 and torabora, and seems quite reasonable:
let's provide means to keep at least some distribution configurations
a bit apart, so that these can be considered more standalone in terms
of hard warranted functionality but at the same time enjoying the common
infrastructure.

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

And before you ask: this might get extended to allow for "private"
out-of-tree configurations being included since apparently there
are goals with no meaning outside of some very particular context...
but otherwise I'd like to encourage getting reusable bits in-tree.
2011-11-04 16:54:41 +02:00
Michael Shigorin
6a280d758d stage2-based debug fixup
Employed double colon targets to eliminate
  warning: ignoring old commands for target `debug'
2011-11-04 16:54:41 +02:00
Michael Shigorin
912d86c4af features.in/syslinux: tweak 00gfxboot.cfg
The same change as in m-p-d f1c5dd0 (discussed in #22486).
Seems it wasn't the culprit regarding the "BIOS won't boot
off this DVD" but is also recommended in README.gfxboot.
2011-11-04 16:54:41 +02:00
Michael Shigorin
812883facc features.in/syslinux: new 10removable.cfg
Borrowed from wmsmall iso by kostyalamer@.
2011-11-04 16:54:41 +02:00
Michael Shigorin
ace2ee1fc1 features.in/Makefile: fixups
src/dst tags might have been empty confusing tags2lists;
the current implementation is more robust (along with
slightly better debug within bin/tags2lists itself).

pushd/popd spam tamed too (replaced by nice log messages).
2011-11-04 16:54:41 +02:00
Michael Shigorin
0a8490ad7f logging tweaks for better readability
...and create a symlink to a just-built image from builddir too.
2011-11-04 16:54:41 +02:00
Michael Shigorin
77115ff50b image.in/functions.mk: added ARCH dup
If the build is (re-)run withing generated profile directory,
the makefiles no longer have ARCH passed by upstream -- the
upstream might be unreachable at that point indeed.

This is unfortunate but we should cope with that.

NB: might be revisited when architecture-specific packagelists emerge
since currently there's no difference in package lists so we can just
re-run the build for a different architecture but this might change...
2011-11-04 16:54:41 +02:00
Michael Shigorin
7919df829c avoid "nothing to commit" in build.log
Typical (to-be-refactored when having settled down)
"cd/git .../cd -" sequences are tweaked to safeguard
against changing back without having actually changed to,
just in case.

features.in/Makefile left with pushd/popd due to its
three-level diving course (which somewhat asks to be
refactores in functions either but is intrinsically
somewhat complex OTOH).
2011-11-04 16:54:41 +02:00
Michael Shigorin
d5a5941f96 official {distro,ve}/* support
This is quite a large-scale change since mkimage-profiles got used to
baking distributions over the last year, and virtual environments are
quite different, so e.g. image.in/Makefile had to be split in two with
the main part of it moved into features.in/iso/lib/.

Short overview:

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

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

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

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

- reviewed, updated and extended docs
  + QUICKSTART: should be[come] a step-by-step guide
    (thanks Leo-sp50 for prodiving feedback)
2011-11-04 16:54:41 +02:00
Michael Shigorin
720a579690 wash, rinse, repeat
install2 cleanups:

- functionally indifferent ones: particularly, install2/*/98system's
  "mkdir -p /image" was superfluous as it was done by that time already
  by sub.in/stage2/image-scripts.d/00stage1

- taken apart, prepared for tags: so far it's a mostly moot change
  since the installer cleanup scripts themselves are mostly the same as
  preceding 90cleanup was (with some additions corresponding to recent
  kernel development); it's still unclear what the mechanism for
  configuring the cleanups in effect will be, either directory/package
  regex lists or tagged scripts excluded from execution by yet another tag

fixes:

- image.in/Makefile: fix metadata related test; the actual test was
  assuming that stage1 kernel means installer, which is not the case
  since generic stage2 introduction; oh well

- 85cleanup-lowmem: a "_" too much was the culprit in destroying the
  needed translations along with those deemed superfluous; thanks go to
  Oleg Ivanov and Lenar Shakirov for finding the bug and proposing the
  fix altogether

additions:

- features.in/Makefile: reworked help target; it was rather inaccessible
  due to BUILDDIR normally undefined at the time of direct make
  invocation, and BUILDDIR is normally defined during normal builds
  anyways so let's try it this way.

- README++

daydreams:

- 01-genbasedir: we should drop bzip2 compressed pkglists some day
  but see genbasedir and apt-cdrom first, 90-pkg.sh (alterator-pkg)
  will fail miserably otherwise
2011-11-04 16:15:31 +02:00
Michael Shigorin
b474bff468 iso.mk: low space hint on build failure
Just in case the build.log will be inobvious, and it's easy to diagnose
automatically.  Thanks Andrey Stroganov for this use case.

Thanks for improving the initial implementation go to raorn@ for kind
commit lynch and to Yuri Bushmelev for actually suggesting something
more concise.

BTW the "1024" magic number was taken out of thin air:
the "no free space" errors are most likely to happen while
forming/populating a chroot (apt/rpm errors out) and chroots are
roughly two orders of magnitude heftier than a megabyte.
2011-11-04 16:15:31 +02:00
Michael Shigorin
368cfd26bd syslinux: trivial cleanup
"echo ... | xargs cp -t" is a bit more complicated
compared to plain "copy ..."
2011-11-04 16:15:31 +02:00
186 changed files with 2224 additions and 940 deletions

101
.gear/mkimage-profiles.spec Normal file
View File

@@ -0,0 +1,101 @@
Name: mkimage-profiles
Version: 0.5.5
Release: alt1
Summary: ALT Linux based distribution metaprofile
License: GPLv2+
Group: Development/Other
Url: http://www.altlinux.org/Mkimage/Profiles/m-p
Source: %name-%version.tar
Packager: Michael Shigorin <mike@altlinux.org>
BuildArch: noarch
Requires: rsync git-core
Requires: time schedutils
Requires: mkimage >= 0.2.0
%define mpdir %_datadir/%name
%add_findreq_skiplist %mpdir/*.in/*
%description
mkimage-profiles is a collection of bits and pieces useful for
distributions construction: it contains package lists, features,
and whole subprofiles (like "rescue" building block) for you
to choose from, and some ready-made image recipes as well.
Make no mistake: constructing distributions isn't just fun, it takes
a lot of passion and knowledge to produce a non-trivial one. So m-p
(the short nick for mkimage-profiles) is complex too. If you need
-- or want -- to make just a few tweaks to an existing recipe, it might
be easier to comprehend the generated profile (aka builddir) which
contains only the needed subprofiles, script hooks and package lists
and is way more compact.
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
But if you're into regular distro hacking and are not afraid of make
and modest metaprogramming (some code generation and introspection),
welcome to the metaprofile itself; read the docs and get the git:
%url
%prep
%setup
%build
%install
mkdir -p %buildroot%mpdir
cp -a * %buildroot%mpdir
%files
%mpdir/
%doc doc/
%doc README QUICKSTART
%changelog
* 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
* Mon Nov 21 2011 Michael Shigorin <mike@altlinux.org> 0.5.0-alt1
- add_feature for autoregistration (simple but invasive)
- added features: isomd5sum, repo, systemd
- changed features: powerbutton -> power
* Tue Nov 08 2011 Michael Shigorin <mike@altlinux.org> 0.4.3.2-alt1
- mkimage version required/checked
* Mon Nov 07 2011 Michael Shigorin <mike@altlinux.org> 0.4.3.1-alt1
- CLEAN by default unless DEBUG
* Mon Nov 07 2011 Michael Shigorin <mike@altlinux.org> 0.4.3-alt2
- include %mpdir/ itself as well
* Mon Nov 07 2011 Michael Shigorin <mike@altlinux.org> 0.4.3-alt1
- enhancements to logging
- NICE variable: employ nice(1) and ionice(1) if available
- features.in/syslinux: banner tweaked to include target name
- features.in/live: set up unicode locale/consolefont
* Wed Nov 02 2011 Michael Shigorin <mike@altlinux.org> 0.4.2-alt1
- initial package

2
.gear/rules Normal file
View File

@@ -0,0 +1,2 @@
spec: .gear/mkimage-profiles.spec
tar: v@version@:.

View File

@@ -0,0 +1,6 @@
object 8473fda02d9c0e194ac54a95159ebf49df8a0ace
type commit
tag v0.5.4
tagger Michael Shigorin <mike@altlinux.org> 1326746252 +0200
apt-get install hasher

1
.gear/tags/list Normal file
View File

@@ -0,0 +1 @@
9e3e95942c73c5a2cca794e28935e6257cb37bc9 v0.5.4

View File

@@ -1,51 +1,38 @@
# steps to build a distribution image:
# --- here
# 1. initialize new profile (BUILDDIR) as a copy of image.in/
# 2. configure distro
# 3. copy subprofiles, script hooks, and package lists/groups
# from metaprofile to new profile (as needed)
# --- in BUILDDIR
# 4. build subprofiles and subsequently the image
# umbrella mkimage-profiles makefile:
# iterate over multiple goals/arches
all help:
@echo '** available distribution targets:'
@echo $(IMAGES) | fmt -sw"$$((COLUMNS>>1))" | column -t
# immediate assignment
ifndef ARCHES
ifdef ARCH
ARCHES := $(ARCH)
else
ARCHES := $(shell arch | sed 's/i686/i586/')
endif
endif
export ARCHES
# most of the actual work done elsewhere
include clean.mk
include profile.mk
include distro.mk
include log.mk
include iso.mk
# recursive make considered useful for m-p
MAKE += --no-print-directory
.PHONY: $(IMAGES)
.PHONY: clean distclean help
clean distclean help:
@$(MAKE) -f main.mk $@
# we can't use implicit rules for top-level targets, only for prereqs
# NB: what about static pattern rules?
# TODO: move into libdistro?
DISTROS := $(shell sed -n 's,^distro/\([^:.]\+\):.*$$,\1,p' distro.mk)
IMAGES := $(addsuffix .iso,$(DISTROS))
export NUM_TARGETS := $(words $(MAKECMDGOALS))
# to be passed into distcfg.mk
IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
&& echo "$$HOME/out" \
|| echo "$(BUILDDIR)/out" )
IMAGENAME ?= mkimage-profiles-$(ARCH).iso
everything:
@for i in $(IMAGES); do $(MAKE) BUILDDIR=$(BUILDDIR) $$i; done
$(IMAGES): %.iso: | profile/init distro/% boot/isolinux profile/populate iso
@# TODO: run automated tests (e.g. iso size)
@OUTNAME="$(@:.iso=)-$(DATE)-$(ARCH).iso"; \
OUTPATH="$(IMAGEDIR)/$$OUTNAME"; \
mkdir -p "$(IMAGEDIR)" && \
test -s "$(IMAGEDIR)/$(IMAGENAME)" && \
mv "$(IMAGEDIR)/$(IMAGENAME)" "$$OUTPATH" && \
echo "** image: $$OUTPATH" && \
ln -sf "$$OUTNAME" "$(IMAGEDIR)/$@" && \
ln -sf "$@" "$(IMAGEDIR)/mkimage-profiles.iso"; \
if [ -n "$(DEBUG)" ]; then \
cp -a "$(BUILDLOG)" "$$OUTPATH.log"; \
cp -a "$(CONFIG)" "$$OUTPATH.cfg"; \
fi
# real targets need real work
%:
@n=1; \
if [ "$(NUM_TARGETS)" -gt 1 ]; then \
n="`echo $(MAKECMDGOALS) \
| tr '[[:space:]]' '\n' \
| grep -nx "$@" \
| cut -d: -f1`"; \
echo "** goal: $@ [$$n/$(NUM_TARGETS)]"; \
fi; \
for ARCH in $(ARCHES); do \
if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then echo; fi; \
echo "** ARCH: $$ARCH"; \
$(MAKE) -f main.mk ARCH=$$ARCH $@; \
done; \
if [ "$$n" -lt "$(NUM_TARGETS)" ]; then echo; fi

34
QUICKSTART Normal file
View File

@@ -0,0 +1,34 @@
требуется
~~~~~~~~~
- ALT Linux 6.0 или выше (возможна адаптация "вниз")
- установленный mkimage (свежий, как и hasher)
- пользователь с правом запуска hasher
полезно
~~~~~~~
- смонтированный tmpfs на несколько гигабайт
+ например, в /tmp или /home/USER/hasher
+ каталог из prefix в /etc/hasher-priv/system
- установленный git-core
- настроенный ~/.gitconfig
команды
~~~~~~~
- от имени root:
# 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
ссылки
~~~~~~
- http://www.altlinux.org/tmpfs
- http://www.altlinux.org/hasher
- http://www.altlinux.org/mkimage
- http://www.altlinux.org/Mkimage/Profiles/m-p

68
README
View File

@@ -1,19 +1,23 @@
see also http://www.altlinux.org/Mkimage/Profiles/next
Welcome to mkimage-profiles!
quickstart: make server-base.iso
(NB: requires configured http://en.altlinux.org/Hasher)
English quickstart: make distro/server-base.iso;
see http://en.altlinux.org/Hasher (and a large tmpfs).
configurables: ~/.mkimage/profiles.mk,
Configurables: ~/.mkimage/profiles.mk;
see doc/profiles.mk.sample and libdistro.mk
license: GPLv2+, see COPYING
License: GPLv2+, see COPYING.
Most docs are in Russian, welcome to learn it or ask for English.
См. тж. http://www.altlinux.org/Mkimage/Profiles/m-p
Задача:
- конфигурирование и создание образов на базе ALT Linux
Концепция:
- конфигурация, как и образ -- объект постадийной сборки
- метапрофиль служит репозиторием для построения индивидуального
профиля, по которому создаётся итоговый дистрибутив
- для одноразовых модификаций можно подправить сгенерированный
профиль, для долгосрочной разработки стоит вливать правки
в метапрофиль (что требует больше навыков и времени)
профиля, по которому создаётся итоговый образ
Особенности:
- метапрофиль может быть полностью read-only при сборке
@@ -22,49 +26,35 @@ license: GPLv2+, see COPYING
он автономен относительно метапрофиля
Стадии работы:
- инициализация дистрибутивного профиля
- сборка конфигурации дистрибутива
- наполнение дистрибутивного профиля
- сборка дистрибутива
- инициализация сборочного профиля
- сборка конфигурации образа
- наполнение сборочного профиля
- сборка образа
Объекты:
- дистрибутивы:
+ описываются в distro.mk
+ могут основываться один на другом
+ включают один или более субпрофилей по надобности
- дистрибутивы и виртуальные окружения:
+ описываются в conf.d/*.mk или соответственно lib/{distro,ve}.mk
+ могут основываться одно на другом
+ дистрибутивы также:
- включают один или более субпрофилей по надобности
+ желательно избегать множественного наследования, см. тж. фичи
- субпрофили:
+ список собирается в $(SUBPROFILES)
+ базовые комплекты помещены в подкаталогах под sub.in/;
их наборы скриптов могут расширяться фичами
- stage1: propagator, ядро инсталятора и initrd в т.ч. с firmware
- stage2: базовый live-образ (и модули ядра, соответствующие stage1);
используется только с модификаторами (см. соответствующие фичи):
+ stage2/install2: инсталятор
+ stage2/live: LiveCD
+ stage2/rescue: спасательная система
- main: пакетная база к инсталяции (обязательная и дополнительная)
- фичи:
+ список собирается в $(FEATURES)
+ законченные блоки функциональности (или наборы таковых)
+ описываются в индивидуальных features.in/*/config.mk
+ могут зависеть друг от друга и требовать субпрофили
+ при сборке $(BUILDDIR) содержимое указанных в $(FEATURES) фич
(подкаталоги, соответствующие входящим в дистрибутив субпрофилям
под их итоговыми названиями -- например, live, а не stage2/live)
добавляется в профиль; затем выполняются generate.sh, generate.mk
- списки пакетов (*_LISTS): просьба по возможности избегать дублирования
NB: перечисленные в этих переменных файлы автоматически копируются
в порождаемый профиль => не следует указывать пакаджлисты напрямую
- индивидуальные пакеты (*_PACKAGES): следует крайне осторожно пользоваться
SYSTEM_PACKAGES -- эти пакеты попадут во все стадии, в том числе в образ
чувствительной к объёму install2 (в stage1 -- только в инструментальный
чрут); применяйте для того, что обязано быть и в инсталяторе, и в готовой
системе -- и не путайте с COMMON_PACKAGES (main, live, rescue)
+ могут требовать другие фичи, а также субпрофили
+ при сборке $(BUILDDIR) содержимое фич добавляется в профиль
- списки пакетов (*_LISTS):
+ просьба по возможности избегать дублирования
- индивидуальные пакеты (*_PACKAGES): см. тж. conf.d/README
Результат:
- при успешном завершении сборки образ называется сообразно
дистрибутиву и укладывается в $(IMAGEDIR):
- при успешном завершении сборки образ называется по имени цели
и укладывается в $(IMAGEDIR):
+ указанный явно,
+ либо ~/out/ (если возможно),
+ или $(BUILDDIR)/out/ иначе

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"
MINSIZE=1048576 # face control criterion
DIRS="$TMP $TMPDIR $HOME/hasher /tmp /var/tmp .."
MINSIZE=262144 # face control criterion
# pick existing, writeable, >1Gb free space dirs
# 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}.XXXXXXXXXX" --tmpdir="${DIR:-..}"
# 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%/.}"

20
bin/pkgdups.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
# a script to help weed out duplicate packages
# contained in package lists given as arguments
#
# Requires: libshell
. /bin/shell-quote
sort "$@" \
| grep -v '^ *#' \
| sed -s 's,[ ]\+, ,g' \
| grep -v '^ *$' \
| uniq -cd \
| while read num str; do
echo -n "$str: $num ";
pattern="`quote_sed_regexp "$str"`"
grep -l "^$pattern$" "$@" | tr '\n' ' '
echo
done \
| sort -rn -t: -k2

View File

@@ -29,4 +29,5 @@ transformed="$(sed \
-e "s, *( *, ( ,g" \
-e "s, *) *, ) ,g")"
[ "$DEBUG" = 2 ] && echo "`basename $0`: transformed = \"$transformed\"" >&2
[ -z "$transformed" ] || find $transformed | sed 's,^\./,,'

View File

@@ -1,32 +0,0 @@
# this makefile can be used standalone
# drop stock predefined rules
.DEFAULT:
# tmpfs-sparing extra rule: cleanup workdir after completing each stage
# (as packed results are saved this only lowers RAM pressure)
ifdef CLEAN
export GLOBAL_CLEAN_WORKDIR = clean-current
ifdef DEBUG
WARNING = (both CLEAN and DEBUG defined, debug options will be limited)
endif
endif
# ordinary clean: destroys workdirs but not the corresponding results
clean:
@echo '** 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
# 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 -r $(shell readlink build); \
fi
@rm -f build

34
conf.d/README Normal file
View File

@@ -0,0 +1,34 @@
Этот каталог содержит включаемые фрагменты конфигурации образов с тем,
чтобы было удобнее параллельно разрабатывать специфические дистрибутивы
и VE без излишних merge conflict'ов.
Следует понимать, что основная цель появления mkimage-profiles на свет
-- это уменьшение "форков" внутри семейства дистрибутивных профилей.
Поэтому при возможности следует всё-таки работать над общей базовой
частью, включая скриптовые хуки и списки пакетов, а также оптимизировать
граф зависимостей между конфигурациями образов.
Попросту говоря, copy-paste -- тревожный признак.
По переменным:
- SYSTEM_PACKAGES стоит применять крайне осторожно -- эти пакеты попадут
во все стадии, в том числе в образ чувствительной к объёму install2
(в stage1 -- только в инструментальный чрут); применяйте для того,
что обязано быть и в инсталяторе, и в готовой системе
- для "обычного общего" (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) и востребовании
значений; в этом случае их значения могут изменяться до окончания
конфигурации, а также зависеть от значений других переменных

23
conf.d/desktop.mk Normal file
View File

@@ -0,0 +1,23 @@
# desktop distributions
ifeq (distro,$(IMAGE_CLASS))
distro/desktop-base: distro/installer use/repo/main \
use/syslinux/ui-vesamenu use/x11/xorg use/bootloader/grub
@$(call set,INSTALLER,desktop)
distro/desktop-mini: distro/desktop-base \
use/lowmem use/x11/xdm use/bootloader/lilo \
use/power/acpi/button use/cleanup/alterator
distro/icewm: distro/desktop-mini
@$(call add,BASE_LISTS,$(call tags,icewm desktop))
distro/ltsp-icewm: distro/icewm use/ltsp use/firmware
@$(call add,BASE_LISTS,$(call tags,base network))
@$(call add,BASE_LISTS,ltsp)
@$(call add,BASE_PACKAGES,apt-repo)
@$(call add,BASE_PACKAGES,firefox)
distro/desktop-systemd: distro/icewm use/systemd
endif

46
conf.d/live.mk Normal file
View File

@@ -0,0 +1,46 @@
# 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-x11: distro/live use/live/autologin use/power/acpi/button
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
@$(call add,LIVE_LISTS,$(call tags,base && (server || builder)))
@$(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))
distro/live-install: distro/.base use/live/base use/syslinux/localboot.cfg
@$(call add,LIVE_PACKAGES,live-install)
distro/live-icewm: distro/.live-x11
@$(call add,LIVE_LISTS, \
$(call tags,(base || desktop) && (live || network || icewm)))
distro/live-razorqt: distro/.live-x11
@$(call add,LIVE_LISTS, \
$(call tags,(base || desktop) && (live || network || razorqt)))
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-x11 use/live/hooks
@$(call add,LIVE_PACKAGES,livecd-webkiosk)
@$(call add,LIVE_PACKAGES,fonts-ttf-dejavu fonts-ttf-droid)
endif

38
conf.d/server.mk Normal file
View File

@@ -0,0 +1,38 @@
# server distributions
ifeq (distro,$(IMAGE_CLASS))
distro/server-base: distro/installer use/repo/main \
use/syslinux/ui-menu use/memtest use/bootloader/grub
@$(call add,BASE_LISTS,server-base)
distro/server-mini: distro/server-base use/cleanup/x11-alterator
@$(call set,KFLAVOURS,el-smp)
@$(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))
distro/server-systemd: distro/server-mini use/systemd
distro/server-ovz: distro/server-mini \
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,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,INSTALL2_PACKAGES,curl) ### should become curl-mini
@$(call add,BASE_LISTS,ovz-server)
@$(call add,MAIN_LISTS,kernel-wifi)
@$(call add,MAIN_GROUPS,dns-server http-server ftp-server kvm-server)
@$(call add,MAIN_GROUPS,ipmi mysql-server dhcp-server mail-server)
@$(call add,MAIN_GROUPS,monitoring diag-tools)
# tiny network-only server-ovz installer (stage2 comes over net too)
distro/server-ovz-netinst: distro/.base sub/stage1 use/stage2 \
use/syslinux/ui-menu use/syslinux/localboot.cfg use/memtest
@$(call add,SYSLINUX_CFG,netinstall2)
endif

View File

@@ -1,86 +0,0 @@
# this makefile is designed to be included in toplevel one
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
# step 2: build up distribution's configuration
# NB: distro/ targets should be defined in this file,
# see toplevel Makefile's $(DISTROS) assignment
CONFIG = $(BUILDDIR)/distcfg.mk
# collect use/% (source initial feature snippets)
-include features.in/*/config.mk
# put(), add(), set(), try(), tags():
# package list names are considered relative to pkg/lists/;
# tags can do boolean expressions: (tag1 && !(tag2 || tag3))
include functions.mk
# distro/.%, sub/.%, boot/%
include libdistro.mk
# bootloader test target; requires recent mkimage to build
distro/syslinux: distro/.init distro/.branding sub/stage1 \
use/syslinux use/syslinux/localboot.cfg \
use/syslinux/ui-vesamenu use/hdt use/memtest use/dos
# $(VAR) will be substituted before writing them to $(CONFIG);
# $$(VAR) will remain unsubstituted until $(CONFIG) is included
# and their value requested (so the variable referenced
# can change its value during configuration _before_
# it's actually used); just peek inside $(CONFIG) ;-)
# BASE_PACKAGES, BASE_LISTS, MAIN_PACKAGES, MAIN_LISTS: see sub.in/main/
# live images
distro/live: distro/.base use/live use/syslinux/ui-menu
distro/rescue: distro/.base use/rescue use/syslinux/ui-menu
distro/dos: sub/stage1 use/dos use/syslinux/ui-menu
# something actually useful (as a network-only installer)
# NB: doesn't carry stage3 thus cannot use/bootloader
distro/installer: distro/.base use/install2
@$(call set,INSTALLER,altlinux-generic)
@$(call set,STAGE1_KMODULES_REGEXP,drm.*) # for KMS
# server distributions
distro/server-base: distro/installer sub/main \
use/syslinux/ui-menu use/memtest use/bootloader/grub
@$(call add,BASE_LISTS,server-base)
distro/server-mini: distro/server-base use/cleanup/x11-alterator
@$(call set,KFLAVOURS,el-smp)
@$(call add,KMODULES,e1000e igb)
@$(call add,BASE_LISTS,\
$(call tags,base && (server || network || security || pkg)))
@$(call add,BASE_LISTS,$(call tags,extra network))
distro/server-ovz: distro/server-base \
use/hdt use/rescue use/firmware/server use/powerbutton/acpi \
use/cleanup/x11-alterator
@$(call set,STAGE1_KFLAVOUR,std-def)
@$(call set,KFLAVOURS,std-def ovz-el)
@$(call add,KMODULES,bcmwl e1000e igb ndiswrapper rtl8168 rtl8192)
@$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,KMODULES,drbd83 kvm)
@$(call add,BASE_LISTS,ovz-server)
@$(call add,BASE_LISTS,$(call tags,base server))
@$(call add,MAIN_LISTS,kernel-wifi)
@$(call add,MAIN_GROUPS,dns-server http-server ftp-server kvm-server)
@$(call add,MAIN_GROUPS,ipmi mysql-server dhcp-server mail-server)
@$(call add,MAIN_GROUPS,monitoring diag-tools)
# desktop distributions
distro/desktop-base: distro/installer sub/main \
use/syslinux/ui-vesamenu use/x11/xorg use/bootloader/grub
distro/icewm: distro/desktop-base \
use/lowmem use/x11/xdm use/x11/runlevel5 \
use/bootloader/lilo use/powerbutton/acpi \
use/cleanup/alterator
@$(call add,BASE_LISTS,$(call tags,icewm desktop))
# NB: if there are too many screens above, it might make sense to distro.d/

8
doc/apt.conf.sample Normal file
View File

@@ -0,0 +1,8 @@
// these must be unset to avoid picking up
// /etc/apt/{apt.conf.d,sources.list.d,}/
Dir::Etc::main "/dev/null";
Dir::Etc::parts "/var/empty";
Dir::Etc::SourceParts "/var/empty";
// this is what caused the whole trouble
Dir::Etc::sourcelist "/home/mike/apt/sources.list";

View File

@@ -1,5 +1,8 @@
предположения фрагментов кода об окружении
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NB: пути приводятся от верхнего уровня
- pkg.in/lists/Makefile
+ ожидает, что названия пакаджлистов указываются в переменных
вида *_LISTS, и копирует в генерируемый профиль только их
@@ -27,3 +30,8 @@
- features.in/syslinux/scripts.d/20-propagator-ramdisk
+ ожидают, что названия squashfs-образов второй стадии инсталятора,
livecd и спасательной системы соответственно altinst, live и rescue
- image.in/Makefile
+ ожидает, что конфигурация будет в distcfg.mk (см. тж. lib/profile.mk),
а лог сборки -- в build.log (см. тж. lib/log.mk); альтернативой было
бы пробрасывание переменных с полным путём ради единственного места

View File

@@ -1,10 +1,16 @@
### sample ~/.mkimage/profiles.mk
# sample ~/.mkimage/profiles.mk
### where to look for apt.conf; system one used by default
# where to look for apt.conf; system one used by default
#APTCONF = ~/apt/apt.conf.$(ARCH)
### turns on GLOBAL_VERBOSE and prettier output
# turns on GLOBAL_VERBOSE and prettier output
#DEBUG = 1
# spares tmpfs, quite recommended unless you need raw workdir chroots
#CLEAN = 1
# run with lower CPU and I/O priorities
#NICE = 1
# try and draw attention when done (depends on readline/terminal settings)
#BELL = 1

View File

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

View File

@@ -2,38 +2,34 @@
и должен дать представление о том, какой код _может_ быть
включён в настоящую фичу: статические файлы, два makefile
для создания конфигурации и генерирования части профиля,
а также шелл-скрипт для генерирования.
а также шелл-скрипт для такого генерирования.
Вовсе не требуется втягивать всё в свою фичу, лучше постараться
Вовсе не требуется втягивать всё в свою фичу: лучше постараться
сделать её минимальной, самодостаточной и полезной в качестве
"кирпичика".
Единственной необходимой частью фичи является файл config.mk,
Единственной обязательной частью фичи является файл config.mk,
который включается в distro.mk верхнего уровня и предоставляет
цель вида use/*, специфичную для данной фичи (а также добавляет
её в переменную FEATURES -- к сожалению, реализовать добавление
автоматом не представляется возможным). Если название фичи не
упоминается в списке, содержащемся в этой переменной, то она
не задействуется при построении профиля, а только при сборке
конфигурации дистрибутива.
цель вида use/*, специфичную для данной фичи, а также добавляет
её в переменную FEATURES. Если название фичи не упоминается
в списке, содержащемся в этой переменной, то она не задействуется
при построении профиля, а только при сборке конфигурации.
Остальное содержимое является дополнительным и используется
в таком порядке (см. features.in/Makefile):
в таком порядке (см. ../Makefile):
- сперва в $(BUILDDIR)/image/ копируются все подкаталоги,
соответствующие именам субпрофилей, запрошенных для
дистрибутивного профиля; при этом они сливаются с деревом,
соответствующие итоговым именам субпрофилей, запрошенных
для профиля образа; при этом они сливаются с деревом,
которое уже сформировано субпрофилями (../sub.in/*) и уже
скопированными фичами; если какие-либо файлы перекрылись
по именам, rsync должен оставить резервные копии (*~),
которые должны просигнализировать о беспорядке;
- затем запускается generate.sh, если существует и исполнимый;
- затем используется generate.mk, если существует и непустой.
- запускается generate.sh, если существует и исполнимый;
- применяется generate.mk, если существует и непустой.
Например, если используются субпрофили stage1, stage2/install2
и main, вы можете решить собрать специфические для фичи скрипты
и main, можно решить собрать специфические для фичи скрипты
инсталятора в install2/image-scripts.d/ (или необходимые для
операций с пакетной базой -- в main/scripts.d/, смотря чего
надо добиться; загляните также в документацию mkimage).
@@ -44,4 +40,4 @@
произвести из generate.sh и generate.mk.
Пожалуйста, присылайте отзывы о (бес)полезности кода в этом каталоге
mike@altlinux.
mike@altlinux.org.

View File

@@ -1,43 +0,0 @@
This directory contains phony example feature and should provide
you with a minimal idea what code _can_ be included into a real
feature: static files, configuration and generation makefiles,
and a generation shell script.
It's not neccessary to toss all of those into your feature,
better try to keep it minimalistic, self-contained and useful
as a building block.
The only requisite part of the feature is config.mk which
is included in toplevel distro.mk and which provides the
use/* target specific for the feature (and also registers
it in FEATURES variable -- sorry, it's not feasible to do
automatically). If the feature's name isn't mentioned in
the list contained in that variable, then it's not examined
while building up the profile either.
The rest of content is optional and used in this order
(see features.in/Makefile):
- first all subdirectories corresponding to subprofile names
requested for the distribution profile being made are copied
over to $(BUILDDIR)/image/; thus they get merged with the tree
which is already formed by subprofiles (../sub.in/*) and preceding
features; in case of overlapping files rsync should leave backup
copies which are to be treated as a signal of disorder;
- then generate.sh is run, if found and executable;
- then generate.mk is used, if found and non-empty.
e.g., if the distro needs stage1, install2 and main subprofiles,
you might want to collect feature-specific scripts for installer
into install2/image-scripts.d/ (or main/scripts.d/, depending on
what is to be achieved -- see also mkimage docs).
And if some non-trivial configuration actions are to be done
(like syslinux config file being compiled from pieces depending
on what bits are present of the functionality asked for...) then
you can perform them in generate.* code.
Please feel free to comment on what's useful here and what's crap
to mike@altlinux.

View File

@@ -9,5 +9,5 @@
# for somewhat more involved example, see syslinux feature
use/00example: sub/main use/anotherfeature
@$(call add,FEATURES,00example)
@$(call add_feature)
@$(call add,MAIN_PACKAGES,hello)

View File

@@ -2,8 +2,16 @@
# (only regarding the needed subprofiles)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
help all:
@echo "** BUILDDIR not defined; available features:"
@for dir in */; do \
echo -n "$$dir: "; \
grep -h '^use/' $$dir/config.mk \
| cut -f1 -d: \
| tr '\n' ' ' \
| sort -u; \
done
else
include $(BUILDDIR)/distcfg.mk
@@ -16,61 +24,100 @@ include $(BUILDDIR)/distcfg.mk
# -- then both src/ and dst/ can hold the addons;
# still both pieces go into a single destination
### {image-,}scripts.d/ get rsynced twice :-/
### still we don't want the trimmed-down case
### 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 \
pushd "$$feat" && \
for sub in / $(SUBPROFILES); do \
# 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#*/}"; \
if [ -d "$$src" ]; then rsync -qab "$$src/" "$(BUILDDIR)/$$dst/"; fi; \
if [ -d "$$dst" ]; then rsync -qab "$$dst/" "$(BUILDDIR)/$$dst/"; fi; \
for scr in {image-,}scripts.d; do \
scriptdir="$(BUILDDIR)/$$dst/$$scr/"; \
if [ -d "$$scriptdir" ]; then \
if [ -d "$$scr" ]; then \
rsync -qab "$$scr/" "$$scriptdir/"; \
fi; \
if [ -d "tagged/$$scr" ]; then \
pushd "tagged/$$scr" && \
echo "$$feat && ($$src || $$dst)" \
| tags2lists . \
| xargs -r cp -v -pLt "$$scriptdir" --; \
popd; \
fi; \
fi; \
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; \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/$$dst/" && \
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; \
done; \
popd >&/dev/null; \
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)" ||:; \
popd; \
done; \
if [ -x "generate.sh" ]; then sh generate.sh; fi; \
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/" && \
git add . && \
git commit -qam "$$feat feature generation complete" ||:; \
popd; \
popd; \
done
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; \
fi; \
popd >/dev/null
finalize:
@find "$(BUILDDIR)/" -name '*~' \
| sed "s,$(BUILDDIR)/,** warning: file clash: ," >&2
# FIXME: drop or fix regarding undefined BUILDDIR being ok
#help:
# @echo "** available features:"
# @grep -h '^use/' */config.mk | fmt -sw"$$((COLUMNS>>1))" | column -t
endif

View File

@@ -1,21 +1,22 @@
Этот каталог содержит т.н. фичи (features, особенности) --
каталоги, содержимое каждого из которых реализует одну из
подключаемых автономных возможностей дистрибутива.
подключаемых автономных возможностей образа.
Каждая фича должна содержать задействуемый при построении
конфигурации будущего образа файл config.mk, включаемый
в ../distro.mk; он может описывать одну или более целей
вида use/*, дополняющих конфигурацию дистрибутива, и при
наличии дополнительных хуков для копирования или generate.*
должен добавить имя фичи в $(FEATURES).
в ../main.mk; он может описывать одну или более целей
вида use/*, дополняющих конфигурацию, и при наличии
дополнительных хуков для копирования или generate.*
обязан добавить имя фичи в $(FEATURES), для чего
создана функция add_feature без аргументов.
На этапе генерации дистрибутивного профиля фичи рассматриваются
На этапе генерации сборочного профиля фичи рассматриваются
после инициализации профиля (см. ../image.in/) и копирования
субпрофилей (см. ../sub.in/). Для каждой фичи, указанной
в $(FEATURES), копируются подкаталоги сообразно субпрофилям,
а также производится обработка {tagged/,}{image-},scripts.d/
(см. cleanup/ в качестве примера); затем выполняется скрипт
generate.sh и задействуется generate.mk (при их наличии).
а также производится обработка {tagged/,}{image-,}scripts.d/;
затем выполняется скрипт generate.sh и задействуется generate.mk
(при их наличии).
NB: тегированные скрипты являются экспериментальными,
возможны недоработки и существенные изменения!
@@ -24,5 +25,8 @@ generate.sh и задействуется generate.mk (при их наличи
построенных на одном базовом, можно воспользоваться подкаталогом
с именем исходного базового субпрофиля (см. $src, $dst в Makefile).
Каталог lib/ является специфическим для фич, определяющих
построение конкретного вида образа -- см. build-*/.
Несложный пример содержится в 00example/, более близкий к жизни
и нынешним пределам возможностей метапрофиля -- в syslinux/.

View File

@@ -5,5 +5,10 @@
систему (он НЕ должен требоваться пакету installer-distro-*)
и требует пакет выбранного загрузчика.
Реализация экспериментальная (нужно модуляризовать installer-steps),
пока завязана на installer-distro-altlinux-generic.
Обратите внимание: в процессе конфигурирования дистрибутива
"переключение" загрузчика может происходить только в одну сторону
-- если выставлен 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

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

View File

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

View File

@@ -0,0 +1,46 @@
# step 4: build the distribution image
# for complex-specified subprofiles like stage2/live,
# take the latter part
SUBDIRS = $(notdir $(SUBPROFILES))
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)
prep: $(GLOBAL_DEBUG) dot-disk $(METADATA) imagedir
metadata: dot-base
@mkdir -p files/Metadata
@rm -f files/Metadata/pkg-groups.tar
# see also alterator-pkg (backend3/pkg-install); we only tar up what's up to it
@tar -cvf files/Metadata/pkg-groups.tar -C $(PKGDIR) \
$$(echo $(call list,$(MAIN_GROUPS) .base) \
$(call group,$(MAIN_GROUPS)) \
| sed 's,$(PKGDIR)/*,,g')
dot-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
@echo "ALT Linux based" >files/.disk/info
@echo "$(ARCH)" >files/.disk/arch
@echo "$(DATE)" >files/.disk/date
@if type -t git >&/dev/null; then \
( cd $(TOPDIR) && test -d .git && \
git show-ref --head -ds -- HEAD ||:) \
>files/.disk/commit 2>/dev/null; \
fi

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

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

View File

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

View File

@@ -0,0 +1,13 @@
#!/bin/sh
# VEs typically have no means to communicate with the outer
# world except for networking; still this might need some
# more tweaking for networkless LXC case
# 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

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

View File

@@ -0,0 +1,3 @@
#!/bin/sh -e
# should be pretty much obsolete but just in case
[ -L /etc/mtab ] || ln -sf /proc/mounts /etc/mtab

View File

@@ -0,0 +1,16 @@
#!/bin/sh -e
# tweak syslog configuration to:
# - avoid logging to a nonexistent tty;
# - avoid hard sync logging (one is better off doing
# remote syslog if you do care for reliable data anyways)
# credits: vvk@, thresh@ (2010)
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,19 @@
# step 4: build the virtual environment image
ifeq (tar,$(IMAGE_PACKTYPE))
MKI_TAR_COMPRESS = $(IMAGE_COMPRESS)
endif
ifeq (cpio,$(IMAGE_PACKTYPE))
MKI_CPIO_COMPRESS = $(IMAGE_COMPRESS)
endif
IMAGE_PACKAGES = $(call list,$(BASE_LISTS)) \
$(SYSTEM_PACKAGES) \
$(COMMON_PACKAGES) \
$(BASE_PACKAGES)
all: $(GLOBAL_DEBUG) build-image copy-tree run-image-scripts pack-image \
postprocess $(GLOBAL_CLEAN_WORKDIR)
prep: imagedir

View File

@@ -1,5 +1,5 @@
use/cleanup:
@$(call add,FEATURES,cleanup)
@$(call add_feature)
use/cleanup/installer: use/cleanup
@$(call add,CLEANUP_PACKAGES,'installer-*')

View File

@@ -1,10 +1,11 @@
#!/bin/sh -efu
### create a postinstall script to drop temporarily needed packages
if [ -n "$GLOBAL_VERBOSE" ]; then
echo "** GLOBAL_CLEANUP_PACKAGES: $GLOBAL_CLEANUP_PACKAGES"
fi >&2
SCRIPT="/usr/share/install2/postinstall.d/01+install2+cleanup"
SCRIPT="/usr/share/install2/postinstall.d/01-remove-pkgs"
cat > "$SCRIPT" << EOF
#!/bin/sh -efu

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

@@ -0,0 +1,5 @@
Эта фича служит для создания образов, предназначающихся для разработки.
В первую очередь обеспечивается развёртывание hasher и mkimage.
Реализована поддержка LiveCD, возможно приспособление для образов
сборочных VM/VE.

View File

@@ -0,0 +1,7 @@
use/dev:
@$(call add_feature)
@$(call add,COMMON_PACKAGES,git-core hasher gear)
use/dev/mkimage: use/dev
@$(call add,COMMON_PACKAGES,mkimage)
@$(call add,LIVE_PACKAGES,shadow-change)

View File

@@ -0,0 +1,44 @@
#!/bin/sh -efu
# configure hasher (implies that 30-users has been run already)
# predefined passwordless livecd user
USER="altlinux"
if ! id "$USER" >&/dev/null; then
echo "No such user '$USER'" >&2
exit
fi
# ~
HOME="/home/$USER"
install -dm750 -o "$USER" -g "$USER" "$HOME"
# we honestly don't know much more
if type -t git >&/dev/null; then
su - -c "git config --global user.email $USER@localhost" "$USER"
su - -c "git config --global user.name 'live builder'" "$USER"
fi
# developer should feel comfortable, eh? ;-)
ZSHELL="/bin/zsh"
if [ -x "$ZSHELL" ]; then
chsh -s "$ZSHELL" "$USER"
install -m755 -o "$USER" -g "$USER" /dev/null "$HOME/.zshrc"
echo "mkdir -p \"\$TMP/hasher\"" >> "$HOME/.zshrc"
fi
# $TMP
TMP="/tmp/.private/$USER"
control pam_mktemp enabled
sed -i '/^%_tmppath.*tmp$/d' "$HOME/.rpmmacros"
echo "%_tmppath $TMP" >> "$HOME/.rpmmacros"
# ~/hasher
WORKDIR="$TMP/hasher"
ln -s "$TMP/hasher" "$HOME/hasher"
# online repo needs network not isolation
echo "export share_network=1" >> /etc/profile.d/hasher.sh
chmod +x /etc/profile.d/hasher.sh
# requisite
hasher-useradd "$USER"

View File

@@ -0,0 +1,7 @@
#!/bin/sh -efu
# attempt to autoconfigure ethernet
mkdir -p /etc/net/ifaces/eth0 && {
echo TYPE=eth
echo BOOTPROTO=dhcp
} > /etc/net/ifaces/eth0/options ||:

View File

@@ -4,3 +4,6 @@
Для практического применения (в первую очередь это
перешивка firmware) требуется сделать подключение
CD и/или USB Flash с тем, чтобы класть туда прошивки.
Спасибо за идею и местами реализацию: Александру Бандуре,
Сергею Горенко, Николаю Гречуху и Алексею Фролову.

View File

@@ -1,5 +1,5 @@
use/dos: use/syslinux
@$(call add,FEATURES,dos)
@$(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)

View File

@@ -9,13 +9,11 @@ use/firmware/server: use/firmware
@$(call add,SYSTEM_PACKAGES,firmware-aic94xx-seq)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-ql.*)
use/firmware/desktop: use/firmware
@$(call add,SYSTEM_PACKAGES,firmware-psb)
use/firmware/wireless: use/firmware
@$(call add,MAIN_PACKAGES,firmware-acx100)
@$(call add,MAIN_PACKAGES,firmware-i2400m)
@$(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,4 @@
Добавление модуля hdt (Hardware Detection Tool COM32 module) к syslinux;
Добавление модуля hdt (Hardware Detection Tool) к syslinux;
может быть востребовано для инсталяторов, live/rescue.
Фича не только требует фичу syslinux (и соответствующий пакет,

View File

@@ -1,6 +1,4 @@
use/hdt: use/syslinux use/memtest
@$(call add,FEATURES,hdt)
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,pciids)
@$(call add,SYSLINUX_MODULES,hdt)
### moved to scripts.d/02-hdt along with compression
# @$(call add,SYSLINUX_FILES,/usr/share/misc/pci.ids)

View File

@@ -1,6 +1,6 @@
use/install2: use/stage2 sub/stage2/install2 use/cleanup/installer
@$(call add,FEATURES,install2)
@$(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))

View File

@@ -1,7 +1,4 @@
#!/bin/sh
# stage1 needs this
mkdir -p /image
# setup stage2 as init
mv -f /usr/sbin/install2-init /sbin/init

View File

@@ -11,7 +11,7 @@ HSH_EXCLUDE_DOCS = 1
# pass downstream
GLOBAL_BASE_BOOTLOADER := $(BASE_BOOTLOADER)
debug:
debug::
@echo "** install2: IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
@echo "** install2: IMAGE_PACKAGES_REGEXP: $(IMAGE_PACKAGES_REGEXP)"
@echo "** install2: CLEANUP_PACKAGES: $(CLEANUP_PACKAGES)"

View File

@@ -0,0 +1,32 @@
#!/bin/sh
# purge anything unused during installation
rm -rf /usr/share/icons/{hicolor,large,mini}
# PAM plugins
rm -rf /lib*/security
rm -rf /usr/share/ca-certificates
rm -rf /usr/lib/qt4/plugins/codecs
rm -rf /usr/lib/qt4/plugins/bearer
rm -rf /usr/lib/qt4/plugins/inputmethods
rm -rf /usr/share/qt4/{doc,mkspecs,phrasebooks}
rm -rf /usr/share/guile/*/{*.txt,scripts}
rm -rf /usr/share/awk/
### could it be handled with any grace?
### TODO: x11vnc, xorg-xvfb: fix installer-common-stage2
rpmquery -a cpp\* gcc\* perl-base file ipv6calc \
bind-utils libbind \
gnupg libgcrypt libgnutls\* libgpg-error libsoup\* \
libGL glxinfo xdriinfo \
make make-initrd x11vnc xorg-xvfb \
| xargs -r rpmi -e --nodeps --
rpmquery -a bind-utils libbind \
| xargs -r rpmi -e --
# outstanding binaries
rm -f /sbin/{sln,tc}
rm -f /usr/bin/openssl

View File

@@ -0,0 +1,5 @@
#!/bin/sh
# remove all docs
rpmquery -ad |grep ^/ |xargs -r rm -f --
rm -rf /usr/share/{doc,man,info,license,gfxboot}

View File

@@ -1,64 +1,50 @@
#!/bin/sh
# remove all docs
rpmquery -adl |grep ^/ |xargs -r rm -f --
rm -rf /usr/share/{doc,man,info,license,gfxboot}
# remove unused icons
rm -rf /usr/share/icons/{hicolor,large,mini}
# remove PAM plugins
rm -rf /lib*/security
# remove some unused files
rm -rf /usr/share/ca-certificates
rm -rf /usr/lib/qt4/plugins/codecs
rm -f /usr/lib*/gconv/IBM*
rm -f /usr/lib*/gconv/BIG5*
rm -f /usr/lib*/gconv/EBCDIC*
# remove unneeded timezones
rm -rf /usr/share/zoneinfo/{posix,right}/
# remove unneeded l10n
find /usr/share/locale/ -type f \! -name 'alterator*' -delete
# remove non-utf8 locales
find /usr/lib*/locale -mindepth 1 -maxdepth 1 -type d \! -name '*.utf8' -print0 |
xargs -r0 rm -rf --
# drop extra drivers et al, purge kernel image(s)
# xorg modules
rm -r /usr/lib*/X11/modules/dri
# remove ogfs
rm -f /lib*/evms/*/ogfs*
# evms modules; see http://evms.sourceforge.net/user_guide/
rm -f /lib*/evms/*/{bbr,csm,drivelink,ogfs,replace,snapshot}*
# remove cpp, gcc and perl
rpmquery -a cpp\* gcc\* perl-base |
xargs -r rpmi -e --nodeps --
# remove unneeded kernel modules
# unneeded kernel modules
### some of these removals belong to a purge grade script
### TODO: mostly scsi-less and net-less cleanup for antique
rm -rf /lib/modules/*/kernel/arch
rm -rf /lib/modules/*/kernel/drivers/atm
rm -rf /lib/modules/*/kernel/drivers/char/ipmi
rm -rf /lib/modules/*/kernel/drivers/bluetooth
rm -rf /lib/modules/*/kernel/drivers/char/{ipmi,hw_random,mwave,tpm}
rm -rf /lib/modules/*/kernel/drivers/char/watchdog
rm -rf /lib/modules/*/kernel/drivers/cpufreq
rm -rf /lib/modules/*/kernel/drivers/edac
rm -rf /lib/modules/*/kernel/drivers/firmware ###
rm -rf /lib/modules/*/kernel/drivers/gpio
rm -rf /lib/modules/*/kernel/drivers/hwmon
rm -rf /lib/modules/*/kernel/drivers/infiniband ###
rm -rf /lib/modules/*/kernel/drivers/input/{gameport,joy*}
rm -rf /lib/modules/*/kernel/drivers/isdn
rm -rf /lib/modules/*/kernel/drivers/leds
rm -rf /lib/modules/*/kernel/drivers/media
rm -rf /lib/modules/*/kernel/drivers/mmc
rm -rf /lib/modules/*/kernel/drivers/mtd*
rm -rf /lib/modules/*/kernel/drivers/net/can
rm -rf /lib/modules/*/kernel/drivers/net/hamradio
rm -rf /lib/modules/*/kernel/drivers/net/irda
rm -rf /lib/modules/*/kernel/drivers/net/tokenring
rm -rf /lib/modules/*/kernel/drivers/net/wimax
rm -rf /lib/modules/*/kernel/drivers/net/wireless
rm -rf /lib/modules/*/kernel/drivers/net/wan
rm -rf /lib/modules/*/kernel/drivers/regulator
rm -rf /lib/modules/*/kernel/drivers/staging
rm -rf /lib/modules/*/kernel/drivers/spi
rm -rf /lib/modules/*/kernel/drivers/target
rm -rf /lib/modules/*/kernel/drivers/telephony
rm -rf /lib/modules/*/kernel/drivers/usb/{misc,mon}
rm -rf /lib/modules/*/kernel/drivers/tty/[^s][^e]*
rm -rf /lib/modules/*/kernel/drivers/usb/{atm,c67*,image,misc,mon,otg,serial,wusbcore}
rm -rf /lib/modules/*/kernel/drivers/usb/storage/ums*
rm -rf /lib/modules/*/kernel/drivers/uwb
rm -rf /lib/modules/*/kernel/drivers/w1
rm -rf /lib/modules/*/kernel/drivers/watchdog
rm -rf /lib/modules/*/kernel/fs/9p
rm -rf /lib/modules/*/kernel/fs/adfs
rm -rf /lib/modules/*/kernel/fs/affs
@@ -68,12 +54,16 @@ rm -rf /lib/modules/*/kernel/fs/autofs4
rm -rf /lib/modules/*/kernel/fs/befs
rm -rf /lib/modules/*/kernel/fs/bfs
rm -rf /lib/modules/*/kernel/fs/btrfs
rm -rf /lib/modules/*/kernel/fs/ceph
rm -rf /lib/modules/*/kernel/fs/cifs
rm -rf /lib/modules/*/kernel/fs/coda
rm -rf /lib/modules/*/kernel/fs/configfs
rm -rf /lib/modules/*/kernel/fs/cramfs
rm -rf /lib/modules/*/kernel/fs/dlm
rm -rf /lib/modules/*/kernel/fs/efs
rm -rf /lib/modules/*/kernel/fs/exofs
rm -rf /lib/modules/*/kernel/fs/freevxfs
rm -rf /lib/modules/*/kernel/fs/fscache
rm -rf /lib/modules/*/kernel/fs/fuse
rm -rf /lib/modules/*/kernel/fs/hfs
rm -rf /lib/modules/*/kernel/fs/hfsplus
@@ -81,18 +71,26 @@ rm -rf /lib/modules/*/kernel/fs/hpfs
rm -rf /lib/modules/*/kernel/fs/jffs
rm -rf /lib/modules/*/kernel/fs/jffs2
rm -rf /lib/modules/*/kernel/fs/lockd
rm -rf /lib/modules/*/kernel/fs/logfs
rm -rf /lib/modules/*/kernel/fs/minix
rm -rf /lib/modules/*/kernel/fs/ncpfs
rm -rf /lib/modules/*/kernel/fs/nilfs2
rm -rf /lib/modules/*/kernel/fs/ocfs2
rm -rf /lib/modules/*/kernel/fs/omfs
rm -rf /lib/modules/*/kernel/fs/qnx4
rm -rf /lib/modules/*/kernel/fs/romfs
rm -rf /lib/modules/*/kernel/fs/smbfs
rm -rf /lib/modules/*/kernel/fs/sysv
rm -rf /lib/modules/*/kernel/fs/ubifs
rm -rf /lib/modules/*/kernel/fs/udf
rm -rf /lib/modules/*/kernel/fs/ufs
rm -rf /lib/modules/*/kernel/net/*/netfilter
rm -rf /lib/modules/*/kernel/net/9p
rm -rf /lib/modules/*/kernel/net/appletalk
rm -rf /lib/modules/*/kernel/net/atm
rm -rf /lib/modules/*/kernel/net/ax25
rm -rf /lib/modules/*/kernel/net/can
rm -rf /lib/modules/*/kernel/net/ceph
rm -rf /lib/modules/*/kernel/net/bluetooth
rm -rf /lib/modules/*/kernel/net/dccp
rm -rf /lib/modules/*/kernel/net/decnet
@@ -102,22 +100,24 @@ rm -rf /lib/modules/*/kernel/net/ipx
rm -rf /lib/modules/*/kernel/net/irda
rm -rf /lib/modules/*/kernel/net/netfilter
rm -rf /lib/modules/*/kernel/net/netrom
rm -rf /lib/modules/*/kernel/net/rds
rm -rf /lib/modules/*/kernel/net/rose
rm -rf /lib/modules/*/kernel/net/sctp
rm -rf /lib/modules/*/kernel/net/tipc
rm -rf /lib/modules/*/kernel/net/{wimax,wireless,mac80211}
rm -rf /lib/modules/*/kernel/net/x25
rm -rf /lib/modules/*/kernel/sound
# remove blacklisted kernel modules
# blacklisted kernel modules
sed -n 's/^blacklist[[:space:]]\+\([^[:space:]]\+\).*/\1/p' /etc/modprobe.d/* |
while read i; do
find /lib/modules/ -type f -name "$i.ko" -delete
done
# run depmod after kernel modules removal
# regenerate module dependencies
for i in /lib*/modules/*; do
/sbin/depmod -a -F /boot/System.map-${i##*/} ${i##*/}
/sbin/depmod -a -F /boot/System.map-${i##*/} ${i##*/}
done
# remove kernel images
# kernel images
rm -rf /boot/*

View File

@@ -0,0 +1,22 @@
#!/bin/sh
# drop unused l10n/i18n data
# the fell swoop
find /usr/share/locale/ -type f \! -name 'alterator*' -delete
rm -rf /usr/share/zoneinfo/{posix,right}/
# charset conversion tables
### NB: BIG5* and friends should be handled consistently
rm -f /usr/lib*/gconv/IBM*
rm -f /usr/lib*/gconv/BIG5*
rm -f /usr/lib*/gconv/EBCDIC*
# en_* variations
rm -rf /usr/{lib*,share}/locale/en_[^U]*
# non-utf8 locales
find /usr/lib*/locale -mindepth 1 -maxdepth 1 -type d \! -name '*.utf8' -print0 |
xargs -r0 rm -rf --
# dangling symlinks
find /usr/lib*/locale \! -readable -delete

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

@@ -0,0 +1,3 @@
Эта фича конфигурирует внедрение контрольной суммы в образ
инсталятора после его сборки с целью проверки целостности
на ранней стадии установки.

View File

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

View File

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

View File

@@ -1,3 +1,16 @@
# copy stage2 as live
use/live: use/stage2 sub/stage2/live
@$(call add,FEATURES,live)
@$(call add,LIVE_LISTS,$(call tags,(base || desktop) && (live || network || icewm)))
@$(call add_feature)
use/live/base: use/live use/syslinux/ui-menu
@$(call add,LIVE_LISTS,$(call tags,base && (live || network)))
use/live/x11: use/live/base use/x11/xorg use/x11/wacom use/virtualbox/guest
# 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/x11
@$(call add,LIVE_PACKAGES,autologin xinit)
use/live/hooks: use/live
@$(call add,LIVE_PACKAGES,livecd-run-hooks)

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

@@ -0,0 +1,12 @@
#!/bin/sh -efu
# if no means for locale setup are employed,
# it should still be somewhat reasonable
# NB: keyboard layout not included!
mkdir -p /etc/sysconfig
cat >> /etc/sysconfig/i18n << _EOF_
# mkimage-profiles live 20-locale hook
SYSFONT=UniCyr_8x16
LANG=en_US.utf8
_EOF_
:

View File

@@ -23,8 +23,7 @@ add_user()
fi
done
/usr/sbin/useradd -p "" -G "$groups" "$1" ||:
chown -R "$1:auth" "/etc/tcb/$1"
useradd -p "" -G "$groups" "$1" ||:
chown -R "$1:$1" /home/$1
if [ -n "$GLOBAL_CRYPT_HOMES" ]; then
@@ -39,13 +38,14 @@ add_user()
else
verbose "Can't find writable $sudoers file."
fi
echo "Hello friend, say \`$1' to log in at \\l" >> /etc/issue
}
verbose "has started"
verbose "Clear password for root account"
/usr/sbin/usermod -p "" root
chown -R root.auth /etc/tcb/root
usermod -p "" root
add_user altlinux

View File

@@ -0,0 +1,40 @@
#!/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
sed -i "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
fi
# autologin^2
if [ -x /usr/sbin/autologin ]; then
cat << E_O_F >> /etc/sysconfig/autologin
USER=$USER
AUTOLOGIN=yes
E_O_F
fi
# gdm2 autologin
GDM_CONF=/etc/X11/gdm/custom.conf
if [ -f "$GDM_CONF" ]; then
sed -i -e '/\[daemon\]/aAutomaticLoginEnable=true\nAutomaticLogin='$USER \
"$GDM_CONF"
fi
# kdm3 autologin
# TODO: iterate over kdm{,4} if feasible
KDMRC=/etc/X11/kdm/kdmrc
if [ -f "$KDMRC" ]; then
sed -i \
-e '/AutoLoginEnable/ s,^.*$,AutoLoginEnable=true,' \
-e '/AutoLoginUser/ s,^.*$,AutoLoginUser='$USER',' \
"$KDMRC"
fi

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>

View File

@@ -1,4 +1,4 @@
use/lowmem: use/install2
@$(call add,FEATURES,lowmem)
@$(call add_feature)
# TODO: http://www.altlinux.org/Branding/slideshow => disable?
# also installer-feature-rm-slideshow

View File

@@ -7,8 +7,8 @@ cd /usr/share/fonts/bitmap/misc/ &&
# drop unneeded translation
# FIXME: whitelist is reasonable
cd /usr/share/qt4/translations/ &&
rm -f *_ar* *_cs* *_da* *_de* *_es* *_fr* \
*_gl* *_he* *_hu* *_pl* \
rm -f *_ar* *_cs* *_da* *_de* *_es* *_fa* *_fr* \
*_gl* *_he* *_hu* *_ko* *_pl* \
*_sk* *_sl* *_sv*
# ...l10n...
@@ -20,23 +20,19 @@ cd /usr/share/X11/locale &&
cd /usr/share/X11/xkb/symbols &&
ls \
| egrep -v 'by|en|kz|pt|ru|ua|us|pc|....*' \
| xargs rm -rf
| xargs rm -rf --
# gconv
cd /usr/lib*/gconv &&
rm -f EUC* G* I*
# locales
cd /usr/lib*/locale &&
for dir in /usr/{lib*,share}/locale; do
cd "$dir" && \
ls \
| egrep -v '^(be|en|kk|pt|ru|uk)_' \
| xargs rm -rf
# remove kbd data
# FIXME: might break things?
#rm -rf /lib/kbd/
# outstanding binaries
rm /bin/ipv6calc /sbin/sln
| egrep -v '^be|en|kk|pt|ru|uk' \
| xargs rm -rf --;
done
### consider cleaning up kbd data (partially?)
:

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

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

View File

@@ -0,0 +1,3 @@
use/ltsp:
@$(call add,INSTALL2_PACKAGES,installer-feature-ltsp-stage2)
@$(call add,MAIN_LISTS,ltsp-client ltsp-client.$(ARCH))

View File

@@ -1,2 +1,2 @@
Добавление memtest86+ в загрузку с образа и в устанавливаемую пакетную базу;
востребовано для для инсталяторов, live/rescue. Интегрируется с syslinux.
востребовано для инсталяторов, live/rescue. Интегрируется с syslinux.

View File

@@ -1,4 +1,4 @@
use/memtest: use/syslinux
@$(call add,FEATURES,memtest)
@$(call add_feature)
@$(call add,SYSTEM_PACKAGES,memtest86+)
@$(call add,SYSLINUX_CFG,memtest)

4
features.in/pack/README Normal file
View File

@@ -0,0 +1,4 @@
Эта фича определяет формат упаковки создаваемого образа.
На данный момент поддерживаются iso (загрузочный ISO9660
для дистрибутивов) и tar/cpio с возможностью сжатия gz/xz
(виртуальные окружения).

View File

@@ -0,0 +1,36 @@
DISTRO_EXTS := .iso
use/pack:
@$(call add_feature)
# 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
@$(call set,IMAGE_PACKTYPE,isodata)
endif
VE_ARCHIVES := tar cpio
VE_COMPRESSORS := gz xz# there's no sense in bzip2 by now
VE_ZIPS := $(call addsuffices, \
$(addprefix .,$(VE_COMPRESSORS)), \
$(VE_ARCHIVES))# tar.gz cpio.xz ...
VE_EXTS := $(sort $(addprefix .,$(VE_ARCHIVES) $(VE_ZIPS)))# .tar .tar.gz ...
# generate rules for archive/compressor combinations
define PACK_containers
use/pack/$(1): use/pack
@$$(call set,IMAGE_PACKTYPE,$(1))
endef
define PACK_compressors
use/pack/$(1).$(2): use/pack/$(1)
@$$(call set,IMAGE_COMPRESS,$(2))
endef
$(foreach c,$(VE_ARCHIVES), \
$(eval $(call PACK_containers,$(c))) \
$(foreach z,$(VE_COMPRESSORS), \
$(eval $(call PACK_compressors,$(c),$(z)))))

6
features.in/power/README Normal file
View File

@@ -0,0 +1,6 @@
Эта фича конфигурирует поддержку управления питанием
-- выключение и регулировку частоты CPU для ACPI,
засыпание для APM (не проверялось).
TODO: учесть изложенное в https://bugzilla.altlinux.org/25018
(для gnome & co)

View File

@@ -0,0 +1,21 @@
# common
# TODO: invent multi-target scripts and integrate that 08-powerbutton
use/power:
@$(call add,COMMON_PACKAGES,installer-feature-powerbutton-stage3)
# modern power management
use/power/acpi: use/power
@$(call add,COMMON_PACKAGES,acpid)
use/power/acpi/button: use/power/acpi
@$(call add,COMMON_PACKAGES,acpid-events-power)
use/power/acpi/cpufreq: use/power/acpi
@$(call add,COMMON_PACKAGES,installer-feature-cpufreq-stage3)
use/power/acpi/powersave: use/power/acpi
@$(call add,COMMON_PACKAGES,powersave)
# legacy power management
use/power/apm: use/power
@$(call add,COMMON_PACKAGES,apmd)

View File

@@ -1,2 +0,0 @@
Эта фича конфигурирует поддержку управления кнопкой питания
-- выключение для ACPI, засыпание для APM (не проверялось).

View File

@@ -1,14 +0,0 @@
# common
use/powerbutton:
@$(call add,COMMON_PACKAGES,installer-feature-powerbutton-stage3)
# modern power management
use/powerbutton/acpi: use/powerbutton
@$(call add,COMMON_PACKAGES,acpid acpid-events-power)
use/powerbutton/powersave: use/powerbutton/acpi
@$(call add,COMMON_PACKAGES,powersave)
# legacy power management
use/powerbutton/apm: use/powerbutton
@$(call add,COMMON_PACKAGES,apmd)

8
features.in/repo/README Normal file
View File

@@ -0,0 +1,8 @@
Эта фича предназначена для конфигурирования репозиториев
в образе, включая генерацию хэшей и подключение к LiveCD.
На данный момент единственным таким репозиторием является
RPMS.main (создаваемый sub/main), но возможно добавление
addons, updates или иных по мере необходимости.
Результат -- каталог ALTLinux/base/ для копирования в образ.

View File

@@ -0,0 +1,5 @@
use/repo:
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,gnupg)
use/repo/main: sub/main use/repo

View File

@@ -0,0 +1,2 @@
# ../scripts.d/01-genbasedir needs that
CHROOT_PACKAGES += apt-utils

View File

@@ -0,0 +1,10 @@
#!/bin/sh -efu
# configure package repository of the image (provided by sub/main);
# this script will be run iff both live and repo features are used
DIR=/etc/apt/sources.list.d
mkdir -p $DIR && {
echo "# for real stuff you'll need full repo, see apt-repo"
echo "rpm file:/image ALTLinux main"
} > $DIR/main.list

View File

@@ -0,0 +1,28 @@
#!/bin/sh -efu
PREFIX=ALTLinux
cd "$WORKDIR/$PREFIX"
COMPS="$(find -mindepth 1 -maxdepth 1 -type d -name 'RPMS.*' -printf '%f\n' |
sed 's/^RPMS\.//')"
[ -z "$GLOBAL_VERBOSE" ] || echo "** COMPS=$COMPS" >&2
[ -n "$COMPS" ] || exit 1
genbasedir \
--topdir="$WORKDIR" \
--no-oldhashfile \
--partial \
--xz \
--bz2 \
--create \
--notautomatic=false \
${INFO_ARCH:+--architecture="$INFO_ARCH"} \
${INFO_NAME:+--archive="$INFO_NAME"} \
${INFO_VERSION:+--version="$INFO_VERSION"} \
${INFO_ORIGIN:+--origin="$INFO_ORIGIN"} \
${INFO_LABEL:+--label="$INFO_LABEL"} \
$PREFIX $COMPS
### drop this when genbasedir is fixed (--no-uncompressed)
for c in $COMPS; do rm -f base/{pkg,src}list.$c; done

View File

@@ -0,0 +1,4 @@
#!/bin/sh
# generate current plaintext rpm pubring representation
gpg --export --armor --homedir=/usr/lib/alt-gpgkeys >$WORKDIR/RPM-GPG-KEY

View File

@@ -1,4 +1,4 @@
use/rescue: use/stage2 sub/stage2/rescue
@$(call add,FEATURES,rescue)
@$(call add,RESCUE_LISTS,$(call tags,base && (rescue || network)))
@$(call add,RESCUE_LISTS,$(call tags,extra network))
@$(call add_feature)
@$(call add,RESCUE_LISTS, \
$(call tags,(base || extra) && (rescue || network)))

View File

@@ -1,14 +1,13 @@
#!/bin/sh
# stage1 needs this <-- FIXME: duplicated in sub.in/stage2/image-scripts.d/00propagator
#mkdir -p /image
# m-p-d::profiles/rescue/image-scripts.d/999system
mv -f -- /etc/inittab.rescue /etc/inittab
# enable NFS mounts
chkconfig rpcbind on
sed -i 's,#\(RPCBIND_ARGS="-l".*\),\1,' /etc/sysconfig/rpcbind
if [ -x /etc/rc.d/init.d/rpcbind ]; then
chkconfig rpcbind on
sed -i 's,#\(RPCBIND_ARGS="-l".*\),\1,' /etc/sysconfig/rpcbind
fi
# remove unwanted startup scripts
find /etc/rc.d/rc{2,3,4,5}.d/ -type l -name 'S*' \

View File

@@ -7,6 +7,6 @@ IMAGE_PACKAGES = $(COMMON_PACKAGES) \
MKI_PACK_RESULTS = squash:rescue
debug:
debug::
@echo "** rescue: IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
@echo "** rescue: IMAGE_PACKAGES_REGEXP: $(IMAGE_PACKAGES_REGEXP)"

View File

@@ -1,6 +1,6 @@
# "1" is not a typo
use/stage2: sub/stage1
@$(call add,FEATURES,stage2)
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,file make-initrd make-initrd-propagator)
# NB: sub/stage2 isn't used standalone but rather

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,21 +1,23 @@
Добавление поддержки syslinux; требуется для инсталяторов, live/rescue.
Добавление поддержки syslinux; требуется для инсталяторов, live/rescue;
реализуется в рамках stage1.
Цели config.mk:
* use/syslinux/ui-% -- конфигурирование интерфейса (см. cfg.in/00*.cfg);
при использовании автоматически добавляют syslinux в FEATURES
при использовании автоматически добавляют syslinux в FEATURES;
* use/syslinux/%.com, use/syslinux/%.c32 -- подключение одноименных модулей
(копирование бинарников и включение кусочков конфигурации; экспериментальное)
* use/syslinux/%.cfg -- подключение кусочков конфигурации (используется)
(копирование бинарников и включение кусочков конфигурации; экспериментальное);
* use/syslinux/%.cfg -- подключение кусочков конфигурации.
Переменные generate.mk:
* BOOTLOADER -- isolinux (TODO: добавить поддержку syslinux для флэшек);
* BOOTLOADER -- isolinux (реализовано с оглядкой на syslinux/syslinux4);
* SYSLINUX_UI -- модуль интерфейса (если не указан, то внутренний prompt);
* SYSLINUX_MODULES -- модули .com или .c32 (перечисляются без расширения);
* SYSLINUX_CFG -- дополнительные кусочки конфигурации (например, localboot).
Здесь производится первичная обработка конфигурационных данных,
окончательно проверяемых и используемых уже в инструментальном чруте.
TODO: может потребоваться обобщение механизма генерации с учётом
многоуровневых меню и включаемых файлов (которыми лучше не злоупотреблять
из соображений скорости инициализации загрузчика); требуется обеспечить
брендирование заголовков.

View File

@@ -1,3 +1,3 @@
ui gfxboot bootlogo
menu title mkimage-profiles 2.0
ui gfxboot bootlogo message
menu title ALT Linux (@mkimage-profiles@)
prompt 0

View File

@@ -1,3 +1,3 @@
ui menu.c32
menu title mkimage-profiles 2.0
menu title ALT Linux (@mkimage-profiles@)
prompt 0

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