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 ...@@ -226,21 +226,37 @@ esac
# NB: don't stick BOOTFS here, it has slightly different semantics # NB: don't stick BOOTFS here, it has slightly different semantics
pushd $ROOTFS/boot pushd $ROOTFS/boot
KVERSIONS=
if [ -s .origver ]; then if [ -s .origver ]; then
while read kver; do while read kver; do
chroot "$ROOTFS" make-initrd -k "$kver" chroot "$ROOTFS" make-initrd -k "$kver"
KVERSIONS="$KVERSIONS $kver"
done < .origver done < .origver
else
fatal "unable to deduce kernel version"
fi fi
[ -n "$KVERSIONS" ] || fatal "unable to deduce kernel version"
rm -f .origver rm -f .origver
# ...target device too # ...target device too
sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab" sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab"
if [ -f boot.conf ]; then # FIXME: relies on particular (current) kernel package naming scheme
sed -i -e "s,@ROOTUUID@,$ROOTUUID,g" -e "s,@KVER@,$KVER,g" boot.conf for v in $KVERSIONS; do
fi 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 popd
if [ -x "$ROOTFS"/sbin/lilo ]; then 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