Commit b31af10c authored by Michael Shigorin's avatar Michael Shigorin

tar2fs: generate proper boot.conf for e2k

This one supports multiple kernels (and tweaks boot labels aiming to simplify target kernel selection for the CPU at hand) instead of an earlier attempt to fill in a template. No need for the template so just drop it.
parent 650e92bf
......@@ -226,21 +226,37 @@ esac
# NB: don't stick BOOTFS here, it has slightly different semantics
pushd $ROOTFS/boot
KVERSIONS=
if [ -s .origver ]; then
while read kver; do
chroot "$ROOTFS" make-initrd -k "$kver"
KVERSIONS="$KVERSIONS $kver"
done < .origver
else
fatal "unable to deduce kernel version"
fi
[ -n "$KVERSIONS" ] || fatal "unable to deduce kernel version"
rm -f .origver
# ...target device too
sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab"
if [ -f boot.conf ]; then
sed -i -e "s,@ROOTUUID@,$ROOTUUID,g" -e "s,@KVER@,$KVER,g" boot.conf
fi
# FIXME: relies on particular (current) kernel package naming scheme
for v in $KVERSIONS; do
l="$(echo "$v" | sed -r 's,.*elbrus-([0-9a-z]+)-.*$,\1,')"
cat >> boot.conf <<EOF
label=$l
partition=0
image=/image-$v
initrd=/initrd-$v.img
cmdline=console=ttyS0,115200 console=tty0 consoleblank=0 hardreset root=UUID=$ROOTUUID
EOF
done
echo "** start of boot.conf"
cat boot.conf
echo "** end of boot.conf"
popd
if [ -x "$ROOTFS"/sbin/lilo ]; then
......
default=auto
label=auto
partition=0
image=/image-@KVER@
initrd=/initrd-@KVER@.img
cmdline=console=tty0 consoleblank=0 hardreset root=UUID=@ROOTUUID@
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