syslinux and features

- syslinux: menu.c32 works
- features: initial draft
  + memtest
- mv pkg/ pkg.in/
  + server-base: include openssh-blacklist by default
- mv isodata/ copy/
- README: changed to utf8, added an URL
This commit is contained in:
Michael Shigorin 2010-09-09 12:50:29 +03:00
parent c36b4df23e
commit c91a2a0994
44 changed files with 147 additions and 77 deletions

View File

@ -5,13 +5,15 @@
include clean.mk
include distro.mk
include profile.mk
include iso.mk
# this could have come come from environment;
# this could have come from environment;
# if not, can be symlinked if r/w, or made anew
ifndef BUILDDIR
BUILDDIR := $(shell realpath build || bin/mktmpdir mkimage-profiles.build)
endif
export BUILDDIR
# we can't use implicit rules for top-level targets, only for prereqs
CONFIGS=$(shell sed -n 's,^distro/\([^:]\+\):.*$$,\1,p' distro.mk)
@ -21,16 +23,4 @@ all:
@echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw65 | column -t
prep:
@echo "** BUILDDIR: $(BUILDDIR)"
# ls -ld $(BUILDDIR)
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/image/
@rm -f "$(BUILDDIR)"/.config.mk
@touch "$(BUILDDIR)"/.config.mk
@mkdir "$(BUILDDIR)"/.mki
@rm -f build
@[ -w . ] \
&& ln -sf "$(BUILDDIR)" build \
|| echo "** profile directory readonly: skipping symlinks, env only"
$(DISTROS): %.iso: | prep distro/% iso
$(DISTROS): %.iso: | profile/init distro/% profile/populate iso

24
README
View File

@ -1,12 +1,14 @@
Объекты:
- дистрибутивы: distro.mk, могут основываться один на другом;
желательно избегать множественного наследования, используя
вместо него блоки use-*
- блоки функциональности use-*: не являются самостоятельными
(не путать с дистрибутивами), но законченными
- субпрофили:
+ install2: инсталятор
+ main: пакетная база к инсталяции (обязательная и дополнительная)
see also http://www.altlinux.org/Mkimage/Profiles/next
Объекты:
- дистрибутивы: distro.mk, могут основываться один на другом;
желательно избегать множественного наследования, используя
вместо него блоки use-*
- блоки функциональности use-*: не являются самостоятельными
(не путать с дистрибутивами), но законченными
- субпрофили:
+ install2: инсталятор
+ main: пакетная база к инсталяции (обязательная и дополнительная)
+ ...
- списки пакетов: большая человеческая просьба по возможности
избегать дублирования
- списки пакетов: большая человеческая просьба по возможности
избегать дублирования

View File

@ -9,7 +9,7 @@
#
# TODO; consider s/-name/-path/
[ -d pkg/lists ] && cd pkg/lists
[ -d pkg.in/lists ] && cd pkg.in/lists
find ${1:-tagged} $(sed \
-e "s,\([^&|! ()']\+\),-name *_\1_*,g" \

View File

@ -1,12 +1,12 @@
clean:
@echo '** cleaning up...'
@[ -d build/ ] && \
make -C build/image $@ GLOBAL_BUILDDIR=$(shell readlink build) \
make -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) \
||:
distclean: clean
@[ -d build/ ] && \
make -C build/image $@ GLOBAL_BUILDDIR=$(shell readlink build) && \
make -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) && \
rm -r $(shell readlink build) && \
rm build \
||:

2
configure vendored
View File

@ -16,7 +16,7 @@ PARAMS="$@"
#ls -ld $BUILDDIR
#find image.in -type f -print0 | xargs -r0 cp -at "$BUILDDIR"/ --
#rsync -qaH --delete image.in/ "$BUILDDIR"/image/
#rsync -qaH --delete image.in/ "$BUILDDIR"/
#rm -f "$BUILDDIR"/.config.mk
#touch "$BUILDDIR"/.config.mk
#mkdir "$BUILDDIR"/.mki

View File

@ -1,6 +1,9 @@
### build up distribution's configuration
# build up distribution's configuration
CONFIG = $(BUILDDIR)/.config.mk
# source initial feature snippets
-include features.in/*/config.mk
# NB: don"t use ANY quotes ('/") for put() arguments!
# shell will get confused by ' or args get spammed with "
put = $(and $(1),$(put_body))
@ -29,9 +32,12 @@ init:
:> $(CONFIG)
$(call put,KFLAVOUR=std-def) ###
$(call put,IMAGE_INIT_LIST=+branding-$$(BRANDING)-release)
$(call put,BRANDING=altlinux-desktop) ###
@#$(call put,STAGE1_PACKAGES=kernel-image-$$(KFLAVOUR))
$(call put,KERNEL_PACKAGES=kernel-image-$$(KFLAVOUR))
distro/syslinux: init
# NB: our */* are phony targets really, just for namespace
distro/installer: init sub/install2
@#$(call put,BRANDING=altlinux-sisyphus) ###
@ -47,9 +53,5 @@ distro/server-light: distro/server-base use/bootsplash
$(call put,DISK_LISTS+=kernel-wifi)
$(call put,BASE_LISTS+=$(call tags,base server))
use/memtest86:
$(call put,COMMON_PACKAGES+=memtest86+)
@# configure syslinux/isolinux as well
use/bootsplash:
$(call put,COMMON_TAGS+=bootsplash)

19
features.in/Makefile Normal file
View File

@ -0,0 +1,19 @@
include $(BUILDDIR)/.config.mk
# make rsync backups
all:
for dir in $(FEATURES); do \
for sub in $(SUBPROFILES); do \
dest=$${sub%stage1}; \
echo "dir/sub: [$$dir/$$sub/]" && \
[ -d $$dir/$$sub/ ] && \
echo rsync -ab $$dir/$$sub/ $(BUILDDIR)/$$dest/ && \
rsync -ab $$dir/$$sub/ $(BUILDDIR)/$$dest/ && \
cd $(BUILDDIR)/$$dest/ && \
git add . && \
git commit -qam "$@/$$dir/$$sub" && \
cd ->&/dev/null; \
done; \
done; \
find $(BUILDDIR) -name '*~'
@# these might signal of file clashes (or plain dirt)

View File

@ -0,0 +1,3 @@
use/memtest86:
$(call put,COMMON_PACKAGES+=memtest86+)
@# configure syslinux/isolinux as well

View File

@ -5,45 +5,33 @@ include $(GLOBAL_BUILDDIR)/.config.mk
SUBDIRS = $(SUBPROFILES)
# we usually need a bootloader (until stage1 is separate),
# and "main" subprofile needs genbasedir
CHROOT_PACKAGES = syslinux apt-utils $(KERNEL_PACKAGES)
# "main" subprofile needs genbasedir
CHROOT_PACKAGES = apt-utils
###
MKI_PACK_RESULTS = boot:mkimage-profiles.iso
COPY_TREE = ./isodata
MKI_PACK_RESULTS = isoboot:mkimage-profiles.iso
COPY_TREE = ./files
BOOT_TYPE = isolinux
###
PROPAGATOR_VERSION = mkimage-profiles 2.0
PROPAGATOR_MAR_MODULES = ./modules
PROPAGATOR_INITFS = ./initfs
include $(MKIMAGE_PREFIX)/targets.mk
all: prep copy-tree copy-subdirs run-scripts pack-image
prep: initfs disk-info metadata
# FIXME: scripts.d/?
prep: disk-info metadata
@echo "TOPDIR=$(TOPDIR)"
initfs:
echo "file /.VERSION @TMPDIR@/.VERSION 0644 0 0" >initfs
### FIXME: broken test, we already do branding
[ -z "$(BRANDING)" ] || \
echo "file /bootsplash /bootsplash/bootsplash 0644 0 0" >>initfs
disk-info:
mkdir -p isodata/.disk
echo "$(PROPAGATOR_VERSION)" >isodata/.disk/info ### +$(ARCH)
(cd $(TOPDIR); git show-ref --head --dereference -s -- HEAD 2>/dev/null) >isodata/.disk/commit
[ -s isodata/.disk/commit ] || rm isodata/.disk/commit
mkdir -p files/.disk
echo "$(PROPAGATOR_VERSION)" >files/.disk/info ### +$(ARCH)
(cd $(TOPDIR); git show-ref --head --dereference -s -- HEAD 2>/dev/null) >files/.disk/commit
[ -s files/.disk/commit ] || rm files/.disk/commit
# see also alterator-pkg (backend3/pkg-install)
# FIXME: groups unmerged
# FIXME: groups unmerged, and only .base hardwired in
metadata:
mkdir -p isodata/Metadata
rm -f isodata/Metadata/pkg-groups.tar
tar -cvf isodata/Metadata/pkg-groups.tar \
mkdir -p files/Metadata
rm -f files/Metadata/pkg-groups.tar
tar -cvf files/Metadata/pkg-groups.tar \
-C $(PKGDIR) \
$(shell echo $(call list,.base) $(call list,base) | sed 's,$(PKGDIR)/*,,g')
$(shell echo $(call list,.base) | sed 's,$(PKGDIR)/*,,g')

View File

@ -1,21 +1,28 @@
#default harddisk
default linux
prompt 1
ui menu.c32
menu title mkimage-profiles 2.0
prompt 0
timeout 200
gfxboot bootlogo
display boot.msg
implicit 1
# f1 help.txt
# f2 version.txt
# ...
default rescue
#label harddisk
# localboot 0x80
label harddisk
menu label Continue as usual
localboot 0x80
# menu default
label linux
menu label Normal install
kernel alt0/vmlinuz
append initrd=alt0/full.cz changedisk vga=0x314 quiet=1 showopts automatic=method:cdrom
label noapic
menu label FailSafe(TM) install
kernel alt0/vmlinuz
append initrd=alt0/full.cz changedisk vga=0x314 showopts nolapic noapic acpi=off
label rescue
menu label Rescue
kernel alt0/vmlinuz
append initrd=alt0/full.cz live fastboot stagename=rescue
label memtest
menu label Memory Test
kernel memtest

View File

@ -1,4 +1,4 @@
PKGDIR=$(TOPDIR)/pkg
PKGDIR=$(GLOBAL_BUILDDIR)/pkg
# prefix pkglist name with its directory to form a path
list = $(1:%=$(PKGDIR)/lists/%)

10
iso.mk
View File

@ -1,10 +1,6 @@
pkgs:
@echo "** starting package lists build process"
$(MAKE) -C pkg BUILDDIR=$(BUILDDIR)
iso: pkgs
iso:
@echo "** starting image build process"
@### setup GLOBAL_BOOT_TYPE, etc
(cd $(BUILDDIR)/image; autoconf; ./configure --with-aptconf=$(HOME)/apt/apt.conf) ###
$(MAKE) -C $(BUILDDIR)/image GLOBAL_BUILDDIR=$(BUILDDIR)
@#echo (cd $(BUILDDIR)/; autoconf; ./configure --with-aptconf=$(HOME)/apt/apt.conf) ###
@echo $(MAKE) -C $(BUILDDIR)/ GLOBAL_BUILDDIR=$(BUILDDIR)
@# check iso size

View File

@ -5,4 +5,5 @@ sfdisk
mdadm
openssh-server
openssh-blacklist
acpid

17
profile.mk Normal file
View File

@ -0,0 +1,17 @@
profile/init:
@echo "** BUILDDIR: $(BUILDDIR)"
# ls -ld $(BUILDDIR)
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
@touch "$(BUILDDIR)"/.config.mk
@mkdir "$(BUILDDIR)"/.mki
cd $(BUILDDIR); git init ###
@rm -f build
@[ -w . ] \
&& ln -sf "$(BUILDDIR)" build \
|| echo "** profile directory readonly: skipping symlinks, env only"
profile/populate: profile/init
for dir in sub.in features.in pkg.in; do \
$(MAKE) -C $$dir; \
done

20
sub.in/Makefile Normal file
View File

@ -0,0 +1,20 @@
include $(BUILDDIR)/.config.mk
all:
ls -l $(BUILDDIR)/.config.mk
echo -- SUBPROFILES: $(SUBPROFILES)
for dir in $(SUBPROFILES); do \
echo -- rsync -a $$dir/ $(BUILDDIR)/$$dir/ && \
rsync -a $$dir/ $(BUILDDIR)/$$dir/ && \
cd $(BUILDDIR)/$$dir/ && \
git add . && \
git commit -qam "$@/$$dir"; \
cd ->&/dev/null; \
done
clean:
for dir in $(SUBPROFILES); do \
[ -n "$$dir" ] && \
rm -rf $(BUILDDIR)/$$dir && \
mkdir -p $(BUILDDIR)/$$dir ||:; \
done

17
sub.in/stage1/Makefile Normal file
View File

@ -0,0 +1,17 @@
include globals.mk
include functions.mk
include $(MKIMAGE_PREFIX)/config.mk
include $(GLOBAL_BUILDDIR)/.config.mk
CHROOT_PACKAGES = syslinux $(KERNEL_PACKAGES)
###
MKI_PACK_RESULTS = data
PROPAGATOR_VERSION = mkimage-profiles 2.0
PROPAGATOR_MAR_MODULES = ./modules
PROPAGATOR_INITFS = ./initfs
include $(MKIMAGE_PREFIX)/targets.mk
all: build-propagator copy-isolinux run-scripts pack-image

View File

@ -0,0 +1,6 @@
#!/bin/sh
echo "file /.VERSION @TMPDIR@/.VERSION 0644 0 0" >"$WORKDIR"/initfs
### FIXME: broken test, we already do branding
[ -z "$(BRANDING)" ] || \
echo "file /bootsplash /bootsplash/bootsplash 0644 0 0" >>"$WORKDIR"/initfs

View File

@ -0,0 +1,2 @@
#!/bin/sh
install -pDm644 /usr/lib/syslinux/menu.c32 "$WORKDIR"/syslinux/menu.c32