scripts/vagrant: Replace lsb_release with os-release check
lsb_release is not shipped under latest fedora distros, hence failing this check. Use /etc/os-release instead. Signed-off-by: Michal Berger <michal.berger@intel.com> Change-Id: Id74095ff5dd5d43f7a97e4c5d026ac13da26d815 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15107 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
This commit is contained in:
parent
3b2eb02bc9
commit
5e244e25f0
@ -51,24 +51,20 @@ if [ "${SYSTEM}" != "Linux" ]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WHICH_OS=$(lsb_release -i | awk '{print $3}')
|
source /etc/os-release
|
||||||
qemu-img create -f raw "$nvme_disk" -o preallocation="$preallocation" $size
|
qemu-img create -f raw "$nvme_disk" -o preallocation="$preallocation" $size
|
||||||
|
|
||||||
case $WHICH_OS in
|
# That's just a wild guess for now
|
||||||
"Fedora")
|
# TODO: needs improvement for other distros
|
||||||
|
qemu_user_group="libvirt-qemu:kvm"
|
||||||
|
|
||||||
|
case "$ID" in
|
||||||
|
"fedora")
|
||||||
qemu_user_group="qemu:qemu"
|
qemu_user_group="qemu:qemu"
|
||||||
|
|
||||||
# Change SE Policy
|
# Change SE Policy
|
||||||
sudo chcon -t svirt_image_t "$nvme_disk"
|
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
|
esac
|
||||||
|
|
||||||
chmod 777 "$nvme_disk"
|
chmod 777 "$nvme_disk"
|
||||||
|
Loading…
Reference in New Issue
Block a user