mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to replace an executing file on an embedded system?
@ 2005-06-01 22:31 Richard B. Johnson
  2005-06-01 23:37 ` Bernd Eckenfels
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Richard B. Johnson @ 2005-06-01 22:31 UTC (permalink / raw)
  To: Linux kernel


The newer linux kernels have this problem:

Suppose I do this:

cp /sbin/init foo	# Make a copy of 'init'
mv foo /sbin/init	# Rename it back (emulate install)
chmod +x /sbin/init	# Make sure we can boot.

When I try to umount() the file-system, it now fails with
EBUSY (16).

I have tried fsync(), sync(), fsync() on /sbin, etc. I can't
get rid of the busy inodes.

This reared its ugly head with field software upgrades. We
used to be able to upload new software for every executable
on an embedded system using the network or a serial link.

This would replace every file. We would then kill all the
tasks except 'init', unmount the file-system and then reboot.
The upgrade was finished. Every lived happily ever after.
But, with newer kernels, we can't.

What am I missing?  How am I supposed to replace files that
are being executed? Do I have to `mv` them to /tmp and
delete them on the next boot? (not easy, we don't have
a shell, I would have to write code to search /tmp). Also
'init' isn't SYS-V 'init'. It's just the startup program
for a system that keeps growing so I need to be able to
upgrade it.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-02  0:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-01 22:31 How to replace an executing file on an embedded system? Richard B. Johnson
2005-06-01 23:37 ` Bernd Eckenfels
2005-06-02  0:05   ` Al Viro
2005-06-01 23:42 ` Stephen Hemminger
2005-06-02  0:11 ` Miquel van Smoorenburg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®