aboutsummaryrefslogtreecommitdiff
path: root/kvmx-create
diff options
context:
space:
mode:
Diffstat (limited to 'kvmx-create')
-rwxr-xr-xkvmx-create10
1 files changed, 5 insertions, 5 deletions
diff --git a/kvmx-create b/kvmx-create
index 2e73f94..05d7571 100755
--- a/kvmx-create
+++ b/kvmx-create
@@ -203,9 +203,6 @@ function kvmx_create_custom {
# Initial configuration.
echo "Applying initial configuration..."
- kvmx_sudo_run mount none -t proc $WORK/proc
- kvmx_sudo_run mount none -t sysfs $WORK/sys
- kvmx_sudo_run mount -o bind /dev/ $WORK/dev
# Hostname configuration.
echo $hostname.$domain | $SUDO tee $WORK/etc/hostname > /dev/null
@@ -287,14 +284,17 @@ iface ens3 inet dhcp
EOF
# Grub
+ kvmx_sudo_run mount none -t proc $WORK/proc
+ kvmx_sudo_run mount none -t sysfs $WORK/sys
+ kvmx_sudo_run mount -o bind /dev/ $WORK/dev
$APT_INSTALL grub-pc -y
kvmx_sudo_run chroot $WORK/ update-grub
kvmx_sudo_run chroot $WORK/ grub-install $device
-
- # Teardown
kvmx_sudo_run umount $WORK/proc
kvmx_sudo_run umount $WORK/sys
kvmx_sudo_run umount $WORK/dev
+
+ # Umount image
kvmx_sudo_run umount $WORK
kvmx_sudo_run rmdir $WORK
kvmx_sudo_run losetup -d $device