Commit 8e146cb5 authored by Anton Midyukov's avatar Anton Midyukov

initrd-propagator: save more reproducible command in mkinitrd

parent 42161637
#!/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
...@@ -18,38 +18,40 @@ done ...@@ -18,38 +18,40 @@ done
[ -s /.in/modules ] || [ -s /.in/modules ] ||
fatal "kernel modules set not found" fatal "kernel modules set not found"
cat >> /etc/initrd.mk <<EOF # copy initrd.mk to image
mkdir -p /.image/.disk
cp /etc/initrd.mk /.image/.disk
cd /.image
cat >> .disk/initrd.mk <<EOF
FEATURES += propagator
FEATURES += add-modules compress cleanup FEATURES += add-modules compress cleanup
EOF EOF
for module in $(grep -v ^# /.in/modules | sort -u | tr -s '\n' ' '); do for module in $(grep -v ^# /.in/modules | sort -u | tr -s '\n' ' '); do
echo "MODULES_TRY_ADD += $module" >> /etc/initrd.mk echo "MODULES_TRY_ADD += $module" >> .disk/initrd.mk
done done
# copy initrd.mk to image
mkdir -p /.image/.disk
cp /etc/initrd.mk /.image/.disk
# FIXME: large storage systems can get that tmpfs filled up # FIXME: large storage systems can get that tmpfs filled up
# with debug data as of make-initrd 2.2.12 # with debug data as of make-initrd 2.2.12
rm -vf /usr/share/make-initrd/data/etc/udev/rules.d/00-debug.rules \ rm -vf /usr/share/make-initrd/data/etc/udev/rules.d/00-debug.rules \
/usr/share/make-initrd/data/lib/uevent/filters/debug /usr/share/make-initrd/data/lib/uevent/filters/debug
MAKE_INITRD_OPTS="--no-checks AUTODETECT= " MAKE_INITRD_OPTS="--no-checks AUTODETECT= -c .disk/initrd.mk"
MAKE_INITRD_VER="`make-initrd -V \ MAKE_INITRD_VER="`make-initrd -V \
| sed -rn 's/^make-initrd version ([0-9.]+)/\1/p'`" | sed -rn 's/^make-initrd version ([0-9.]+)/\1/p'`"
[ -z "$GLOBAL_VERBOSE" ] || [ -z "$GLOBAL_VERBOSE" ] ||
MAKE_INITRD_OPTS="$MAKE_INITRD_OPTS -v" MAKE_INITRD_OPTS="$MAKE_INITRD_OPTS -v"
cd /boot
for KVER in $kver; do for KVER in $kver; do
echo make-initrd $MAKE_INITRD_OPTS -k "$KVER" >> /.image/.disk/mkinitrd echo make-initrd $MAKE_INITRD_OPTS -k "$KVER" >> .disk/mkinitrd
make-initrd $MAKE_INITRD_OPTS -k "$KVER" || make-initrd $MAKE_INITRD_OPTS -k "$KVER" ||
fatal "make-initrd failed" fatal "make-initrd failed"
done done
cd /boot
case `arch` in case `arch` in
e2k) e2k)
kname=image;; kname=image;;
......
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