Compare commits

...

58 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
90 changed files with 801 additions and 343 deletions

View File

@@ -1,5 +1,5 @@
Name: mkimage-profiles
Version: 0.5.1
Version: 0.5.5
Release: alt1
Summary: ALT Linux based distribution metaprofile
@@ -59,6 +59,20 @@ cp -a * %buildroot%mpdir
%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

View File

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

View File

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

View File

@@ -1 +1 @@
851085a67914bd2f9470cf81f552b06a9b98d83d v0.5.0
9e3e95942c73c5a2cca794e28935e6257cb37bc9 v0.5.4

107
Makefile
View File

@@ -1,75 +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 the needed bits from metaprofile to a new profile
# --- in BUILDDIR
# 4. build subprofiles and subsequently an image
# umbrella mkimage-profiles makefile:
# iterate over multiple goals/arches
help:
@echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t
@echo
@echo '** available virtual environment targets:'
@echo $(VES) | fmt -sw"$$((COLUMNS>>1))" | column -t
MKIMAGE_PROFILES = $(dir $(lastword $(MAKEFILE_LIST)))
# only process the first target (inter-target cleanup is tricky)
IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz
ifeq (./,$(dir $(IMAGE_TARGET)))# convenience fallback
IMAGE_TARGET := distro/$(IMAGE_TARGET)# for omitted "distro/"
# immediate assignment
ifndef ARCHES
ifdef ARCH
ARCHES := $(ARCH)
else
ARCHES := $(shell arch | sed 's/i686/i586/')
endif
IMAGE_CONF := $(firstword $(subst ., ,$(IMAGE_TARGET)))# ve/generic
IMAGE_CLASS := $(firstword $(subst /, ,$(IMAGE_TARGET)))# ve
IMAGE_FILE := $(lastword $(subst /, ,$(IMAGE_TARGET)))# generic.tar.gz
IMAGE_NAME := $(firstword $(subst ., ,$(IMAGE_FILE)))# generic
IMAGE_TYPE := $(subst $(IMAGE_NAME).,,$(IMAGE_FILE))# tar.gz
# preferences
-include $(HOME)/.mkimage/profiles.mk
# most of the actual work done elsewhere
include lib/*.mk
include conf.d/*.mk
include features.in/*/config.mk
DISTRO_TARGETS := $(shell sed -n 's,^\(distro/[^:.]\+\):.*$$,\1,p' \
lib/distro.mk $(wildcard conf.d/*.mk) | sort -u)
VE_TARGETS := $(shell sed -n 's,^\(ve/[^:.]\+\):.*$$,\1,p' \
lib/ve.mk $(wildcard conf.d/*.mk) | sort -u)
DISTROS := $(call addsuffices,$(DISTRO_EXTS),$(DISTRO_TARGETS))
VES := $(call addsuffices,$(VE_EXTS),$(VE_TARGETS))
IMAGES := $(DISTROS) $(VES)
.PHONY: $(IMAGES) $(DISTRO_TARGETS) $(VE_TARGETS)
### suboptimal but at least clear, reliable and convenient
all:
@n=1; sum=$(words $(DISTROS)); \
for distro in $(DISTROS); do \
echo "** building $$distro:"; \
$(MAKE) --no-print-directory \
ALL=$$n/$$sum \
BUILDDIR=$(BUILDDIR) \
$$distro; \
echo; \
n=$$(($$n+1)); \
done
$(IMAGES): debug \
config/with/$(IMAGE_CONF) \
config/like/$(IMAGE_CLASS) \
config/name/$(IMAGE_NAME) \
config/pack/$(IMAGE_TYPE) \
build; @:
# convenience shortcut
$(DISTROS:distro/%=%): %: distro/%
debug:
ifeq (2,$(DEBUG))
@$(foreach v,\
$(filter IMAGE_%,$(sort $(.VARIABLES))),\
$(warning $v = $($v)))
endif
export ARCHES
# recursive make considered useful for m-p
MAKE += --no-print-directory
.PHONY: clean distclean help
clean distclean help:
@$(MAKE) -f main.mk $@
export NUM_TARGETS := $(words $(MAKECMDGOALS))
# real targets need real work
%:
@n=1; \
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

View File

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

View File

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

View File

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

View File

@@ -3,13 +3,21 @@ 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/icewm: distro/desktop-base \
use/lowmem use/x11/xdm use/x11/runlevel5 \
use/bootloader/lilo use/power/acpi/button \
use/cleanup/alterator
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

View File

@@ -5,13 +5,8 @@ distro/dos: distro/.init use/dos use/syslinux/ui-menu
distro/rescue: distro/.base use/rescue use/syslinux/ui-menu
distro/live: distro/.base use/live/base use/power/acpi/cpufreq
distro/live-systemd: distro/.base use/live/base use/systemd
distro/live-install: distro/.base use/live/install use/syslinux/localboot.cfg
distro/live-icewm: distro/live use/live/icewm
distro/live-rescue: distro/live-icewm
@$(call add,LIVE_LISTS,$(call tags,rescue && (live || x11)))
@$(call add,LIVE_LISTS, \
$(call tags,(base || extra) && (archive || rescue || network)))
distro/.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)
@@ -28,4 +23,24 @@ distro/live-builder: distro/.base use/repo/main \
@$(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

View File

@@ -7,7 +7,8 @@ distro/server-base: distro/installer use/repo/main \
distro/server-mini: distro/server-base use/cleanup/x11-alterator
@$(call set,KFLAVOURS,el-smp)
@$(call add,KMODULES,e1000e igb)
@$(call add,THE_KMODULES,e1000e igb)
@$(call add,STAGE1_KMODULES,e1000e igb)
@$(call add,BASE_LISTS,\
$(call tags,base && (server || network || security || pkg)))
@$(call add,BASE_LISTS,$(call tags,extra network))
@@ -18,9 +19,10 @@ 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,KMODULES,bcmwl ndiswrapper rtl8168 rtl8192)
@$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,KMODULES,drbd83 kvm)
@$(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)

View File

@@ -1,5 +1,8 @@
предположения фрагментов кода об окружении
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NB: пути приводятся от верхнего уровня
- pkg.in/lists/Makefile
+ ожидает, что названия пакаджлистов указываются в переменных
вида *_LISTS, и копирует в генерируемый профиль только их

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
Каждая фича должна содержать задействуемый при построении
конфигурации будущего образа файл config.mk, включаемый
в ../Makefile; он может описывать одну или более целей
в ../main.mk; он может описывать одну или более целей
вида use/*, дополняющих конфигурацию, и при наличии
дополнительных хуков для копирования или generate.*
обязан добавить имя фичи в $(FEATURES), для чего

View File

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

View File

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

View File

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

View File

@@ -8,10 +8,14 @@ BOOT_TYPE = isolinux
# Metadata/ needed only for installers (and not for e.g. syslinux.iso)
# FIXME: installable live needs it too, don't move to install2 feature
### see also .../pkg.in/lists/Makefile
ifneq (,$(findstring install2,$(FEATURES)))
METADATA = metadata
endif
# see also ../scripts.d/01-isosort; needs mkimage-0.2.2+
MKI_SORTFILE := /tmp/isosort
all: $(GLOBAL_DEBUG) prep copy-subdirs copy-tree run-scripts pack-image \
postprocess $(GLOBAL_CLEAN_WORKDIR)
@@ -27,10 +31,8 @@ metadata: dot-base
| sed 's,$(PKGDIR)/*,,g')
dot-base:
@{ \
echo -e "\n## added by image.in/Makefile"; \
echo "$(call kpackages,$(KMODULES),$(KFLAVOURS))"; \
} >> $(call list,.base)
@p="$(call kpackages,$(THE_KMODULES) $(BASE_KMODULES),$(KFLAVOURS))"; \
echo -e "\n## added by build-distro.mk\n$$p" >> $(call list,.base)
dot-disk:
@mkdir -p files/.disk

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,18 +1,16 @@
# copy stage2 as live
use/live: use/stage2 sub/stage2/live
@$(call add_feature)
use/live/base: use/live use/syslinux/ui-menu
@$(call add,LIVE_LISTS,$(call tags,base && (live || network)))
use/live/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/base
use/live/autologin: use/live/x11
@$(call add,LIVE_PACKAGES,autologin xinit)
use/live/icewm: use/live/autologin
@$(call add,LIVE_LISTS, \
$(call tags,(base || desktop) && (live || network || icewm)))
# this is a manual installation script (text-based)
use/live/install: use/live/base
@$(call add,LIVE_PACKAGES,live-install)
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

@@ -1,11 +1,17 @@
#!/bin/sh -ef
if [ ! -x /usr/bin/X ]; then
echo "warning: autologin feature requested but X not installed" >&2
exit 0
fi
USER=altlinux
# setup runlevel
INITTAB=/etc/inittab
if [ -f "$INITTAB" ]; then
[ -z "$runlevel" ] && runlevel=5
subst "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
sed -i "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
fi
# autologin^2

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,14 @@
use/x11/xorg:
@$(call add,BASE_LISTS,xorg)
@$(call add,THE_LISTS,xorg)
@$(call add,THE_KMODULES,drm)
use/x11/wacom: use/x11/xorg
@$(call add,THE_PACKAGES,xorg-drv-wacom)
### strictly speaking, runlevel5 should require a *dm, not vice versa
use/x11/runlevel5: use/x11/xorg
@$(call add,BASE_PACKAGES,installer-feature-runlevel5-stage3)
@$(call add,THE_PACKAGES,installer-feature-runlevel5-stage3)
### xdm: see also #23108
use/x11/xdm: use/x11/runlevel5
@$(call add,BASE_PACKAGES,xdm installer-feature-no-xconsole)
@$(call add,THE_PACKAGES,xdm installer-feature-no-xconsole)

View File

@@ -10,6 +10,11 @@ MKI_VER_OPTIMAL = 0.2.0
include distcfg.mk
include functions.mk
ifeq (,$(realpath $(MKIMAGE_PREFIX)/config.mk))
$(error please apt-get install mkimage and have a look at QUICKSTART as well)
endif
include $(MKIMAGE_PREFIX)/config.mk
ifeq (-,$(shell rpmvercmp $(MKI_VERSION) $(MKI_VER_MINIMAL) | tr -d [0-9]))
@@ -47,7 +52,7 @@ pack-image: imagedir
imagedir:
@mkdir -p "$(IMAGEDIR)"
postprocess: $(addprefix postprocess-,$(POSTPROCESS_TARGETS))
postprocess: | $(addprefix postprocess-,$(sort $(POSTPROCESS_TARGETS)))
@OUTPATH="$(IMAGEDIR)/$(IMAGE_OUTFILE)"; \
echo "** image: $$OUTPATH" >&2 && \
ln -sf "$(IMAGE_OUTFILE)" "$(IMAGEDIR)/$(IMAGE_LINK)" && \
@@ -60,5 +65,6 @@ postprocess: $(addprefix postprocess-,$(POSTPROCESS_TARGETS))
debug:
@echo "TOPDIR=$(TOPDIR)"
@echo "IMAGEDIR=$(IMAGEDIR)"
@echo "ARCH=$(ARCH)"
@echo "GLOBAL_HSH_APT_CONFIG=$(GLOBAL_HSH_APT_CONFIG)"

View File

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

View File

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

View File

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

View File

@@ -3,6 +3,8 @@
# drop stock predefined rules
.DEFAULT:
SYMLINK = build
# tmpfs-sparing extra rule: cleanup workdir after completing each stage
# (as packed results are saved this only lowers RAM pressure)
# NB: it's useful enough to be enabled by default in DEBUG abscence
@@ -18,22 +20,37 @@ endif
# ordinary clean: destroys workdirs but not the corresponding results
clean:
@echo "$(TIME) cleaning up $(WARNING)"
@find -name '*~' -delete >&/dev/null ||:
@if [ -L build -a -d build/ ]; then \
$(MAKE) -C build $@ \
GLOBAL_BUILDDIR=$(shell readlink build) $(LOG) ||:; \
@if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
echo "$(TIME) cleaning up $(WARNING)"; \
$(MAKE) -C "$(SYMLINK)" $@ \
GLOBAL_BUILDDIR="$(realpath $(SYMLINK))" $(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 -rf build/; \
rm -rf $(shell readlink build); \
@if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
build="$(realpath $(SYMLINK)/)"; \
if [ "$$build" = / ]; then \
echo "** ERROR: invalid \`"$(SYMLINK)"' symlink" >&2; \
exit 128; \
else \
$(MAKE) -C "$(SYMLINK)" $@ \
GLOBAL_BUILDDIR="$$build" $(LOG) ||: \
rm -rf "$$build"; \
fi; \
fi
@rm -f "$(SYMLINK)"
# builddir existing outside read-only metaprofile is less ephemeral
# than BUILDDIR is -- usually it's unneeded afterwards so just zap it
postclean: build-image
@if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" ] || \
[ ! -L "$(SYMLINK)" -a "0$(DEBUG)" -lt 2 ]; then \
echo "$(TIME) cleaning up after build"; \
$(MAKE) -C "$(BUILDDIR)" distclean \
GLOBAL_BUILDDIR="$(BUILDDIR)" $(LOG) ||:; \
rm -rf "$(BUILDDIR)"; \
fi
@rm -f build ||:

View File

@@ -11,7 +11,7 @@ sub/%:
@$(call add,SUBPROFILES,$(@:sub/%=%))
# install media bootloader
boot/%: profile/bare use/syslinux
boot/%: use/syslinux
@$(call set,BOOTLOADER,$*)
# fundamental targets
@@ -25,8 +25,8 @@ distro/.base: distro/.init
# bootloader test target
distro/syslinux: distro/.init \
use/syslinux use/syslinux/localboot.cfg \
use/syslinux/ui-vesamenu use/hdt use/memtest
use/syslinux/localboot.cfg use/syslinux/ui-vesamenu \
use/hdt use/memtest
# something marginally useful (as a network-only installer)
# NB: doesn't carry stage3 thus cannot use/bootloader

View File

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

View File

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

View File

@@ -4,14 +4,23 @@ endif
SYMLINK = build
# this could have come from environment;
# if not, can be symlinked if r/w, or made anew
# this could have come from env; or could be symlinked; or is made anew
# (the reuse rationale is avoiding extra tmpdir lookups)
# NB: immediate assignment matters
# NB: PATH has no effect here
ifndef BUILDDIR
BUILDDIR := $(shell [ -s "$(SYMLINK)" ] \
&& realpath "$(SYMLINK)" \
|| bin/mktmpdir mkimage-profiles)
BUILDLINK := $(realpath $(SYMLINK))
BUILDDIR := $(shell \
if [ -s "$(SYMLINK)" -a "$(NUM_TARGETS)" = 1 ] && \
[ -n "$(findstring $(BUILDDIR_PREFIX).,$(BUILDLINK))" ]; \
then \
echo "$(BUILDLINK)"; \
else \
bin/mktmpdir $(BUILDDIR_PREFIX) || exit 127; \
fi; )
endif
ifeq (,$(BUILDDIR))
$(error suitable BUILDDIR unavailable)
endif
# even smart caching only hurts when every build goes from scratch
@@ -24,19 +33,14 @@ export BUILDDIR NO_CACHE PATH
CONFIG := $(BUILDDIR)/distcfg.mk
RC := $(HOME)/.mkimage/profiles.mk
# holds a postprocessor; shell test executes in particular situation
# NB: not exported, for toplevel use only
SHORTEN = $(shell \
if [ -s "$(SYMLINK)" ]; then \
echo "| sed 's,$(BUILDDIR),$(SYMLINK),'"; \
else \
echo "| sed 's,$(TMP),\$$TMP,'"; \
fi;)
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
profile/init: distclean
@if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \
echo "$(TIME) ERROR: invalid BUILDDIR: \`$(BUILDDIR)'"; \
exit 128; \
fi;
@echo -n "$(TIME) initializing BUILDDIR: "
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
@rsync -qaxH --delete-after image.in/ "$(BUILDDIR)"/
@mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker
@$(call put,ifndef DISTCFG_MK)
@$(call put,DISTCFG_MK = 1)
@@ -64,7 +68,7 @@ profile/init: distclean
fi
@if [ -w . ]; then \
rm -f "$(SYMLINK)" && \
ln -sf "$(BUILDDIR)" "$(SYMLINK)" && \
ln -s "$(BUILDDIR)" "$(SYMLINK)" && \
echo "$(SYMLINK)/"; \
else \
echo "$(BUILDDIR)/" $(SHORTEN); \

View File

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

View File

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

85
main.mk Normal file
View File

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

View File

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

View File

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

25
pkg.in/lists/ltsp Normal file
View File

@@ -0,0 +1,25 @@
ltsp-server
ltsp-server-basic
alterator-ltsconf
alsa-plugins
alsa-plugins-pulse
syslinux
mkisofs
#kde-settings-kded-no_media_popup
#docs-install_ltsp
#docs-issue-desktop_personal
installer-feature-ltsp-stage3
# Set available online repository and some useful utilites from /sbin
installer-feature-symlinks-from-sbin
installer-feature-online-repo
####
vim-console
cpio

5
pkg.in/lists/ltsp-client Normal file
View File

@@ -0,0 +1,5 @@
ltsp-client
ltsp-client-full
ltsp-client-nxsession
# ouch!
mc

View File

@@ -0,0 +1,3 @@
kernel-image-ltsp-client
kernel-modules-drm-ltsp-client
kernel-modules-alsa-ltsp-client

View File

@@ -0,0 +1,3 @@
kernel-image-std-def
kernel-modules-drm-std-def
kernel-modules-alsa-std-def

View File

@@ -7,4 +7,5 @@ mdadm
openssh-server
openssh-clients
openssh-blacklist
screen
acpid

View File

@@ -0,0 +1,10 @@
razorqt
arora
qtfm
qterminal
juffed
juffed-plugins
screengrab
xscreensaver
icon-theme-oxygen
x-cursor-theme-jimmac

View File

@@ -0,0 +1,18 @@
# carefully chosen
x-cursor-theme-BlueGlass3D
x-cursor-theme-CP38
x-cursor-theme-Obsidian
x-cursor-theme-oxy-white
# a bit lacking
icon-theme-simple
# nice and useful qt4 apps
bsc
clementine
fatrat
focuswriter
qt4-settings
qtparted
tubularix
smplayer

View File

@@ -1,3 +1,2 @@
httperf
nepim

View File

@@ -8,10 +8,14 @@ bonnie++
cfdisk
ddrescue
disktype
evms
evms-ncurses
# NB: EVMS must be off by default as "normal" /dev/sd*
# would suddenly get busy otherwise
#evms
#evms-ncurses
fdisk
gpart
iotop
iperf
hdparm
lvm2
mdadm
@@ -65,8 +69,10 @@ iftop
iproute2
iptables
iputils
lft
lftp
mailx
mtr
netcat
netlist
nfs-utils
@@ -97,3 +103,6 @@ mc
# Development/Debuggers
strace
sysstat
# win32
chntpw

View File

@@ -1,8 +1,8 @@
#anyfs-tools
cpipe
dar
ddrescue
foremost
ntfsprogs
sleuthkit
xfsdump
#zfs-fuse

View File

@@ -21,12 +21,13 @@ xorg-drv-wacom
xorg-drv-wizardpen
xorg-drv-qxl
# #25044?
xorg-dri-intel
# for those who need these
xorg-drv-keyboard
xorg-drv-mouse
#xorg-dri-*
xauth
xorg-utils
#xorg-extensions*

View File

@@ -30,3 +30,6 @@
- main: пакетная база, укладываемая на образ (NB: поскольку рабочий
чрут в этом случае не содержит ничего, кроме пакетов, добавлять
image-scripts.d/* смысла нет, только scripts.d/*)
Шаблонное правило сейчас определено в ../lib/distro.mk,
поскольку субпрофили востребованы только дистрибутивами.

View File

@@ -12,14 +12,19 @@ include $(MKIMAGE_PREFIX)/config.mk
CHROOT_PACKAGES = apt-utils rsync
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS)) \
$(MAIN_PACKAGES_REGEXP)
IMAGE_PACKAGES_REGEXP = $(MAIN_PACKAGES_REGEXP) \
$(call kpackages, \
$(THE_KMODULES) \
$(BASE_KMODULES) \
$(MAIN_KMODULES), \
$(KFLAVOURS))
IMAGE_PACKAGES = $(call map,list,$(BASE_LISTS) $(MAIN_LISTS) $(MAIN_GROUPS)) \
$(SYSTEM_PACKAGES) \
$(COMMON_PACKAGES) \
$(BASE_PACKAGES) \
$(MAIN_PACKAGES)
IMAGE_PACKAGES = $(call map,list, \
$(THE_LISTS) $(THE_GROUPS) \
$(BASE_LISTS) \
$(MAIN_LISTS) $(MAIN_GROUPS)) \
$(SYSTEM_PACKAGES) $(COMMON_PACKAGES) \
$(THE_PACKAGES) $(BASE_PACKAGES) $(MAIN_PACKAGES)
MKI_DESTDIR = ALTLinux/RPMS.main
MKI_PACK_RESULTS = data

View File

@@ -11,6 +11,7 @@ include $(MKIMAGE_PREFIX)/config.mk
ifndef BOOTLOADER
$(error BOOTLOADER not defined)
endif
GLOBAL_BOOTLOADER := $(BOOTLOADER)
MKI_PACK_RESULTS = data
PROPAGATOR_VERSION = ALT Linux
@@ -29,23 +30,24 @@ STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS))
# propagator needed iff stage1 kernel installed (not for e.g. syslinux.iso)
ifneq "$(STAGE1_KFLAVOUR)" ""
BUILD_PROPAGATOR = build-propagator
CHROOT_PACKAGES_REGEXP := $(call kpackages,$(STAGE1_KMODULES_REGEXP),$(STAGE1_KFLAVOUR))
INFO_STAGE1_KFLAVOUR := $(STAGE1_KFLAVOUR)
CHROOT_PACKAGES_REGEXP := $(call kpackages, \
$(STAGE1_KMODULES_REGEXP),$(STAGE1_KFLAVOUR))
endif
CHROOT_PACKAGES_REGEXP += $(STAGE1_PACKAGES_REGEXP)
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(SYSTEM_PACKAGES)
# scripts prepare bootloader configuration, too
# NB: we pass tested squashfs options for ../install2/Makefile
# NB: we pass tested squashfs options for ../stage2/Makefile to include
all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \
copy-$(BOOTLOADER) $(COPY_SQUASHCFG) pack-image $(GLOBAL_CLEAN_WORKDIR)
@if test -s $(OUTDIR)/squashcfg.mk; then \
@if [ -s $(OUTDIR)/squashcfg.mk ]; then \
cp $(OUTDIR)/squashcfg.mk $(GLOBAL_BUILDDIR)/; \
fi
debug:
@if test -n "$(GLOBAL_VERBOSE)"; then \
@if [ -n "$(GLOBAL_VERBOSE)" ]; then \
echo "** BRANDING: $(BRANDING)"; \
echo "** IMAGE_INIT_LIST: $(IMAGE_INIT_LIST)"; \
echo "** STAGE1_PACKAGES: $(STAGE1_PACKAGES)"; \

View File

@@ -32,7 +32,9 @@ endif
# need kernel modules only (which require corresponding kernel-image);
# these go into work chroot; NB: no vmlinuz there
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(STAGE1_KMODULES),$(STAGE1_KFLAVOUR))
IMAGE_PACKAGES_REGEXP = $(call kpackages, \
$(STAGE1_KMODULES) $(STAGE2_KMODULES), \
$(STAGE1_KFLAVOUR))
include $(MKIMAGE_PREFIX)/targets.mk

View File

@@ -5,6 +5,9 @@
Зависимость на него стоит прописывать в таких фичах;
сама по себе (без нужного stage2cfg.mk) смысла не имеет.
Обратите внимание, что набор потенциально доступных в stage1
модулей ядра для stage2 может быть расширен (STAGE2_KMODULES).
Результат -- соответственно названный файл со squashfs,
подлежащий копированию в итоговый образ.