init: avoid add root dev to fstab for vm image

This was erroneously added to overly broad class of images.
This commit is contained in:
Алексей Шабалин 2018-11-22 20:02:32 +03:00 committed by Michael Shigorin
parent 3921d83174
commit 0aa7c20ff5
2 changed files with 16 additions and 4 deletions

View File

@ -19,7 +19,3 @@ sub /etc/initrd.mk 'MODULES_PRELOAD += autofs4'
# don't allow systemd to set LANG (see also #27408)
sub /etc/locale.conf 'LANG='
# aufs2 root is rw in reality; but don't bother if there's a record already
grep -q '[[:space:]]/[[:space:]]' /etc/fstab ||
sub /etc/fstab '/dev/root / auto defaults 0 0'

View File

@ -0,0 +1,16 @@
#!/bin/sh
# the part below relates to systemd as init specifically
rpm -q systemd-sysvinit || exit 0
sub() {
local file="$1"
shift
for i in "$@"; do
grep -q "^$i" "$file" || echo "$i" >> "$file"
done
}
# aufs2 root is rw in reality; but don't bother if there's a record already
grep -q '[[:space:]]/[[:space:]]' /etc/fstab ||
sub /etc/fstab '/dev/root / auto defaults 0 0'