diff options
author | Julien BLACHE <jblache@debian.org> | 2007-09-26 13:13:36 +0200 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-11-21 16:06:48 +0100 |
commit | f577c71678df55756b7f41838a9c1eb9b2fdb7e8 (patch) | |
tree | 6c6b6431a340aee08d5aeb7af46634dd7a3eb51b /ext2load/conffile.c | |
parent | 7ad3285e7ff99cd2b586620869dedfd2c84588e1 (diff) |
arcboot initrd support patch
Hi Guido,
Attached is a proposed patch for initrd support in arcboot. It's
mostly based on an old patch submitted long ago, with some changes.
I'm using what should be the max page size for the machine to align
the initrd address, that's the offset of the first section of the ELF
image (found that in IRIX' elf manpage, thought it'd be nice to be
able to load kernels with different page sizes).
I've changed the order of the params[] array slightly to add the
initrd to the mix.
It looks like gcc 4.2 brings a ton of new warnings while building
arcboot :/
Tested on IP22 with a standard debian initrd.
JB.
--
Julien BLACHE <jblache@debian.org> | Debian, because code matters more
Debian & GNU/Linux Developer | <http://www.debian.org>
Public key available on <http://www.jblache.org> - KeyID: F5D6 5169
GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169
Signed-off-by: Guido Guenther <agx@sigxcpu.org>
Diffstat (limited to 'ext2load/conffile.c')
-rw-r--r-- | ext2load/conffile.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ext2load/conffile.c b/ext2load/conffile.c index 518ccf1..dbdfaa4 100644 --- a/ext2load/conffile.c +++ b/ext2load/conffile.c @@ -19,8 +19,9 @@ #define _PARM_LIMIT 32 -static char *carray[_PARM_LIMIT+3]; /* 0 is the name, - 1 the boofile, ... +static char *carray[_PARM_LIMIT+4]; /* 0 is the name, + 1 an initrd, + 2 the bootfile, X is OSLoadOptions X+1 ... _PARM_LIMIT are options given on the command line */ @@ -70,18 +71,20 @@ CHAR** GetConfig(char* config, char* name) if (((strcmp(carray[0], name) == 0) && (strcmp(name, carray[0]) == 0))) { return carray; } - /* Reset image & append */ - carray[1]=carray[2]=0; + /* Reset initrd & image & append */ + carray[1]=carray[2]=carray[3]=0; carray[0]=&start[6]; } else if (strncmp("image=",start,6) == 0) { - carray[1]=&start[6]; + carray[2]=&start[6]; + } else if (strncmp("initrd=",start,7) == 0) { + carray[1]=&start[7]; } else if (strncmp("append=",start,7) == 0) { t=&start[7]; /* Does append start with " */ if (*t == '"') { t++; /* If so - append starts +1 */ - carray[2]=t; + carray[3]=t; /* Search ending quote */ while(*t != '"' && *t != 0x0) t++; @@ -89,9 +92,9 @@ CHAR** GetConfig(char* config, char* name) if (*t == '"') *t=0x0; } else - carray[2]=&start[7]; - t=carray[2]; - i=3; + carray[3]=&start[7]; + t=carray[3]; + i=4; while(i<_PARM_LIMIT && *t != 0x0) { t++; |