FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 08-30-2008, 05:24 AM
Andres Salomon
 
Default Bug#497133: initramfs-tools: explodes when kernel is booted with root=mtd0

Package: initramfs-tools
Version: 0.92f

On OLPC machines, root is a nand device that is mounted as mtd0 (it is
neither a block device nor a char device). The arguments passed to the
kernel are "ro root=mtd0 rootfstype=jffs2".

Unfortunately, attempting to use an initrd based upon initramfs-tools
on such a machine results in a kernel panic and a syntax error.


Begin: Mounting root file system ... /init: line 172: syntax error:
0xmtd0

The probably appears to be in parse_numeric(); the init scripts assume
that normal devices are always prefixed with /, and root= strings that
aren't are raw device numbers (prefixing them with 0x). I'm not sure
if there are other devices similar to mtd that don't begin with a /.



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 09-01-2008, 01:58 PM
maximilian attems
 
Default Bug#497133: initramfs-tools: explodes when kernel is booted with root=mtd0

On Sat, 30 Aug 2008, Andres Salomon wrote:

> Package: initramfs-tools
> Version: 0.92f
>
> On OLPC machines, root is a nand device that is mounted as mtd0 (it is
> neither a block device nor a char device). The arguments passed to the
> kernel are "ro root=mtd0 rootfstype=jffs2".

could you try to give the full device string root=/dev/mtd0

> Unfortunately, attempting to use an initrd based upon initramfs-tools
> on such a machine results in a kernel panic and a syntax error.
>
>
> Begin: Mounting root file system ... /init: line 172: syntax error:
> 0xmtd0
>
> The probably appears to be in parse_numeric(); the init scripts assume
> that normal devices are always prefixed with /, and root= strings that
> aren't are raw device numbers (prefixing them with 0x). I'm not sure
> if there are other devices similar to mtd that don't begin with a /.

parse_numeric is for legacy lilo support, right. does aboves
circumvent it?

thanks for report!

--
maks



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 09-01-2008, 03:22 PM
Andres Salomon
 
Default Bug#497133: initramfs-tools: explodes when kernel is booted with root=mtd0

On Mon, 1 Sep 2008 15:58:15 +0200
maximilian attems <max@stro.at> wrote:

> On Sat, 30 Aug 2008, Andres Salomon wrote:
>
> > Package: initramfs-tools
> > Version: 0.92f
> >
> > On OLPC machines, root is a nand device that is mounted as mtd0 (it
> > is neither a block device nor a char device). The arguments passed
> > to the kernel are "ro root=mtd0 rootfstype=jffs2".
>
> could you try to give the full device string root=/dev/mtd0
>

Already tried that, it simply fails to find root then. I also tried
root=/dev/mtdblock0, but that's not a real solution (mtd block emulation
is slower than just mtd).


> > Unfortunately, attempting to use an initrd based upon
> > initramfs-tools on such a machine results in a kernel panic and a
> > syntax error.
> >
> >
> > Begin: Mounting root file system ... /init: line 172: syntax error:
> > 0xmtd0
> >
> > The probably appears to be in parse_numeric(); the init scripts
> > assume that normal devices are always prefixed with /, and root=
> > strings that aren't are raw device numbers (prefixing them with
> > 0x). I'm not sure if there are other devices similar to mtd that
> > don't begin with a /.
>
> parse_numeric is for legacy lilo support, right. does aboves
> circumvent it?
>
> thanks for report!
>

How about something like the following (untested) patch? It's not foolproof,
but it at least ignores things that can't possibly be hex strings.



--- /usr//share/initramfs-tools/scripts/functions.orig 2008-09-01 11:14:11.000000000 -0400
+++ /usr//share/initramfs-tools/scripts/functions 2008-09-01 11:18:57.000000000 -0400
@@ -242,11 +242,14 @@ parse_numeric() {
minor=${1#*:}
major=${1%:*}
;;
- *)
+ [A-Fa-f0-9]*)
value=$(( 0x${1} ))
minor=$(( ${value} % 256 ))
major=$(( ${value} / 256 ))
;;
+ *)
+ return
+ ;;
esac

mknod -m 600 /dev/root b ${major} ${minor}



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 09-01-2008, 03:37 PM
maximilian attems
 
Default Bug#497133: initramfs-tools: explodes when kernel is booted with root=mtd0

On Mon, Sep 01, 2008 at 11:22:34AM -0400, Andres Salomon wrote:

<snipp>

> How about something like the following (untested) patch? It's not foolproof,
> but it at least ignores things that can't possibly be hex strings.

looks good to me, i'll apply it, tested on dash,
right you can still have non hex but it starts to exclude.



> --- /usr//share/initramfs-tools/scripts/functions.orig 2008-09-01 11:14:11.000000000 -0400
> +++ /usr//share/initramfs-tools/scripts/functions 2008-09-01 11:18:57.000000000 -0400
> @@ -242,11 +242,14 @@ parse_numeric() {

what i'd be interested is the failure that happens with this patch
applied, there is no way $ROOT aka mtd0 will be found?!

--
maks



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 09-02-2008, 04:51 AM
Andres Salomon
 
Default Bug#497133: initramfs-tools: explodes when kernel is booted with root=mtd0

On Mon, 1 Sep 2008 17:37:28 +0200
maximilian attems <max@stro.at> wrote:

> On Mon, Sep 01, 2008 at 11:22:34AM -0400, Andres Salomon wrote:
[...]
>
> > --- /usr//share/initramfs-tools/scripts/functions.orig
> > 2008-09-01 11:14:11.000000000 -0400
> > +++ /usr//share/initramfs-tools/scripts/functions 2008-09-01
> > 11:18:57.000000000 -0400 @@ -242,11 +242,14 @@ parse_numeric() {
>
> what i'd be interested is the failure that happens with this patch
> applied, there is no way $ROOT aka mtd0 will be found?!
>

Correct, but at least it drops me into a shell (rather than giving me a
syntax error and panicking

I'm still trying to figure out how to deal w/ root=mtd0 (and wondering
whether it's even worth dealing with, or if I can do something
clever with UBI or flash partitioning)




--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 09-09-2008, 07:39 AM
maximilian attems
 
Default Bug#497133: initramfs-tools: explodes when kernel is booted with root=mtd0

On Tue, 02 Sep 2008, Andres Salomon wrote:

> I'm still trying to figure out how to deal w/ root=mtd0 (and wondering
> whether it's even worth dealing with, or if I can do something
> clever with UBI or flash partitioning)

how does fedora kernel boot it?
does nash have some hacks one could look at it.
or is it a custom compiled kernel?

--
maks



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 07:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org