Date: Sun, 16 Oct 2016 04:22:05 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307388 - head/sys/powerpc/powerpc Message-ID: <201610160422.u9G4M52R089538@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Sun Oct 16 04:22:04 2016 New Revision: 307388 URL: https://svnweb.freebsd.org/changeset/base/307388 Log: 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 Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sun Oct 16 02:55:52 2016 (r307387) +++ head/sys/powerpc/powerpc/machdep.c Sun Oct 16 04:22:04 2016 (r307388) @@ -238,6 +238,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ 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_ 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_ OF_bootstrap(); - ofw_parse_bootargs(); + if (ofw_bootargs) + ofw_parse_bootargs(); /* * Initialize the console before printing anything.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610160422.u9G4M52R089538>