Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
edfdeca311 | ||
|
b6e640bd8d | ||
|
0c41e39ec0 | ||
|
ed7bf0db9f | ||
|
17bd880e19 | ||
|
80090d1f1a | ||
|
7ffd600076 | ||
|
1b7ce25f10 | ||
|
5dba27d011 | ||
|
79bb3f8d6e | ||
|
788cad885e | ||
|
a52b7476a4 | ||
|
deb63e0d63 |
@@ -1,5 +1,5 @@
|
||||
Name: mkimage-profiles
|
||||
Version: 0.5.7
|
||||
Version: 0.6.1
|
||||
Release: alt1
|
||||
|
||||
Summary: ALT Linux based distribution metaprofile
|
||||
@@ -15,6 +15,8 @@ Requires: rsync git-core
|
||||
Requires: time schedutils
|
||||
Requires: mkimage >= 0.2.0
|
||||
|
||||
# Recommends: graphviz
|
||||
|
||||
%define mpdir %_datadir/%name
|
||||
%add_findreq_skiplist %mpdir/*.in/*
|
||||
|
||||
@@ -37,7 +39,7 @@ Virtual environment template caches (OpenVZ/LXC) can be made either.
|
||||
In short, setup hasher (http://en.altlinux.org/hasher) and here we go:
|
||||
cd %mpdir
|
||||
head README
|
||||
make distro/syslinux.iso
|
||||
make syslinux.iso
|
||||
|
||||
But if you're into regular distro hacking and are not afraid of make
|
||||
and modest metaprogramming (some code generation and introspection),
|
||||
@@ -59,6 +61,13 @@ cp -a * %buildroot%mpdir
|
||||
%doc README QUICKSTART
|
||||
|
||||
%changelog
|
||||
* Mon Mar 26 2012 Michael Shigorin <mike@altlinux.org> 0.6.1-alt1
|
||||
- ISO9660 metadata support
|
||||
- initial alien VE image
|
||||
|
||||
* Mon Mar 19 2012 Michael Shigorin <mike@altlinux.org> 0.6.0-alt1
|
||||
- reports (targets graph)
|
||||
|
||||
* Mon Mar 12 2012 Michael Shigorin <mike@altlinux.org> 0.5.7-alt1
|
||||
- distro tweaks
|
||||
|
||||
|
@@ -1,6 +0,0 @@
|
||||
object a8e70fd4e667a95fb429c3b77a2f45eca0da7859
|
||||
type commit
|
||||
tag v0.5.6
|
||||
tagger Michael Shigorin <mike@altlinux.org> 1329770647 +0200
|
||||
|
||||
fixups
|
6
.gear/tags/9f3938b732545a20e4acfd547c5a002fbca54b21
Normal file
6
.gear/tags/9f3938b732545a20e4acfd547c5a002fbca54b21
Normal file
@@ -0,0 +1,6 @@
|
||||
object 1b7ce25f10d8e3faede66d8c66d3f3bb43f59ceb
|
||||
type commit
|
||||
tag v0.6.0
|
||||
tagger Michael Shigorin <mike@altlinux.org> 1332177960 +0200
|
||||
|
||||
reports/targets
|
@@ -1 +1 @@
|
||||
5f2dbc6d511b0a0a39799983df054a249298dd8c v0.5.6
|
||||
9f3938b732545a20e4acfd547c5a002fbca54b21 v0.6.0
|
||||
|
25
Makefile
25
Makefile
@@ -1,7 +1,8 @@
|
||||
# umbrella mkimage-profiles makefile:
|
||||
# iterate over multiple goals/arches
|
||||
# iterate over multiple goals/arches,
|
||||
# collect proceedings
|
||||
|
||||
# immediate assignment
|
||||
# for immediate assignment
|
||||
ifndef ARCHES
|
||||
ifdef ARCH
|
||||
ARCHES := $(ARCH)
|
||||
@@ -11,8 +12,14 @@ endif
|
||||
endif
|
||||
export ARCHES
|
||||
|
||||
# supervise target tracing; leave stderr alone
|
||||
ifdef REPORT
|
||||
export REPORT_PATH := $(shell mktemp --tmpdir mkimage-profiles.report.XXXXXXX)
|
||||
POSTPROC := | bin/report-filter > $(REPORT_PATH)
|
||||
endif
|
||||
|
||||
# recursive make considered useful for m-p
|
||||
MAKE += --no-print-directory
|
||||
MAKE += -r --no-print-directory
|
||||
|
||||
.PHONY: clean distclean help
|
||||
clean distclean help:
|
||||
@@ -23,16 +30,18 @@ export NUM_TARGETS := $(words $(MAKECMDGOALS))
|
||||
# real targets need real work
|
||||
%:
|
||||
@n=1; \
|
||||
say() { echo "$$@" >&2; }; \
|
||||
if [ "$(NUM_TARGETS)" -gt 1 ]; then \
|
||||
n="`echo $(MAKECMDGOALS) \
|
||||
| tr '[[:space:]]' '\n' \
|
||||
| grep -nx "$@" \
|
||||
| cut -d: -f1`"; \
|
||||
echo "** goal: $@ [$$n/$(NUM_TARGETS)]"; \
|
||||
say "** 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 $@; \
|
||||
if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then say; fi; \
|
||||
say "** ARCH: $$ARCH" >&2; \
|
||||
$(MAKE) -f main.mk ARCH=$$ARCH $@ $(POSTPROC); \
|
||||
$(MAKE) -f reports.mk ARCH=$$ARCH; \
|
||||
done; \
|
||||
if [ "$$n" -lt "$(NUM_TARGETS)" ]; then echo; fi
|
||||
if [ "$$n" -lt "$(NUM_TARGETS)" ]; then say; fi
|
||||
|
4
bin/report-filter
Executable file
4
bin/report-filter
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
# filter worker make stdout for report scripts
|
||||
|
||||
grep '^trace:building ' | uniq
|
33
bin/report-targets
Executable file
33
bin/report-targets
Executable 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
52
bin/report-targets2vars
Executable 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 "}"
|
6
conf.d/alien.mk
Normal file
6
conf.d/alien.mk
Normal 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)
|
||||
|
@@ -1,25 +1,18 @@
|
||||
# desktop distributions
|
||||
ifeq (distro,$(IMAGE_CLASS))
|
||||
|
||||
distro/.desktop-base: distro/.installer \
|
||||
use/syslinux/ui-vesamenu use/x11/xorg
|
||||
distro/.desktop-base: distro/.installer use/syslinux/ui-vesamenu use/x11/xorg
|
||||
@$(call set,INSTALLER,desktop)
|
||||
|
||||
distro/.desktop-mini: distro/.desktop-base \
|
||||
use/lowmem use/x11/xdm use/power/acpi/button \
|
||||
use/cleanup/alterator
|
||||
distro/.desktop-mini: distro/.desktop-base use/lowmem use/x11/xdm \
|
||||
use/power/acpi/button use/cleanup/alterator; @:
|
||||
|
||||
distro/icewm: distro/.desktop-mini
|
||||
@$(call add,BASE_LISTS,$(call tags,icewm desktop))
|
||||
distro/tde: distro/.desktop-mini +tde
|
||||
@$(call add,BASE_LISTS,$(call tags,(base || desktop) && network))
|
||||
|
||||
distro/tde: distro/.desktop-mini use/x11/kdm
|
||||
@$(call add,BASE_LISTS, \
|
||||
$(call tags,(base || desktop) && (network || tde)))
|
||||
|
||||
distro/ltsp-icewm: distro/icewm use/ltsp/base
|
||||
|
||||
distro/ltsp-tde: distro/tde use/ltsp/base
|
||||
|
||||
distro/desktop-systemd: distro/icewm use/systemd
|
||||
distro/icewm: distro/.desktop-mini +icewm; @:
|
||||
distro/ltsp-icewm: distro/icewm +ltsp; @:
|
||||
distro/ltsp-tde: distro/tde +ltsp; @:
|
||||
distro/desktop-systemd: distro/icewm use/systemd; @:
|
||||
|
||||
endif
|
||||
|
@@ -2,53 +2,42 @@
|
||||
ifeq (distro,$(IMAGE_CLASS))
|
||||
|
||||
distro/syslinux: distro/.init \
|
||||
use/syslinux/localboot.cfg use/syslinux/ui-vesamenu \
|
||||
use/hdt use/memtest
|
||||
use/syslinux/localboot.cfg use/syslinux/ui-vesamenu use/hdt; @:
|
||||
|
||||
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/dos: distro/.init use/dos use/syslinux/ui-menu; @:
|
||||
distro/rescue: distro/.base use/rescue use/syslinux/ui-menu; @:
|
||||
distro/live-systemd: distro/.base use/live/base use/systemd; @:
|
||||
|
||||
distro/.live-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 use/syslinux/ui-vesamenu +live; @:
|
||||
|
||||
distro/live-isomd5sum: distro/.base use/live/base use/isomd5sum
|
||||
@$(call add,LIVE_PACKAGES,livecd-isomd5sum)
|
||||
|
||||
distro/live-builder: pkgs := livecd-tmpfs livecd-online-repo mkimage-profiles
|
||||
distro/live-builder: distro/.base use/repo/main \
|
||||
use/live/base use/dev/mkimage use/power/acpi/button
|
||||
distro/live-builder: distro/.live-base use/dev/mkimage use/dev/repo
|
||||
@$(call add,LIVE_LISTS,$(call tags,base && (server || builder)))
|
||||
@$(call add,LIVE_PACKAGES,zsh sudo)
|
||||
@$(call add,LIVE_PACKAGES,$(pkgs))
|
||||
@$(call add,LIVE_PACKAGES,zsh sudo apt-repo)
|
||||
@$(call add,MAIN_PACKAGES,rpm-build basesystem)
|
||||
@$(call add,MAIN_PACKAGES,fakeroot sisyphus_check)
|
||||
@$(call add,MAIN_PACKAGES,syslinux pciids memtest86+ mkisofs)
|
||||
@$(call add,MAIN_PACKAGES,file make-initrd make-initrd-propagator)
|
||||
@$(call add,MAIN_PACKAGES,$(pkgs))
|
||||
@$(call add,MAIN_PACKAGES,syslinux pciids memtest86+ mkisofs)
|
||||
|
||||
distro/live-install: distro/.base use/live/base use/syslinux/localboot.cfg
|
||||
distro/live-install: distro/.live-base use/syslinux/localboot.cfg
|
||||
@$(call add,LIVE_PACKAGES,live-install)
|
||||
|
||||
distro/live-icewm: distro/.live-x11 use/live/autologin
|
||||
@$(call add,LIVE_LISTS, \
|
||||
$(call tags,(base || desktop) && (live || network || icewm)))
|
||||
|
||||
distro/live-razorqt: distro/.live-x11 use/x11/lightdm use/syslinux/ui-vesamenu
|
||||
@$(call add,LIVE_LISTS, \
|
||||
$(call tags,(base || desktop) && (live || network || razorqt)))
|
||||
|
||||
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-icewm: distro/.live-desktop use/live/autologin +icewm; @:
|
||||
distro/live-razorqt: distro/.live-desktop +razorqt; @:
|
||||
distro/live-tde: distro/.live-desktop +tde; @:
|
||||
|
||||
distro/live-rescue: distro/live-icewm
|
||||
@$(call add,LIVE_LISTS,$(call tags,rescue && (fs || live || x11)))
|
||||
@$(call add,LIVE_LISTS, \
|
||||
$(call tags,(base || extra) && (archive || rescue || network)))
|
||||
|
||||
distro/live-webkiosk: distro/.live-x11 use/live/autologin use/live/hooks
|
||||
distro/live-webkiosk: distro/.live-desktop use/live/autologin \
|
||||
use/live/hooks use/live/ru use/cleanup
|
||||
@$(call add,LIVE_PACKAGES,livecd-webkiosk)
|
||||
@$(call add,LIVE_PACKAGES,fonts-ttf-dejavu fonts-ttf-droid)
|
||||
@$(call add,CLEANUP_PACKAGES,'installer*' 'alterator*' 'libqt4*')
|
||||
|
||||
endif
|
||||
|
@@ -12,9 +12,9 @@ distro/server-mini: distro/.server-base use/cleanup/x11-alterator
|
||||
$(call tags,base && (server || network || security || pkg)))
|
||||
@$(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
|
||||
@$(call set,STAGE1_KFLAVOUR,std-def)
|
||||
@$(call set,KFLAVOURS,std-def ovz-el)
|
||||
@@ -22,7 +22,6 @@ distro/server-ovz: distro/server-mini \
|
||||
@$(call add,MAIN_KMODULES,bcmwl ndiswrapper)
|
||||
@$(call add,MAIN_KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
|
||||
@$(call add,MAIN_KMODULES,drbd83 kvm)
|
||||
@$(call add,INSTALL2_PACKAGES,curl) ### should become curl-mini
|
||||
@$(call add,BASE_LISTS,ovz-server)
|
||||
@$(call add,MAIN_LISTS,kernel-wifi)
|
||||
@$(call add,MAIN_GROUPS,dns-server http-server ftp-server kvm-server)
|
||||
|
@@ -3,6 +3,12 @@
|
||||
NB: пути приводятся от верхнего уровня; проект в целом предполагает
|
||||
GNU make 3.81 (с использованием которого и разрабатывается).
|
||||
|
||||
- lib/report.mk
|
||||
+ ожидает, что каждая подлежащая трассированию цель каждого
|
||||
makefile при сборке конфигурации образа содержит непустой
|
||||
recipe -- хотя бы "; @:" -- т.к. зависит от запуска $(SHELL)
|
||||
+ характерный признак пропуска -- разрыв графа (report-targets.png)
|
||||
|
||||
- pkg.in/lists/Makefile
|
||||
+ ожидает, что названия пакаджлистов указываются в переменных
|
||||
вида *_LISTS, и копирует в генерируемый профиль только их
|
||||
|
@@ -65,6 +65,11 @@
|
||||
+ значение: пусто (по умолчанию) либо любая строка
|
||||
+ см. ../lib/build.mk
|
||||
|
||||
- REPORT
|
||||
+ запрашивает создание отчёта о собранном образе
|
||||
+ значение: пусто (по умолчанию) либо любая строка
|
||||
+ см. ../Makefile, ../report.mk, ../lib/report.mk
|
||||
|
||||
- SAVE_PROFILE
|
||||
+ сохраняет архив сгенерированного профиля в .disk/
|
||||
+ значение: пусто (по умолчанию) либо любая строка
|
||||
|
@@ -2,15 +2,29 @@
|
||||
# (only regarding the needed subprofiles)
|
||||
|
||||
ifndef BUILDDIR
|
||||
help all:
|
||||
|
||||
help/plus all: banner
|
||||
@$(call grepper,'^+')
|
||||
|
||||
help/features: banner
|
||||
@$(call grepper,'^use/')
|
||||
|
||||
banner:
|
||||
@echo "** BUILDDIR not defined; available features:"
|
||||
|
||||
grepper = $(and $(1),$(grepper_body))
|
||||
define grepper_body
|
||||
@for dir in */; do \
|
||||
echo -n "$$dir: "; \
|
||||
grep -h '^use/' $$dir/config.mk \
|
||||
out="`grep -h $(1) $$dir/config.mk \
|
||||
| cut -f1 -d: \
|
||||
| tr ' ' '\n\n' \
|
||||
| grep $(1) \
|
||||
| tr '\n' ' ' \
|
||||
| sort -u; \
|
||||
| sort -u`"; \
|
||||
[ -z "$$out" ] || echo "$$dir: $$out"; \
|
||||
done
|
||||
endef
|
||||
|
||||
else
|
||||
|
||||
include $(BUILDDIR)/distcfg.mk
|
||||
|
@@ -22,6 +22,10 @@
|
||||
построенных на одном базовом, можно воспользоваться подкаталогом
|
||||
с именем исходного базового субпрофиля (см. $src, $dst в Makefile).
|
||||
|
||||
Наиболее употребительные цели можно снабжать "ярлычками" вроде
|
||||
"+icewm" с тем, чтобы сделать более краткими и выразительными
|
||||
использующие их правила. Просьба не злоупотреблять количеством.
|
||||
|
||||
Каталог lib/ является специфическим для фич, определяющих
|
||||
построение конкретного вида образа -- см. build-*/.
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
Эта фича конфигурирует создание образа дистрибутива, включая работу
|
||||
с субпрофилями -- которая сейчас нужна только дистрибутивным целям.
|
||||
|
||||
Дополняет финальную стадию сборки (lib/, scripts.d/).
|
||||
Дополняет финальную стадию сборки (lib/, scripts.d/)
|
||||
и тесно с ней связана.
|
||||
|
@@ -4,7 +4,17 @@
|
||||
# take the latter part
|
||||
SUBDIRS = $(notdir $(SUBPROFILES))
|
||||
|
||||
BOOT_TYPE = isolinux
|
||||
# proxy over the ISO metadata collected; see also genisoimagerc(5)
|
||||
BOOT_SYSI := $(META_SYSTEM_ID)
|
||||
BOOT_PUBL := $(META_PUBLISHER)
|
||||
BOOT_PREP := $(META_PREPARER)
|
||||
BOOT_APPI := $(META_APP_ID)
|
||||
BOOT_VOLI := $(META_VOL_ID)
|
||||
BOOT_VOLS := $(META_VOL_SET)
|
||||
BOOT_BIBL := $(META_BIBLIO)
|
||||
BOOT_ABST := $(META_ABSTRACT)
|
||||
|
||||
BOOT_TYPE := isolinux
|
||||
|
||||
# Metadata/ needed only for installers (and not for e.g. syslinux.iso)
|
||||
# FIXME: installable live needs it too, don't move to install2 feature
|
||||
|
@@ -1,3 +1,4 @@
|
||||
Эта фича конфигурирует создание образа виртуального окружения (VE).
|
||||
|
||||
Дополняет финальную стадию сборки (lib/, image-scripts.d/).
|
||||
Дополняет финальную стадию сборки (lib/, image-scripts.d/)
|
||||
и тесно с ней связана.
|
||||
|
6
features.in/build-ve/image-scripts.d/07fstab
Executable file
6
features.in/build-ve/image-scripts.d/07fstab
Executable 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
|
11
features.in/cleanup/live/image-scripts.d/80locales
Executable file
11
features.in/cleanup/live/image-scripts.d/80locales
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# FIXME: there should be less brutal i18n tuning
|
||||
|
||||
cd /usr/share/locale
|
||||
for i in */; do
|
||||
case "$i" in
|
||||
be*|en*|ru*|uk*) continue;;
|
||||
esac
|
||||
rm -r "$i"
|
||||
done
|
||||
:
|
6
features.in/cleanup/live/image-scripts.d/90cleanup-pkgs
Executable file
6
features.in/cleanup/live/image-scripts.d/90cleanup-pkgs
Executable 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
|
||||
:
|
3
features.in/cleanup/live/image-scripts.d/99cleanupdb
Executable file
3
features.in/cleanup/live/image-scripts.d/99cleanupdb
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
# remove rpm, apt databases and cache
|
||||
find /var/lib/rpm /var/lib/apt /var/cache/apt -type f -delete
|
@@ -1,7 +1,12 @@
|
||||
use/dev:
|
||||
@$(call add_feature)
|
||||
@$(call add,COMMON_PACKAGES,git-core hasher gear)
|
||||
@$(call add,THE_PACKAGES,git-core hasher gear)
|
||||
|
||||
use/dev/mkimage: use/dev
|
||||
@$(call add,COMMON_PACKAGES,mkimage)
|
||||
@$(call add,LIVE_PACKAGES,shadow-change)
|
||||
@$(call add,THE_PACKAGES,mkimage shadow-change)
|
||||
|
||||
use/dev/repo: use/dev use/repo/main
|
||||
@$(call add,THE_PACKAGES,apt-repo)
|
||||
@$(call add,MAIN_PACKAGES,rpm-build basesystem)
|
||||
@$(call add,MAIN_PACKAGES,fakeroot sisyphus_check)
|
||||
@$(call add,MAIN_PACKAGES,file make-initrd make-initrd-propagator)
|
||||
|
@@ -1,5 +1,9 @@
|
||||
# tries to fill in ISO metadata in case it's the only inhabitant
|
||||
use/dos: use/syslinux
|
||||
@$(call add_feature)
|
||||
@$(call add,SYSLINUX_CFG,dos)
|
||||
@$(call add,SYSLINUX_FILES,/usr/lib/syslinux/memdisk)
|
||||
@$(call add,STAGE1_PACKAGES,make-freedos-floppy glibc-gconv-modules)
|
||||
@$(call try,META_SYSTEM_ID,DOS)
|
||||
@$(call try,META_VOL_ID,FreeDOS 2.88M)
|
||||
@$(call try,META_VOL_SET,FreeDOS)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
use/hdt: use/syslinux use/memtest
|
||||
# optimized out use/syslinux due to use/memtest
|
||||
use/hdt: use/memtest
|
||||
@$(call add_feature)
|
||||
@$(call add,STAGE1_PACKAGES,pciids)
|
||||
@$(call add,SYSLINUX_MODULES,hdt)
|
||||
|
@@ -4,3 +4,7 @@ use/install2: use/stage2 sub/stage2/install2 use/cleanup/installer
|
||||
@$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator)
|
||||
@$(call add,BASE_PACKAGES,branding-$$(BRANDING)-release)
|
||||
@$(call add,BASE_LISTS,$(call tags,basesystem))
|
||||
|
||||
### FR: curl-mini
|
||||
use/install2/net: use/install2
|
||||
@$(call add,INSTALL2_PACKAGES,curl)
|
||||
|
@@ -1,6 +1,3 @@
|
||||
# remove rpm database
|
||||
rm -rf /var/lib/rpm/*
|
||||
|
||||
# remove apt data files
|
||||
rm -rf /var/cache/apt /var/lib*/apt
|
||||
|
||||
#!/bin/sh
|
||||
# remove rpm, apt databases and cache
|
||||
find /var/lib/rpm /var/lib/apt /var/cache/apt -type f -delete
|
||||
|
@@ -1,3 +1,5 @@
|
||||
+live: use/live/desktop; @:
|
||||
|
||||
# copy stage2 as live
|
||||
use/live: use/stage2 sub/stage2/live
|
||||
@$(call add_feature)
|
||||
@@ -5,12 +7,19 @@ use/live: use/stage2 sub/stage2/live
|
||||
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
|
||||
use/live/desktop: use/live/base use/x11/xorg use/x11/wacom \
|
||||
use/firmware use/virtualbox/guest \
|
||||
use/power/acpi/button use/power/acpi/cpufreq
|
||||
@$(call add,LIVE_LISTS,$(call tags,desktop && (live || network)))
|
||||
|
||||
# NB: there's an unconditional live/image-scripts.d/40-autologin script
|
||||
# *but* it only configures some of the *existing* means; let's add one
|
||||
use/live/autologin: use/live/x11
|
||||
# for the cases when there should be no display manager
|
||||
use/live/autologin: use/live/desktop
|
||||
@$(call add,LIVE_PACKAGES,autologin xinit)
|
||||
|
||||
use/live/hooks: use/live
|
||||
@$(call add,LIVE_PACKAGES,livecd-run-hooks)
|
||||
|
||||
use/live/ru: use/live
|
||||
@$(call add,LIVE_PACKAGES,livecd-ru)
|
||||
|
@@ -1,3 +1,5 @@
|
||||
+ltsp: use/ltsp/base; @:
|
||||
|
||||
use/ltsp:
|
||||
@$(call add,INSTALL2_PACKAGES,installer-feature-ltsp-stage2)
|
||||
@$(call add,MAIN_LISTS,ltsp-client ltsp-client.$(ARCH))
|
||||
|
@@ -2,6 +2,7 @@
|
||||
use/syslinux: sub/stage1
|
||||
@$(call add_feature)
|
||||
@$(call add,STAGE1_PACKAGES,syslinux)
|
||||
@$(call try,META_SYSTEM_ID,SYSLINUX)
|
||||
|
||||
# UI is overwritten
|
||||
use/syslinux/ui-%: use/syslinux
|
||||
|
@@ -1,3 +1,7 @@
|
||||
+icewm: use/x11/icewm; @:
|
||||
+razorqt: use/x11/razorqt use/x11/lightdm; @:
|
||||
+tde: use/x11/tde use/x11/kdm; @:
|
||||
|
||||
use/x11/xorg:
|
||||
@$(call add,THE_LISTS,xorg)
|
||||
@$(call add,THE_KMODULES,drm)
|
||||
@@ -13,9 +17,18 @@ use/x11/runlevel5: use/x11/xorg
|
||||
use/x11/xdm: use/x11/runlevel5
|
||||
@$(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?
|
||||
use/x11/lightdm: use/x11/runlevel5
|
||||
@$(call add,THE_PACKAGES,lightdm)
|
||||
|
||||
use/x11/kdm: use/x11/runlevel5
|
||||
@$(call add,THE_PACKAGES,kdebase-kdm)
|
||||
|
||||
use/x11/icewm: use/x11/xorg
|
||||
@$(call add,THE_LISTS,$(call tags,icewm desktop))
|
||||
|
||||
use/x11/razorqt: use/x11/xorg
|
||||
@$(call add,THE_LISTS,$(call tags,razorqt desktop))
|
||||
|
||||
use/x11/tde: use/x11/xorg
|
||||
@$(call add,THE_LISTS,$(call tags,tde desktop))
|
||||
|
@@ -10,7 +10,7 @@ PREFS := $(.VARIABLES)
|
||||
DISTCFG := $(.VARIABLES)
|
||||
|
||||
# a separator variable
|
||||
-- := --
|
||||
-- = --
|
||||
|
||||
.PHONY: dump-vars
|
||||
|
||||
|
@@ -31,8 +31,10 @@ IMAGEDIR ?= $(shell \
|
||||
)
|
||||
|
||||
# actual build starter
|
||||
# NB: our output MUST go into stderr to escape POSTPROC
|
||||
build-image: profile/populate
|
||||
@if [ -n "$(CHECK)" ]; then \
|
||||
@{ \
|
||||
if [ -n "$(CHECK)" ]; then \
|
||||
echo "$(TIME) skipping actual image build (CHECK is set)"; \
|
||||
exit; \
|
||||
fi; \
|
||||
@@ -61,4 +63,5 @@ build-image: profile/populate
|
||||
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
|
||||
if [ -n "$(BELL)" ]; then echo -ne '\a'; fi; \
|
||||
} >&2
|
||||
|
23
lib/clean.mk
23
lib/clean.mk
@@ -19,19 +19,23 @@ endif
|
||||
endif
|
||||
|
||||
# ordinary clean: destroys workdirs but not the corresponding results
|
||||
# NB: our output MUST go into stderr to escape POSTPROC
|
||||
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)"; \
|
||||
$(MAKE) -C "$(SYMLINK)" $@ \
|
||||
GLOBAL_BUILDDIR="$(realpath $(SYMLINK))" $(LOG) ||:; \
|
||||
fi
|
||||
fi; \
|
||||
} >&2
|
||||
|
||||
# there can be some sense in writing log here even if normally
|
||||
# $(BUILDDIR)/ gets purged: make might have failed,
|
||||
# and BUILDLOG can be specified by hand either
|
||||
distclean: clean
|
||||
@if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
|
||||
@{ \
|
||||
if [ -L "$(SYMLINK)" -a -d "$(SYMLINK)"/ ]; then \
|
||||
build="$(realpath $(SYMLINK)/)"; \
|
||||
if [ "$$build" = / ]; then \
|
||||
echo "** ERROR: invalid \`"$(SYMLINK)"' symlink" >&2; \
|
||||
@@ -41,16 +45,19 @@ distclean: clean
|
||||
GLOBAL_BUILDDIR="$$build" $(LOG) ||: \
|
||||
rm -rf "$$build"; \
|
||||
fi; \
|
||||
fi
|
||||
@rm -f "$(SYMLINK)"
|
||||
fi; \
|
||||
rm -f "$(SYMLINK)"; \
|
||||
} >&2
|
||||
|
||||
# builddir existing outside read-only metaprofile is less ephemeral
|
||||
# than BUILDDIR is -- usually it's unneeded afterwards so just zap it
|
||||
postclean: build-image
|
||||
@if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" ] || \
|
||||
@{ \
|
||||
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
|
||||
fi; \
|
||||
} >&2
|
||||
|
@@ -11,17 +11,23 @@ sub/%:
|
||||
@$(call add,SUBPROFILES,$(@:sub/%=%))
|
||||
|
||||
# install media bootloader
|
||||
boot/%: use/syslinux
|
||||
boot/%:
|
||||
@$(call set,BOOTLOADER,$*)
|
||||
|
||||
# fundamental targets
|
||||
|
||||
distro/.init: profile/bare
|
||||
@$(call try,META_PREPARER,mkimage-profiles)
|
||||
@$(call try,META_APP_ID,$(IMAGE_NAME))
|
||||
@$(call set,META_PUBLISHER,ALT Linux Team)
|
||||
|
||||
# NB: the last flavour in KFLAVOURS gets to be the default one;
|
||||
# the kernel packages regexp evaluation has to take place at build stage
|
||||
distro/.base: distro/.init
|
||||
@$(call set,KFLAVOURS,std-def)
|
||||
@$(call set,META_SYSTEM_ID,LINUX)
|
||||
@$(call set,META_VOL_ID,ALT Linux $(ARCH))
|
||||
@$(call set,META_VOL_SET,ALT Linux)
|
||||
|
||||
# something marginally useful (as a network-only installer)
|
||||
# NB: doesn't carry stage3 thus cannot use/bootloader
|
||||
@@ -29,6 +35,6 @@ distro/installer: distro/.base use/install2 use/syslinux/localboot.cfg
|
||||
@$(call set,INSTALLER,altlinux-generic)
|
||||
@$(call set,STAGE1_KMODULES_REGEXP,drm.*) # for KMS
|
||||
|
||||
distro/.installer: distro/installer use/bootloader/grub use/repo/main
|
||||
distro/.installer: distro/installer use/bootloader/grub use/repo/main; @:
|
||||
|
||||
endif
|
||||
|
12
lib/help.mk
Normal file
12
lib/help.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
# this makefile holds the most helpful bits for the toplevel one
|
||||
|
||||
help/distro:
|
||||
@echo '** available distribution targets:'; \
|
||||
echo $(DISTROS) | fmt -sw"$$((COLUMNS>>1))" | column -t
|
||||
|
||||
help/ve:
|
||||
@echo '** available virtual environment targets:'; \
|
||||
echo $(VES) | fmt -sw"$$((COLUMNS>>1))" | column -t
|
||||
|
||||
help: | help/distro help/space help/ve; @:
|
||||
help/space:; @echo
|
@@ -34,50 +34,57 @@ CONFIG := $(BUILDDIR)/distcfg.mk
|
||||
RC := $(HOME)/.mkimage/profiles.mk
|
||||
|
||||
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
|
||||
# NB: our output MUST go into stderr to escape POSTPROC
|
||||
profile/init: distclean
|
||||
@if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \
|
||||
@{ \
|
||||
if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \
|
||||
echo "$(TIME) ERROR: invalid BUILDDIR: \`$(BUILDDIR)'"; \
|
||||
exit 128; \
|
||||
fi;
|
||||
@echo -n "$(TIME) initializing BUILDDIR: "
|
||||
@rsync -qaxH --delete-after image.in/ "$(BUILDDIR)"/
|
||||
@mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker
|
||||
fi; \
|
||||
echo -n "$(TIME) initializing BUILDDIR: "; \
|
||||
rsync -qaxH --delete-after image.in/ "$(BUILDDIR)"/; \
|
||||
mkdir "$(BUILDDIR)"/.mki; \
|
||||
} >&2
|
||||
@$(call put,ifndef DISTCFG_MK)
|
||||
@$(call put,DISTCFG_MK = 1)
|
||||
@if type -t git >&/dev/null; then \
|
||||
@{ \
|
||||
if type -t git >&/dev/null; then \
|
||||
if [ -d .git ]; then \
|
||||
git show-ref --head -d -s -- HEAD && \
|
||||
git status -s && \
|
||||
echo; \
|
||||
fi $(LOG); \
|
||||
fi
|
||||
@{ \
|
||||
fi; \
|
||||
{ \
|
||||
eval `apt-config shell $${APTCONF:+-c=$(wildcard $(APTCONF))} \
|
||||
SOURCELIST Dir::Etc::sourcelist/f \
|
||||
SOURCEPARTS Dir::Etc::sourceparts/d`; \
|
||||
find "$$SOURCEPARTS" -name '*.list' \
|
||||
| xargs egrep -Rhv '^#|^[[:blank:]]*$$' "$$SOURCELIST" && \
|
||||
echo; \
|
||||
} $(LOG)
|
||||
@if type -t git >&/dev/null; then \
|
||||
} $(LOG); \
|
||||
if type -t git >&/dev/null; then \
|
||||
if cd $(BUILDDIR); then \
|
||||
git init -q && \
|
||||
git add . && \
|
||||
git commit -qam 'derivative profile initialized'; \
|
||||
cd ->&/dev/null; \
|
||||
fi; \
|
||||
fi
|
||||
@if [ -w . ]; then \
|
||||
fi; \
|
||||
if [ -w . ]; then \
|
||||
rm -f "$(SYMLINK)" && \
|
||||
ln -s "$(BUILDDIR)" "$(SYMLINK)" && \
|
||||
echo "$(SYMLINK)/"; \
|
||||
else \
|
||||
echo "$(BUILDDIR)/" $(SHORTEN); \
|
||||
fi $(SHORTEN)
|
||||
echo "$(BUILDDIR)/"; \
|
||||
fi $(SHORTEN); \
|
||||
} >&2
|
||||
|
||||
profile/bare: profile/init
|
||||
@NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \
|
||||
echo "$(TIME) preparing distro config$$NOTE" \
|
||||
$(SHORTEN)
|
||||
@{ \
|
||||
NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \
|
||||
echo "$(TIME) preparing distro config$$NOTE" $(SHORTEN); \
|
||||
} >&2
|
||||
@$(call try,MKIMAGE_PREFIX,/usr/share/mkimage)
|
||||
@$(call try,GLOBAL_VERBOSE,)
|
||||
@$(call try,IMAGEDIR,$(IMAGEDIR))
|
||||
@@ -106,7 +113,7 @@ profile/dump-vars:
|
||||
fi $(LOG)
|
||||
|
||||
# step 3 entry point: copy the needed parts into BUILDDIR
|
||||
profile/populate: profile/init profile/finalize profile/dump-vars
|
||||
profile/populate: profile/finalize profile/dump-vars
|
||||
@for dir in sub.in features.in pkg.in; do \
|
||||
$(MAKE) -C $$dir $(LOG); \
|
||||
done
|
||||
|
9
lib/report.mk
Normal file
9
lib/report.mk
Normal 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
|
@@ -15,4 +15,4 @@ config/name/%:
|
||||
@$(call set,IMAGE_NAME,$*)
|
||||
|
||||
# the final thing will pull the rest in
|
||||
build: postclean
|
||||
build: postclean; @:
|
||||
|
@@ -13,6 +13,7 @@ ve/bare: ve/.bare
|
||||
@$(call add,BASE_PACKAGES,apt)
|
||||
|
||||
ve/generic: ve/.bare
|
||||
@$(call add,BASE_PACKAGES,openssh-server openssh-blacklist openssh-clients)
|
||||
@$(call add,BASE_LISTS,\
|
||||
$(call tags,base && (server || network || security || pkg)))
|
||||
|
||||
|
13
main.mk
13
main.mk
@@ -45,17 +45,6 @@ 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)); \
|
||||
@@ -75,7 +64,7 @@ $(IMAGES): debug \
|
||||
build; @:
|
||||
|
||||
# convenience shortcut
|
||||
$(DISTROS:distro/%=%): %: distro/%
|
||||
$(DISTROS:distro/%=%): %: distro/%; @:
|
||||
|
||||
debug:
|
||||
ifeq (2,$(DEBUG))
|
||||
|
@@ -9,6 +9,8 @@ mailx
|
||||
netcat
|
||||
netlist
|
||||
openssh-clients
|
||||
openssh-server
|
||||
openssh-blacklist
|
||||
rsync
|
||||
traceroute
|
||||
vlan-utils
|
||||
|
14
reports.mk
Normal file
14
reports.mk
Normal file
@@ -0,0 +1,14 @@
|
||||
# collect what's left
|
||||
|
||||
all: reports/targets
|
||||
|
||||
reports/targets:
|
||||
@if [ -n "$$REPORT_PATH" -a -s "$$REPORT_PATH" ]; then \
|
||||
BUILDDIR="`sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' \
|
||||
"$$REPORT_PATH"`"; \
|
||||
REPORT_IMAGE="$$BUILDDIR/targets.png"; \
|
||||
bin/report-targets < "$$REPORT_PATH" \
|
||||
| dot -Tpng -o "$$REPORT_IMAGE" \
|
||||
&& echo "** target graph report: $$REPORT_IMAGE" \
|
||||
&& mv "$$REPORT_PATH" "$$BUILDDIR/targets.log"; \
|
||||
fi
|
Reference in New Issue
Block a user