Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/beagle copy boot args so they dont get clobb...



details:   https://anonhg.NetBSD.org/src/rev/d8f0da3d7286
branches:  trunk
changeset: 783986:d8f0da3d7286
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Jan 14 11:23:48 2013 +0000

description:
copy boot args so they dont get clobbered later, fixes root= on beagleboard

diffstat:

 sys/arch/evbarm/beagle/beagle_machdep.c |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (47 lines):

diff -r 904826ca27f3 -r d8f0da3d7286 sys/arch/evbarm/beagle/beagle_machdep.c
--- a/sys/arch/evbarm/beagle/beagle_machdep.c   Mon Jan 14 11:00:05 2013 +0000
+++ b/sys/arch/evbarm/beagle/beagle_machdep.c   Mon Jan 14 11:23:48 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: beagle_machdep.c,v 1.34 2013/01/10 17:36:35 macallan Exp $ */
+/*     $NetBSD: beagle_machdep.c,v 1.35 2013/01/14 11:23:48 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.34 2013/01/10 17:36:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.35 2013/01/14 11:23:48 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -189,15 +189,9 @@
 #include "ukbd.h"
 #include <dev/usb/ukbdvar.h>
 
-#ifdef BOOT_ARGS
-#define DEFAULT_BOOT_ARGS BOOT_ARGS
-#else
-#define DEFAULT_BOOT_ARGS "-a"
-#endif
-
 BootConfig bootconfig;         /* Boot config storage */
-static char beagle_default_boot_args[] = DEFAULT_BOOT_ARGS;
-char *boot_args = beagle_default_boot_args;
+static char bootargs[MAX_BOOT_STRING];
+char *boot_args = NULL;
 char *boot_file = NULL;
 
 static uint8_t beagle_edid[128];       /* EDID storage */
@@ -483,8 +477,9 @@
 
        /* "bootargs" env variable is passed as 4th argument to kernel */
        if ((uboot_args[3] & 0xf0000000) == 0x80000000) {
-               boot_args = (char *)uboot_args[3];
+               strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
        }
+       boot_args = bootargs;
        parse_mi_bootargs(boot_args);
 
        /* we've a specific device_register routine */



Home | Main Index | Thread Index | Old Index