113 |
void |
void |
114 |
grub_machine_init (void) |
grub_machine_init (void) |
115 |
{ |
{ |
116 |
|
char args[256]; |
117 |
|
grub_ieee1275_phandle_t chosen; |
118 |
|
int actual; |
119 |
extern char _start; |
extern char _start; |
120 |
|
|
121 |
grub_console_init (); |
grub_console_init (); |
135 |
grub_set_prefix (); |
grub_set_prefix (); |
136 |
|
|
137 |
grub_ofdisk_init (); |
grub_ofdisk_init (); |
138 |
|
|
139 |
|
/* Process commandline. */ |
140 |
|
grub_ieee1275_finddevice ("/chosen", &chosen); |
141 |
|
if (grub_ieee1275_get_property (chosen, "bootargs", &args, |
142 |
|
sizeof args, &actual) == 0 |
143 |
|
&& actual > 1) |
144 |
|
{ |
145 |
|
int i = 0; |
146 |
|
|
147 |
|
while (i < actual) |
148 |
|
{ |
149 |
|
char *command = &args[i]; |
150 |
|
char *end; |
151 |
|
char *val; |
152 |
|
|
153 |
|
end = grub_strchr (command, ';'); |
154 |
|
if (end == 0) |
155 |
|
i = actual; /* No more commands after this one. */ |
156 |
|
else |
157 |
|
{ |
158 |
|
*end = '\0'; |
159 |
|
i += end - command + 1; |
160 |
|
while (grub_isspace(args[i])) |
161 |
|
i++; |
162 |
|
} |
163 |
|
|
164 |
|
/* Process command. */ |
165 |
|
val = grub_strchr (command, '='); |
166 |
|
if (val) |
167 |
|
{ |
168 |
|
*val = '\0'; |
169 |
|
grub_env_set (command, val + 1); |
170 |
|
} |
171 |
|
} |
172 |
|
} |
173 |
} |
} |
174 |
|
|
175 |
void |
void |