Commit c91a2a09 authored by Michael Shigorin's avatar Michael Shigorin

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
parent c36b4df2
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
include clean.mk include clean.mk
include distro.mk include distro.mk
include profile.mk
include iso.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 # if not, can be symlinked if r/w, or made anew
ifndef BUILDDIR ifndef BUILDDIR
BUILDDIR := $(shell realpath build || bin/mktmpdir mkimage-profiles.build) BUILDDIR := $(shell realpath build || bin/mktmpdir mkimage-profiles.build)
endif endif
export BUILDDIR
# we can't use implicit rules for top-level targets, only for prereqs # we can't use implicit rules for top-level targets, only for prereqs
CONFIGS=$(shell sed -n 's,^distro/\([^:]\+\):.*$$,\1,p' distro.mk) CONFIGS=$(shell sed -n 's,^distro/\([^:]\+\):.*$$,\1,p' distro.mk)
...@@ -21,16 +23,4 @@ all: ...@@ -21,16 +23,4 @@ all:
@echo '** available distribution targets:' @echo '** available distribution targets:'
@echo $(DISTROS) | fmt -sw65 | column -t @echo $(DISTROS) | fmt -sw65 | column -t
prep: $(DISTROS): %.iso: | profile/init distro/% profile/populate iso
@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
Объекты: see also http://www.altlinux.org/Mkimage/Profiles/next
- дистрибутивы: distro.mk, могут основываться один на другом;
желательно избегать множественного наследования, используя Объекты:
вместо него блоки use-* - дистрибутивы: distro.mk, могут основываться один на другом;
- блоки функциональности use-*: не являются самостоятельными желательно избегать множественного наследования, используя
(не путать с дистрибутивами), но законченными вместо него блоки use-*
- субпрофили: - блоки функциональности use-*: не являются самостоятельными
+ install2: инсталятор (не путать с дистрибутивами), но законченными
+ main: пакетная база к инсталяции (обязательная и дополнительная) - субпрофили:
+ install2: инсталятор
+ main: пакетная база к инсталяции (обязательная и дополнительная)
+ ... + ...
- списки пакетов: большая человеческая просьба по возможности - списки пакетов: большая человеческая просьба по возможности
избегать дублирования избегать дублирования
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# TODO; consider s/-name/-path/ # TODO; consider s/-name/-path/
[ -d pkg/lists ] && cd pkg/lists [ -d pkg.in/lists ] && cd pkg.in/lists
find ${1:-tagged} $(sed \ find ${1:-tagged} $(sed \
-e "s,\([^&|! ()']\+\),-name *_\1_*,g" \ -e "s,\([^&|! ()']\+\),-name *_\1_*,g" \
......
clean: clean:
@echo '** cleaning up...' @echo '** cleaning up...'
@[ -d build/ ] && \ @[ -d build/ ] && \
make -C build/image $@ GLOBAL_BUILDDIR=$(shell readlink build) \ make -C build/ $@ GLOBAL_BUILDDIR=$(shell readlink build) \
||: ||:
distclean: clean distclean: clean
@[ -d build/ ] && \ @[ -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 -r $(shell readlink build) && \
rm build \ rm build \
||: ||:
...@@ -16,7 +16,7 @@ PARAMS="$@" ...@@ -16,7 +16,7 @@ PARAMS="$@"
#ls -ld $BUILDDIR #ls -ld $BUILDDIR
#find image.in -type f -print0 | xargs -r0 cp -at "$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 #rm -f "$BUILDDIR"/.config.mk
#touch "$BUILDDIR"/.config.mk #touch "$BUILDDIR"/.config.mk
#mkdir "$BUILDDIR"/.mki #mkdir "$BUILDDIR"/.mki
......
### build up distribution's configuration # build up distribution's configuration
CONFIG = $(BUILDDIR)/.config.mk CONFIG = $(BUILDDIR)/.config.mk
# source initial feature snippets
-include features.in/*/config.mk
# NB: don"t use ANY quotes ('/") for put() arguments! # NB: don"t use ANY quotes ('/") for put() arguments!
# shell will get confused by ' or args get spammed with " # shell will get confused by ' or args get spammed with "
put = $(and $(1),$(put_body)) put = $(and $(1),$(put_body))
...@@ -29,9 +32,12 @@ init: ...@@ -29,9 +32,12 @@ init:
:> $(CONFIG) :> $(CONFIG)
$(call put,KFLAVOUR=std-def) ### $(call put,KFLAVOUR=std-def) ###
$(call put,IMAGE_INIT_LIST=+branding-$$(BRANDING)-release) $(call put,IMAGE_INIT_LIST=+branding-$$(BRANDING)-release)
$(call put,BRANDING=altlinux-desktop) ###
@#$(call put,STAGE1_PACKAGES=kernel-image-$$(KFLAVOUR)) @#$(call put,STAGE1_PACKAGES=kernel-image-$$(KFLAVOUR))
$(call put,KERNEL_PACKAGES=kernel-image-$$(KFLAVOUR)) $(call put,KERNEL_PACKAGES=kernel-image-$$(KFLAVOUR))
distro/syslinux: init
# NB: our */* are phony targets really, just for namespace # NB: our */* are phony targets really, just for namespace
distro/installer: init sub/install2 distro/installer: init sub/install2
@#$(call put,BRANDING=altlinux-sisyphus) ### @#$(call put,BRANDING=altlinux-sisyphus) ###
...@@ -47,9 +53,5 @@ distro/server-light: distro/server-base use/bootsplash ...@@ -47,9 +53,5 @@ distro/server-light: distro/server-base use/bootsplash
$(call put,DISK_LISTS+=kernel-wifi) $(call put,DISK_LISTS+=kernel-wifi)
$(call put,BASE_LISTS+=$(call tags,base server)) $(call put,BASE_LISTS+=$(call tags,base server))
use/memtest86:
$(call put,COMMON_PACKAGES+=memtest86+)
@# configure syslinux/isolinux as well
use/bootsplash: use/bootsplash:
$(call put,COMMON_TAGS+=bootsplash) $(call put,COMMON_TAGS+=bootsplash)
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)
use/memtest86:
$(call put,COMMON_PACKAGES+=memtest86+)
@# configure syslinux/isolinux as well
...@@ -5,45 +5,33 @@ include $(GLOBAL_BUILDDIR)/.config.mk ...@@ -5,45 +5,33 @@ include $(GLOBAL_BUILDDIR)/.config.mk
SUBDIRS = $(SUBPROFILES) SUBDIRS = $(SUBPROFILES)
# we usually need a bootloader (until stage1 is separate), # "main" subprofile needs genbasedir
# and "main" subprofile needs genbasedir CHROOT_PACKAGES = apt-utils
CHROOT_PACKAGES = syslinux apt-utils $(KERNEL_PACKAGES)
### ###
MKI_PACK_RESULTS = boot:mkimage-profiles.iso MKI_PACK_RESULTS = isoboot:mkimage-profiles.iso
COPY_TREE = ./isodata COPY_TREE = ./files
BOOT_TYPE = isolinux BOOT_TYPE = isolinux
###
PROPAGATOR_VERSION = mkimage-profiles 2.0
PROPAGATOR_MAR_MODULES = ./modules
PROPAGATOR_INITFS = ./initfs
include $(MKIMAGE_PREFIX)/targets.mk include $(MKIMAGE_PREFIX)/targets.mk
all: prep copy-tree copy-subdirs run-scripts pack-image 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)" @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: disk-info:
mkdir -p isodata/.disk mkdir -p files/.disk
echo "$(PROPAGATOR_VERSION)" >isodata/.disk/info ### +$(ARCH) echo "$(PROPAGATOR_VERSION)" >files/.disk/info ### +$(ARCH)
(cd $(TOPDIR); git show-ref --head --dereference -s -- HEAD 2>/dev/null) >isodata/.disk/commit (cd $(TOPDIR); git show-ref --head --dereference -s -- HEAD 2>/dev/null) >files/.disk/commit
[ -s isodata/.disk/commit ] || rm isodata/.disk/commit [ -s files/.disk/commit ] || rm files/.disk/commit
# see also alterator-pkg (backend3/pkg-install) # see also alterator-pkg (backend3/pkg-install)
# FIXME: groups unmerged # FIXME: groups unmerged, and only .base hardwired in
metadata: metadata:
mkdir -p isodata/Metadata mkdir -p files/Metadata
rm -f isodata/Metadata/pkg-groups.tar rm -f files/Metadata/pkg-groups.tar
tar -cvf isodata/Metadata/pkg-groups.tar \ tar -cvf files/Metadata/pkg-groups.tar \
-C $(PKGDIR) \ -C $(PKGDIR) \
$(shell echo $(call list,.base) $(call list,base) | sed 's,$(PKGDIR)/*,,g') $(shell echo $(call list,.base) | sed 's,$(PKGDIR)/*,,g')
#default harddisk ui menu.c32
default linux menu title mkimage-profiles 2.0
prompt 1 prompt 0
timeout 200 timeout 200
gfxboot bootlogo # f1 help.txt
display boot.msg # f2 version.txt
implicit 1 # ...
default rescue
#label harddisk label harddisk
# localboot 0x80 menu label Continue as usual
localboot 0x80
# menu default
label linux label linux
menu label Normal install
kernel alt0/vmlinuz kernel alt0/vmlinuz
append initrd=alt0/full.cz changedisk vga=0x314 quiet=1 showopts automatic=method:cdrom append initrd=alt0/full.cz changedisk vga=0x314 quiet=1 showopts automatic=method:cdrom
label noapic label noapic
menu label FailSafe(TM) install
kernel alt0/vmlinuz kernel alt0/vmlinuz
append initrd=alt0/full.cz changedisk vga=0x314 showopts nolapic noapic acpi=off append initrd=alt0/full.cz changedisk vga=0x314 showopts nolapic noapic acpi=off
label rescue label rescue
menu label Rescue
kernel alt0/vmlinuz kernel alt0/vmlinuz
append initrd=alt0/full.cz live fastboot stagename=rescue append initrd=alt0/full.cz live fastboot stagename=rescue
label memtest label memtest
menu label Memory Test
kernel memtest kernel memtest
PKGDIR=$(TOPDIR)/pkg PKGDIR=$(GLOBAL_BUILDDIR)/pkg
# prefix pkglist name with its directory to form a path # prefix pkglist name with its directory to form a path
list = $(1:%=$(PKGDIR)/lists/%) list = $(1:%=$(PKGDIR)/lists/%)
......
pkgs: iso:
@echo "** starting package lists build process"
$(MAKE) -C pkg BUILDDIR=$(BUILDDIR)
iso: pkgs
@echo "** starting image build process" @echo "** starting image build process"
@### setup GLOBAL_BOOT_TYPE, etc @### setup GLOBAL_BOOT_TYPE, etc
(cd $(BUILDDIR)/image; autoconf; ./configure --with-aptconf=$(HOME)/apt/apt.conf) ### @#echo (cd $(BUILDDIR)/; autoconf; ./configure --with-aptconf=$(HOME)/apt/apt.conf) ###
$(MAKE) -C $(BUILDDIR)/image GLOBAL_BUILDDIR=$(BUILDDIR) @echo $(MAKE) -C $(BUILDDIR)/ GLOBAL_BUILDDIR=$(BUILDDIR)
@# check iso size @# check iso size
...@@ -5,4 +5,5 @@ sfdisk ...@@ -5,4 +5,5 @@ sfdisk
mdadm mdadm
openssh-server openssh-server
openssh-blacklist
acpid acpid
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
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
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
#!/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
#!/bin/sh
install -pDm644 /usr/lib/syslinux/menu.c32 "$WORKDIR"/syslinux/menu.c32
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment