@@ -20,8 +20,8 @@ setup-virtualization ACTION="":
20
20
if [ "$OPTION" == "help" ]; then
21
21
echo "Usage : ujust configure-grub <option>"
22
22
echo " <option> : Specify the quick option to skip the prompt"
23
- echo " Use 'enable ' to select Enable Virtualization"
24
- echo " Use 'disable ' to select Disable Virtualization"
23
+ echo " Use 'virt-on ' to select Enable Virtualization"
24
+ echo " Use 'virt-off ' to select Disable Virtualization"
25
25
echo " Use 'group' to select Add $USER to libvirt group"
26
26
echo " Use 'vfio-on' to select Enable VFIO drivers"
27
27
echo " Use 'vfio-off' to select Disable VFIO drivers"
@@ -40,7 +40,7 @@ setup-virtualization ACTION="":
40
40
"Autocreate Looking-Glass shm" \
41
41
)
42
42
fi
43
- if [[ "${OPTION,,}" =~ ^enable(| [[ :space:]]virtualization) ]]; then
43
+ if [[ "${OPTION,,}" =~ ( ^enable[[ :space:]]virtualization|virt-on ) ]]; then
44
44
virt_test =$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager" )
45
45
if [[ -z ${virt_test} ]]; then
46
46
echo "Installing QEMU and virt-manager..."
@@ -50,7 +50,7 @@ setup-virtualization ACTION="":
50
50
--append-if-missing="kvm.report_ignored_msrs=0"
51
51
echo 'Please re-run "ujust setup-virtualization" after the reboot to enable libvirtd service'
52
52
fi
53
- elif [[ "${OPTION,,}" =~ ^disable(| [[ :space:]]virtualization) ]]; then
53
+ elif [[ "${OPTION,,}" =~ ( ^disable[[ :space:]]virtualization|virt-off ) ]]; then
54
54
virt_test =$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager" )
55
55
if [[ ${virt_test} ]]; then
56
56
if [ "$(systemctl is-enabled libvirtd.service)" == "enabled" ]; then
@@ -76,7 +76,7 @@ setup-virtualization ACTION="":
76
76
VENDOR_KARG ="unset"
77
77
if [[ ${VIRT_TEST} == *kvm.report_ignored_msrs* ]]; then
78
78
echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf
79
- sudo touch /etc/bazzite/ initramfs/rebuild
79
+ rpm-ostree initramfs --enable
80
80
if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then
81
81
VENDOR_KARG="amd_iommu =on"
82
82
elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then
@@ -118,8 +118,7 @@ setup-virtualization ACTION="":
118
118
fi
119
119
echo "Removing dracut modules"
120
120
sudo rm /etc/dracut.conf.d/vfio.conf
121
- echo "Issuing initramfs rebuild for next boot"
122
- sudo touch /etc/bazzite/initramfs/rebuild
121
+ rpm-ostree initramfs --enable
123
122
rpm-ostree kargs \
124
123
--delete-if-present="iommu =pt" \
125
124
--delete-if-present="iommu=on" \
@@ -147,10 +146,10 @@ setup-virtualization ACTION="":
147
146
exit 0
148
147
fi
149
148
echo "Creating tmpfile definition for shm file in /etc/tmpfiles.d/"
150
- sudo bash -c "tee << LOOKING_GLASS_TMP > /etc/tmpfiles.d/10-looking-glass.conf
151
- # Type Path Mode UID GID Age Argument
152
- f /dev/shm/looking-glass 0660 1000 qemu -
153
- LOOKING_GLASS_TMP"
149
+ sudo bash -c "cat << LOOKING_GLASS_TMP > /etc/tmpfiles.d/10-looking-glass.conf
150
+ # Type Path Mode UID GID Age Argument
151
+ f /dev/shm/looking-glass 0660 1000 qemu -
152
+ LOOKING_GLASS_TMP"
154
153
echo "Adding SELinux context record for /dev/shm/looking-glass"
155
154
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
156
155
elif [[ "${OPTION,,}" =~ group ]]; then
0 commit comments