compile error when using MEMREADOOB in do_mounts.c.

Paul Wong paul.wong at
Fri Jan 3 04:22:36 EST 2003

Firstly, thanks Thomas,

Let me to explain my system: I separate three partitions of NAND flash
/dev/mtd0   for kernel image , use dd if=xxx.img of=/dev/mtd0
/dev/mtd1   for rootfs image , use dd if=roofts.img of=/dev/mtd1
/dev/mtd2   for jffs2 filesystem

Firstly, system decompress and run the compressed kernel image in mtd0, then
the kernel (kernel 2.4.20)will decompress the rootfs image in mtd1 to
ramdisk. ( I modified the do_mounts.c to do it). Finally, I success to boot
up and run normal. But, I see fill_inbuf() in do_mounts.c, it only use the
read(..) functon to get the content of the rootfs.img (/dev/mtd1), is it
care the bad block??

best regards,

----- Original Message -----
From: "Thomas Gleixner" <tglx at>
To: "Paul Wong" <paul.wong at>; <linux-mtd at>
Sent: Friday, January 03, 2003 4:52 PM
Subject: Re: compile error when using MEMREADOOB in do_mounts.c.

> On Friday 03 January 2003 08:56, Paul Wong wrote:
> > Dear All,
> >
> >     I modified the init/do_mounts.c to want to skip the invalid block.
> > than make bzImage, that result say: undefined reference to 'ioctl'. What
> > the problem?
> ioctl is part of userspace library. You can not use glibc functions inside
> kernel.
> What's the deeper sense of  this modification ? Bad block handling is done
> the filesystem and the mtd drivers.
> --
> Thomas
> ____________________________________________________
> linutronix - competence in embedded & realtime linux
> mail: tglx at

More information about the linux-mtd mailing list