FS#13277 - /sbin/grub-install hardcoded root-directory
Attached to Project:
Release Engineering
Opened by Dieter Plaetinck (Dieter_be) - Saturday, 14 February 2009, 18:29 GMT
Last edited by Gerhard Brauer (GerBra) - Thursday, 23 July 2009, 10:04 GMT
Opened by Dieter Plaetinck (Dieter_be) - Saturday, 14 February 2009, 18:29 GMT
Last edited by Gerhard Brauer (GerBra) - Thursday, 23 July 2009, 10:04 GMT
|
Details
Hi,
when /arch/setup was changed from /sbin/grub to /sbin/grub-install ( http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=4565577dbd2182dd49612f1e0b68288f5573bf7b ) You use --root-directory=$DESTDIR but: in the code a bit higher (look for "# look for a separately-mounted /boot partition " in http://projects.archlinux.org/?p=installer.git;a=blob_plain;f=setup;hb=HEAD we do some effort to set $bootpart by looking for a mounted '/boot', using the root partition or just asking the user. In the old days we used that variable, but now we don't. So, shouldn't we use --root-directory=$bootpart? Edit: no wait.. $bootpart is a partition, they want a directory. Maybe we *should* stick to --root-directory=$DESTDIR, but just drop the code related to $bootpart, there is no more need for the "try to detect where it is or just ask the user"-code, because we always know where it is ($DESTDIR), right? |
This task depends upon
Closed by Gerhard Brauer (GerBra)
Thursday, 23 July 2009, 10:04 GMT
Reason for closing: Won't fix
Additional comments about closing: We don't use arch-installer anymore. New grub related reports and infos are in the last comment.
Thursday, 23 July 2009, 10:04 GMT
Reason for closing: Won't fix
Additional comments about closing: We don't use arch-installer anymore. New grub related reports and infos are in the last comment.
# look for a separately-mounted /boot partition
bootpart=$(mount | grep $DESTDIR/boot | cut -d' ' -f 1)
if [ "$bootpart" = "" ]; then
if [ "$PART_ROOT" = "" ]; then
DIALOG --inputbox "Enter the full path to your root device" 8 65 "/dev/sda3" 2>$ANSWER || return 1
bootpart=$(cat $ANSWER)
else
bootpart=$PART_ROOT
fi
fi
And what about this one?
DIALOG --defaultno --yesno "Do you have your system installed on software raid?\nAnswer 'YES' to install grub to another hard disk." 0 0
if [ $? -eq 0 ]; then
DIALOG --menu "Please select the boot partition device, this cannot be autodetected!\nPlease redo grub installation for all partitions you need it!" 14 55 7 $DEVS 2>$ANSWER || return 1
bootpart=$(cat $ANSWER)
fi
We don't do anything with $bootpart anymore, so all code to set and check it becomes unneeded.
But $bootpart is not used anywhere anymore since http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=4565577dbd2182dd49612f1e0b68288f5573bf7b
Also we should recheck why the switch to grub-install was needed. I have done this change in 12/2008 (but with the same grub version as we use it now in core). With the old method (/sbin/grub instead of grub-install) i got reproducable boot errors on ext4 root/boot partitions. But grub-install is "only" a wrapper script for /sbin/grub. And after all i see no real difference on the parameters for /sbin/grub if we call it with grub-install. But grub-install work - /sbin/grub -foo- bar not.
grub-install writes a temp logfile which is removed after execution, this could be changed when edit the grub-install script.
So further we should check (when aif code is solid for grub): Do we still need with current software versions this way with grub-install (do we gain or loss features when using the wrapper script) or could/should we maybe switch back to /sbin/grub.
Also i tried with AIF: ext4 / and ext2 /boot, and once with ext4 /boot and those work both fine (though I test in virtualbox, in the thread you seem to mention there is a difference between VM and real system?)
The problem with grub-0.97-15 was in 12/2008 (the date from the commit):
method /sbin/grub in installer code doesn't work. It gets installed but a ext4 / or /boot partition could not be bootet after finished installation in virtualbox.
But changing to /sbin/grub-install (the wrapper script, there is also another method install-grub <g>) solved it in 12/2008. Therefor the commit, and this code also make it's way to 2009.02. I have no plan why the wrapper methode works - and our old (using the grub shell directly) don't.
So i mean: If we writing the code piece for aif we should check: what methods for calling/installing grub works (or not) with our current versions of software (we have a new glibc for ex.). Maybe we don't have to stuck with grub-install...
And the raid part: Anyway which method of calling/installing the grub bootloader - it should be still possible to install the bootloader also on the other disks of an raid1 for example...
In fact, both $bootpart and $ROOTDEV seem to basically be the same (it's one of $DEVS, see line 1060 and 1082) Since we already ask at line 1060, is there any reason we ask the same question again at line 1082 ?
As long as we keep the question at line 1060, that covers any case (including raid), right?
And for the reason we switched to /sbin/grub-install: I can only say that with aif (which still uses the old method) I tried an ext4 /boot and an ext4 / with ext2 /boot, and both cases worked fine for me (in virtualbox!)
How exactly could you reproduce the errors? Could you consistently reproduce the errors on a virtual machine (vbox?) I want to know this, so my tests are not "in the dark" :)
Dieter
The error in old installer with "old methode" was: grub menu appears correctly but the ext4 system (neither /boot nor /) could not be booted. I don't remember the exact error, maybe it was something what we fixed later with ex. glibc. But in 12/2008 switching to grub-install works, so it was the solution for me that time. I agree to recheck "the old methode" again (you say it works for you), we have to look on what methode we benefit the most.
Nevertheless is will then open a new report mainly for the softraid part (i am working on that).
FS#13945(long term refactor)FS#15652(for special raid(1) setup)Closing this report.