Commit 52083d8a authored by Anton Midyukov's avatar Anton Midyukov

build-vm: create initrd from a special config

The config for generating a generic initrd can be interesting because it will allow you to return the initrd to its original generic state.
parent 1190de27
...@@ -19,24 +19,25 @@ done ...@@ -19,24 +19,25 @@ done
cd /boot cd /boot
VM_INITRDMODULES="$GLOBAL_VM_INITRDMODULES" # creating a special initrd.mk
VM_INITRDMODULES+=" $(grep '^MODULES_TRY_ADD +=' /etc/initrd.mk | cp /etc/initrd.mk /etc/initrd.mk.oem
sed 's/MODULES_TRY_ADD +=//g' | tr "\n" " " )" echo 'FEATURES += add-modules compress cleanup kbd rdshell rootfs' \
>> /etc/initrd.mk.oem
VM_INITRDFEATURES="$GLOBAL_VM_INITRDFEATURES"
VM_INITRDFEATURES+=" $(grep '^FEATURES +=' /etc/initrd.mk |
sed 's/FEATURES +=//g' | tr "\n" " " )"
if [ -n "$GLOBAL_VM_INITRDFEATURES" ]; then if [ -n "$GLOBAL_VM_INITRDFEATURES" ]; then
for INITRDFEATURE in $GLOBAL_VM_INITRDFEATURES; do for INITRDFEATURE in $GLOBAL_VM_INITRDFEATURES; do
echo "FEATURES += $INITRDFEATURE" >> /etc/initrd.mk echo "FEATURES += $INITRDFEATURE" >> /etc/initrd.mk.oem
done
fi
if [ -n "$GLOBAL_VM_INITRDMODULES" ]; then
for INITRDMODULE in $GLOBAL_VM_INITRDMODULES; do
echo "MODULES_TRY_ADD += $INITRDMODULE" >> /etc/initrd.mk.oem
done done
fi fi
for KVER in $kver; do for KVER in $kver; do
make-initrd -N -v -k "$KVER" AUTODETECT= \ make-initrd -N -v -k "$KVER" AUTODETECT= -c /etc/initrd.mk.oem \
FEATURES+="add-modules compress cleanup kbd rdshell rootfs $VM_INITRDFEATURES" \
MODULES_TRY_ADD+="$VM_INITRDMODULES" \
|| { echo "** Error: make-initrd failed" >&2; exit 1; } || { echo "** Error: make-initrd failed" >&2; exit 1; }
done done
......
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