contrib/nm-live-vm: write /etc/fstab

Everytime you call mock again, the fstab file will be reset.
So, we have to write it shortly before creating the image.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-03-06 15:58:12 +01:00
parent 0178d73699
commit cd7c97eb1d
2 changed files with 8 additions and 2 deletions

View file

@ -92,7 +92,14 @@ do_live_vm() {
echo "Preparing kernel and initrd..." || exit 1
mkdir -p $NAME || exit 1
cp $TREE/boot/vmlinuz* $NAME/vmlinuz || exit 1
mock -r "$ROOT" --chroot "{ ( cd / ; find -not \( -path ./tmp/initramfs.img -o -path './var/cache/yum/*' -o -path './boot' \) -xdev -print0 | cpio -o0c ) || exit 1; } | gzip > /tmp/initramfs.img || exit 1" || die "error creating initramfs"
mock -r "$ROOT" --chroot "{ ( cd / ; \
echo '/dev/sda1 /mnt/sda1 vfat defaults 0 0' >> /etc/fstab ; \
find -not \( \
-path ./tmp/initramfs.img -o \
-path './var/cache/yum/*' -o \
-path './boot' \
\) -xdev -print0 | \
cpio -o0c ) || exit 1; } | gzip > /tmp/initramfs.img || exit 1" || die "error creating initramfs"
cp "$TREE/tmp/initramfs.img" "$NAME/" || exit 1
cp run.sh $NAME/run.sh
}

View file

@ -62,6 +62,5 @@ sed -e 's/^#\?\(RateLimitInterval *= *\).*/\10/' \
-i /etc/systemd/journald.conf
mkdir /mnt/sda1
echo "/dev/sda1 /mnt/sda1 vfat defaults 0 0" >> /etc/fstab
git gc