1

I need to do remote updates on an embedded Linux box that has its rootfs on /dev/sda1.

My first thought was to add an update partition and switch to it on update, but for reasons specific to our solution, I'm restricted to booting only /dev/sda1.

Then I thought I could include a squashfs rootfs file and switch to mounting that, which would let me update /dev/sda1. The squashfs file needs to live on /dev/sda1.

So far I haven't figured out how to mount the squashfs file as my root filesystem. I've tried doing it manually to test:

mkdir /tmp/sda1
mount /dev/sda1 /tmp/sda1
mount -t squashfs /tmp/sda1/rootfs.sqsh /

which, not surprisingly, results in a mount failure (32).

And if that wasn't enough, I'm not able to do chroot in my system.

Any ideas?

  • What you want is something like `pivot_root`—which, naturally, is typically used in init scripts. Is rebooting okay? How exactly does the boot process work? – Daniel B Apr 24 '14 at 17:06
  • Rebooting is definitely ok, and in some cases ideal. I'd never heard of pivot_root, it looks very useful, but from what I see on the man page, it still needs chroot. The boot process uses an EFI boot loader to boot GPT partition /dev/sda1. The linux we're using doesn't allow booting to /dev/sda2, which would have made my life much easier. – user2679165 Apr 24 '14 at 17:30

0 Answers0