On Tue, 17 Mar 2009 14:50:49 -0500 Aaron Griffin email@example.com wrote:
On Fri, Mar 13, 2009 at 1:39 PM, Dieter Plaetinck firstname.lastname@example.org wrote:
Hi. I'm getting confused here on what is the best approach to install grub programatically. It's time to do some cleaning up :)
- the grub-install script. gnu ships it and it looks quite good.
You can specify your root directory and on which blockdevice to install grub. Isn't this all you need, even for softraid/lvm/.. setups?
- use the shell directly. This is how it's been done in /arch/setup
script until recently (we changed the way of working then to work around a problem with ext4. it looks like (on my system at least) this is not needed anymore btw). See http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=4565577dbd2182... Is there a specific reason why this method has been in use for so long? does it give more possibilities that we may need?
- the install-grub script. It is shipped with our grub package
but it looks like this script is written by an Arch developer. (see abs and it's source) It shares a lot of code with the old /arch/setup script (which makes we wonder why the same code is in 2 places? the installer script does/did not call install-grub). To make things more confusing, the quickinst recommends using this script. It seems like it wraps around method 2 and provides some additional "block device to mount location" mapping. I don't understand why we would need that logic (we always _know_ where /boot is mounted afaik), let alone why it's there if the same logic is in the installer script.
Right now, aif -p interactive uses method 2. But I would like to switch to 1 because it's cleaner and doesn't suffer NIH. We can still support special cases like softraid etc because we only need to pass a different blockdevice for that, right? In my limited testing grub-install seems to work fine. Maybe we can even drop the install-grub script?
This sounds good to me. I always wondered why we ship this script, too.
Can anyone see any benefit to it, or should it be removed? I vote remove it (vanilla packages, ahem). Either way, let's go with option one. Using the grub shell seems like too much work, especially considering grub ships a script that simplifies it anyway.
Okay, a related thing: http://bugs.archlinux.org/task/13277 I want to clean up the dialogs we present to the user a bit. If we switch to grub-install, we only need to ask the user on which blockdevice (can be physical disk, partition or device mapper disk) he wants to install grub right? This should handle all use cases, including softraid? (eg that's the only user input we need?) Or does softraid require the user to install grub on more then one blockdevice? In that case we could a checkbox widget instead of a select-one-item widget.