[oe-commits] org.oe.dev arm-kernel-shim: Update DSM-G600 kernel shim to supply a default cmline,

mwester commit openembedded-commits at lists.openembedded.org
Thu Feb 15 10:53:35 UTC 2007


arm-kernel-shim: Update DSM-G600 kernel shim to supply a default cmline,
if the cmdline passed in from the bootloader is empty or missing.

Author: mwester at openembedded.org
Branch: org.openembedded.dev
Revision: 3da5174282c3cc65d9982b13c8d2c63c267fddb0
ViewMTN: http://monotone.openembedded.org/revision.psp?id=3da5174282c3cc65d9982b13c8d2c63c267fddb0
Files:
1
packages/arm-kernel-shim/files/cmdline_if_none.patch
packages/arm-kernel-shim/arm-kernel-shim_1.3.bb
packages/arm-kernel-shim/files/config-dsmg600.h
Diffs:

#
# mt diff -r4a9a7e8f070b07c9351e88a6d0acde26d4917fb0 -r3da5174282c3cc65d9982b13c8d2c63c267fddb0
#
# 
# 
# add_file "packages/arm-kernel-shim/files/cmdline_if_none.patch"
#  content [21754ae4519bcefbc50272616e7c02efb8409395]
# 
# patch "packages/arm-kernel-shim/arm-kernel-shim_1.3.bb"
#  from [f76553f2032435dab3f62170824a3f9d82c6beaf]
#    to [35e2491006be731ffcdddfb61fe3470a550ea0d2]
# 
# patch "packages/arm-kernel-shim/files/config-dsmg600.h"
#  from [c81a661c49e1b83e23275cfce5a32e290fc013a8]
#    to [685904f931afe9e792c363210f3b6696fdce3444]
# 
============================================================
--- packages/arm-kernel-shim/files/cmdline_if_none.patch	21754ae4519bcefbc50272616e7c02efb8409395
+++ packages/arm-kernel-shim/files/cmdline_if_none.patch	21754ae4519bcefbc50272616e7c02efb8409395
@@ -0,0 +1,45 @@
+--- arm-kernel-shim-1.3/main.c.orig	2007-02-14 19:05:35.000000000 -0600
++++ arm-kernel-shim-1.3/main.c	2007-02-14 22:48:06.000000000 -0600
+@@ -153,6 +153,42 @@
+   p->hdr.tag		= ATAG_NONE;
+   p->hdr.size		= 0;
+ 
++#else
++
++#ifdef CMDLINE_IF_NONE
++
++  /* Walk over the ATAG list, we need to find the end of the list.
++   * If we find a command line tag, stash away the pointer to the
++   * actual command line itself.  Note that the implementation
++   * below assumes a single ATAG_CMDLINE passed in from the
++   * bootloader, which may not be a good assumption in all cases.
++   */
++  {
++    char *c = 0;
++    for_each_tag(p, (struct tag*) PHYS_PARAMS)
++      if (p->hdr.tag == ATAG_CMDLINE) c = p->u.cmdline.cmdline;
++
++  /* p -> final tag (ATAG_NONE), and c -> command line if found */
++  /* if no ATAG_CMDLINE, or command line is empty, add the default one. */
++
++    if ((c == 0) || (*c == 0)) {
++      p->hdr.tag = ATAG_CMDLINE;
++      p->hdr.size = tag_size (tag_cmdline)
++        + (sizeof (cmdline)+3)/4 - 1;
++      {
++        const char* sz = cmdline + offset;
++        int i;
++        for (i = 0; i < sizeof (cmdline); ++i)
++          p->u.cmdline.cmdline[i] = sz[i];
++      }
++      p = tag_next (p);
++      p->hdr.tag = ATAG_NONE;
++      p->hdr.size = 0;
++    }
++  }
++
++#endif
++
+ #endif
+ 
+ 	/* Pass control to the kernel */
============================================================
--- packages/arm-kernel-shim/arm-kernel-shim_1.3.bb	f76553f2032435dab3f62170824a3f9d82c6beaf
+++ packages/arm-kernel-shim/arm-kernel-shim_1.3.bb	35e2491006be731ffcdddfb61fe3470a550ea0d2
@@ -1,14 +1,15 @@ LICENSE = "GPL"
 DESCRIPTION = "ARM Kernel Shim"
 SECTION = ""
 PRIORITY = "optional"
 HOMEPAGE = "http://wiki.buici.com/twiki/bin/view/Main/ApexBootloader"
 LICENSE = "GPL"
-PR = "r3"
+PR = "r4"
 
 COMPATIBLE_MACHINE = "(ixp4xx|nslu2)"
 
 SRC_URI = "ftp://ftp.buici.com/pub/arm/arm-kernel-shim/arm-kernel-shim-${PV}.tar.gz \
 	   file://passthrough-atags.patch;patch=1 \
+	   file://cmdline_if_none.patch;patch=1 \
 	   file://config-nslu2.h \
 	   file://config-nas100d.h \
 	   file://config-dsmg600.h \
============================================================
--- packages/arm-kernel-shim/files/config-dsmg600.h	c81a661c49e1b83e23275cfce5a32e290fc013a8
+++ packages/arm-kernel-shim/files/config-dsmg600.h	685904f931afe9e792c363210f3b6696fdce3444
@@ -22,14 +22,17 @@
 //#define RAM_BANK1_START	   0xd0000000
 //#define RAM_BANK1_LENGTH   0x10000000
 
-//#define COMMANDLINE\
-// "init=/linuxrc root=/dev/mtdblock2 rootfstype=jffs2 rw noirqdebug console=ttyS0,115200n8"
+#define COMMANDLINE \
+ "init=/linuxrc root=/dev/mtdblock2 rootfstype=jffs2 rw noirqdebug console=ttyS0,115200n8"
 
 #define MACH_TYPE		   964
 
 /* The DSM-G600 RedBoot sets up the ATAGs correctly */
 #define PASSTHROUGH_ATAGS
 
+/* but if the command line passed in is empty, use the default above. */
+#define CMDLINE_IF_NONE
+
 /* Uncomment one of these if you need to switch the CPU into a
    specific mode. */
 //#define FORCE_LITTLEENDIAN






More information about the Openembedded-commits mailing list