Why '-c DEV' option for switch_root?

Harald Becker ralda at gmx.de
Mon Dec 16 22:48:09 UTC 2013


Hi Laurent,

I won't say you are wrong, as most of your arguments are the
reason why I prefer to use real root file systems, but ...

>  A real filesystem (squashfs or otherwise) is independent from
> the kernel.

Despite it's possible to bundle an initramfs with the kernel, the
initramfs is just an cpio archiv and may be loaded separate from
kernel. So it's independent of a specific kernel.


> You don't have to reboot to test it in a real live working
> environment.

mount a tmpfs and extract cpio archiv to this tmpfs then you may
test in you live working environment. That may be one command
more to extract the archive, compared with other file systems (if
you have mount which does loop device handling).

> You can develop it in an emulator to avoid cross-compiling.

Why shall this not be possible with an intramfs? Mount tmpfs,
extract archiv, run emulator?

> You can copy the archive around and mount it as is on another
> machine.

Can't you copy around a cpio archive? You only describe initramfs
bundled with a kernel, but this is a special case.

> You can keep your userland firmware and your kernel entirely
>separate, and even perform live firmware upgrades.

Live firmware upgrades on a read only file system? How do you do
this? You need to at least create a new squashfs image. If yourr
flash does not contain an underlying file system with lots of
extra space you can't install the new image. If your flash device
does only contain the squashfs as bare file system, you need to
overwrite this image. Live update?

> Additionally, disk or even flash is cheaper than RAM. If you
> have a little mass storage, you can store a bajillion utilities
> or recovery stuff on it, and fail gracefully if your remote
> server is down,

What is different here? Why can't you access your utilities
from a mass storage drive when booting with an initramfs? Just
check and mount the local file system then you have access.

> whereas you probably don't want to keep too many things in an
> initramfs.

Right, initramfs shouldn't be overloaded. Putting there only the
required minimum to bring up the system, but from there to more
local storage is just a mount.

... still have the question: How is a read only file system, like
squashfs easier to maintain than a initramfs? IMO you only
compare with kernel bundled initramfs usage, but initramfs means
cpio archiv which may be loaded separately.

Please don't misunderstand. I'm pro static root file system and
avoid using big kernel bundled initramfs or initrd usage, but I
don't see it being easier to maintain, except on full read
writeable file systems (but we were talking about squashfs).

--
Harald


More information about the busybox mailing list