Commit e53b6acb authored by Michael Shigorin's avatar Michael Shigorin

installer firmware support

Thanks go to lakostis@ (see #18047) for all the aic94xx reminders and the final testing of the proposed image.
parent faafaf12
......@@ -34,21 +34,16 @@ distro/syslinux: distro/.init distro/.branding sub/stage1 \
# something actually useful (as a network-only installer)
distro/installer: distro/.base use/installer
@$(call set,INSTALLER,server-light)
@$(call set,INSTALLER_KMODULES_REGEXP,drm.*) # for KMS
# BASE_LISTS, DISK_LISTS, MAIN_PACKAGES: see sub.in/main/
distro/server-base: distro/installer sub/main use/syslinux/ui-menu use/memtest
@$(call add,BASE_LISTS,server-base)
# STAGE1_KFLAVOUR is the one for installer
# KDEFAULT is for the installed system
# both of these default to the last KFLAVOURS item if not set
distro/server-ovz: distro/server-base use/hdt
@$(call set,STAGE1_KFLAVOUR,std-def)
distro/server-ovz: distro/server-base use/hdt use/firmware/server
@$(call set,INSTALLER_KFLAVOUR,std-def)
@$(call set,KFLAVOURS,std-def ovz-el)
@$(call set,KDEFAULT,ovz-el)
@$(call set,STAGE1_KMODULES_REGEXP,drm.*)
@$(call add,KMODULES,bcmwl e1000e igb ndiswrapper rtl8168 rtl8192)
@$(call add,KMODULES,ipset ipt-netflow opendpi pf_ring xtables-addons)
@$(call add,KMODULES,drbd83 kvm)
......
# NB: if the firmware is needed in installer,
# it should be installed to stage1's *instrumental* chroot
# for mkmodpack to use
use/firmware:
@$(call add,COMMON_PACKAGES,firmware-linux)
use/firmware/server: use/firmware
@$(call add,COMMON_PACKAGES,firmware-aic94xx-seq)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-ql.*)
use/firmware/desktop: use/firmware
@$(call add,COMMON_PACKAGES,firmware-psb)
use/firmware/wireless: use/firmware
@$(call add,MAIN_PACKAGES,firmware-acx100)
@$(call add,MAIN_PACKAGES,firmware-i2400m)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-ipw.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-iwl.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-rt.*)
@$(call add,MAIN_PACKAGES_REGEXP,firmware-zd.*)
......@@ -35,7 +35,7 @@ include $(MKIMAGE_PREFIX)/targets.mk
all: prep copy-subdirs copy-tree run-scripts pack-image
# Metadata/ needed only for installer (and not for e.g. syslinux.iso)
ifeq "$(STAGE1_KFLAVOUR)$(KFLAVOURS)" ""
ifeq "$(INSTALLER_KFLAVOUR)$(KFLAVOURS)" ""
metadata:
@echo "** skipping metadata target, no stage1 kernel installed"
else
......@@ -47,6 +47,7 @@ metadata:
@rm -f files/Metadata/pkg-groups.tar
@echo -e "\n# auto-added in image.in/Makefile" >> $(call list,.base)
@echo "$(call kpackages,$(KMODULES),$(KFLAVOURS))" >> $(call list,.base)
@echo "$(COMMON_PACKAGES)" >> $(call list,.base)
@echo "branding-$(BRANDING)-release" >> $(call list,.base)
@tar -cvf files/Metadata/pkg-groups.tar \
-C $(PKGDIR) \
......
......@@ -17,7 +17,7 @@ iso:
else \
echo " (coffee time)"; \
fi
@if time -f %E $(ARCH) \
@if time -f "%E %PCPU %Mk" $(ARCH) \
$(MAKE) -C $(BUILDDIR)/ GLOBAL_BUILDDIR=$(BUILDDIR) $(LOG); \
then \
echo "** build done (`tail -1 $(BUILDLOG) | cut -f1 -d. \
......@@ -27,5 +27,5 @@ iso:
if test -z "$(DEBUG)"; then \
echo " (you might want to re-run with DEBUG=1)"; \
fi; \
tail -100 "$(BUILDLOG)" | egrep "^E:|rror|arning"; \
tail -100 "$(BUILDLOG)" | egrep "^E:|[Ee]rror|[Ww]arning"; \
fi
......@@ -6,6 +6,6 @@ $(error BUILDDIR not defined)
endif
all:
for dir in lists groups; do \
$(MAKE) -C $$dir BUILDDIR=$(BUILDDIR); \
@for dir in lists groups; do \
$(MAKE) -C $$dir; \
done
......@@ -12,7 +12,7 @@ include $(MKIMAGE_PREFIX)/config.mk
# need kernel modules only (which require corresponding kernel-image);
# these go into work chroot; NB: no vmlinuz there
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS))
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(INSTALLER_KMODULES),$(INSTALLER_KFLAVOUR))
IMAGE_PACKAGES = $(COMMON_PACKAGES) \
$(INSTALL2_PACKAGES) \
./packages
......
......@@ -12,7 +12,8 @@ include $(MKIMAGE_PREFIX)/config.mk
CHROOT_PACKAGES = apt-utils rsync
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS))
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(KMODULES),$(KFLAVOURS)) \
$(MAIN_PACKAGES_REGEXP)
IMAGE_PACKAGES = $(call map,list,.base $(BASE_LISTS) $(DISK_LISTS) $(GROUPS)) \
$(COMMON_PACKAGES) \
$(MAIN_PACKAGES)
......@@ -25,4 +26,5 @@ include $(MKIMAGE_PREFIX)/targets.mk
all: $(GLOBAL_DEBUG) copy-packages pack-image
debug:
@echo "IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
@echo "** main: IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
@echo "** main: IMAGE_PACKAGES_REGEXP: $(IMAGE_PACKAGES_REGEXP)"
......@@ -21,23 +21,24 @@ COPY_TREE = ./files
include $(MKIMAGE_PREFIX)/targets.mk
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(COMMON_PACKAGES)
# here we try and come up with the installer kernel/modules, if any;
# only a single kernel might be needed (STAGE1_KFLAVOUR sets explicitly);
# only a single kernel might be needed (INSTALLER_KFLAVOUR sets explicitly);
# kernel image copied from instrumental chroot into .work/syslinux/alt0/
STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS))
INSTALLER_KFLAVOUR ?= $(lastword $(KFLAVOURS))
# propagator needed iff stage1 kernel installed (not for e.g. syslinux.iso)
ifeq "$(STAGE1_KFLAVOUR)" ""
ifeq "$(INSTALLER_KFLAVOUR)" ""
build-propagator:
@echo "** skipping build-propagator target, no kernel installed"
else
CHROOT_PACKAGES_REGEXP := $(call kpackages,$(STAGE1_KMODULES_REGEXP),$(STAGE1_KFLAVOUR))
INFO_STAGE1_KFLAVOUR := $(STAGE1_KFLAVOUR)
CHROOT_PACKAGES_REGEXP := $(call kpackages,$(INSTALLER_KMODULES_REGEXP),$(INSTALLER_KFLAVOUR))
INFO_INSTALLER_KFLAVOUR := $(INSTALLER_KFLAVOUR)
endif
CHROOT_PACKAGES_REGEXP += $(STAGE1_PACKAGES_REGEXP)
CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(COMMON_PACKAGES)
# scripts prepare bootloader configuration, too
all: debug prepare-workdir copy-tree run-scripts build-propagator \
copy-$(BOOTLOADER) pack-image
......@@ -45,6 +46,7 @@ all: debug prepare-workdir copy-tree run-scripts build-propagator \
debug:
@if test -n "$(GLOBAL_VERBOSE)"; then \
echo "** STAGE1_PACKAGES: $(STAGE1_PACKAGES)"; \
echo "** STAGE1_PACKAGES_REGEXP: $(STAGE1_PACKAGES_REGEXP)"; \
echo "** CHROOT_PACKAGES: $(CHROOT_PACKAGES)"; \
echo "** CHROOT_PACKAGES_REGEXP: $(CHROOT_PACKAGES_REGEXP)"; \
echo "** BOOTLOADER: $(BOOTLOADER)"; \
......
......@@ -7,10 +7,10 @@
к составу STAGE1_PACKAGES и объёму этой стадии.
Обратите внимание: если не указать явно требуемый вариант
ядра посредством STAGE1_KFLAVOUR, будет взят последний из
перечисленных в KFLAVOURS; если не указать явно регэкс,
ядра посредством INSTALLER_KFLAVOUR, будет взят последний
из перечисленных в KFLAVOURS; если не указать явно регэкс,
описывающий требуемые в инсталяторе модули, посредством
STAGE1_KMODULES_REGEXP -- будет только подмножество модулей
INSTALLER_KMODULES_REGEXP -- будет подмножество модулей
из kernel-image (упаковываются в syslinux/alt0/full.cz).
Требуется для инсталяционных, live- и rescue-образов.
......
#!/bin/sh
# symlink default kernel iff requested but not yet done
STAGE1_KFLAVOUR="$INFO_STAGE1_KFLAVOUR"
INSTALLER_KFLAVOUR="$INFO_INSTALLER_KFLAVOUR"
if [ -n "$GLOBAL_VERBOSE" ]; then
echo "** STAGE1_KFLAVOUR: $STAGE1_KFLAVOUR"
echo "** INSTALLER_KFLAVOUR: $INSTALLER_KFLAVOUR"
fi
# kernel-image in instrumental chroot
......@@ -16,8 +16,8 @@ if [ -L "$VMLINK" ]; then
echo "** $VMLINK -> $(readlink "$VMLINK")"
fi
if [ -n "$STAGE1_KFLAVOUR" ]; then
VMLINUZ="$(cd /boot; echo vmlinuz-*-$STAGE1_KFLAVOUR-*)"
if [ -n "$INSTALLER_KFLAVOUR" ]; then
VMLINUZ="$(cd /boot; echo vmlinuz-*-$INSTALLER_KFLAVOUR-*)"
if [ -n "$VMLINUZ" ]; then
ln -sf "$VMLINUZ" "$VMLINK"
echo "** overriding $VMLINK with $VMLINUZ"
......
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