Fix booting on systems that use loader(8) (most of them).
r306065/r306067 introduced ofw_parse_bootargs(), setting environment variables from Open Firmware's /chosen/bootargs property. On systems booting with loader(8) (meaning, most systems), the initial static kenv is created with no extra space, causing kern_setenv() to panic. Since these already have the environment set directly, there is no need to parse bootargs anyway. Found by: swills
This commit is contained in:
parent
8d249f5e2f
commit
69d251f910
@ -238,6 +238,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp)
|
||||
vm_offset_t startkernel, endkernel;
|
||||
void *kmdp;
|
||||
char *env;
|
||||
bool ofw_bootargs = false;
|
||||
#ifdef DDB
|
||||
vm_offset_t ksym_start;
|
||||
vm_offset_t ksym_end;
|
||||
@ -295,6 +296,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp)
|
||||
bzero(__bss_start, _end - __bss_start);
|
||||
#endif
|
||||
init_static_kenv(init_kenv, sizeof(init_kenv));
|
||||
ofw_bootargs = true;
|
||||
}
|
||||
/* Store boot environment state */
|
||||
OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry);
|
||||
@ -337,7 +339,8 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp)
|
||||
|
||||
OF_bootstrap();
|
||||
|
||||
ofw_parse_bootargs();
|
||||
if (ofw_bootargs)
|
||||
ofw_parse_bootargs();
|
||||
|
||||
/*
|
||||
* Initialize the console before printing anything.
|
||||
|
Loading…
x
Reference in New Issue
Block a user