12.02.2016 21:41, Vladimir 'φ-coder/phcoder' Serbinenko пишет: > On 08.05.2015 20:53, Andrei Borzenkov wrote: >> There are two main applications. >> >> 1. Omit install device to create generic image intended for chainloading >> from other master loader. Such image can be put on any device (or file >> system) and will still be able to find its $root. Currently even with >> --no-bootsector grub-install optimizes image by skipping UUID search if >> possible. >> >> 2. Redundant installation on multi-device filesystem, RAID or similar. >> This allows both optimizing image w.r.t. to using --prefix vs. load.cfg >> as well as creating image just once. >> >> Patch allows transparently use none or multiple installation devices, >> similar to >> >> grub_devices="/dev/sda /dev/sda1 /dev/sdb" >> grub-install $grub_devices >> >> where grub_devices can be empty and still do the right thing. >> >> This is work in progress, although it is functionally complete and just >> needs some cleanups. >> >> Comments? > I like the idea and it was on my "nice to have" list for some time. Do > you want to clean it up first or should I review this version? I updated it to the current master with small cleanup. See attached. Open questions - we probably should not allow empty install list by default. This is too error prone to have grub-install silently succeed leaving unbootable system. Should we add special argument or --force will do? - it still may be useful to be able to force UUID search instead of encoding partition number irrespectively of install device locations. But that is separate topic. - messages from grub-setup need now qualification with device. It is otherwise confusing when you have several devices and do not know which one it refers to. - for completeness this should really be pushed into grub-bios-setup as well. But this is a lot of work for rather small gain (only when installing on multiple partitions on the same disk). Most common applications I had in mind are zero install devices or different disks in RAID. - this makes grub-install even less atomic than it is now. It would be really useful to have framework for alternative /boot/grub locations so that boot sector always refers to valid boot location. Or notion of "undo" where we could revert changes.