Opened 18 years ago
Closed 17 years ago
#159 closed defect (fixed)
stabgrub-me script needs mod for Ubuntu (/etc/grub.conf is a link to a full path name)
Reported by: | Scott Cummings | Owned by: | Bruno Cornec |
---|---|---|---|
Priority: | normal | Milestone: | 2.2.4 |
Component: | mondo | Version: | 2.2.2 |
Severity: | normal | Keywords: | |
Cc: |
Description
In Ubuntu 6.10 -
$ ls -l /etc/grub.conf lrwxrwxrwx 1 root root 19 2007-04-13 15:12 /etc/grub.conf -> /boot/grub/menu.lst
I don't know how this patch will play with other distributions, but for Ubuntu it seems to work better this way -
*** stabgrub-me.orig 2007-04-15 11:07:28.000000000 -0500 --- stabgrub-me.new 2007-04-15 11:13:23.000000000 -0500 *************** *** 37,43 **** # which we need to resolve and prepend with /mnt/RESTORING because # we run this outside the chroot. if [ -L "$old_grubconf" ] ; then ! old_grubconf=/mnt/RESTORING/etc/`readlink "$old_grubconf"` fi return 0 elif [ -f "/mnt/cdrom/archives/CUCKOO" ] ; then --- 37,43 ---- # which we need to resolve and prepend with /mnt/RESTORING because # we run this outside the chroot. if [ -L "$old_grubconf" ] ; then ! old_grubconf=/mnt/RESTORING`readlink "$old_grubconf"` fi return 0 elif [ -f "/mnt/cdrom/archives/CUCKOO" ] ; then
Related problem is -
When mondorestore does 'vi /mnt/RESTORING/etc/grub.conf', busybox? doesn't follow link, so get empty file. (should I create a separate ticket for this?)
Change History (9)
comment:1 by , 18 years ago
Status: | new → assigned |
---|
comment:2 by , 18 years ago
Milestone: | → 2.2.4 |
---|
rev [1448] should fix your readlink issue. Can you please check ?
comment:3 by , 18 years ago
I'm working on checking the fix.
On the related problem - you are, of course :), right that busybox is following links, It escaped me before. But because the resolved link is relative to / and not /mnt/RESTORING something similar to your fix is needed in http://trac.mondorescue.org/browser/branches/2.2.4/mondo/src/mondorestore/mondo-rstr-tools.c#L1704 where
vi /mnt/RESTORING/etc/grub.conf
effectively turns into
vi /boot/grub/menu.lst
and that leads to a blank editor screen.
P.S. I do try to put myself in your place and think about how difficult it must be to find the wheat amidst the chaff in the stuff you get and to make changes that support all of the different distributions. Thanks for your efforts.
comment:4 by , 18 years ago
I applied the patch 1448 and restored in qemu and now it installs grub and successfully boots. (Immediately before that I did also check that the problem was still present.)
Thanks, Bruno!
See above for one remaining issue. Would you like me to create a separate ticket?
Scott
comment:5 by , 18 years ago
No we can continue here.
Your point is interesting :-) I wonder why the edition is not launched in the chroot then. It would make it easier (I need to add lots of code in C to check what is done in one shell/perl command).
So replacing
sprintf(tmp, "%s " MNT_RESTORING "/etc/fstab", editor);
by {{{sprintf(tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor); }}}
Same thing for grub.conf of course. Would you like to test that please ?
Also FYI I know build Ubuntu packages for 7.04 (on our ftp site). You may also want to have a look as I produce a pre-2.2.4 for a colleague there. Might be useful for you as well.
And thanks for your feedback and encouragemetns ;-) Much appreciated.
comment:8 by , 18 years ago
Milestone: | → 2.2.4 |
---|
Could you check that the official 2.2.4 effectively fixes that bug ? TIA.
comment:9 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
No feedback so considered closed.
I think busybox IS following links:
the problem is that your patch will not work for some distros (Debian IIRC) due to that:
So I need to make a more precise check or use chroot.