Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
mkimage-profiles
Commits
a9e161b4
Commit
a9e161b4
authored
Sep 18, 2010
by
Michael Shigorin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gfxboot brought to reasonable shape
Also included: - reworked syslinux feature inclusion - syslinux: s/textprompt/prompt/ - README++
parent
30bb8137
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
149 additions
and
92 deletions
+149
-92
Makefile
Makefile
+2
-2
README
README
+1
-0
distro.mk
distro.mk
+25
-28
Makefile
features.in/Makefile
+8
-5
config.mk
features.in/hdt/config.mk
+2
-5
02-hdt
features.in/hdt/stage1/scripts.d/02-hdt
+2
-0
config.mk
features.in/memtest/config.mk
+3
-3
02-memtest
features.in/memtest/stage1/scripts.d/02-memtest
+2
-2
00gfxboot.cfg
features.in/syslinux/cfg.in/00gfxboot.cfg
+2
-3
00menu.cfg
features.in/syslinux/cfg.in/00menu.cfg
+1
-1
00prompt.cfg
features.in/syslinux/cfg.in/00prompt.cfg
+1
-1
01defaults.cfg
features.in/syslinux/cfg.in/01defaults.cfg
+0
-0
config.mk
features.in/syslinux/config.mk
+16
-8
generate.mk
features.in/syslinux/generate.mk
+38
-20
02-gfxboot
features.in/syslinux/stage1/scripts.d/02-gfxboot
+20
-0
functions.mk
functions.mk
+11
-8
Makefile
image.in/Makefile
+4
-2
Makefile
pkg.in/groups/Makefile
+4
-2
profile.mk
profile.mk
+5
-1
Makefile
sub.in/Makefile
+1
-0
Makefile
sub.in/stage1/Makefile
+1
-1
No files found.
Makefile
View file @
a9e161b4
# 1. configure distro
# 2. configure subprofiles, prepare package lists
# 2. configure subprofiles, prepare package lists
/groups and hooks
# 3. build subprofiles
# 4. build image
...
...
@@ -9,7 +9,7 @@ include profile.mk
include
iso.mk
# 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
(NB: immediate assignment)
ifndef
BUILDDIR
BUILDDIR
:=
$(
shell
realpath
build
||
bin/mktmpdir mkimage-profiles.build
)
endif
...
...
README
View file @
a9e161b4
...
...
@@ -33,5 +33,6 @@ make distclean server-light.iso
или несколько субпрофилей каталоги/файлы и могут выполнять
необходимые действия во время сборки после копирования
(generate.sh, generate.mk). NB: добавляем в $(FEATURES)
(из того же config.mk, который будет включён в distro.mk)
- списки пакетов: большая человеческая просьба по возможности
избегать дублирования и подумать над pkg/lists/tagged...
distro.mk
View file @
a9e161b4
...
...
@@ -19,41 +19,38 @@ include functions.mk
# request particular image subprofile inclusion
sub/%:
$(call add,SUBPROFILES,$(@:sub/%=%))
@
$(call add,SUBPROFILES,$(@:sub/%=%))
distro/init:
@echo "** starting distro configuration build process"
@:> $(CONFIG)
distro/base: distro/init sub/stage1 use/syslinux/localboot
$(call set,KFLAVOUR,std-def)
$(call set,IMAGE_INIT_LIST,+branding-$$(BRANDING)-release)
$(call set,BRANDING,altlinux-desktop) ###
$(call set,KERNEL_PACKAGES,kernel-image-$$(KFLAVOUR))
distro/base: distro/init sub/stage1 use/syslinux/localboot
.cfg
@
$(call set,KFLAVOUR,std-def)
@
$(call set,IMAGE_INIT_LIST,+branding-$$(BRANDING)-release)
@
$(call set,BRANDING,altlinux-desktop) ###
@
$(call set,KERNEL_PACKAGES,kernel-image-$$(KFLAVOUR))
# bootloader test target
distro/syslinux: distro/base use/syslinux/ui/menu use/syslinux/localboot use/hdt use/memtest boot/isolinux
distro/installer: distro/base sub/install2 use/syslinux/install2
distro/installer: distro/base sub/install2 use/syslinux/install2.cfg
@#$(call put,BRANDING=altlinux-sisyphus) ###
$(call set,BASE_LISTS,base kernel)
$(call set,INSTALL2_PACKAGES,installer-distro-server-light-stage2) ###
@
$(call set,BASE_LISTS,base kernel)
@
$(call set,INSTALL2_PACKAGES,installer-distro-server-light-stage2) ###
distro/server-base: distro/installer sub/main use/syslinux/ui
/
menu use/memtest
$(call add,BASE_LISTS,server-base kernel-server)
distro/server-base: distro/installer sub/main use/syslinux/ui
-
menu use/memtest
@
$(call add,BASE_LISTS,server-base kernel-server)
distro/server-light: distro/server-base use/hdt
$(call set,KFLAVOUR,ovz-smp) # override default
$(call set,BRANDING,sisyphus-server-light)
$(call add,DISK_LISTS,kernel-wifi)
$(call add,BASE_LISTS,$(call tags,base server))
$(call add,GROUPS,dns-server http-server ftp-server kvm-server)
$(call add,GROUPS,ipmi mysql-server dhcp-server mail-server)
$(call add,GROUPS,monitoring diag-tools)
#
FIXME: this belongs to bootsplash feature
#use/bootsplash:
# $(call add,COMMON_TAGS,bootsplash)
boot/%:
$(call set,BOOTLOADER,$*)
@
$(call set,KFLAVOUR,ovz-smp) # override default
@
$(call set,BRANDING,sisyphus-server-light)
@
$(call add,DISK_LISTS,kernel-wifi)
@
$(call add,BASE_LISTS,$(call tags,base server))
@
$(call add,GROUPS,dns-server http-server ftp-server kvm-server)
@
$(call add,GROUPS,ipmi mysql-server dhcp-server mail-server)
@
$(call add,GROUPS,monitoring diag-tools)
#
bootloader test target
distro/syslinux: distro/base use/syslinux/ui-gfxboot \
use/hdt use/memtest boot/isolinux
boot/%:
distro/init
@
$(call set,BOOTLOADER,$*)
features.in/Makefile
View file @
a9e161b4
include
$(BUILDDIR)/.config.mk
SHELL
+=
-x
-include
$(BUILDDIR)/.config.mk
# first rsync what's static, and make backups --
# these might signal of file clashes (or plain dirt);
# then handle two more ways of implementing a feature
all
:
@
echo
"** starting feature configuration"
@
[
-z
$(FEATURES)
]
||
\
@
[
-z
"
$(FEATURES)
"
]
||
\
for
dir
in
$
(
sort
$(FEATURES)
)
;
do
\
for
sub
in
$(SUBPROFILES)
;
do
\
[
-d
$$
dir
/
$$
sub/
]
&&
\
rsync
-ab
$$
dir
/
$$
sub/
$(BUILDDIR)
/
$$
sub/
&&
{
\
type
-t
git
>
&/dev/null
&&
\
cd
$(BUILDDIR)
/
$$
sub/
&&
\
git add
.
&&
\
git commit
-qam
"
$@
/
$$
dir/
$$
sub"
||
:
;
\
cd
-
>
&/dev/null
;
\
}
;
\
}
||
:
;
\
done
;
\
[
-x
$$
dir
/generate.sh
]
&&
{
cd
$$
dir
&&
./generate.sh
;
cd
-
;
}
;
\
[
-s
$$
dir
/generate.mk
]
&&
$(MAKE)
-C
$$
dir
-f
generate.mk
;
\
done
@
find
$(BUILDDIR)
-name
'*~'
||
:
help
:
@
echo
"** available features:"
@
grep
'^use/*'
*
/config.mk |
cut
-f2
-d
:
features.in/hdt/config.mk
View file @
a9e161b4
# no "Memory" in hdt's menu, weird
use/hdt: use/memtest
$(call add,SYSLINUX_ITEMS,hdt)
@# ITEMS iterator will happily omit a missing file, so...
$(call add,SYSLINUX_FILES,/usr/lib/syslinux/hdt.c32)
@# TODO: modules.pcimap (optional); maybe gzip
$(call add,SYSLINUX_FILES,/usr/share/pci.ids)
@$(call add,SYSLINUX_MODULES,hdt)
@$(call add,SYSLINUX_FILES,/usr/share/pci.ids)
features.in/hdt/stage1/scripts.d/02-hdt
0 → 100755
View file @
a9e161b4
#!/bin/sh
gzip
-9
"
$WORKDIR
"
/syslinux/pci.ids
||
:
features.in/memtest/config.mk
View file @
a9e161b4
use/memtest:
$(call add,FEATURES,memtest)
$(call add,COMMON_PACKAGES,memtest86+)
$(call add,SYSLINUX_ITEMS,memtest)
@
$(call add,FEATURES,memtest)
@
$(call add,COMMON_PACKAGES,memtest86+)
@
$(call add,SYSLINUX_ITEMS,memtest)
features.in/memtest/stage1/scripts.d/02-memtest
View file @
a9e161b4
#!/bin/sh
-x
#!/bin/sh
mkdir
-p
"
$WORKDIR
"
/syslinux
MEMTEST
=
"
$(
find /boot/
-name
'memtest*'
-print
-quit
)
"
# hdt recommends adding .bin
# hdt
wiki
recommends adding .bin
[
-z
"
$MEMTEST
"
]
||
cp
-f
"
$MEMTEST
"
"
$WORKDIR
"
/syslinux/memtest.bin
features.in/syslinux/cfg.in/00gfxboot.cfg
View file @
a9e161b4
ui gfxboot
.com
menu title mkimage-profiles 2.0
###
ui gfxboot
bootlogo
menu title mkimage-profiles 2.0
prompt 0
gfxboot bootlogo
features.in/syslinux/cfg.in/00menu.cfg
View file @
a9e161b4
ui menu.c32
menu title mkimage-profiles 2.0
###
menu title mkimage-profiles 2.0
prompt 0
features.in/syslinux/cfg.in/00prompt.cfg
View file @
a9e161b4
say mkimage-profiles 2.0
###
say mkimage-profiles 2.0
prompt 1
features.in/syslinux/cfg.in/01
timeout
.cfg
→
features.in/syslinux/cfg.in/01
defaults
.cfg
View file @
a9e161b4
File moved
features.in/syslinux/config.mk
View file @
a9e161b4
# UI _does_ automatically enable the feature...
use/syslinux/ui/%:
$(call set,SYSLINUX_UI,$*)
$(call add,FEATURES,syslinux)
$(call add,SYSLINUX_ITEMS,$*)
# UI is overwritten and _does_ automatically enable the feature...
use/syslinux/ui-%:
@$(call add,FEATURES,syslinux)
@$(call set,SYSLINUX_UI,$*)
@$(call add,STAGE1_PACKAGES,syslinux)
if [ "$*" == gfxboot ]; then \
$(call add,STAGE1_PACKAGES,gfxboot); \
$(call add,STAGE1_PACKAGES,branding-$$(BRANDING)-bootloader); \
fi
# ...and menu items don't
use/syslinux/%:
$(call add,SYSLINUX_ITEMS,$*)
# ...while plain modules...
use/syslinux/%.com use/syslinux/%.c32:
@$(call add,SYSLINUX_MODULES,$*)
# ...and menu items don't autoenable it (but stack up themselves)
use/syslinux/%.cfg:
@$(call add,SYSLINUX_CFG,$*)
features.in/syslinux/generate.mk
View file @
a9e161b4
...
...
@@ -4,35 +4,53 @@ ifndef BOOTLOADER
$(warning syslinux feature enabled but BOOTLOADER undefined)
endif
ifndef SYSLINUX
SYSLINUX = textprompt
ifndef SYSLINUX_UI
$(warning no syslinux ui module configured, falling back to plain text prompt)
SYSLINUX_UI := prompt
endif
### FIXME: too much insight (ab)used
# UI is backed by modules in modern syslinux
# (except for built-in text prompt)
SYSLINUX_MODULES := $(SYSLINUX_MODULES) $(SYSLINUX_UI)
# SUBPROFILES are considered SYSLINUX_CFG too;
# 01defaults.cfg is included indefinitely
SYSLINUX_CFG := $(SYSLINUX_CFG) $(SUBPROFILES) defaults
DSTDIR := $(BUILDDIR)/stage1/files/syslinux
CONFIG := $(DSTDIR)/$(BOOTLOADER).cfg
PARTS := $(SYSLINUX_UI) $(SYSLINUX_ITEMS) $(SUBPROFILES) timeout
MODDIR := /usr/lib/syslinux
# compile bootloader config from chosen parts
# NB: list position determined by file numbering (*.cfg)
config: debug copy
@cat $(sort $(foreach P,$(PARTS),$(wildcard cfg.in/??$(P).cfg))) /dev/null > $(CONFIG)
# we can do SYSLINUX_{CFG,MODULES,FILES}
# CFG have only cfg snippet
# FILES have only filenames (absolute or relative to /usr/lib/syslinux/)
# MODULES must have both cfg snippet and syslinux module filename
# (and get included iff cfg snippet AND module exist)
prep:
@mkdir -p $(DSTDIR)
# syslinux modules come as .com and .c32 files
sysmod = $(wildcard $(addprefix $(MODDIR)/,$(addsuffix .c??,$(1))))
cfg = $(wildcard cfg.in/??$(1).cfg)
# copy over the needed syslinux modules (item.c32 or item.com)
# and SYSLINUX_FILES (list of absolute paths)
copy: prep
@$(foreach F, \
$(SYSLINUX_FILES) $(wildcard $(addprefix $(MODDIR)/,$(addsuffix .c??,$(SYSLINUX_ITEMS)))), \
$(shell cp -pLt $(DSTDIR) -- $(F)))
# NB: list position determined by file numbering (*.cfg sorting)
all: prep debug
cat $(sort \
$(foreach C,$(SYSLINUX_CFG),$(call cfg,$(C))) \
$(foreach M,$(SYSLINUX_MODULES), \
$(shell cp -pLt $(DSTDIR) -- $(call sysmod,$(M)) && echo $(call cfg,$(M))))) \
/dev/null > $(CONFIG)
[ -z "$(SYSLINUX_FILES)" ] || { \
cd $(MODDIR); \
cp -pLt $(DSTDIR) -- $(SYSLINUX_FILES); \
}
# cat's argument gets evaluated before recipe body execution
prep:
mkdir -p $(DSTDIR)
# for p in $
PARTS
; do ls ??$p.cfg; done | sort
# for p in $
...
; do ls ??$p.cfg; done | sort
debug:
@echo "** BOOTLOADER: $(BOOTLOADER)"
@echo "** SYSLINUX_UI: $(SYSLINUX_UI)"
@echo "** SYSLINUX_
ITEMS: $(SYSLINUX_ITEMS
)"
@echo "**
PARTS: $(sort $(foreach P,$(PARTS),$(wildcard cfg.in/??$(P).cfg))
)"
@echo "**
MODULES: $(wildcard $(addprefix $(MODDIR)/,$(addsuffix .c??,$(SYSLINUX_ITEMS)))
)"
@echo "** SYSLINUX_
CFG: $(SYSLINUX_CFG
)"
@echo "**
SYSLINUX_FILES: $(SYSLINUX_FILES
)"
@echo "**
SYSLINUX_MODULES: $(SYSLINUX_MODULES
)"
features.in/syslinux/stage1/scripts.d/02-gfxboot
0 → 100755
View file @
a9e161b4
#!/bin/sh
gfxboot_datadir
=
/usr/share/gfxboot
bootlogo
=
"
`
ls
$gfxboot_datadir
/
*
/bootlogo |
head
-1
`
"
###
if
[
!
-f
"
$bootlogo
"
]
;
then
echo
"
${
0
##*/
}
- SKIP:
$bootlogo
not found"
ls
-alR
$gfxboot_datadir
exit
0
fi
cd
"
$WORKDIR
"
mkdir
-p
syslinux
cd
syslinux
# unpack
cpio
-iduV
<
"
$bootlogo
"
# pack
printf
'init\nlanguages\n'
|
cpio
-oV
>
bootlogo
functions.mk
View file @
a9e161b4
# NB: don"t use ANY quotes ('/") for put()/add()/set() arguments!
# shell will get confused by ' or args get spammed with "
# pay attention to the context in which functions get called:
# e.g. features.in/syslinux/config.mk introduces conditionals
# this one adds whatever is given as an argument
put = $(and $(1),$(put_body))
define put_body
$(log_body)
@printf '%s\n' '$(1)' >> "$(CONFIG)"
{ $(log_body); \
printf '%s\n' '$(1)' >> "$(CONFIG)"; }
endef
# these two take two args
# add() just appends an additive rule...
add = $(and $(1),$(2),$(add_body))
define add_body
$(log_body)
@printf '%s += %s\n' '$(1)' '$(2)' >> "$(CONFIG)"
{ $(log_body); \
printf '%s += %s\n' '$(1)' '$(2)' >> "$(CONFIG)"; }
endef
# ...set() comments out any previous definition
# and then appends an assigning rule
set = $(and $(1),$(2),$(set_body))
define set_body
$(log_body)
@subst 's|^$(1)[ ]*+*=.*$$|#& # overridden by $@|' "$(CONFIG)"
@printf '%s = %s\n' '$(1)' '$(2)' >> "$(CONFIG)"
{ $(log_body); \
subst 's|^$(1)[ ]*+*=.*$$|#& # overridden by $@|' "$(CONFIG)"; \
printf '%s = %s\n' '$(1)' '$(2)' >> "$(CONFIG)"; }
endef
# is there a way to set a global make var from a recipe?..
define log_body
@grep -q '^# $@$$' "$(CONFIG)" || printf '# %s\n' '$@' >> "$(CONFIG)"
{ grep -q '^# $@$$' "$(CONFIG)" || printf '# %s\n' '$@' >> "$(CONFIG)"; }
endef
tags = $(shell echo "$(1)" | bin/tags2lists)
image.in/Makefile
View file @
a9e161b4
...
...
@@ -23,8 +23,10 @@ prep: disk-info metadata
disk-info
:
@
mkdir
-p
files/.disk
@
echo
"FIXME"
>
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
@
type
-t
git
>
&/dev/null
&&
(
\
cd
$(TOPDIR)
&&
\
git show-ref
--head
--dereference
-s
--
HEAD 2>/dev/null
;
\
)
>
files/.disk/commit
# see also alterator-pkg (backend3/pkg-install)
# FIXME: if we copy --as-needed, maybe just tar . ?
...
...
pkg.in/groups/Makefile
View file @
a9e161b4
...
...
@@ -4,8 +4,10 @@
include
$(BUILDDIR)/.config.mk
all
:
debug
@
mkdir
-p
$(BUILDDIR)
/pkg/groups
\
&&
cp
-at
$(BUILDDIR)
/pkg/groups/
--
$
(
addsuffix .directory,
$(GROUPS)
)
@
[
-n
"
$(GROUPS)
"
]
&&
{
\
mkdir
-p
$(BUILDDIR)
/pkg/groups
&&
\
cp
-at
$(BUILDDIR)
/pkg/groups/
--
$
(
addsuffix .directory,
$(GROUPS)
)
;
\
}
||
:
debug
:
@
echo
"** GROUPS:
$(GROUPS)
"
profile.mk
View file @
a9e161b4
...
...
@@ -3,7 +3,11 @@ profile/init:
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
@touch "$(BUILDDIR)"/.config.mk
@mkdir "$(BUILDDIR)"/.mki
cd $(BUILDDIR); git init -q; git add .; git commit -qam 'init' ###
@type -t git >&/dev/null && \
cd $(BUILDDIR) && \
git init -q && \
git add . && \
git commit -qam 'init'
@rm -f build
@[ -w . ] \
&& ln -sf "$(BUILDDIR)" build \
...
...
sub.in/Makefile
View file @
a9e161b4
...
...
@@ -3,6 +3,7 @@ include $(BUILDDIR)/.config.mk
all
:
@
for
dir
in
$(SUBPROFILES)
;
do
\
rsync
-a
$$
dir
/
$(BUILDDIR)
/
$$
dir
/
&&
\
type
-t
git
>
&/dev/null
&&
\
cd
$(BUILDDIR)
/
$$
dir
/
&&
\
git add
.
&&
\
git commit
-qam
"
$@
/
$$
dir"
;
\
...
...
sub.in/stage1/Makefile
View file @
a9e161b4
...
...
@@ -3,7 +3,7 @@ include ../functions.mk
include
$(MKIMAGE_PREFIX)/config.mk
include
$(GLOBAL_BUILDDIR)/.config.mk
CHROOT_PACKAGES
=
syslinux
$(KERNEL
_PACKAGES)
$(COMMON_PACKAGES)
CHROOT_PACKAGES
=
$(KERNEL_PACKAGES)
$(STAGE1
_PACKAGES)
$(COMMON_PACKAGES)
MKI_PACK_RESULTS
=
data
###
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment