On 15/06/2025 14:48, Alexey Gladkov wrote:
If a mounted image is used as root, overlayfs is typically used to
provide write access. In this case, it is safe to execute switch_root.

But when overlayfs is used, this does not guarantee that it is safe, and does risk the exact sort of destructive behaviour that is meant to be protected against. It's only safe with specific uses of overlayfs.

util-linux's version of switch_root does the same ramfs/tmpfs check that busybox does, but reacts to it differently: rather than exiting with an error for other file systems, it simply prints a warning and carries on without removing any files. Would doing that instead in busybox too be enough to work for your use case?

Cheers,
Harald van Dijk
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to