diff --git a/scripts/vagrant/create_nvme_img.sh b/scripts/vagrant/create_nvme_img.sh index 7452b0af6..8be9fdbbe 100755 --- a/scripts/vagrant/create_nvme_img.sh +++ b/scripts/vagrant/create_nvme_img.sh @@ -51,24 +51,20 @@ if [ "${SYSTEM}" != "Linux" ]; then exit 2 fi -WHICH_OS=$(lsb_release -i | awk '{print $3}') +source /etc/os-release qemu-img create -f raw "$nvme_disk" -o preallocation="$preallocation" $size -case $WHICH_OS in - "Fedora") +# That's just a wild guess for now +# TODO: needs improvement for other distros +qemu_user_group="libvirt-qemu:kvm" + +case "$ID" in + "fedora") qemu_user_group="qemu:qemu" # Change SE Policy sudo chcon -t svirt_image_t "$nvme_disk" ;; - "Ubuntu") - qemu_user_group="libvirt-qemu:kvm" - ;; - *) - # That's just a wild guess for now - # TODO: needs improvement for other distros - qemu_user_group="libvirt-qemu:kvm" - ;; esac chmod 777 "$nvme_disk"