Commit 8faf1407 authored by Michael Shigorin's avatar Michael Shigorin

kernel, stage2: rearranged initrd hooks

stage2 has been thinking it's synonymous with propagator and used to usurp kernel's belongings either; carefully tear scripts apart so that kernel feature makes sure initrd gets generated, and stage2 (which is still all about propagator) cares for its bits.
parent 730e791f
......@@ -27,7 +27,7 @@ ALT Linux 6.0+ и GNU make 3.81+ (на которых и разрабатыва
E: Couldn't find package
* features.in/stage2/stage1/scripts.d/02-kdefault
* features.in/kernel/stage1/scripts.d/80-make-initrd
* features.in/stage2/stage1/scripts.d/03-test-kernel
* sub.in/stage1/Makefile
** ожидают, что в stage1 попадёт строго одно ядро сообразно
......
#!/bin/sh
# prepare base make-initrd configuration for stage1
# see also http://www.altlinux.org/Make-initrd-propagator
MAKE_INITRD_VER="`make-initrd -V \
| sed -rn 's/^make-initrd version ([0-9.]+)/\1/p'`"
......@@ -10,8 +9,3 @@ if [ "`rpmvercmp "$MAKE_INITRD_VER" "0.8.1"`" != "-1" ]; then
else
sed -i 's/AUTODETECT/#&/' /etc/initrd.mk # see also #28578
fi
echo 'FEATURES += propagator' >> /etc/initrd.mk
# FIXME: #29705 workaround
echo 'MODULES_PRELOAD += ahci' >> /etc/initrd.mk
#!/bin/sh -efux
# NB: /etc/initrd.mk carefully prepared by earlier scripts
verbose() { [ -z "$GLOBAL_VERBOSE" ] || echo "** 80-make-initfs: $@" >&2; }
fatal() { echo "** error: $@" >&1; exit 1; }
kver="$(rpm -qa 'kernel-image*' \
--qf '%{installtime} %{version}-%{name}-%{release}\n' \
......@@ -10,6 +10,9 @@ kver="$(rpm -qa 'kernel-image*' \
| cut -f 2 -d ' ' \
| sed 's/kernel-image-//')"
[ -n "$kver" ] ||
fatal "no kernel version identified"
MAKE_INITRD_OPTS="--no-checks -k $kver"
MAKE_INITRD_VER="`make-initrd -V \
| sed -rn 's/^make-initrd version ([0-9.]+)/\1/p'`"
......@@ -19,17 +22,16 @@ if [ "`rpmvercmp "$MAKE_INITRD_VER" "0.7.8"`" != "-1" ]; then
MAKE_INITRD_OPTS="$MAKE_INITRD_OPTS --no-depmod"
fi
[ -z "$GLOBAL_VERBOSE" ] || MAKE_INITRD_OPTS="$MAKE_INITRD_OPTS -v"
[ -z "$GLOBAL_VERBOSE" ] ||
MAKE_INITRD_OPTS="$MAKE_INITRD_OPTS -v"
if make-initrd $MAKE_INITRD_OPTS; then
pdir="$(getconf LIBDIR)/propagator"
mkdir -p "$pdir"
gzip < /boot/initrd-$kver.img > "$pdir"/initfs
else
verbose "make-initrd failed"
exit 1
fi
make-initrd $MAKE_INITRD_OPTS ||
fatal "make-initrd failed"
[ -h /boot/vmlinuz ] ||
ln -s vmlinuz-$kver /boot/vmlinuz
[ -h /boot/initrd.img ] ||
ln -s initrd-$kver.img /boot/initrd.img
[ -h /boot/vmlinuz ] || ln -s vmlinuz-$kver /boot/vmlinuz
[ -h /boot/initrd.img ] || ln -s initrd-$kver.img /boot/initrd.img
:
#!/bin/sh
# see also http://www.altlinux.org/Make-initrd-propagator
echo 'FEATURES += propagator' >> /etc/initrd.mk
# FIXME: #29705 workaround
echo 'MODULES_PRELOAD += ahci' >> /etc/initrd.mk
#!/bin/sh -efu
# NB: initrd.mk carefully built by an earlier script
verbose() { [ -z "$GLOBAL_VERBOSE" ] || echo "** 81-make-initfs: $@" >&2; }
if [ -h /boot/initrd.img ]; then
pdir="$(getconf LIBDIR)/propagator"
mkdir -p "$pdir"
gzip < /boot/initrd.img > "$pdir"/initfs
else
verbose "/boot/initrd.img missing"
exit 1
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