Hi everyone, my first post/question in this forum, which I've followed from time to time in complete awe. I have a limited understanding of grub4dos, although I've used it for years to dual boot Windows and Linux.
This is my setup. I carry a single USB stick with me and an external USB drive. The stick holds Linux boot files (initrd, vmlinuz), the USB external disk holds the rest of the Linux system. I use the same stick+disk on several different PCs, and it works well.
Here my need. Some PCs need different cheat codes to be able to boot, for instance, I need to blacklist some modules _on the kernel line_. This is very hardware specific, i.e., PC A needs cheat code X, PC B needs cheat code Y, etc. So far I've managed the cheat codes with a proliferation of menu.lst entries, each entry specific to one PC, but this is getting unwieldy, and the user has to know which PC is which.
If grub4dos could detect disk UUIDs, and the boot entry could be written such that it adds the cheat codes conditionally, based on finding a specific UUID. It this possible and how? Roughly this entry would "run" some code that implements this pseudo-code
CHEATCODE = "" For UUID in all hard disk drives Switch(UUID) Case "abc": CHEATCODE = "blacklist=module1 custom_code1" Break Case "def": CHEATCODE = "blacklist=module2 custom_code2 custom_code3" Break EndFor kernel /vmlinuz %CHEATCODE% initrd /initrd
Of course, the Case labels and CHEATCODE values are specific to the hardware pool that the stick is being used on, but at least such an entry would be easy to update for new hardware, and the stick could be given to users who can't tell which PC is which.
My idea of using UUIDs might be too limiting; I recognize that UUIDs don't scale up well. For instance, if G4D could probe PCI hardware, then the blacklist cheat code could be written for an entire group of PCs without limiting it by UUID. But I don't think that G4D is so advanced that it can probe hardware other than disks. This is why I thought about using UUIDs. If there are better ways, please tell me.
Anyway, I would appreciate if anyone could lead me into writing a boot entry that implements the above pseudo-code. Thank you