/dev/mtdblock/3 is read-only

From: Jørgen Andreas Michaelsen <jorgenam.a.t.ifi.uio.no>
Date: Thu Jul 10 2003 - 07:43:55 EDT

I'm trying to write asset information in linux (image is
bootgpe2-h5400.pb2-h3900.jffs2) on my h5450 (because bootldr does not
support writing asset), but the asset partition (/dev/mtdblock/3) is
write protected. Is it possible to change this on a running system?

Ioctl BLKROSET would be one way to do it, but from looking at
kernel/drivers/mtd/mtdblock.c, it doesn't seem like it's
supported. This is probably a good idea if readonly is set because the
actual hardware doesn't support writes, but not a good idea if one is
asking because one wants to be able to shoot oneself in the
foot. (Perhaps introducing two different flags, one soft write
protection (for writeable devices where one wants to protect users),
and one hard write protection (for when the hardware does not support
writing)?).

(Another way would be to edit
/linux/kernel/drivers/mtd/maps/ipaq-flash.c and remove the
MTD_WRITEABLE from mask_flags. But this is not a very nice
solution. And certainly not a general one.)

-- 
Jørgen
Received on Thu Jul 10 11:45:13 2003

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:41:56 EDT