From: Marco Gerards <metgerards@student.han.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [patch] set prefix on PPC
Date: Sun, 13 Feb 2005 18:35:54 +0000 [thread overview]
Message-ID: <87mzu8tiid.fsf@marco.marco-g.com> (raw)
In-Reply-To: <20050213165452.GA4503@miracle> (Hollis Blanchard's message of "Sun, 13 Feb 2005 10:54:52 -0600")
Hollis Blanchard <hollis@penguinppc.org> writes:
Hi,
> This code sets the GRUB "prefix" environment variable from the OF
> /chosen/bootpath property. It must therefore translate between the two
> syntaxes.
Personally I don't like setting prefix to the path grubof was loaded
from. Mainly because of the way how things work on the macintosh. It
has a special HFS[+] boot partition (at least my installation, but I
think this is the common practice).
I don't like installing all modules and the configuration file on this
partition. There were some problems with writing to this partition
IIRC and it is not comfortable to use. It should not be touched by a
user, I just can't remember why. I will look that up.
What I would prefer is a way to encode the prefix into the grubof
binary. The only disadvantage is that it might be hard to detect this
install time.
What I would prefer is this:
1) Set prefix to whatever was set in the binary.
2) If nothing was set, use `bootpath'.
3) Read the arguments and if a prefix was passed to GRUB, use it to
override the prefix.
For #3 I wrote a patch, but I forgot to send it to grub-devel... It's
included with this email. As far as I am concerned #1 is what is
really important for us.
Perhaps I might be confused by what I read last year and it is not
really an issue. I just want to get things right.
Thanks,
Marco
2005-02-13 Marco Gerards <metgerards@student.han.nl>
* kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize the
prefix env variable with the bootargs when it has a valid value.
* loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Don't
initialize `init_addr' yet, set it to 0 instead.
Index: kern/powerpc/ieee1275/init.c
===================================================================
RCS file: /cvsroot/grub/grub2/kern/powerpc/ieee1275/init.c,v
retrieving revision 1.13
diff -u -p -r1.13 init.c
--- kern/powerpc/ieee1275/init.c 4 Jan 2005 14:01:45 -0000 1.13
+++ kern/powerpc/ieee1275/init.c 11 Feb 2005 22:41:15 -0000
@@ -48,6 +48,8 @@ grub_machine_init (void)
extern char _start;
grub_addr_t heap_start;
grub_addr_t heap_len;
+ grub_ieee1275_phandle_t chosen;
+ grub_size_t proplen;
grub_console_init ();
@@ -67,6 +69,20 @@ grub_machine_init (void)
grub_env_set ("prefix", "");
+ /* Try to override the prefix using the argument passed to GRUB. */
+ grub_ieee1275_finddevice ("/chosen", &chosen);
+ grub_ieee1275_get_property_length (chosen, "bootargs", &proplen);
+ {
+ char args[proplen];
+ grub_size_t actual;
+
+ grub_ieee1275_get_property (chosen, "bootargs", args, proplen, &actual);
+
+ /* If the argument is a valid path, use it. */
+ if (actual > 0 && args[0] == '(' && grub_strchr (args, ')'))
+ grub_env_set ("prefix", args);
+ }
+
grub_ofdisk_init ();
}
Index: loader/powerpc/ieee1275/linux.c
===================================================================
RCS file: /cvsroot/grub/grub2/loader/powerpc/ieee1275/linux.c,v
retrieving revision 1.5
diff -u -p -r1.5 linux.c
--- loader/powerpc/ieee1275/linux.c 31 Jan 2005 21:44:35 -0000 1.5
+++ loader/powerpc/ieee1275/linux.c 11 Feb 2005 22:41:15 -0000
@@ -258,7 +258,7 @@ grub_rescue_cmd_linux (int argc, char *a
else
{
grub_loader_set (grub_linux_boot, grub_linux_unload);
- initrd_addr = 0xc0000000;
+ initrd_addr = 0;
loaded = 1;
}
next prev parent reply other threads:[~2005-02-13 18:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-13 16:54 [patch] set prefix on PPC Hollis Blanchard
2005-02-13 18:35 ` Marco Gerards [this message]
2005-02-13 19:52 ` Hollis Blanchard
2005-02-14 19:01 ` Marco Gerards
2005-02-15 16:39 ` Hollis Blanchard
2005-02-15 21:31 ` Marco Gerards
2005-02-20 0:21 ` Hollis Blanchard
2005-02-20 17:50 ` Marco Gerards
2005-02-24 4:44 ` Hollis Blanchard
2005-04-14 16:35 ` Marco Gerards
2005-02-21 19:01 ` Marco Gerards
2005-02-24 4:40 ` Hollis Blanchard
2005-04-14 17:05 ` Marco Gerards
2005-04-17 17:10 ` partition numbering (was: set prefix on PPC) Hollis Blanchard
2005-04-17 17:44 ` partition numbering Marco Gerards
2005-04-17 18:23 ` Hollis Blanchard
2005-04-17 18:57 ` Marco Gerards
2005-04-17 19:24 ` Yoshinori K. Okuji
2005-04-17 19:45 ` Marco Gerards
-- strict thread matches above, loose matches on Subject: below --
2005-04-14 2:38 [patch] set prefix on PPC Hollis Blanchard
2005-04-14 17:13 ` Marco Gerards
2005-04-15 20:24 ` Marco Gerards
2005-04-17 18:42 ` Hollis Blanchard
2005-04-17 19:23 ` Marco Gerards
2005-04-17 18:33 Hollis Blanchard
2005-04-17 19:38 ` Marco Gerards
2005-04-17 20:32 ` Hollis Blanchard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mzu8tiid.fsf@marco.marco-g.com \
--to=metgerards@student.han.nl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.