replace rootfs out from under running programs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a read-only rootfs that I want to update from a userspace
program.  My rootfs is actually a CRAMFS image in a block device
called /dev/mtdblock/1 which can be written to as /dev/mtd/1.  Here is
my plan:

  1.  losetup /dev/loop/0 /path/to/new_rootfs.img
  2.  mount /dev/loop/0 /mnt/newroot
  3.  cd /mnt/new-root
  4.  pivot_root . oldroot
  5.  exec chroot . sh <dev/console >dev/console 2>&1
  6.  umount oldroot
  7.  dd if=/path/to/new_rootfs.img of=/dev/mtd/1
  8.  reboot

The problem is that I have all these applications still running on the
old root fs.  Can I pivot_root out from under them?

If not, how else can I disable them all so that I can rewrite the
CRAMFS root filesystem?

Thanks,
Dave

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux