aboutsummaryrefslogtreecommitdiff
path: root/kvmx-create
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-04-01 22:42:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-04-01 22:42:00 -0300
commitb2e96fae1957229fb63649122023f5e0c3d3332a (patch)
tree469ec839cafcff39405ff040d318f6602577302f /kvmx-create
parentedc02316f465cfb073ca706910518dc4dea37cd7 (diff)
downloadkvmx-b2e96fae1957229fb63649122023f5e0c3d3332a.tar.gz
kvmx-b2e96fae1957229fb63649122023f5e0c3d3332a.tar.bz2
Mount /dev /proc /sys only for grub at kvmx-create
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