You are not logged in.
I have Arch installation on dedicated SSD which is used in bare metal and Virtualbox environment.
Most of things work fine, but I think it would be better if some services/drivers/tunes will differ depends on environment.
In bare metal I don't need vbox guest tools, in virtual environment hardware sensors fail to start and nvidia/broadcom kernel modules is unneeded.
Bootloader - GRUB (BIOS, GPT partitions loaded by UUID)
I can generate separate initrd/kernel images, but:
How to detect VBox environment in GRUB?
How to enable/disable systemd services depend on environment?
Last edited by speshuric (2020-10-21 20:56:13)
Offline
Would you consider an alternative approach where you have systemd do the detection? Systemd#Drop-in_files
[Service]
ConditionVirtualization=falseMore complex for the module loading but you could try overriding the automatic module loading rules in /usr/lib/modprobe.d/ and add a systemd service that loads the modules again with ConditionVirtualization=false
Offline
Thank you, loqs, for fast reply. That's exactly what I want. Drop-in files have solved service loading at the least. I've created /etc/systemd/system/lm_sensors.service.d/override.conf for test
[Unit]
ConditionVirtualization=false(not the Service section, but Unit)
Now it's not loading in VBox.
Now I will try your solution for modules, I think topic can be marked as solved.
Offline