Commit c1b349cf authored by Anton Midyukov's avatar Anton Midyukov

initrd-bootchain: allow overriding variables in bootchain config

parent 63df7d7f
......@@ -5,3 +5,10 @@ bootchain. Это альтернатива фичи initrd-propagator. Испо
Документацию по использованию bootchain следует смотреть в пакетах
make-initrd-bootchain-*:
/usr/share/make-initrd/features/bootchain-*/README.md
Конфиг находится в stage1/files/bootchain. Почти все переменные можно
переопределить. Переменные в m-p по сравнению с конфигом bootchain
имеют приставку 'BOOTCHAIN_'. Дефолты заданы в config.mk
Переопределить можно так:
$(call set,BOOTCHAIN_OEM_WELCOME_TEXT,Welcome to my OS!)
......@@ -5,3 +5,17 @@ use/initrd-bootchain: use/uuid-iso
@$(call set,STAGE1_INITRD_TYPEARGS,$(shell echo "root=bootchain bootchain=fg,altboot automatic"))
@$(call set,STAGE1_INITRD_BOOTMETHOD,$(shell echo "method:cdrom,uuid:$(UUID_ISO)"))
@$(call set,STAGE1_INITRD_STAGE2_OPTION,stagename)
@$(call try,BOOTCHAIN_BC_FGVT_ACTIVATE,7)
@$(call try,BOOTCHAIN_WAITDEV_TIMEOUT,)
@$(call try,BOOTCHAIN_OEM_WELCOME_TEXT,Welcome to ALT!)
@$(call try,BOOTCHAIN_OEM_CDROOT,/image)
@$(call try,BOOTCHAIN_OEM_DEFAULT_STAGE2,altinst)
@$(call try,BOOTCHAIN_OEM_LIVE_STORAGE,alt-live-storage)
@$(call try,BOOTCHAIN_OEM_BAD_STORAGE,alt-slow-storage)
@$(call try,BOOTCHAIN_OEM_SETUP_STORAGE,alt-drivers-update)
@$(call try,BOOTCHAIN_OEM_IMAGES_BASE,/tmp/images)
@$(call try,BOOTCHAIN_OEM_OVERLAYS_DIR,/tmp/overlays)
@$(call try,BOOTCHAIN_OEM_URL_NETINST,/pub/netinst/current)
@$(call try,BOOTCHAIN_OEM_SRV_NETINST,)
@$(call try,BOOTCHAIN_OEM_NFS_NETINST,/srv/public/netinst)
@$(call try,BOOTCHAIN_OEM_CIFS_NETINST,/netinst)
# set up livecd browser redirection page
# set up initrd-bootchain config
ifdef BUILDDIR
......@@ -7,16 +7,28 @@ include $(BUILDDIR)/distcfg.mk
BOOTCHAIN_CFG := $(BUILDDIR)/stage1/files/bootchain
all: debug
@if [ -n "$(META_VOL_ID)" ]; then \
@[ -s "$(BOOTCHAIN_CFG)" ] || exit 1; \
if [ -n "$(META_VOL_ID)" ]; then \
DISTRO="$(META_VOL_ID)"; \
else \
DISTRO="$(RELNAME)"; \
fi; \
if [ -s "$(BOOTCHAIN_CFG)" ]; then \
sed -i \
-e "s,@distro@,$$DISTRO," \
$(BOOTCHAIN_CFG); \
fi
sed -i -e "s,@distro@,$$DISTRO," \
-e "s,@bc_fgvt_activate@,$(BOOTCHAIN_BC_FGVT_ACTIVATE)," \
-e "s,@waitdev_timeout@,$(BOOTCHAIN_WAITDEV_TIMEOUT)," \
-e "s,@oem_welcome_text@,$(BOOTCHAIN_OEM_WELCOME_TEXT)," \
-e "s,@oem_cdroot@,$(BOOTCHAIN_OEM_CDROOT)," \
-e "s,@oem_default_stage2@,$(BOOTCHAIN_OEM_DEFAULT_STAGE2)," \
-e "s,@oem_live_storage@,$(BOOTCHAIN_OEM_LIVE_STORAGE)," \
-e "s,@oem_bad_storage@,$(BOOTCHAIN_OEM_BAD_STORAGE)," \
-e "s,@oem_setup_storage@,$(BOOTCHAIN_OEM_SETUP_STORAGE)," \
-e "s,@oem_images_base@,$(BOOTCHAIN_OEM_IMAGES_BASE)," \
-e "s,@oem_overlays_dir@,$(BOOTCHAIN_OEM_OVERLAYS_DIR)," \
-e "s,@oem_url_netinst@,$(BOOTCHAIN_OEM_URL_NETINST)," \
-e "s,@oem_srv_netinst@,$(BOOTCHAIN_OEM_SRV_NETINST)," \
-e "s,@oem_nfs_netinst@,$(BOOTCHAIN_OEM_NFS_NETINST)," \
-e "s,@oem_cifs_netinst@,$(BOOTCHAIN_OEM_CIFS_NETINST)," \
$(BOOTCHAIN_CFG)
debug:
@if [ -n "$(DEBUG)" ]; then \
......
# /etc/sysconfig/bootchain example
# /etc/sysconfig/bootchain
#############################
# Bootchain defaults #
......@@ -11,15 +11,14 @@
# BC_LOG_VT=3
# Delay in seconds before auto-activate interactive VT, empty value for switch immediately
# BC_FGVT_ACTIVATE=7
BC_FGVT_ACTIVATE=@bc_fgvt_activate@
# Full path to the bootchain log or character special device name
# BC_LOGFILE=/var/log/bootchained.log
# Common timeout in seconds for all waitdev steps:
# this make possible using fallback after last waitdev step
#
# WAITDEV_TIMEOUT=
WAITDEV_TIMEOUT=@waitdev_timeout@
#############################
......@@ -38,42 +37,42 @@
#############################
# altboot back title
OEM_WELCOME_TEXT="Welcome to ALT!"
OEM_WELCOME_TEXT="@oem_welcome_text@"
# Distribution name, for example
OEM_DISTRIBUTION="@distro@"
# ISO-image mount point (required for ALT)
OEM_CDROOT=/image
OEM_CDROOT=@oem_cdroot@
# Default stage2 filename for boot from ISO-9660
OEM_DEFAULT_STAGE2=altinst
OEM_DEFAULT_STAGE2=@oem_default_stage2@
# Persistent storage device LABEL for Live-RW sessions
OEM_LIVE_STORAGE=alt-live-storage
OEM_LIVE_STORAGE=@oem_live_storage@
# Live storage device LABEL for mark non-usable devices
OEM_BAD_STORAGE=alt-slow-storage
OEM_BAD_STORAGE=@oem_bad_storage@
# Local storage device LABEL with the OEM drivers update
OEM_SETUP_STORAGE=alt-drivers-update
OEM_SETUP_STORAGE=@oem_setup_storage@
# Mount point inside stage2 for read additional images
# OEM_IMAGES_BASE=/tmp/images
OEM_IMAGES_BASE=@oem_images_base@
# Directory inside stage2 for mount images as LiveCD slices
# OEM_OVERLAYS_DIR=/tmp/overlays
OEM_OVERLAYS_DIR=@oem_overlays_dir@
# HTTP and FTP default base directory for netinstall
# (if empty "/pub/netinst/current" path will be used)
# OEM_URL_NETINST=/pub/distributions/ALTLinux/p10/images
OEM_URL_NETINST=@oem_url_netinst@
# HTTP and FTP default server name or IP-address for netinstall
# (if empty near gateway will be used)
# OEM_SRV_NETINST=ftp.altlinux.org
OEM_SRV_NETINST=@oem_srv_netinst@
# NFS path with overlays-live sub-directory, containing slice images
# OEM_NFS_NETINST=/srv/public/netinst
OEM_NFS_NETINST=@oem_nfs_netinst@
# SAMBA share with overlays-live sub-directory, containing slice images
# OEM_CIFS_NETINST=/netinst
OEM_CIFS_NETINST=@oem_cifs_netinst@
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