Compare commits

..

47 Commits

Author SHA1 Message Date
Michael Shigorin
d190759717 0.6.3-alt1
- massive squashfs tuning
2012-04-09 22:44:11 +03:00
Gleb Fotengauer-Malinovskiy
1432bb1607 add dummy distro/livecd-install
sub.in/stage2/image-scripts.d/99cleanup-boot,
livecd-install need /boot files too
2012-04-09 22:44:11 +03:00
Michael Shigorin
f4519332e9 READMEs: pkglist related clarification
glebfm@ asked what to do with new package lists: whether these
belong to features, or to distributions themselves.  This question
is actually open and up for discussion but there are guidelines
that can and should be written down already; and so they were.

Added pkgdups utility reference as well.
2012-04-09 22:21:10 +03:00
Michael Shigorin
acaf12c34e doc/variables.txt: ARCHES explained
Multiple ARCHES won't just magically work without
the ability to figure out the correct apt.conf;
fortunately there's just the right example handy
in profiles.mk.sample already.

Thanks glebfm@ for feedback.
2012-04-09 22:08:00 +03:00
Michael Shigorin
8d16069882 stage2: squashfs blocksize tweaks
Looks like the 128k default block size is pretty well chosen:
it saves ~6% of image size compared to 64k, and subsequent
differences are ~3% per doubling the block size up to 1M
(thanks led@ for carrying out the tests).

So we'll stick with 256k for "normal" xz compression (inodes
uncompressed) and get 512k back for "tight" one (compressed).
The runtime performance issues are to be examined yet when
bootchart or the like is deployed, nothing drastic though.

With "fast" (gzip/lzo) squash compression inodes go unmolested.

For the record, tight live-webkiosk builds as 95M image in 3:40,
and tight live-flightgear.iso builds as 669M image in 6:34.  Nice.

There's no much sense going for 1M block size: e.g. live-webkiosk
would drop to 93M (3:46) but its load time would increase up to
2:07 as compared to 1:48 for -b 524288 and 1:42 for -b 262144 -noI
on a Duron 500/512M system given the very same DVD+RW media.
2012-04-09 22:03:29 +03:00
Michael Shigorin
931d23e86c reports.mk: handle missing gra{phviz,cefully}
If there's no dot(1) then its input file should just be stored;
thanks glebfm@ for reminding about this.
2012-04-09 22:03:29 +03:00
Michael Shigorin
6fee43e9cb live: tweak autologin warning
Should be removed when console autologin is there
(mind the live-builder).
2012-04-09 22:03:29 +03:00
Michael Shigorin
fe58c46ead stage2: tunable squashfs compression
The existing implementation would handle kernel differences
just fine but a bit too automatically: if it sees xz support,
that's what will end up being used (and if there's -Xbcj binary
compression filter available for the target platform, it will
be applied unequivocally either).

It's perfectly suitabe for getting fine-tuned release images
but is also a bit too resource-consuming while developing the
image configuration which has no business with its compression.

The one and only knob is SQUASHFS (see doc/variables.txt);
to give an idea of the differences, here are some numbers
for a mostly-binary (43% as per 99-elf-stats) webkiosk livecd
and a rather less so (18%) flightgear one on a dual quad-core
X5570 node (each mksquashfs run used up all the cores):

SQUASHFS | live-webkiosk.iso | live-flightgear.iso
---------+-------------------+---------------------
fast     | 3:30 / 130M       | 5:11 / 852M
normal * | 3:37 / 100M       | 5:35 / 688M
tight    | 3:50 / 98M        | 6:47 / 683M

Thus if the knob isn't fiddled with, the defaults will allow
for a reasonably fast build of a pretty slim image; if one is
building a release or if a particular image is very sensitive
being close to the media capacity then just add SQUASHFS=tight
and see it a percent or two down on size.

Please note that lzo/gzip-compressed images are also quicker
to uncompress thus further helping with test iterations.

Thanks to led@ and glebfm@ for helpful hints and questions.
2012-04-09 22:03:29 +03:00
Michael Shigorin
0cc20d107d power: apm += lphdisk
APM enabled notebooks would usually hibernate to
a partition of special type and special format;
thus to make use of this APM BIOS feature folks
might need a corresponding formatter.
2012-04-09 22:03:29 +03:00
Michael Shigorin
c2996cc493 stage2: 99-elf-stats for squashfs tuning
This kind of test was proposed by led@ to gather statistics
on chroot's contents going to become squashfs (the script
optimizations lowering added overhead from ~10 sec down
to a subsecond range were also proposed by him).

Intentionally not documented in doc/variables.txt due to
the rather lowlevel nature of the probe (at least so far).

The knobs involved are SQUASHFS (the additional effort kicks
in only for "tight" case) and GLOBAL_SQUASHFS_SORT (must be
non-empty for this extra overhead to occur).

Additional experimentation is needed to find out whether
the difference in squashfs size and performance is worth
the trouble (seems the impact is non-zero but pretty minor).
2012-04-09 22:03:29 +03:00
Michael Shigorin
94b2052bfb stage1: halve squashfs block size
gns@ has 512k, led@ suggests that it's too much a bit;
let's try 256k.
2012-04-07 15:46:03 +03:00
Michael Shigorin
665c70a444 use PATH instead of hardwired pathlets
bin/ prefix tried to become a permatemp(tm).  No way.
2012-04-07 15:45:40 +03:00
Michael Shigorin
68022a3222 conf.d/live.mk: add joystick calibration tools
Thanks Chernetsky Andrey for testing and suggesting it.
(NB: currently only t6 build is proper, see input-utils bugs)
2012-04-06 12:41:05 +03:00
Michael Shigorin
88050c9742 lib/log.mk: check hasher version
There is at least one known deficiency for mkimage-profiles:
build.log will be truncated if verbose mode is enabled and
hasher version is lower than 1.3.22.

The check is done here since it's where the logging is arranged,
and doing it in image.in/Makefile would result in the warning
about log-truncating software being truncated by the said software.

Thanks Max Kosmach for reporting this inobviousity.
2012-04-03 16:26:25 +03:00
Michael Shigorin
c6ee8861f4 gear-store-tags 2012-04-02 18:22:09 +03:00
Michael Shigorin
5347d342cc 0.6.2-alt1
- better live-webkiosk and initial live-flightgear
- cleanup, syslinux, xorg feature tweaks
2012-04-02 18:18:52 +03:00
Michael Shigorin
74d1e45a1c docs update
Status updates and readability tweaks all over the place.
2012-04-02 18:13:14 +03:00
Michael Shigorin
dccf9a58b5 conf.d/server.mk += server-nano
A very basic server image with sshd onboard for testing
and very basic installs; thanks legion@ for the query.
2012-04-02 17:16:27 +03:00
Michael Shigorin
9fd0bc143e more readable `make help', finally
The output was still somewhat ragged in 80x24 terminal window
with fmt(1) which wasn't anticipating the word length difference
subsequent column(1) would have to cope with later on.

Thanks Loic Cattani for his shell columnizer implementation:
https://github.com/Arko/Columnize
2012-04-02 17:16:27 +03:00
Michael Shigorin
4afd735adb live-flightgear.iso lacked sound
Thanks snejok@ for spotting the missing, I didn't get around
to tests with headphones...

Also fixed nouveau getting in after target shuffling,
and tweaked firefox homepage to be useful in this context.
2012-03-31 21:08:09 +03:00
Michael Shigorin
3d649db656 live: introduce homepage redirector knobs
There are three more variables to adjust the redirect page:
HOMEPAGE, HOMENAME and HOMEWAIT; e.g. live-webkiosk is now
quite a bit more whitelabel.
2012-03-31 21:08:09 +03:00
Michael Shigorin
b5e6906b56 syslinux configuration revisited
- incompatible change (to fix the rather broken early style):
  use/syslinux/ui-% is now use/syslinux/ui/%;

- default timeout changed to 9 seconds (long enough and keeps
  the countdown in a single figure);

- added totaltimeout of 300 seconds;

- provided live kiosk images with almost-instant boot by default;

...and some other assorted tweaks here and there, sorry.
2012-03-31 21:08:09 +03:00
Michael Shigorin
afd84973d9 live-webkiosk-mini.iso: 85M is enough
Thanks to a reviewer who came with useful feedback and a goal:
http://www.opennet.ru/openforum/vsluhforumID3/83728.html#136
the live-webkiosk image got forked into a separate one:

- dropped DRI, virtualbox GA, mc & co, docs, rpmdb;
- added Russian keyboard layout (ctrl+shift to toggle);
- rebased live-webkiosk onto live-webkiosk-mini ;-)

Maybe vbox guest additions will get back but rpmdb is a bit
impractical on a kiosk squashfs image, even in presence of
aufs rw overlay.
2012-03-31 21:08:09 +03:00
Michael Shigorin
b129c86ac1 xorg reorg
Now is the time for all fonts to be pulled in when needed and not
along with the X server and hardware drivers; tablet support is
moved to a (preexisting) specific target either.

There's no need now to arch-discriminate a few older drivers too.
2012-03-31 21:08:09 +03:00
Michael Shigorin
1b885b3d24 cleanup scripts rehashed
There's much reason for reuse instead of duplication
among the different stage2-based subprofiles.

In particular, the rather monolithic driver cleanup script
of the ancient is better done in several clear pieces with
the final depmod run.

Scripts dropping apt/rpm databases will dump pkglist first.

A script purging /boot/* will honour live-install if present.

Minor inno^Wfixups all over the map too.
2012-03-31 21:08:09 +03:00
Michael Shigorin
ea5ae29ada mind the aptitude
Folks asked to include aptitude in desktop user distros:
http://www.opennet.ru/openforum/vsluhforumID3/83728.html#117
2012-03-30 23:38:26 +03:00
Michael Shigorin
ece828c0dc image.in/Makefile: output image size too
Checking the image size is one of the usual things
after building it, and there's some media related
testing to be ported from m-p-d as well.
2012-03-29 16:30:05 +03:00
Michael Shigorin
50a0c66899 fix live-install image
Removing /boot stuff from the live root was a nice idea
to spare some space except that live-install depends on it...
2012-03-28 21:46:29 +03:00
Michael Shigorin
5ff765275b initial live-flightgear.iso
This one should help (erm... hope not the other way around!)
testing both 3D setup and FlightGear packages I happen to
maintain in a known clean environment.
2012-03-28 21:38:14 +03:00
Michael Shigorin
9555f1f69a enhanced 3D graphics support
The previous configuration would result in intel-only
3D being available since nouveau and radeon kernel modules
are packaged separately with most kernel-images; getting
NVIDIA/AMD drivers in is more tricky due to availability
of both proprietary and free implementations with the choice
being rather a tradeoff in each case (somewhat less so with
ATI/AMD drivers).

So this is a first shot at the problem: FlightGear would
freeze on me with today's nouveau.
2012-03-28 21:38:14 +03:00
Michael Shigorin
87502d2a4a live-tde += ru
This is actually a band-aid until decent l10n is there...
2012-03-28 21:37:11 +03:00
Michael Shigorin
d39b0b984a live index.html: fix typo
The <html> tag wasn't closed but actually duplicated;
thanks Aleksey Ilchenko for spotting.
2012-03-27 11:30:50 +03:00
Michael Shigorin
587eac45ec tweak the fatal errorlevel
127 is also returned by dot(1), and we're toasted
if unable to create $(BUILDDIR).
2012-03-27 08:36:23 +03:00
Michael Shigorin
d6e899d129 gear-store-tags 2012-03-26 23:24:24 +03:00
Michael Shigorin
edfdeca311 0.6.1-alt1
- ISO9660 metadata support
- initial alien VE image
2012-03-26 23:23:30 +03:00
Michael Shigorin
b6e640bd8d slimmer webkiosk with Russian layout
Thanks someone for review and feedback:
http://www.opennet.ru/openforum/vsluhforumID3/83728.html#136

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

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

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

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

The simplest thing to do is hooking "; @:" onto the rule's tail
(one-liner with a non-printing shell builting "true" command).
2012-03-19 19:23:38 +02:00
Michael Shigorin
788cad885e initial target tracing support and reporting
The purpose is being able to examine particular target interdependency
graph for a given image having been configured to avoid convoluted
dependencies (loops in particular).

The implementation is based on SHELL hook hint by John Graham-Cumming:
http://cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
2012-03-19 19:23:38 +02:00
Michael Shigorin
a52b7476a4 initial "+shortcut" support and refactoring
It looks like the intermediate targets aren't all equal:
some define a finished feature while some create a common
lower level piece of configuration.

Let's do shortcuts for the former so that a distro line can be
more terse and descriptive; help targets in features.in/ tweaked
accordingly.
2012-03-19 13:14:07 +02:00
Michael Shigorin
deb63e0d63 gear-store-tags 2012-03-12 22:15:54 +02:00
96 changed files with 822 additions and 260 deletions

View File

@@ -1,5 +1,5 @@
Name: mkimage-profiles Name: mkimage-profiles
Version: 0.5.7 Version: 0.6.3
Release: alt1 Release: alt1
Summary: ALT Linux based distribution metaprofile Summary: ALT Linux based distribution metaprofile
@@ -15,6 +15,8 @@ Requires: rsync git-core
Requires: time schedutils Requires: time schedutils
Requires: mkimage >= 0.2.0 Requires: mkimage >= 0.2.0
# Recommends: graphviz
%define mpdir %_datadir/%name %define mpdir %_datadir/%name
%add_findreq_skiplist %mpdir/*.in/* %add_findreq_skiplist %mpdir/*.in/*
@@ -37,7 +39,7 @@ Virtual environment template caches (OpenVZ/LXC) can be made either.
In short, setup hasher (http://en.altlinux.org/hasher) and here we go: In short, setup hasher (http://en.altlinux.org/hasher) and here we go:
cd %mpdir cd %mpdir
head README head README
make distro/syslinux.iso make syslinux.iso
But if you're into regular distro hacking and are not afraid of make But if you're into regular distro hacking and are not afraid of make
and modest metaprogramming (some code generation and introspection), and modest metaprogramming (some code generation and introspection),
@@ -59,6 +61,20 @@ cp -a * %buildroot%mpdir
%doc README QUICKSTART %doc README QUICKSTART
%changelog %changelog
* Mon Apr 09 2012 Michael Shigorin <mike@altlinux.org> 0.6.3-alt1
- massive squashfs tuning
* Mon Apr 02 2012 Michael Shigorin <mike@altlinux.org> 0.6.2-alt1
- better live-webkiosk and initial live-flightgear
- cleanup, syslinux, xorg feature tweaks
* Mon Mar 26 2012 Michael Shigorin <mike@altlinux.org> 0.6.1-alt1
- ISO9660 metadata support
- initial alien VE image
* Mon Mar 19 2012 Michael Shigorin <mike@altlinux.org> 0.6.0-alt1
- reports (targets graph)
* Mon Mar 12 2012 Michael Shigorin <mike@altlinux.org> 0.5.7-alt1 * Mon Mar 12 2012 Michael Shigorin <mike@altlinux.org> 0.5.7-alt1
- distro tweaks - distro tweaks

View File

@@ -0,0 +1,6 @@
object 5347d342cca7ad1c23b866a81a70735b7b59616f
type commit
tag v0.6.2
tagger Michael Shigorin <mike@altlinux.org> 1333380199 +0300
webkiosk

View File

@@ -1,6 +0,0 @@
object a8e70fd4e667a95fb429c3b77a2f45eca0da7859
type commit
tag v0.5.6
tagger Michael Shigorin <mike@altlinux.org> 1329770647 +0200
fixups

View File

@@ -1 +1 @@
5f2dbc6d511b0a0a39799983df054a249298dd8c v0.5.6 5b441e948d3bca3360d062ec7a36cdfa348f67f7 v0.6.2

View File

@@ -1,7 +1,8 @@
# umbrella mkimage-profiles makefile: # umbrella mkimage-profiles makefile:
# iterate over multiple goals/arches # iterate over multiple goals/arches,
# collect proceedings
# immediate assignment # for immediate assignment
ifndef ARCHES ifndef ARCHES
ifdef ARCH ifdef ARCH
ARCHES := $(ARCH) ARCHES := $(ARCH)
@@ -11,8 +12,16 @@ endif
endif endif
export ARCHES export ARCHES
export PATH := $(CURDIR)/bin:$(PATH)
# supervise target tracing; leave stderr alone
ifdef REPORT
export REPORT_PATH := $(shell mktemp --tmpdir mkimage-profiles.report.XXXXXXX)
POSTPROC := | report-filter > $(REPORT_PATH)
endif
# recursive make considered useful for m-p # recursive make considered useful for m-p
MAKE += --no-print-directory MAKE += -r --no-print-directory
.PHONY: clean distclean help .PHONY: clean distclean help
clean distclean help: clean distclean help:
@@ -23,16 +32,18 @@ export NUM_TARGETS := $(words $(MAKECMDGOALS))
# real targets need real work # real targets need real work
%: %:
@n=1; \ @n=1; \
say() { echo "$$@" >&2; }; \
if [ "$(NUM_TARGETS)" -gt 1 ]; then \ if [ "$(NUM_TARGETS)" -gt 1 ]; then \
n="`echo $(MAKECMDGOALS) \ n="`echo $(MAKECMDGOALS) \
| tr '[[:space:]]' '\n' \ | tr '[[:space:]]' '\n' \
| grep -nx "$@" \ | grep -nx "$@" \
| cut -d: -f1`"; \ | cut -d: -f1`"; \
echo "** goal: $@ [$$n/$(NUM_TARGETS)]"; \ say "** goal: $@ [$$n/$(NUM_TARGETS)]"; \
fi; \ fi; \
for ARCH in $(ARCHES); do \ for ARCH in $(ARCHES); do \
if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then echo; fi; \ if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then say; fi; \
echo "** ARCH: $$ARCH"; \ say "** ARCH: $$ARCH" >&2; \
$(MAKE) -f main.mk ARCH=$$ARCH $@; \ $(MAKE) -f main.mk ARCH=$$ARCH $@ $(POSTPROC); \
$(MAKE) -f reports.mk ARCH=$$ARCH; \
done; \ done; \
if [ "$$n" -lt "$(NUM_TARGETS)" ]; then echo; fi if [ "$$n" -lt "$(NUM_TARGETS)" ]; then say; fi

9
README
View File

@@ -1,12 +1,12 @@
Welcome to mkimage-profiles! Welcome to mkimage-profiles!
English quickstart: make distro/server-base.iso; English quickstart: make server-mini.iso;
see http://en.altlinux.org/Hasher (and a large tmpfs). 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 see doc/variables.txt and conf.d/README
License: GPLv2+, see COPYING. License: GPLv2+, see COPYING
Most docs are in Russian, welcome to learn it or ask for English. Most docs are in Russian, welcome to learn it or ask for English.
См. тж. http://www.altlinux.org/Mkimage/Profiles/m-p См. тж. http://www.altlinux.org/Mkimage/Profiles/m-p
@@ -34,7 +34,7 @@ Most docs are in Russian, welcome to learn it or ask for English.
Объекты: Объекты:
- дистрибутивы и виртуальные окружения: - дистрибутивы и виртуальные окружения:
+ описываются в conf.d/*.mk или соответственно lib/{distro,ve}.mk + описываются в conf.d/*.mk или соответственно lib/{distro,ve}.mk
+ могут основываться одно на другом + могут основываться на предшественниках, расширяя их
+ дистрибутивы также: + дистрибутивы также:
- включают один или более субпрофилей по надобности - включают один или более субпрофилей по надобности
+ желательно избегать множественного наследования, см. тж. фичи + желательно избегать множественного наследования, см. тж. фичи
@@ -58,3 +58,4 @@ Most docs are in Russian, welcome to learn it or ask for English.
+ указанный явно, + указанный явно,
+ либо ~/out/ (если возможно), + либо ~/out/ (если возможно),
+ или $(BUILDDIR)/out/ иначе + или $(BUILDDIR)/out/ иначе
- формируются отчёты, если запрошены (REPORTS)

36
bin/columnize Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# columnize.sh
# Take a list of values and output them in a nicely formatted column view.
# Author: Loïc Cattani "Arko" <loic cattani at gmail com>
# https://github.com/Arko/Columnize
values=($*)
longest_value=0
# Find the longest value
for value in ${values[@]}; do
if [[ ${#value} -gt $longest_value ]]; then
longest_value=${#value}
fi
done
# Compute column span
term_width=${COLUMNS:-$(tput cols)}
(( columns = $term_width / ($longest_value + 2) ))
# Print values with pretty column width
curr_col=0
for value in ${values[@]}; do
value_len=${#value}
echo -n $value
(( spaces_missing = $longest_value - $value_len + 2 ))
printf "%*s" $spaces_missing
(( curr_col++ ))
if [[ $curr_col == $columns ]]; then
echo
curr_col=0
fi
done
# Make sure there is a newline at the end
if [[ $curr_col != 0 ]]; then echo; fi

4
bin/report-filter Executable file
View File

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

33
bin/report-targets Executable file
View File

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

52
bin/report-targets2vars Executable file
View File

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

View File

@@ -32,3 +32,14 @@
- $$(VAR) раскрываются позже, при включении $(CONFIG) и востребовании - $$(VAR) раскрываются позже, при включении $(CONFIG) и востребовании
значений; в этом случае их значения могут изменяться до окончания значений; в этом случае их значения могут изменяться до окончания
конфигурации, а также зависеть от значений других переменных конфигурации, а также зависеть от значений других переменных
По спискам пакетов:
- на этапе экспериментирования можно забивать прямо в описание образа
- при фиксации состояния стоит воспользоваться существующими списками,
а дополнительные оформить как можно более чётко обособленными по тем
задачам, для решения которых они и подобраны
- повторяющиеся логически связанные группы списков может иметь смысл
выделить в фичу (см., например, power или x11)
- если явной фичи не наблюдается, но у группы дистрибутивов намечается
заметная общая часть -- её можно выделить в промежуточную цель вида
distro/.name, не являющуюся самостоятельно собираемой

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

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

View File

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

View File

@@ -2,53 +2,55 @@
ifeq (distro,$(IMAGE_CLASS)) ifeq (distro,$(IMAGE_CLASS))
distro/syslinux: distro/.init \ distro/syslinux: distro/.init \
use/syslinux/localboot.cfg use/syslinux/ui-vesamenu \ use/syslinux/localboot.cfg use/syslinux/ui/vesamenu use/hdt; @:
use/hdt use/memtest
distro/dos: distro/.init use/dos use/syslinux/ui-menu distro/dos: distro/.init use/dos use/syslinux/ui/menu; @:
distro/rescue: distro/.base use/rescue 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-systemd: distro/.base use/live/base use/systemd
distro/.live-x11: distro/live use/firmware use/power/acpi/button distro/.live-base: distro/.base use/live/base use/power/acpi/button; @:
distro/.live-desktop: distro/.base +live use/syslinux/ui/vesamenu; @:
distro/.live-kiosk: distro/.base use/live/base use/live/autologin \
use/syslinux/timeout/1 use/cleanup +power
@$(call add,LIVE_PACKAGES,fonts-ttf-dejavu)
@$(call add,CLEANUP_PACKAGES,'alterator*' 'guile*' 'vim-common')
distro/live-isomd5sum: distro/.base use/live/base use/isomd5sum distro/live-isomd5sum: distro/.base use/live/base use/isomd5sum
@$(call add,LIVE_PACKAGES,livecd-isomd5sum) @$(call add,LIVE_PACKAGES,livecd-isomd5sum)
distro/live-builder: pkgs := livecd-tmpfs livecd-online-repo mkimage-profiles distro/live-builder: pkgs := livecd-tmpfs livecd-online-repo mkimage-profiles
distro/live-builder: distro/.base use/repo/main \ distro/live-builder: distro/.live-base use/dev/mkimage use/dev/repo
use/live/base use/dev/mkimage use/power/acpi/button
@$(call add,LIVE_LISTS,$(call tags,base && (server || builder))) @$(call add,LIVE_LISTS,$(call tags,base && (server || builder)))
@$(call add,LIVE_PACKAGES,zsh sudo)
@$(call add,LIVE_PACKAGES,$(pkgs)) @$(call add,LIVE_PACKAGES,$(pkgs))
@$(call add,LIVE_PACKAGES,zsh sudo apt-repo)
@$(call add,MAIN_PACKAGES,rpm-build basesystem)
@$(call add,MAIN_PACKAGES,fakeroot sisyphus_check)
@$(call add,MAIN_PACKAGES,syslinux pciids memtest86+ mkisofs)
@$(call add,MAIN_PACKAGES,file make-initrd make-initrd-propagator)
@$(call add,MAIN_PACKAGES,$(pkgs)) @$(call add,MAIN_PACKAGES,$(pkgs))
@$(call add,MAIN_PACKAGES,syslinux pciids memtest86+ mkisofs)
distro/live-install: distro/.base use/live/base use/syslinux/localboot.cfg distro/live-install: distro/.live-base use/syslinux/localboot.cfg
@$(call add,LIVE_PACKAGES,live-install) @$(call add,LIVE_PACKAGES,live-install)
distro/live-icewm: distro/.live-x11 use/live/autologin distro/livecd-install: distro/.live-base use/syslinux/localboot.cfg
@$(call add,LIVE_LISTS, \ @$(call add,LIVE_PACKAGES,livecd-install)
$(call tags,(base || desktop) && (live || network || icewm)))
distro/live-razorqt: distro/.live-x11 use/x11/lightdm use/syslinux/ui-vesamenu distro/live-icewm: distro/.live-desktop use/live/autologin +icewm; @:
@$(call add,LIVE_LISTS, \ distro/live-razorqt: distro/.live-desktop +razorqt; @:
$(call tags,(base || desktop) && (live || network || razorqt))) distro/live-tde: distro/.live-desktop use/live/ru +tde; @:
distro/live-tde: distro/.live-x11 use/x11/kdm use/syslinux/ui-vesamenu
@$(call add,LIVE_LISTS, \
$(call tags,(base || desktop) && (live || network || tde)))
distro/live-rescue: distro/live-icewm distro/live-rescue: distro/live-icewm
@$(call add,LIVE_LISTS,$(call tags,rescue && (fs || live || x11))) @$(call add,LIVE_LISTS,$(call tags,rescue && (fs || live || x11)))
@$(call add,LIVE_LISTS, \ @$(call add,LIVE_LISTS, \
$(call tags,(base || extra) && (archive || rescue || network))) $(call tags,(base || extra) && (archive || rescue || network)))
distro/live-webkiosk: distro/.live-x11 use/live/autologin use/live/hooks distro/live-webkiosk-mini: distro/.live-kiosk use/live/hooks use/live/ru
@$(call add,LIVE_LISTS,$(call tags,desktop && (live || network)))
@$(call add,LIVE_PACKAGES,livecd-webkiosk) @$(call add,LIVE_PACKAGES,livecd-webkiosk)
@$(call add,LIVE_PACKAGES,fonts-ttf-dejavu fonts-ttf-droid) @$(call add,CLEANUP_PACKAGES,'libqt4*' 'qt4*')
distro/live-webkiosk: distro/live-webkiosk-mini use/live/desktop; @:
distro/live-flightgear: distro/live-icewm use/live/sound use/x11/3d-proprietary
@$(call add,LIVE_PACKAGES,FlightGear fgo input-utils)
@$(call try,HOMEPAGE,http://www.4p8.com/eric.brasseur/flight_simulator_tutorial.html)
endif endif

View File

@@ -1,9 +1,14 @@
# server distributions # server distributions
ifeq (distro,$(IMAGE_CLASS)) ifeq (distro,$(IMAGE_CLASS))
distro/.server-base: distro/.installer use/syslinux/ui-menu use/memtest distro/.server-base: distro/.installer use/syslinux/ui/menu use/memtest
@$(call add,BASE_LISTS,server-base) @$(call add,BASE_LISTS,server-base)
distro/server-nano: distro/.server-base \
use/cleanup/x11-alterator use/bootloader/lilo
@$(call add,BASE_LISTS,$(call tags,server network))
@$(call add,BASE_PACKAGES,dhcpcd cpio)
distro/server-mini: distro/.server-base use/cleanup/x11-alterator distro/server-mini: distro/.server-base use/cleanup/x11-alterator
@$(call set,KFLAVOURS,el-smp) @$(call set,KFLAVOURS,el-smp)
@$(call add,THE_KMODULES,e1000e igb) @$(call add,THE_KMODULES,e1000e igb)
@@ -12,9 +17,9 @@ distro/server-mini: distro/.server-base use/cleanup/x11-alterator
$(call tags,base && (server || network || security || pkg))) $(call tags,base && (server || network || security || pkg)))
@$(call add,BASE_LISTS,$(call tags,extra (server || network))) @$(call add,BASE_LISTS,$(call tags,extra (server || network)))
distro/server-systemd: distro/server-mini use/systemd use/bootloader/lilo distro/server-systemd: distro/server-mini use/systemd use/bootloader/lilo; @:
distro/server-ovz: distro/server-mini \ distro/server-ovz: distro/server-mini use/install2/net \
use/hdt use/rescue use/firmware/server use/power/acpi/button use/hdt use/rescue use/firmware/server use/power/acpi/button
@$(call set,STAGE1_KFLAVOUR,std-def) @$(call set,STAGE1_KFLAVOUR,std-def)
@$(call set,KFLAVOURS,std-def ovz-el) @$(call set,KFLAVOURS,std-def ovz-el)
@@ -22,7 +27,6 @@ distro/server-ovz: distro/server-mini \
@$(call add,MAIN_KMODULES,bcmwl ndiswrapper) @$(call add,MAIN_KMODULES,bcmwl ndiswrapper)
@$(call add,MAIN_KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons) @$(call add,MAIN_KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,MAIN_KMODULES,drbd83 kvm) @$(call add,MAIN_KMODULES,drbd83 kvm)
@$(call add,INSTALL2_PACKAGES,curl) ### should become curl-mini
@$(call add,BASE_LISTS,ovz-server) @$(call add,BASE_LISTS,ovz-server)
@$(call add,MAIN_LISTS,kernel-wifi) @$(call add,MAIN_LISTS,kernel-wifi)
@$(call add,MAIN_GROUPS,dns-server http-server ftp-server kvm-server) @$(call add,MAIN_GROUPS,dns-server http-server ftp-server kvm-server)
@@ -31,7 +35,7 @@ distro/server-ovz: distro/server-mini \
# tiny network-only server-ovz installer (stage2 comes over net too) # tiny network-only server-ovz installer (stage2 comes over net too)
distro/server-ovz-netinst: distro/.base sub/stage1 use/stage2 \ distro/server-ovz-netinst: distro/.base sub/stage1 use/stage2 \
use/syslinux/ui-menu use/syslinux/localboot.cfg use/memtest use/syslinux/ui/menu use/syslinux/localboot.cfg use/memtest
@$(call add,SYSLINUX_CFG,netinstall2) @$(call add,SYSLINUX_CFG,netinstall2)
endif endif

View File

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

View File

@@ -2,7 +2,7 @@
~~~~ ~~~~
Особенности дистрибутива, не учитываемые в пакетной базе Особенности дистрибутива, не учитываемые в пакетной базе
или зависящие от переменных времени сборки/установки образа, или зависящие от переменных времени сборки/установки образа,
могут быть оформлены несколькими образами: могут быть оформлены как:
* scripts.d/ или image-scripts.d/ различных стадий; * scripts.d/ или image-scripts.d/ различных стадий;
* пакеты installer-feature-* * пакеты installer-feature-*
@@ -10,7 +10,7 @@
В большинстве случаев можно рекомендовать создание feature В большинстве случаев можно рекомендовать создание feature
средствами метапрофиля, поскольку при этом дерево кода более средствами метапрофиля, поскольку при этом дерево кода более
удобно для анализа и обновления (и в отличие от m-p-d, нет удобно для анализа и обновления (и в отличие от m-p-d -- нет
вынужденной необходимости либо контролировать включение нужных вынужденной необходимости либо контролировать включение нужных
фич "вручную" в скриптах по косвенным признакам, либо выносить фич "вручную" в скриптах по косвенным признакам, либо выносить
их в пакеты installer-feature-*). их в пакеты installer-feature-*).

View File

@@ -1,4 +1,5 @@
# sample ~/.mkimage/profiles.mk # sample ~/.mkimage/profiles.mk
# NB: REPORT doesn't work here, it's somewhat special
# 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) #APTCONF = ~/apt/apt.conf.$(ARCH)

View File

@@ -14,9 +14,9 @@
+ см. ../lib/build.mk + см. ../lib/build.mk
- ARCHES - ARCHES
+ задаёт набор целевых архитектур образов + задаёт набор целевых архитектур при параметрическом задании APTCONF
+ значение: пусто (по умолчанию авто) либо список через пробел + значение: пусто (по умолчанию авто) либо список через пробел
+ см. ../Makefile + см. ../Makefile, profiles.mk.sample
- BELL - BELL
+ подаёт сигнал после завершения сборки + подаёт сигнал после завершения сборки
@@ -55,6 +55,11 @@
+ значение: пусто (по умолчанию), 1 или 2 + значение: пусто (по умолчанию), 1 или 2
+ см. ../lib/log.mk + см. ../lib/log.mk
- HOMEPAGE, HOMENAME, HOMEWAIT
+ указывают адрес, название и таймаут перехода для домашней страницы
+ значение: корректный URL, строка, целое неотрицательное число
+ см. ../features.in/live/generate.mk (тж. по умолчаниям)
- ISOHYBRID - ISOHYBRID
+ включает постобработку ISO-образа isohybrid + включает постобработку ISO-образа isohybrid
+ значение: пусто (по умолчанию) либо любая строка + значение: пусто (по умолчанию) либо любая строка
@@ -65,11 +70,25 @@
+ значение: пусто (по умолчанию) либо любая строка + значение: пусто (по умолчанию) либо любая строка
+ см. ../lib/build.mk + см. ../lib/build.mk
- REPORT
+ запрашивает создание отчёта о собранном образе
+ значение: пусто (по умолчанию) либо любая строка
+ NB: в силу специфики обработки передаётся только явно
+ см. ../Makefile, ../report.mk, ../lib/report.mk
- SAVE_PROFILE - SAVE_PROFILE
+ сохраняет архив сгенерированного профиля в .disk/ + сохраняет архив сгенерированного профиля в .disk/
+ значение: пусто (по умолчанию) либо любая строка + значение: пусто (по умолчанию) либо любая строка
+ см. ../image.in/Makefile + см. ../image.in/Makefile
- SQUASHFS
+ определяет характер сжатия squashfs для stage2
+ значение:
- пусто (по умолчанию) либо normal: xz
- tight: xz с -Xbcj по платформе (лучше, но дольше -- подбор в два прохода)
- fast: gzip/lzo (быстрее запаковывается и распаковывается, меньше степень)
+ см. ../features.in/stage2/stage1/scripts.d/03-test-kernel
пример пример
~~~~~~ ~~~~~~
make DEBUG=1 CLEAN=1 distro/syslinux.iso make DEBUG=1 CLEAN=1 distro/syslinux.iso

View File

@@ -15,6 +15,11 @@
в списке, содержащемся в этой переменной, то она не задействуется в списке, содержащемся в этой переменной, то она не задействуется
при построении профиля, а только при сборке конфигурации. при построении профиля, а только при сборке конфигурации.
Для наиболее ходовых целей use/*, особенно если их много, можно
создавать цели-алиасы +* (например, +power). Просьба относиться
вдумчиво, т.к. в дальнейшем предполагается визуализировать такие
цели в UI конфигурирования образа.
Остальное содержимое является дополнительным и используется Остальное содержимое является дополнительным и используется
в таком порядке (см. ../Makefile): в таком порядке (см. ../Makefile):

View File

@@ -2,15 +2,29 @@
# (only regarding the needed subprofiles) # (only regarding the needed subprofiles)
ifndef BUILDDIR ifndef BUILDDIR
help all:
help/plus all: banner
@$(call grepper,'^+')
help/features: banner
@$(call grepper,'^use/')
banner:
@echo "** BUILDDIR not defined; available features:" @echo "** BUILDDIR not defined; available features:"
grepper = $(and $(1),$(grepper_body))
define grepper_body
@for dir in */; do \ @for dir in */; do \
echo -n "$$dir: "; \ out="`grep -h $(1) $$dir/config.mk \
grep -h '^use/' $$dir/config.mk \
| cut -f1 -d: \ | cut -f1 -d: \
| tr ' ' '\n\n' \
| grep $(1) \
| tr '\n' ' ' \ | tr '\n' ' ' \
| sort -u; \ | sort -u`"; \
[ -z "$$out" ] || echo "$$dir: $$out"; \
done done
endef
else else
include $(BUILDDIR)/distcfg.mk include $(BUILDDIR)/distcfg.mk

View File

@@ -22,6 +22,10 @@
построенных на одном базовом, можно воспользоваться подкаталогом построенных на одном базовом, можно воспользоваться подкаталогом
с именем исходного базового субпрофиля (см. $src, $dst в Makefile). с именем исходного базового субпрофиля (см. $src, $dst в Makefile).
Наиболее употребительные цели можно снабжать "ярлычками" вроде
"+icewm" с тем, чтобы сделать более краткими и выразительными
использующие их правила. Просьба не злоупотреблять количеством.
Каталог lib/ является специфическим для фич, определяющих Каталог lib/ является специфическим для фич, определяющих
построение конкретного вида образа -- см. build-*/. построение конкретного вида образа -- см. build-*/.

View File

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

View File

@@ -4,7 +4,17 @@
# take the latter part # take the latter part
SUBDIRS = $(notdir $(SUBPROFILES)) SUBDIRS = $(notdir $(SUBPROFILES))
BOOT_TYPE = isolinux # proxy over the ISO metadata collected; see also genisoimagerc(5)
BOOT_SYSI := $(META_SYSTEM_ID)
BOOT_PUBL := $(META_PUBLISHER)
BOOT_PREP := $(META_PREPARER)
BOOT_APPI := $(META_APP_ID)
BOOT_VOLI := $(META_VOL_ID)
BOOT_VOLS := $(META_VOL_SET)
BOOT_BIBL := $(META_BIBLIO)
BOOT_ABST := $(META_ABSTRACT)
BOOT_TYPE := isolinux
# Metadata/ needed only for installers (and not for e.g. syslinux.iso) # Metadata/ needed only for installers (and not for e.g. syslinux.iso)
# FIXME: installable live needs it too, don't move to install2 feature # FIXME: installable live needs it too, don't move to install2 feature

View File

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

View File

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

View File

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

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

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

View File

@@ -0,0 +1,15 @@
#!/bin/sh
# dump what's here by this point
echo "** live packages before rpmdb purge:"
rpmquery -a --qf='%{NAME} %{VERSION}-%{RELEASE}\n'
# remove apt database and cache
find /var/lib/apt /var/cache/apt -type f -delete
# not going to need them without rpmdb, it's not even rescue anymore
rpm -e --nodeps apt libapt rpm librpmbuild librpm 2>/dev/null ||:
# finally, drop rpmdb
find /var/lib/rpm -type f -delete
:

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
#!/bin/sh -x #!/bin/sh
# create a barebone bootable freedos floppy # create a barebone bootable freedos floppy
# TODO: some sub-framework to populate it as well # TODO: some sub-framework to populate it as well

View File

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

View File

@@ -6,4 +6,5 @@
чтобы в компактном livecd, которым является инсталятор, оказались чтобы в компактном livecd, которым является инсталятор, оказались
нужные им утилиты (INSTALL2_PACKAGES). Перегружать его не следует, нужные им утилиты (INSTALL2_PACKAGES). Перегружать его не следует,
поскольку это прямо влияет на требования по минимальному размеру поскольку это прямо влияет на требования по минимальному размеру
оперативной памяти для установки. оперативной памяти для установки (если не задействован параметр
загрузки ядра lowmem, обрабатываемый propagator).

View File

@@ -4,3 +4,7 @@ use/install2: use/stage2 sub/stage2/install2 use/cleanup/installer
@$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator) @$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator)
@$(call add,BASE_PACKAGES,branding-$$(BRANDING)-release) @$(call add,BASE_PACKAGES,branding-$$(BRANDING)-release)
@$(call add,BASE_LISTS,$(call tags,basesystem)) @$(call add,BASE_LISTS,$(call tags,basesystem))
### FR: curl-mini
use/install2/net: use/install2
@$(call add,INSTALL2_PACKAGES,curl)

View File

@@ -27,6 +27,4 @@ rpmquery -a cpp\* gcc\* perl-base file ipv6calc \
rpmquery -a bind-utils libbind \ rpmquery -a bind-utils libbind \
| xargs -r rpmi -e -- | xargs -r rpmi -e --
# outstanding binaries :
rm -f /sbin/{sln,tc}
rm -f /usr/bin/openssl

View File

@@ -107,17 +107,3 @@ rm -rf /lib/modules/*/kernel/net/tipc
rm -rf /lib/modules/*/kernel/net/{wimax,wireless,mac80211} rm -rf /lib/modules/*/kernel/net/{wimax,wireless,mac80211}
rm -rf /lib/modules/*/kernel/net/x25 rm -rf /lib/modules/*/kernel/net/x25
rm -rf /lib/modules/*/kernel/sound rm -rf /lib/modules/*/kernel/sound
# 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
# regenerate module dependencies
for i in /lib*/modules/*; do
/sbin/depmod -a -F /boot/System.map-${i##*/} ${i##*/}
done
# kernel images
rm -rf /boot/*

View File

@@ -12,11 +12,14 @@ rm -f /usr/lib*/gconv/BIG5*
rm -f /usr/lib*/gconv/EBCDIC* rm -f /usr/lib*/gconv/EBCDIC*
# en_* variations # en_* variations
rm -rf /usr/{lib*,share}/locale/en_[^U]* rm -rf /usr/{lib,share}/locale/en_[^U]*
# mods
rm -rf /usr/{lib,share}/locale/*@*
# non-utf8 locales # non-utf8 locales
find /usr/lib*/locale -mindepth 1 -maxdepth 1 -type d \! -name '*.utf8' -print0 | find /usr/lib/locale -mindepth 1 -maxdepth 1 -type d \! -name '*.utf8' -print0 |
xargs -r0 rm -rf -- xargs -r0 rm -rf --
# dangling symlinks # dangling symlinks
find /usr/lib*/locale \! -readable -delete find /usr/lib/locale \! -readable -delete

View File

@@ -1,6 +1,12 @@
# remove rpm database #!/bin/sh
rm -rf /var/lib/rpm/* # dump what's here by this point
echo "** install2 packages before rpmdb purge:"
rpmquery -a --qf='%{NAME} %{VERSION}-%{RELEASE}\n'
# remove apt data files # not going to need them without rpmdb, it's not even rescue anymore
rm -rf /var/cache/apt /var/lib*/apt apt-get remove -f -y apt libapt
# remove rpm, apt databases and cache
find /var/lib/rpm /var/lib/apt /var/cache/apt -type f -delete
:

View File

@@ -3,7 +3,10 @@
так и с USB-флэшки. так и с USB-флэшки.
Можно указать в цепочке зависимостей дистрибутива явно с тем, Можно указать в цепочке зависимостей дистрибутива явно с тем,
чтобы гарантировать гибридный вид образа; в экспериментальном чтобы гарантировать гибридный вид образа, либо запросить включение
порядке сделана возможность запросить включение этой фичи при этой фичи при сборке конфигурации произвольного дистрибутива
сборке конфигурации произвольного дистрибутива
(ISOHYBRID=1, см. ../pack/config.mk). (ISOHYBRID=1, см. ../pack/config.mk).
Обратите внимание: в propagator до 20101130-alt15 поддержка
автоматической загрузки с флэш-носителя и при этом ISO-образа
отсутствует, что компенсируется специальной обработкой в gfxboot.

View File

@@ -1,3 +1,4 @@
Эта фича дополняет базовый "живой" образ второй стадии Эта фича дополняет базовый "живой" образ второй стадии
специфическими для полноценного LiveCD настройками специфическими для полноценного LiveCD настройками
и скриптовыми хуками. и скриптовыми хуками, а также создаёт файл index.html
с домашней страницей (редиректором) в корне образа.

View File

@@ -1,16 +1,32 @@
+live: use/live/desktop; @:
# copy stage2 as live # copy stage2 as live
# NB: starts to preconfigure but doesn't use/cleanup yet
use/live: use/stage2 sub/stage2/live use/live: use/stage2 sub/stage2/live
@$(call add_feature) @$(call add_feature)
@$(call add,CLEANUP_PACKAGES,'installer*')
use/live/base: use/live use/syslinux/ui-menu use/live/base: use/live use/syslinux/ui/menu
@$(call add,LIVE_LISTS,$(call tags,base && (live || network))) @$(call add,LIVE_LISTS,$(call tags,base && (live || network)))
use/live/x11: use/live/base use/x11/xorg use/x11/wacom use/virtualbox/guest # optimized out: use/x11/xorg
use/live/desktop: use/live/base use/x11/wacom use/virtualbox/guest \
use/live/sound +power
@$(call add,LIVE_LISTS,$(call tags,desktop && (live || network)))
@$(call add,LIVE_PACKAGES,fonts-ttf-dejavu fonts-ttf-droid)
@$(call add,SYSLINUX_CFG,localboot)
# NB: there's an unconditional live/image-scripts.d/40-autologin script # 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 # *but* it only configures some of the *existing* means; let's add one
use/live/autologin: use/live/x11 # for the cases when there should be no display manager
use/live/autologin: use/live use/x11/xorg
@$(call add,LIVE_PACKAGES,autologin xinit) @$(call add,LIVE_PACKAGES,autologin xinit)
use/live/hooks: use/live use/live/hooks: use/live
@$(call add,LIVE_PACKAGES,livecd-run-hooks) @$(call add,LIVE_PACKAGES,livecd-run-hooks)
use/live/ru: use/live
@$(call add,LIVE_PACKAGES,livecd-ru)
use/live/sound: use/live
@$(call add,LIVE_PACKAGES,amixer alsa-utils aplay udev-alsa)

View File

@@ -0,0 +1,37 @@
# set up livecd browser redirection page
ifdef BUILDDIR
include $(BUILDDIR)/distcfg.mk
ifndef HOMEPAGE
HOMEPAGE = http://www.altlinux.org/
endif
ifndef HOMENAME
HOMENAME = ALT Linux
endif
ifndef HOMEWAIT
HOMEWAIT = 3
endif
INDEXHTML := $(BUILDDIR)/stage1/files/index.html
all: debug
@if [ -s "$(INDEXHTML)" ]; then \
sed -i \
-e 's,@homepage@,$(HOMEPAGE),' \
-e 's,@homename@,$(HOMENAME),' \
-e 's,@homewait@,$(HOMEWAIT),' \
$(INDEXHTML); \
fi
debug:
@if [ -n "$(DEBUG)" ]; then \
echo "** HOMEPAGE: $(HOMEPAGE)"; \
echo "** HOMENAME: $(HOMENAME)"; \
echo "** HOMEWAIT: $(HOMEWAIT)"; \
fi
endif

View File

@@ -1,4 +1,4 @@
#!/bin/sh -x #!/bin/sh
# * reset password for root # * reset password for root
# * add user `altlinux' (without password) # * add user `altlinux' (without password)

View File

@@ -1,7 +1,7 @@
#!/bin/sh -ef #!/bin/sh -ef
if [ ! -x /usr/bin/X ]; then if [ ! -x /usr/bin/X ]; then
echo "warning: autologin feature requested but X not installed" >&2 echo "SKIP autologin: X not installed" >&2
exit 0 exit 0
fi fi

View File

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

View File

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

View File

@@ -2,4 +2,4 @@
- загрузку бездисковых тонких клиентов по сети; - загрузку бездисковых тонких клиентов по сети;
- предоставление им доступа к серверу приложений. - предоставление им доступа к серверу приложений.
На данный момент является совсем экспериментальной. На данный момент является экспериментальной.

View File

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

View File

@@ -1,3 +1,5 @@
+power: use/power/acpi/button use/power/acpi/cpufreq; @:
# common # common
# TODO: invent multi-target scripts and integrate that 08-powerbutton # TODO: invent multi-target scripts and integrate that 08-powerbutton
use/power: use/power:
@@ -18,4 +20,4 @@ use/power/acpi/powersave: use/power/acpi
# legacy power management # legacy power management
use/power/apm: use/power use/power/apm: use/power
@$(call add,COMMON_PACKAGES,apmd) @$(call add,COMMON_PACKAGES,apmd lphdisk)

View File

@@ -1,32 +1,55 @@
#!/bin/sh #!/bin/sh
# NB: -f prohibited in this shebang
# check relevant kernel features availability # check relevant kernel features availability
GZ_OPTS="-comp gzip" CONFIGS=/boot/config-*
XZ_OPTS="-comp xz -b 524288 -noI" GZ_OPTS="-comp gzip -noI"
XZ_OPTS="-comp xz"
LZO_OPTS="-comp lzo -noI"
verbose() { [ -n "$GLOBAL_VERBOSE" ] && echo "** $@" >&2; }
fatal() { echo "** error: $@" >&2; exit 1; }
configured()
{
local option="CONFIG_$1"
if grep -q "^$option" $CONFIGS; then
verbose "${option%=*} available"
return 0
else
return 1
fi
}
ls $CONFIGS >&/dev/null || fatal "no stage1 kernel config found in /boot"
# test for installer-required filesystems support # test for installer-required filesystems support
for opt in CONFIG_SQUASHFS CONFIG_AUFS_FS; do for opt in SQUASHFS AUFS_FS; do
if grep -q "^$opt=[my]$" /boot/config-*; then configured "$opt=[my]" || fatal "stage1 kernel must have $opt support"
[ -n "$GLOBAL_VERBOSE" ] && echo "** $opt available"
else
if [ "$?" = 1 ]; then # a file exists but lacks the pattern
echo "** error: stage1 kernel must have $opt support" >&2
exit 1
fi
fi
done done
# squashfs options: not really neccessary but better than none verbose "GLOBAL_SQUASHFS: $GLOBAL_SQUASHFS"
# NB: this config file should be carried over into install2
if grep -q '^CONFIG_SQUASHFS_XZ=y$' /boot/config-*; then options()
# TODO: figure out if it's generally worth it even on x86: {
# if binaries account for less than ~70% of blocks, # squashfs options: not really neccessary but better than none
# the decompression filter overhead might hurt # NB: this config file should be carried over into install2
# NB: there are arm, powerpc and some other filters too if [ "$GLOBAL_SQUASHFS" != "fast" ] && configured "SQUASHFS_XZ=y"; then
if grep -q "^CONFIG_X86" /boot/config-*; then # NB: the decompression filter overhead might hurt
XZ_OPTS="$XZ_OPTS -Xbcj x86" # NB: there are arm, powerpc and some other filters too
if [ "$GLOBAL_SQUASHFS" = "tight" ] && configured "X86"; then
XZ_OPTS="$XZ_OPTS -b 524288 -Xbcj x86"
else
XZ_OPTS="$XZ_OPTS -b 262144 -noI"
fi
echo "$XZ_OPTS"
else # go fast, or even faster if possible
if configured "SQUASHFS_LZO=y"; then
echo "$LZO_OPTS"
else # safe default
echo "$GZ_OPTS"
fi
fi fi
echo "PACK_SQUASHFS_OPTS=$XZ_OPTS" > /.image/squashcfg.mk }
else
echo "PACK_SQUASHFS_OPTS=$GZ_OPTS" > /.image/squashcfg.mk echo "PACK_SQUASHFS_OPTS=-no-recovery `options`" > /.image/squashcfg.mk
fi

View File

@@ -2,8 +2,9 @@
реализуется в рамках stage1. реализуется в рамках stage1.
Цели config.mk: Цели config.mk:
* use/syslinux/ui-% -- конфигурирование интерфейса (см. cfg.in/00*.cfg); * use/syslinux/ui/% -- конфигурирование интерфейса (см. cfg.in/00*.cfg);
при использовании автоматически добавляют syslinux в FEATURES; при использовании автоматически добавляют syslinux в FEATURES;
* use/syslinux/timeout/% -- задание таймаута автозагрузки (в десятых секунды);
* use/syslinux/%.com, use/syslinux/%.c32 -- подключение одноименных модулей * use/syslinux/%.com, use/syslinux/%.c32 -- подключение одноименных модулей
(копирование бинарников и включение кусочков конфигурации; экспериментальное); (копирование бинарников и включение кусочков конфигурации; экспериментальное);
* use/syslinux/%.cfg -- подключение кусочков конфигурации. * use/syslinux/%.cfg -- подключение кусочков конфигурации.

View File

@@ -0,0 +1,2 @@
timeout @timeout@
totaltimeout 3000

View File

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

View File

@@ -2,9 +2,10 @@
use/syslinux: sub/stage1 use/syslinux: sub/stage1
@$(call add_feature) @$(call add_feature)
@$(call add,STAGE1_PACKAGES,syslinux) @$(call add,STAGE1_PACKAGES,syslinux)
@$(call try,META_SYSTEM_ID,SYSLINUX)
# UI is overwritten # UI is overwritten
use/syslinux/ui-%: use/syslinux use/syslinux/ui/%: use/syslinux
@$(call set,SYSLINUX_UI,$*) @$(call set,SYSLINUX_UI,$*)
@if [ "$*" == gfxboot ]; then \ @if [ "$*" == gfxboot ]; then \
$(call add,STAGE1_PACKAGES,gfxboot); \ $(call add,STAGE1_PACKAGES,gfxboot); \
@@ -17,3 +18,6 @@ use/syslinux/%.com use/syslinux/%.c32: use/syslinux
use/syslinux/%.cfg: use/syslinux use/syslinux/%.cfg: use/syslinux
@$(call add,SYSLINUX_CFG,$*) @$(call add,SYSLINUX_CFG,$*)
use/syslinux/timeout/%: use/syslinux
@$(call set,SYSLINUX_TIMEOUT,$*)

View File

@@ -1,5 +1,8 @@
ifdef BUILDDIR ifdef BUILDDIR
# in deciseconds
DEFAULT_TIMEOUT = 90
# prepare data for syslinux installation; # prepare data for syslinux installation;
# see also stage1/scripts.d/01-syslinux # see also stage1/scripts.d/01-syslinux
@@ -44,15 +47,27 @@ cfg = $(wildcard cfg.in/??$(1).cfg)
# and files involved will appear inside instrumental chroot # and files involved will appear inside instrumental chroot
# #
# arguments get evaluated before recipe body execution thus prep # arguments get evaluated before recipe body execution thus prep
all: prep debug
@cp -pLt $(DSTDIR) -- $(sort \ all: debug timeout
$(foreach C,$(SYSLINUX_CFG),$(call cfg,$(C))) \
$(foreach M,$(SYSLINUX_MODULES),$(call cfg,$(M))))
@### proper text branding should be implemented @### proper text branding should be implemented
@sed -i 's,@mkimage-profiles@,$(IMAGE_NAME),' $(DSTDIR)/*.cfg @sed -i 's,@mkimage-profiles@,$(IMAGE_NAME),' $(DSTDIR)/*.cfg
@echo $(SYSLINUX_MODULES) > $(DSTDIR)/modules.list @echo $(SYSLINUX_MODULES) > $(DSTDIR)/modules.list
@echo $(SYSLINUX_FILES) > $(DSTDIR)/syslinux.list @echo $(SYSLINUX_FILES) > $(DSTDIR)/syslinux.list
# integerity check
timeout: copy
@if [ "$(SYSLINUX_TIMEOUT)" -ge 0 ] 2>/dev/null; then \
TIMEOUT="$(SYSLINUX_TIMEOUT)"; \
else \
TIMEOUT="$(DEFAULT_TIMEOUT)"; \
fi; \
sed -i "s,@timeout@,$$TIMEOUT," $(DSTDIR)/*.cfg
copy: prep
@cp -pLt $(DSTDIR) -- $(sort \
$(foreach C,$(SYSLINUX_CFG),$(call cfg,$(C))) \
$(foreach M,$(SYSLINUX_MODULES),$(call cfg,$(M))))
prep: prep:
@mkdir -p $(DSTDIR) @mkdir -p $(DSTDIR)

View File

@@ -1,4 +1,4 @@
#!/bin/sh -x #!/bin/sh
# postprocess isolinux configuration # postprocess isolinux configuration
# when the image sizes are finally known # when the image sizes are finally known

View File

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

View File

@@ -1,9 +1,24 @@
+icewm: use/x11/icewm; @:
+razorqt: use/x11/razorqt use/x11/lightdm; @:
+tde: use/x11/tde use/x11/kdm; @:
use/x11/xorg: use/x11/xorg:
@$(call add,THE_LISTS,xorg) @$(call add,THE_LISTS,xorg)
@$(call add,THE_KMODULES,drm)
use/x11/wacom: use/x11/xorg use/x11/wacom: use/x11/xorg
@$(call add,THE_PACKAGES,xorg-drv-wacom) @$(call add,THE_PACKAGES,xorg-drv-wacom xorg-drv-wizardpen)
use/x11/drm: use/x11/xorg
@$(call add,THE_KMODULES,drm drm-radeon)
use/x11/3d-free: use/x11/drm
@$(call add,THE_KMODULES,drm-nouveau)
### fglrx is broken with xorg-1.12 so far
use/x11/3d-proprietary: use/x11/xorg
@$(call add,THE_KMODULES,fglrx nvidia)
@$(call add,THE_PACKAGES,nvidia-settings nvidia-xconfig)
@$(call add,THE_PACKAGES,fglrx_glx fglrx-tools)
### strictly speaking, runlevel5 should require a *dm, not vice versa ### strictly speaking, runlevel5 should require a *dm, not vice versa
use/x11/runlevel5: use/x11/xorg use/x11/runlevel5: use/x11/xorg
@@ -13,9 +28,18 @@ use/x11/runlevel5: use/x11/xorg
use/x11/xdm: use/x11/runlevel5 use/x11/xdm: use/x11/runlevel5
@$(call add,THE_PACKAGES,xdm installer-feature-no-xconsole) @$(call add,THE_PACKAGES,xdm installer-feature-no-xconsole)
use/x11/kdm: use/x11/runlevel5
@$(call add,THE_PACKAGES,kdebase-kdm)
### : some set()-like thing might be better? ### : some set()-like thing might be better?
use/x11/lightdm: use/x11/runlevel5 use/x11/lightdm: use/x11/runlevel5
@$(call add,THE_PACKAGES,lightdm) @$(call add,THE_PACKAGES,lightdm)
use/x11/kdm: use/x11/runlevel5
@$(call add,THE_PACKAGES,kdebase-kdm)
use/x11/icewm: use/x11/xorg
@$(call add,THE_LISTS,$(call tags,icewm desktop))
use/x11/razorqt: use/x11/xorg
@$(call add,THE_LISTS,$(call tags,razorqt desktop))
use/x11/tde: use/x11/xorg
@$(call add,THE_LISTS,$(call tags,tde desktop))

View File

@@ -61,7 +61,8 @@ imagedir:
postprocess: | $(addprefix postprocess-,$(sort $(POSTPROCESS_TARGETS))) postprocess: | $(addprefix postprocess-,$(sort $(POSTPROCESS_TARGETS)))
@OUTPATH="$(IMAGEDIR)/$(IMAGE_OUTFILE)"; \ @OUTPATH="$(IMAGEDIR)/$(IMAGE_OUTFILE)"; \
echo "** image: $$OUTPATH" >&2 && \ OUTSIZE="`ls -lh "$$OUTPATH" | cut -f5 -d' '`"; \
echo "** image: $$OUTPATH [$$OUTSIZE]" >&2 && \
ln -sf "$(IMAGE_OUTFILE)" "$(IMAGEDIR)/$(IMAGE_LINK)" && \ ln -sf "$(IMAGE_OUTFILE)" "$(IMAGEDIR)/$(IMAGE_LINK)" && \
ln -sf "$${IMAGEDIR#`pwd`/}" "$(OUT_LINK)"; \ ln -sf "$${IMAGEDIR#`pwd`/}" "$(OUT_LINK)"; \
ln -sf "$(IMAGE_LINK)" $(OUT_LINK)/"$(CURRENT_LINK).$(IMAGE_TYPE)"; \ ln -sf "$(IMAGE_LINK)" $(OUT_LINK)/"$(CURRENT_LINK).$(IMAGE_TYPE)"; \

View File

@@ -1,11 +1,11 @@
Этот каталог копируется из метапрофиля в профиль "как есть" Этот каталог копируется из метапрофиля в профиль "как есть"
и формирует "затравку" финальной стадии, собирающей собственно и формирует "заготовку" финальной стадии, собирающей собственно
образ из результатов работы индивидуальных субпрофилей образ из результатов работы индивидуальных субпрофилей
(для distro/*) либо непосредственно "на месте" (для ve/*). (для distro/*) либо непосредственно "на месте" (для ve/*).
Содержимое files/ копируется в корень образа. Содержимое files/ копируется в корень образа.
Соответственно для сборки требуется или features.in/build-distro, Соответственно для сборки также потребуется или
или use/build-ve. ../features.in/build-distro, или ../features.in/build-ve.
Пакетная база рабочего чрута минимальна (может чуть расширяться Пакетная база рабочего чрута минимальна (может чуть расширяться
фичами -- см. ../features.in/repo/lib/build-genbasedir.mk фичами -- см. ../features.in/repo/lib/build-genbasedir.mk

View File

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

View File

@@ -31,8 +31,10 @@ IMAGEDIR ?= $(shell \
) )
# actual build starter # actual build starter
# NB: our output MUST go into stderr to escape POSTPROC
build-image: profile/populate build-image: profile/populate
@if [ -n "$(CHECK)" ]; then \ @{ \
if [ -n "$(CHECK)" ]; then \
echo "$(TIME) skipping actual image build (CHECK is set)"; \ echo "$(TIME) skipping actual image build (CHECK is set)"; \
exit; \ exit; \
fi; \ fi; \
@@ -61,4 +63,5 @@ build-image: profile/populate
df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \ df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \
{ print "NB: low space on "$$6" ("$$5" used)"}}'; \ { print "NB: low space on "$$6" ("$$5" used)"}}'; \
fi; \ fi; \
if [ -n "$(BELL)" ]; then echo -ne '\a' >&2; fi if [ -n "$(BELL)" ]; then echo -ne '\a'; fi; \
} >&2

View File

@@ -19,19 +19,23 @@ endif
endif endif
# ordinary clean: destroys workdirs but not the corresponding results # ordinary clean: destroys workdirs but not the corresponding results
# NB: our output MUST go into stderr to escape POSTPROC
clean: clean:
@find -name '*~' -delete >&/dev/null ||: @{ \
@if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \ find -name '*~' -delete >&/dev/null ||:; \
if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
echo "$(TIME) cleaning up $(WARNING)"; \ echo "$(TIME) cleaning up $(WARNING)"; \
$(MAKE) -C "$(SYMLINK)" $@ \ $(MAKE) -C "$(SYMLINK)" $@ \
GLOBAL_BUILDDIR="$(realpath $(SYMLINK))" $(LOG) ||:; \ GLOBAL_BUILDDIR="$(realpath $(SYMLINK))" $(LOG) ||:; \
fi fi; \
} >&2
# there can be some sense in writing log here even if normally # there can be some sense in writing log here even if normally
# $(BUILDDIR)/ gets purged: make might have failed, # $(BUILDDIR)/ gets purged: make might have failed,
# and BUILDLOG can be specified by hand either # and BUILDLOG can be specified by hand either
distclean: clean distclean: clean
@if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \ @{ \
if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
build="$(realpath $(SYMLINK)/)"; \ build="$(realpath $(SYMLINK)/)"; \
if [ "$$build" = / ]; then \ if [ "$$build" = / ]; then \
echo "** ERROR: invalid \`"$(SYMLINK)"' symlink" >&2; \ echo "** ERROR: invalid \`"$(SYMLINK)"' symlink" >&2; \
@@ -41,16 +45,19 @@ distclean: clean
GLOBAL_BUILDDIR="$$build" $(LOG) ||: \ GLOBAL_BUILDDIR="$$build" $(LOG) ||: \
rm -rf "$$build"; \ rm -rf "$$build"; \
fi; \ fi; \
fi fi; \
@rm -f "$(SYMLINK)" rm -f "$(SYMLINK)"; \
} >&2
# builddir existing outside read-only metaprofile is less ephemeral # builddir existing outside read-only metaprofile is less ephemeral
# than BUILDDIR is -- usually it's unneeded afterwards so just zap it # than BUILDDIR is -- usually it's unneeded afterwards so just zap it
postclean: build-image postclean: build-image
@if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" ] || \ @{ \
if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" ] || \
[ ! -L "$(SYMLINK)" -a "0$(DEBUG)" -lt 2 ]; then \ [ ! -L "$(SYMLINK)" -a "0$(DEBUG)" -lt 2 ]; then \
echo "$(TIME) cleaning up after build"; \ echo "$(TIME) cleaning up after build"; \
$(MAKE) -C "$(BUILDDIR)" distclean \ $(MAKE) -C "$(BUILDDIR)" distclean \
GLOBAL_BUILDDIR="$(BUILDDIR)" $(LOG) ||:; \ GLOBAL_BUILDDIR="$(BUILDDIR)" $(LOG) ||:; \
rm -rf "$(BUILDDIR)"; \ rm -rf "$(BUILDDIR)"; \
fi fi; \
} >&2

View File

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

View File

@@ -47,7 +47,8 @@ add_feature = $(call add,FEATURES,$(word 2,$(subst /, ,$@)))
# convert tag list into a list of relative package list paths # convert tag list into a list of relative package list paths
# NB: tags can do boolean expressions: (tag1 && !(tag2 || tag3)) # NB: tags can do boolean expressions: (tag1 && !(tag2 || tag3))
tags = $(and $(strip $(1)),$(addprefix tagged/,$(shell echo "$(1)" | bin/tags2lists pkg.in/lists/tagged))) tags = $(and $(strip $(1)),$(addprefix tagged/,$(shell echo "$(1)" \
| tags2lists pkg.in/lists/tagged)))
# toplevel Makefile convenience # toplevel Makefile convenience
addsuffices = $(foreach s,$(1),$(call addsuffix,$s,$(2))) addsuffices = $(foreach s,$(1),$(call addsuffix,$s,$(2)))

12
lib/help.mk Normal file
View File

@@ -0,0 +1,12 @@
# this makefile holds the most helpful bits for the toplevel one
help/distro:
@echo '** available distribution targets:'; \
columnize $(sort $(DISTROS:distro/%=%))
help/ve:
@echo '** available virtual environment targets:'; \
columnize $(sort $(VES))
help: | help/distro help/space help/ve; @:
help/space:; @echo

View File

@@ -6,6 +6,14 @@ ifndef MKIMAGE_PROFILES
$(error this makefile is designed to be included in toplevel one) $(error this makefile is designed to be included in toplevel one)
endif endif
# 1.3.22 fixes http://bugzilla.altlinux.org/26217
HSH_VER_OPTIMAL = 1.3.22
HSH_VERSION := $(shell hsh -V | sed -n 's/^.* version \([0-9.]\+\).*$$/\1/p')
ifeq (-,$(shell rpmvercmp $(HSH_VERSION) $(HSH_VER_OPTIMAL) | tr -d [0-9]))
$(info warning: hasher-$(HSH_VERSION) is suboptimal, consider upgrading)
endif
BUILDLOG ?= $(BUILDDIR)/build.log BUILDLOG ?= $(BUILDDIR)/build.log
# LOG holds a redirecting postprocessor # LOG holds a redirecting postprocessor

View File

@@ -15,7 +15,7 @@ if [ -s "$(SYMLINK)" -a "$(NUM_TARGETS)" = 1 ] && \
then \ then \
echo "$(BUILDLINK)"; \ echo "$(BUILDLINK)"; \
else \ else \
bin/mktmpdir $(BUILDDIR_PREFIX) || exit 127; \ mktmpdir $(BUILDDIR_PREFIX) || exit 200; \
fi; ) fi; )
endif endif
@@ -26,58 +26,63 @@ endif
# even smart caching only hurts when every build goes from scratch # even smart caching only hurts when every build goes from scratch
NO_CACHE ?= 1 NO_CACHE ?= 1
PATH := $(CURDIR)/bin:$(PATH) export BUILDDIR NO_CACHE
export BUILDDIR NO_CACHE PATH
CONFIG := $(BUILDDIR)/distcfg.mk CONFIG := $(BUILDDIR)/distcfg.mk
RC := $(HOME)/.mkimage/profiles.mk RC := $(HOME)/.mkimage/profiles.mk
# step 1: initialize the off-tree mkimage profile (BUILDDIR) # step 1: initialize the off-tree mkimage profile (BUILDDIR)
# NB: our output MUST go into stderr to escape POSTPROC
profile/init: distclean profile/init: distclean
@if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \ @{ \
if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \
echo "$(TIME) ERROR: invalid BUILDDIR: \`$(BUILDDIR)'"; \ echo "$(TIME) ERROR: invalid BUILDDIR: \`$(BUILDDIR)'"; \
exit 128; \ exit 128; \
fi; fi; \
@echo -n "$(TIME) initializing BUILDDIR: " echo -n "$(TIME) initializing BUILDDIR: "; \
@rsync -qaxH --delete-after image.in/ "$(BUILDDIR)"/ rsync -qaxH --delete-after image.in/ "$(BUILDDIR)"/; \
@mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker mkdir "$(BUILDDIR)"/.mki; \
} >&2
@$(call put,ifndef DISTCFG_MK) @$(call put,ifndef DISTCFG_MK)
@$(call put,DISTCFG_MK = 1) @$(call put,DISTCFG_MK = 1)
@if type -t git >&/dev/null; then \ @{ \
if type -t git >&/dev/null; then \
if [ -d .git ]; then \ if [ -d .git ]; then \
git show-ref --head -d -s -- HEAD && \ git show-ref --head -d -s -- HEAD && \
git status -s && \ git status -s && \
echo; \ echo; \
fi $(LOG); \ fi $(LOG); \
fi fi; \
@{ \ { \
eval `apt-config shell $${APTCONF:+-c=$(wildcard $(APTCONF))} \ eval `apt-config shell $${APTCONF:+-c=$(wildcard $(APTCONF))} \
SOURCELIST Dir::Etc::sourcelist/f \ SOURCELIST Dir::Etc::sourcelist/f \
SOURCEPARTS Dir::Etc::sourceparts/d`; \ SOURCEPARTS Dir::Etc::sourceparts/d`; \
find "$$SOURCEPARTS" -name '*.list' \ find "$$SOURCEPARTS" -name '*.list' \
| xargs egrep -Rhv '^#|^[[:blank:]]*$$' "$$SOURCELIST" && \ | xargs egrep -Rhv '^#|^[[:blank:]]*$$' "$$SOURCELIST" && \
echo; \ echo; \
} $(LOG) } $(LOG); \
@if type -t git >&/dev/null; then \ if type -t git >&/dev/null; then \
if cd $(BUILDDIR); then \ if cd $(BUILDDIR); then \
git init -q && \ git init -q && \
git add . && \ git add . && \
git commit -qam 'derivative profile initialized'; \ git commit -qam 'derivative profile initialized'; \
cd ->&/dev/null; \
fi; \ fi; \
fi fi; \
@if [ -w . ]; then \ if [ -w . ]; then \
rm -f "$(SYMLINK)" && \ rm -f "$(SYMLINK)" && \
ln -s "$(BUILDDIR)" "$(SYMLINK)" && \ ln -s "$(BUILDDIR)" "$(SYMLINK)" && \
echo "$(SYMLINK)/"; \ echo "$(SYMLINK)/"; \
else \ else \
echo "$(BUILDDIR)/" $(SHORTEN); \ echo "$(BUILDDIR)/"; \
fi $(SHORTEN) fi $(SHORTEN); \
} >&2
profile/bare: profile/init profile/bare: profile/init
@NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \ @{ \
echo "$(TIME) preparing distro config$$NOTE" \ NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \
$(SHORTEN) echo "$(TIME) preparing distro config$$NOTE" $(SHORTEN); \
} >&2
@$(call try,MKIMAGE_PREFIX,/usr/share/mkimage) @$(call try,MKIMAGE_PREFIX,/usr/share/mkimage)
@$(call try,GLOBAL_VERBOSE,) @$(call try,GLOBAL_VERBOSE,)
@$(call try,IMAGEDIR,$(IMAGEDIR)) @$(call try,IMAGEDIR,$(IMAGEDIR))
@@ -106,7 +111,7 @@ profile/dump-vars:
fi $(LOG) fi $(LOG)
# step 3 entry point: copy the needed parts into BUILDDIR # step 3 entry point: copy the needed parts into BUILDDIR
profile/populate: profile/init profile/finalize profile/dump-vars profile/populate: profile/finalize profile/dump-vars
@for dir in sub.in features.in pkg.in; do \ @for dir in sub.in features.in pkg.in; do \
$(MAKE) -C $$dir $(LOG); \ $(MAKE) -C $$dir $(LOG); \
done done

9
lib/report.mk Normal file
View File

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

View File

@@ -15,4 +15,4 @@ config/name/%:
@$(call set,IMAGE_NAME,$*) @$(call set,IMAGE_NAME,$*)
# the final thing will pull the rest in # the final thing will pull the rest in
build: postclean build: postclean; @:

View File

@@ -13,6 +13,7 @@ ve/bare: ve/.bare
@$(call add,BASE_PACKAGES,apt) @$(call add,BASE_PACKAGES,apt)
ve/generic: ve/.bare ve/generic: ve/.bare
@$(call add,BASE_PACKAGES,openssh-server openssh-blacklist openssh-clients)
@$(call add,BASE_LISTS,\ @$(call add,BASE_LISTS,\
$(call tags,base && (server || network || security || pkg))) $(call tags,base && (server || network || security || pkg)))

15
main.mk
View File

@@ -6,7 +6,7 @@
# --- in BUILDDIR # --- in BUILDDIR
# 4. build subprofiles and subsequently an image # 4. build subprofiles and subsequently an image
MKIMAGE_PROFILES = $(dir $(lastword $(MAKEFILE_LIST))) MKIMAGE_PROFILES := $(dir $(lastword $(MAKEFILE_LIST)))
# deal with one target at a time # deal with one target at a time
IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz
@@ -45,17 +45,6 @@ IMAGES := $(DISTROS) $(VES)
.PHONY: $(IMAGES) $(DISTRO_TARGETS) $(VE_TARGETS) .PHONY: $(IMAGES) $(DISTRO_TARGETS) $(VE_TARGETS)
.PHONY: debug everything help space .PHONY: debug everything help space
distro/help:
@echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t
ve/help:
@echo '** available virtual environment targets:'
@echo $(VES) | fmt -sw"$$((COLUMNS>>1))" | column -t
help: | distro/help space ve/help
space:; @echo
### duplicate but still needed ### duplicate but still needed
everything: everything:
@n=1; sum=$(words $(DISTROS)); \ @n=1; sum=$(words $(DISTROS)); \
@@ -75,7 +64,7 @@ $(IMAGES): debug \
build; @: build; @:
# convenience shortcut # convenience shortcut
$(DISTROS:distro/%=%): %: distro/% $(DISTROS:distro/%=%): %: distro/%; @:
debug: debug:
ifeq (2,$(DEBUG)) ifeq (2,$(DEBUG))

View File

@@ -6,5 +6,11 @@
см. http://www.altlinux.org/Alterator-pkg); он создаётся из см. http://www.altlinux.org/Alterator-pkg); он создаётся из
содержимого ряда переменных (см. Makefile). содержимого ряда переменных (см. Makefile).
Подкаталог tagged/ стоит рассматривать как экспериментальный, Подкаталог tagged/ содержит тегированные списки, имена которых
но находящий всё более широкое практическое использование. удобно получать функцией tags() (см. ../../lib/functions.mk).
Для выявления дубликатов в составе списков служит запускаемый
с указанием перечня анализируемых файлов скрипт ../../bin/pkgdups;
пытаться избежать дублей на 100% скорее бесполезно, но бродячие
устойчивые группы пакетов могут заслуживать выделения отдельным
списком.

View File

@@ -1,12 +1,12 @@
Этот каталог содержит тегированные списки; на данный момент Этот каталог содержит тегированные списки; на данный момент
реализация (tags2lists) требует, чтобы каждый из тегов был реализация (../../../bin/tags2lists) требует, чтобы каждый
отдельным словом, состоящим из символов из набора a-zA-Z0-9_ из тегов был отдельным словом, состоящим из символов из набора
(внимание: не используйте в слове "-"); рекомендуется a-zA-Z0-9_ (внимание: не используйте в слове "-"); рекомендуется
разделять слова "+". разделять слова "+".
Предположительное применение: дополнение функциональности, Применение: дополнение жёстко статически заданной функциональности
заданной статически (наследственно или явно), факультативным более "плавающим" в долгосрочном плане результатом раскрытия
результатом раскрытия списка тегов; в первую очередь contrib? списка тегов.
Реализация является экспериментальной и требует утряски Реализация является экспериментальной и требует утряски
с ../groups/; комментарии и помощь всячески приветствуются. с ../groups/; комментарии и помощь всячески приветствуются.

View File

@@ -0,0 +1 @@
aptitude

View File

@@ -9,6 +9,8 @@ mailx
netcat netcat
netlist netlist
openssh-clients openssh-clients
openssh-server
openssh-blacklist
rsync rsync
traceroute traceroute
vlan-utils vlan-utils

View File

@@ -0,0 +1,9 @@
#wm-select
# for those who need these
xorg-drv-keyboard
xorg-drv-mouse
#xorg-extensions*
# :-/
#*-debuginfo-

View File

@@ -9,40 +9,22 @@ xorg-drv-mga
xorg-drv-multimedia xorg-drv-multimedia
xorg-drv-nouveau xorg-drv-nouveau
xorg-drv-nv xorg-drv-nv
#I586_ONLY@xorg-drv-s3 xorg-drv-s3
#I586_ONLY@xorg-drv-s3virge xorg-drv-s3virge
#I586_ONLY@xorg-drv-savage xorg-drv-savage
xorg-drv-sis xorg-drv-sis
xorg-drv-synaptics xorg-drv-synaptics
xorg-drv-vesa xorg-drv-vesa
xorg-drv-video xorg-drv-video
xorg-drv-void xorg-drv-void
xorg-drv-wacom
xorg-drv-wizardpen
xorg-drv-qxl xorg-drv-qxl
# #25044? #25044?
xorg-dri-intel xorg-dri-intel
# for those who need these
xorg-drv-keyboard
xorg-drv-mouse
xauth xauth
xorg-utils xorg-utils
#xorg-extensions*
xinit
# TODO: split these into a separate packagelist or no sense?
#wm-select
fonts-ttf-dejavu
fonts-bitmap-terminus
fonts-otf-stix
fonts-ttf-droid
x-cursor-theme-jimmac x-cursor-theme-jimmac
menu-icons-default menu-icons-default
# :-/
#*-debuginfo-

19
reports.mk Normal file
View File

@@ -0,0 +1,19 @@
# collect what's left
all: reports/targets
reports/targets:
@if ! [ -n "$$REPORT_PATH" -a -s "$$REPORT_PATH" ]; then \
exit 0; \
fi; \
BUILDDIR="`sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' "$$REPORT_PATH"`"; \
if type -t dot >&/dev/null; then \
REPORT_IMAGE="$$BUILDDIR/targets.png"; \
report-targets < "$$REPORT_PATH" \
| dot -Tpng -o "$$REPORT_IMAGE" \
&& echo "** target graph report: $$REPORT_IMAGE"; \
else \
REPORT_DOT="$$BUILDDIR/targets.dot"; \
report-targets < "$$REPORT_PATH" > "$$REPORT_DOT" \
&& echo "** graphviz missing, target graph dot file: $$REPORT_DOT"; \
fi && mv "$$REPORT_PATH" "$$BUILDDIR/targets.log"

View File

@@ -12,6 +12,6 @@
рабочий чрут не содержит исполняемых файлов. рабочий чрут не содержит исполняемых файлов.
Не следует использовать этот субпрофиль напрямую, для добавления Не следует использовать этот субпрофиль напрямую, для добавления
пакетного репозитория в образ предназначена фича repo/main. пакетного репозитория в образ предназначена фича use/repo/main.
Результат -- каталог ALTLinux/RPMS.main для копирования в образ. Результат -- каталог ALTLinux/RPMS.main для копирования в образ.

View File

@@ -38,6 +38,9 @@ endif
CHROOT_PACKAGES_REGEXP += $(STAGE1_PACKAGES_REGEXP) CHROOT_PACKAGES_REGEXP += $(STAGE1_PACKAGES_REGEXP)
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(SYSTEM_PACKAGES) CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(SYSTEM_PACKAGES)
# pass for use/stage2
GLOBAL_SQUASHFS := $(SQUASHFS)
# scripts prepare bootloader configuration, too # scripts prepare bootloader configuration, too
# NB: we pass tested squashfs options for ../stage2/Makefile to include # NB: we pass tested squashfs options for ../stage2/Makefile to include
all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \ all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \

View File

@@ -31,17 +31,29 @@ $(error STAGE1_KFLAVOUR is utterly empty; cannot guess either)
endif endif
# need kernel modules only (which require corresponding kernel-image); # need kernel modules only (which require corresponding kernel-image);
# these go into work chroot; NB: no vmlinuz there # these go into work chroot; NB: no vmlinuz there (unless live-install)
IMAGE_PACKAGES_REGEXP = $(call kpackages, \ IMAGE_PACKAGES_REGEXP = $(call kpackages, \
$(STAGE1_KMODULES) $(STAGE2_KMODULES), \ $(STAGE1_KMODULES) $(STAGE2_KMODULES), \
$(STAGE1_KFLAVOUR)) $(STAGE1_KFLAVOUR))
# see also scripts.d/99-elf-stats
ifdef GLOBAL_SQUASHFS_SORT
ifeq (tight,$(SQUASHFS))
CHROOT_PACKAGES += file
pack-image: PACK_SQUASHFS_OPTS += -sort /.our/elf.lst
pack-image: CLEANUP_OUTDIR=
endif
endif
GLOBAL_SQUASHFS := $(SQUASHFS)
include $(MKIMAGE_PREFIX)/targets.mk include $(MKIMAGE_PREFIX)/targets.mk
# NB: it's a collector variable, add()ing to a GLOBAL_ results in lost hair # NB: it's a collector variable, add()ing to a GLOBAL_ results in lost hair
GLOBAL_CLEANUP_PACKAGES := $(CLEANUP_PACKAGES) GLOBAL_CLEANUP_PACKAGES := $(CLEANUP_PACKAGES)
all: | $(GLOBAL_DEBUG) build-image run-image-scripts pack-image \ all: | $(GLOBAL_DEBUG) \
build-image run-image-scripts run-scripts pack-image \
$(GLOBAL_CLEAN_WORKDIR) $(GLOBAL_CLEAN_WORKDIR)
# dummy # dummy

View File

@@ -14,7 +14,7 @@ cd /usr/share/X11/locale && rm -rf ja* ko* th* vi* zh*
cd /usr/share/X11/xkb/symbols && rm -rf jp kr th vn cn cd /usr/share/X11/xkb/symbols && rm -rf jp kr th vn cn
# locales # locales
cd /usr/lib*/locale && rm -rf ja_* ko_* th_* zh_* cd /usr/lib/locale && rm -rf ja_* ko_* th_* zh_*
# gconv # gconv
cd /usr/lib*/gconv && rm -f JIS* T* cd /usr/lib*/gconv && rm -f JIS* T*

View File

@@ -0,0 +1,6 @@
#!/bin/sh
# outstanding binaries
rm -f /sbin/{sash,sln,tc}
rm -f /usr/bin/{openssl,ipv6log*}
rm -f /bin/ipv6calc

View File

@@ -0,0 +1,5 @@
#!/bin/sh
# no sense in xorg-dri-* without kernel-modules-drm*
stat /lib/modules/*/kernel/drivers/gpu/drm >&/dev/null \
|| rm -rf /usr/lib*/X11/modules/dri/

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# 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

View File

@@ -0,0 +1,8 @@
#!/bin/sh
# regenerate module dependencies after pruning kernel modules
# (this script must run after anything touching /lib/modules)
cd /lib/modules
for i in *.*; do
depmod -a -F /boot/System.map-$i $i
done

View File

@@ -0,0 +1,6 @@
#!/bin/sh
# no need for the kernel in live root
# (unless it's a live-install):
# it's been booted already
[ -x /usr/sbin/live-install ] || [ -x /usr/sbin/livecd-install ] || rm -f /boot/*

View File

@@ -0,0 +1,48 @@
#!/bin/sh -e
# tally up sizes of chroot's ELF binaries for squashfs tuning
# NB: it's unclear so far whether mksquashfs -sort is beneficial
if [ -z "$GLOBAL_SQUASHFS_SORT" -o "$GLOBAL_SQUASHFS" != "tight" ]; then
echo "SKIP elf-stats: looks like it's not needed" >&2
exit 0
fi
exit_handler()
{
local rc=$1
rm -f -- "$TMPFILE"
exit $rc
}
# it's controlled environment
TMPFILE="$(mktemp)"
trap 'exit_handler $?' EXIT HUP PIPE INT QUIT TERM
# a list of ELF binaries (both executables and shared libraries)
ELFLIST=/.our/elf.lst
cd "$WORKDIR"
# let's parallelize a bit, chroot should be on tmpfs or just-cached
du -bsx | cut -f1 > "$TMPFILE" &
elf="$(find {,usr/}{lib*,{,s}bin} \
-path lib/modules -prune -o \
-path usr/lib/locale -prune -o \
-type f \
| file -nN -e ascii -e compress -e tar -e elf -f - \
| sed -n "/: ELF /s/: .*$//p" \
| tee "$ELFLIST.in" \
| tr '\n' '\0' \
| du -cb --files0-from=- \
| tail -1 \
| cut -f1)"
wait
read root < "$TMPFILE"
echo "** live chroot ELF ratio: $((100*$elf/$root))% ($elf/$root)" >&2
# add priorities
sed 's,^.*$,& 1,' < "$ELFLIST.in" > "$ELFLIST"