Upgrading cramfs root file system while running (DENX wrote that is not possible)

Wolfgang Denk wd at denx.de
Sat Apr 22 06:23:08 EST 2006

In message <200604210853.32860.david.jander at protonic.nl> you wrote:
> What do you mean with "something bad could happen"?

System crashes.

> The only thing I can think of is pulling the power plug while flash is being 
> erased or written. What else could go wrong?

The kernel may try to (re-) load some pages of a  running  executable
or  library  which  is  no  longer  available  (at  least  not at the
addresses where they used to be). The kernel will either stumble over
what it believes to be a corrupted file system,  or  load  the  wrong
data -> kaboom.

> We do the following: system running from read-only jffs2 partition. Sometimes 
> that partition is remounted read-write and single files are replaced, but in 
> some occasions we need to upgrade the whole fs. In that case a CGI lodas the 
> image into a ramdisk, and the upgrade process is started. For upgrade, 

You *have* to unmount the old file system here.

> partition, and then "dd" again to copy the image. At that point no critical 
> flash-read access should be requested since dd is already in cache (it's 

The kernel might reload any page of any running executable or library.

Best regards,

Wolfgang Denk

Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Logic and practical information do not seem to apply here."
"You admit that?"
"To deny the facts would be illogical, Doctor"
	-- Spock and McCoy, "A Piece of the Action", stardate unknown

More information about the Linuxppc-embedded mailing list