Commit 1f4db6c7 authored by Anton Midyukov's avatar Anton Midyukov

stage1: build propagator and copy kernel in mkimage-profiles

parent 2c53e5ef
#!/bin/sh -efu
libdir="$(getconf LIBDIR)"
case "`arch`" in
e2k)
kname=image
;;
*)
kname=vmlinuz
;;
esac
if [ -L /boot/$kname ]; then
kimage="$(readlink -mv /boot/$kname)"
else
kimage="$(find /boot -type f -name "$kname-*" -print -quit)"
fi
kver="${kimage#/boot/$kname-}"
mkmodpack -p /.in/modules -o /tmp/modules -k "$kver"
rm -f /boot/full.cz
[ ! -f /tmp/modules ] ||
cat "$libdir/propagator/initfs" /tmp/modules > /boot/full.cz
sed \
-e "s,@LIBDIR@,$libdir," \
-e "s,@TMPDIR@,/tmp,g" \
< "$WORKDIR/initfs" |
gencpio - |
gzip -c >> /boot/full.cz
#!/bin/sh -ef
cd /.image
mkdir -p boot
case "`arch`" in
e2k)
kname=image
;;
*)
kname=vmlinuz
;;
esac
if [ -L "/boot/$kname" ]; then
kimage="$(readlink -ev /boot/$kname)"
else
kimage="$(find /boot -type f -name "$kname-*" -print -quit)"
fi
if [ -n "$kimage" ]; then
cp -af "$kimage" boot/$kname
[ ! -f /boot/full.cz ] ||
cp -af /boot/full.cz boot/full.cz
fi
# config is generated in mkimage
case "$GLOBAL_EFI_BOOTLOADER" in
refind|elilo)
mkdir -p EFI/BOOT
cp -lpLft EFI/BOOT -- boot/vmlinuz
[ ! -f boot/full.cz ] ||
cp -lpLft EFI/BOOT -- boot/full.cz
;;
esac
......@@ -30,10 +30,8 @@ GLOBAL_STAGE1_KFLAVOUR := $(STAGE1_KFLAVOUR)
CHROOT_PACKAGES_REGEXP := $(call kpackages, \
$(STAGE1_KFLAVOUR),$(STAGE1_KMODULES),$(STAGE1_KMODULES_REGEXP))
ifneq "$(findstring stage2,$(SUBPROFILES))" "" ### assumes stage2 ~ propagator
PROPAGATOR_VERSION = ALT
PROPAGATOR_MAR_MODULES = ./modules
PROPAGATOR_INITFS = ./initfs
BUILD_PROPAGATOR = prepare-modules build-propagator
LIST_MODULES = .work/chroot/.in/modules
PREPARE_MODULES = prepare-modules
endif
endif
......@@ -51,8 +49,8 @@ prepare-modules:
# scripts prepare bootloader configuration, too
# NB: we pass tested squashfs options for sub.in/stage2/Makefile to include
all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \
copy-$(BOOTLOADER) $(COPY_SQUASHCFG) pack-image $(GLOBAL_CLEAN_WORKDIR)
all: | debug prepare-workdir copy-tree $(PREPARE_MODULES) run-scripts \
$(COPY_SQUASHCFG) pack-image $(GLOBAL_CLEAN_WORKDIR)
@if [ -s $(OUTDIR)/squashcfg.mk ]; then \
cp $(OUTDIR)/squashcfg.mk $(GLOBAL_BUILDDIR)/; \
fi
......
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