Commit 2ac26880 authored by Anton Midyukov's avatar Anton Midyukov Committed by Michael Shigorin

tar2fs: avoid duplicate fstab entry

This commit fixes duplication of root device entry in /etc/fstab and changes LABEL=ROOT entry with the proper one if found. Apparently this didn't hurt qemu images much though...
parent caee317e
......@@ -224,7 +224,11 @@ tar -C "$ROOTFS" --numeric-owner -xf "$TAR"
for i in /dev /proc /sys; do mount --bind "$i" "$ROOTFS$i"; done
# loop device so lilo could work...
echo "$ROOTDEV / $ROOTFSTYPE relatime 1 1" >> "$ROOTFS/etc/fstab"
if grep -qe "[[:space:]]/[[:space:]]" "$ROOTFS/etc/fstab"; then \
sed -i "s/LABEL=ROOT/$ROOTDEV/" "$ROOTFS/etc/fstab"
else
echo "$ROOTDEV / $ROOTFSTYPE relatime 1 1" >> "$ROOTFS/etc/fstab"
fi
# target device at once
if [ -n "$BOOTPART" ]; then
......
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