You are not logged in.
I have a systemd-boot based setup where I have two different arch entries for two different configurations, where the easiest fix for some hardware quirks is to just use a different set of kernel parameters depending on what is plugged in.
However, this can be annoying: one of the pieces of hardware is an EGPU, which means I can't necessarily see the screen to select the right boot entry. So what I would prefer is if there were some script or something that looks for the connected device, and then chooses between the two boot entries or even just have a single entry with two different kernel invocations with different kernel parameters.
The problem is, I see nothing in the systemd-boot man pages about how to do really anything conditionally. Is this even possible, or do I need to go down another path of trying to convince the kernel to change some of its choices after it has started up?
Offline
Perhaps something like this? https://hackaday.io/project/179539-hard … ion-switch
Online
Yes, that's definitely the right direction (although I have slightly more complex of an if statement than "is this GPIO high or low"), but it looks like that uses GRUB, which seems to have much better "scripting" capability than systemd-boot loader entries. So sharpening the question might be: "can that be done with systemd-boot instead of grub?"
Offline
Directly? No. You might be able to write an EFI binary and preload that which will in turn chainload your actual kernels. But for the goal you envision systemd-boot on its own will not cut it.
Last edited by V1del (2024-11-12 01:31:31)
Offline
The UEFI shell can be used by systemd-boot: https://wiki.archlinux.org/title/System … other_disk
Para todos todo, para nosotros nada
Offline