Skip to content

Commit

Permalink
Merge pull request #162 from dolphinoracle/gtk3
Browse files Browse the repository at this point in the history
add feature to disable early kvm module loading for virtualbox on ker…
  • Loading branch information
dolphinoracle authored Dec 9, 2024
2 parents ab4ce7d + f8ca7ac commit d8b40bd
Show file tree
Hide file tree
Showing 5 changed files with 328 additions and 244 deletions.
39 changes: 39 additions & 0 deletions defaultlook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,24 @@ void defaultlook::setupEtc()
ui->checkBoxBluetoothBattery->hide();
}

//setup early KVM module loading
test = runCmd("LANG=C grep \"enable_virt_at_load=0\" /etc/modprobe.d/* | grep kvm").output;
if (!test.isEmpty()){
if (!test.section(":",1,1).startsWith("#" )){
ui->checkBoxKVMVirtLoad->setChecked(true);
kvmconffile=test.section(":",0,0);
if (verbose) qDebug() << "kvm conf file is " << kvmconffile;
} else {
ui->checkBoxKVMVirtLoad->setChecked(false);
kvmconffile = "/etc/modprobe.d/kvm.conf";
}
} else {
ui->checkBoxKVMVirtLoad->setChecked(false);
kvmconffile = "/etc/modprobe.d/kvm.conf";
}
//set flag false so future changes processed, but not an unchanged checkbox
kvmflag=false;

//setup apt install_recommends
//enable checkbox only if Install-Recommends is set to 1. default is 0 or no if no existanct apt.conf
if ( QFile("/etc/apt/apt.conf").exists()){
Expand Down Expand Up @@ -2682,6 +2700,15 @@ void defaultlook::on_ButtonApplyEtc_clicked()
ui->checkBoxDisplayManager->setChecked(false);
}

//kvm_early_switch
if (kvmflag){
if (ui->checkBoxKVMVirtLoad->isChecked()){
kvm_early_switch("on", kvmconffile);
} else {
kvm_early_switch("off", kvmconffile);
}
}

//checkbox options
if ( ! udisks_option.isEmpty() || ! sudo_override_option.isEmpty() || ! user_name_space_override_option.isEmpty() || ! intel_option.isEmpty() || ! lightdm_option.isEmpty() || ! amd_option.isEmpty() || ! radeon_option.isEmpty() || !bluetooth_option.isEmpty() || !recommends_option.isEmpty() || !debian_kernel_updates_option.isEmpty() || !liq_kernel_updates_option.isEmpty()){
runCmd("pkexec /usr/lib/mx-tweak/mx-tweak-lib.sh " + udisks_option + " " + sudo_override_option + " " + user_name_space_override_option + " " + intel_option + " " + amd_option + " " + radeon_option + " " + bluetooth_option + " " + recommends_option + " " + lightdm_option + " " + debian_kernel_updates_option + " " + liq_kernel_updates_option);
Expand All @@ -2695,6 +2722,11 @@ void defaultlook::changecomputername(QString hostname){
runCmd("pkexec /usr/lib/mx-tweak/mx-tweak-lib.sh hostname " + hostname);
}

void defaultlook::kvm_early_switch(QString action, QString file){
if (verbose) qDebug() << "kvm flag is " << kvmflag << "action is " << action << " file is " << file;
runCmd("pkexec /usr/lib/mx-tweak/mx-tweak-lib.sh kvm_early_switch " + action + " " + file);
}

void defaultlook::changedisplaymanager(QString dm){
runCmd("pkexec /usr/lib/mx-tweak/mx-tweak-lib.sh displaymanager " + dm);
}
Expand Down Expand Up @@ -4457,3 +4489,10 @@ void defaultlook::on_checkBoxDisplayManager_clicked()
ui->ButtonApplyEtc->setEnabled(true);
}


void defaultlook::on_checkBoxKVMVirtLoad_clicked()
{
ui->ButtonApplyEtc->setEnabled(true);
kvmflag = !kvmflag;
}

5 changes: 5 additions & 0 deletions defaultlook.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class defaultlook : public QDialog
bool debianKernelUpdateFlag = false;
bool plasmadisoverautostartflag = false;
bool graphicssetupflag=true;
bool kvmflag=false;
QString kvmconffile;



Expand Down Expand Up @@ -193,6 +195,7 @@ class defaultlook : public QDialog
void changecomputername(QString hostname);
bool validatecomputername(QString hostname);
void changedisplaymanager(QString dm);
void kvm_early_switch(QString action, QString file);

private slots:
static void on_buttonCancel_clicked();
Expand Down Expand Up @@ -331,6 +334,8 @@ private slots:

void on_checkBoxDisplayManager_clicked();

void on_checkBoxKVMVirtLoad_clicked();

private:
Ui::defaultlook *ui;
};
Expand Down
180 changes: 95 additions & 85 deletions defaultlook.ui
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>8</number>
</property>
<widget class="QWidget" name="Panel">
<attribute name="title">
Expand Down Expand Up @@ -1933,135 +1933,107 @@
</property>
</widget>
</item>
<item row="19" column="2">
<widget class="QRadioButton" name="radioSudoUser">
<property name="text">
<string>&amp;User</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxLightdmReset">
<property name="text">
<string>Reset Lightdm (login screen) to system default theme</string>
</property>
</widget>
</item>
<item row="16" column="1" colspan="3">
<widget class="QLineEdit" name="lineEditHostname"/>
</item>
<item row="10" column="0" colspan="4">
<item row="11" column="0" colspan="4">
<widget class="QCheckBox" name="checkboxIntelDriver">
<property name="text">
<string>Use intel driver instead of default &quot;modesetting&quot; driver (requires restart)</string>
</property>
</widget>
</item>
<item row="13" column="0" colspan="3">
<widget class="QLabel" name="labelamdgpu">
<item row="16" column="0" colspan="3">
<widget class="QLabel" name="labelradeon">
<property name="text">
<string> NOTE: existing /etc/X11/xorg.conf.d/20-amd.conf will be backed up to home folder</string>
<string> NOTE: existing /etc/X11/xorg.conf.d/20-radeon.conf will be backed up to home folder</string>
</property>
</widget>
</item>
<item row="19" column="0" colspan="2">
<widget class="QLabel" name="label_11">
<item row="0" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxLightdmReset">
<property name="text">
<string>Password for administrative tasks:</string>
<string>Reset Lightdm (login screen) to system default theme</string>
</property>
</widget>
</item>
<item row="19" column="3">
<item row="20" column="3">
<widget class="QRadioButton" name="radioSudoRoot">
<property name="text">
<string>Root</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxInstallRecommends">
<property name="text">
<string>Apt installs additional &quot;recommends&quot; packages as dependencies</string>
</property>
</widget>
<item row="17" column="1" colspan="3">
<widget class="QLineEdit" name="lineEditHostname"/>
</item>
<item row="7" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxCSD">
<item row="17" column="0">
<widget class="QCheckBox" name="checkBoxComputerName">
<property name="text">
<string>Use Client Side Decorations (CSD) on GTK3 applications that support them (requires session restart)</string>
<string extracomment="option to change the system hostname, requires a reboot to be 100% effective">Change computer name (requires reboot)</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxLiqKernelUpdates">
<property name="toolTip">
<string extracomment="toggle for apt hold action on update meta packages">put a hold or remove a hold on updates of Liquorix kernels</string>
</property>
<item row="2" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxSandbox">
<property name="text">
<string extracomment="uses apt-mark to hold or unhold updates to kernel metapackages">Enable Automatic Liquorix Kernel Updates (MX ahs repository)</string>
<string>Enable kernel sandbox</string>
</property>
</widget>
</item>
<item row="18" column="0" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="1" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxMountInternalDrivesNonRoot">
<property name="text">
<string>Enable mounting of internal drives by non-root users</string>
</property>
</widget>
</item>
<item row="14" column="0" colspan="4">
<widget class="QCheckBox" name="checkboxRadeontearfree">
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxBluetoothBattery">
<property name="text">
<string>Use tearfree radeon driver option</string>
<string extracomment="expose battery info for connected bluetooth devices to the operating system via dbus">Enable Bluetooth battery info for connected devices (requires system restart)</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxDisableFluxboxMenuGeneration">
<widget class="QCheckBox" name="checkBoxInstallRecommends">
<property name="text">
<string>Generate fluxbox All Apps menu after package installation, removal, and updates</string>
<string>Apt installs additional &quot;recommends&quot; packages as dependencies</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="4">
<widget class="QCheckBox" name="checkboxAMDtearfree">
<property name="text">
<string>Use tearfree amdgpu option</string>
</property>
</widget>
<item row="18" column="1" colspan="3">
<widget class="QComboBox" name="comboBoxDisplayManager"/>
</item>
<item row="2" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxSandbox">
<property name="text">
<string>Enable kernel sandbox</string>
<item row="19" column="0" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="17" column="0">
<widget class="QCheckBox" name="checkBoxDisplayManager">
<item row="20" column="0" colspan="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string extracomment="option to change display manager login screen. present if more than one display manager is installed">Change Default Display Manager (login screen) (requires reboot)</string>
<string>Password for administrative tasks:</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxDebianKernelUpdates">
<widget class="QCheckBox" name="checkBoxLiqKernelUpdates">
<property name="toolTip">
<string extracomment="toggle for apt hold action on update meta packages">put a hold or remove a hold on updates of Debian kernels</string>
<string extracomment="toggle for apt hold action on update meta packages">put a hold or remove a hold on updates of Liquorix kernels</string>
</property>
<property name="text">
<string extracomment="uses apt-mark to hold or unhold updates to kernel metapackages">Enable Automatic Debian Kernel Updates</string>
<string extracomment="uses apt-mark to hold or unhold updates to kernel metapackages">Enable Automatic Liquorix Kernel Updates (MX ahs repository)</string>
</property>
</widget>
</item>
<item row="16" column="0">
<widget class="QCheckBox" name="checkBoxComputerName">
<item row="14" column="0" colspan="3">
<widget class="QLabel" name="labelamdgpu">
<property name="text">
<string extracomment="option to change the system hostname, requires a reboot to be 100% effective">Change computer name (requires reboot)</string>
<string> NOTE: existing /etc/X11/xorg.conf.d/20-amd.conf will be backed up to home folder</string>
</property>
</widget>
</item>
<item row="21" column="0" colspan="4">
<item row="22" column="0" colspan="4">
<widget class="QPushButton" name="ButtonApplyEtc">
<property name="minimumSize">
<size>
Expand All @@ -2078,38 +2050,52 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxBluetoothBattery">
<item row="15" column="0" colspan="4">
<widget class="QCheckBox" name="checkboxRadeontearfree">
<property name="text">
<string extracomment="expose battery info for connected bluetooth devices to the operating system via dbus">Enable Bluetooth battery info for connected devices (requires system restart)</string>
<string>Use tearfree radeon driver option</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="3">
<widget class="QLabel" name="labelIntel">
<item row="13" column="0" colspan="4">
<widget class="QCheckBox" name="checkboxAMDtearfree">
<property name="text">
<string> NOTE: existing /etc/X11/xorg.conf.d/20-intel.conf will be backed up to home folder</string>
<string>Use tearfree amdgpu option</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxMountInternalDrivesNonRoot">
<item row="18" column="0">
<widget class="QCheckBox" name="checkBoxDisplayManager">
<property name="text">
<string>Enable mounting of internal drives by non-root users</string>
<string extracomment="option to change display manager login screen. present if more than one display manager is installed">Change Default Display Manager (login screen) (requires reboot)</string>
</property>
</widget>
</item>
<item row="15" column="0" colspan="3">
<widget class="QLabel" name="labelradeon">
<item row="8" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxCSD">
<property name="text">
<string> NOTE: existing /etc/X11/xorg.conf.d/20-radeon.conf will be backed up to home folder</string>
<string>Use Client Side Decorations (CSD) on GTK3 applications that support them (requires session restart)</string>
</property>
</widget>
</item>
<item row="17" column="1" colspan="3">
<widget class="QComboBox" name="comboBoxDisplayManager"/>
<item row="20" column="2">
<widget class="QRadioButton" name="radioSudoUser">
<property name="text">
<string>&amp;User</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxDebianKernelUpdates">
<property name="toolTip">
<string extracomment="toggle for apt hold action on update meta packages">put a hold or remove a hold on updates of Debian kernels</string>
</property>
<property name="text">
<string extracomment="uses apt-mark to hold or unhold updates to kernel metapackages">Enable Automatic Debian Kernel Updates</string>
</property>
</widget>
</item>
<item row="20" column="0">
<item row="21" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand All @@ -2122,6 +2108,30 @@
</property>
</spacer>
</item>
<item row="12" column="0" colspan="3">
<widget class="QLabel" name="labelIntel">
<property name="text">
<string> NOTE: existing /etc/X11/xorg.conf.d/20-intel.conf will be backed up to home folder</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="4">
<widget class="QCheckBox" name="checkBoxDisableFluxboxMenuGeneration">
<property name="text">
<string>Generate fluxbox All Apps menu after package installation, removal, and updates</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBoxKVMVirtLoad">
<property name="toolTip">
<string extracomment="early loading is new on 6.12 kernel and conflicts with virtualbox">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;early loading of KVM module is new to kernel 6.12 and conflicts with some non-KVM virtual machine applications, including virtuabox &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string extracomment="disable early loading of KVM module. necessary for virtualbox to function with kernels 6.12 and up. actually default behavior on kernels 6.11 and earlier.">Disable early KVM module load (must be disabled for Virtualbox operation on kernel 6.12 and up)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
Loading

0 comments on commit d8b40bd

Please sign in to comment.