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.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to