Hello. On Mon, Jun 16, 2025 at 1:40 AM Harald van Dijk <har...@gigawatt.nl> wrote: > Whether it's enough to cover the concerns in the comment > > > // Additional sanity checks: we're about to rm -rf /, so be REALLY > > SURE > > // we mean it. I could make this a CONFIG option, but I would get > > email > > // from all the people who WILL destroy their filesystems. > > I'm not qualified to comment on, will leave that for others. :)
My two cents here. I think the in-code comment makes sense and it's better to NOT implement the option allowing the users to accidentally trash their filesystems. On 15/06/2025 16:09, Alexey Gladkov wrote: > On Sun, Jun 15, 2025 at 03:35:17PM +0100, Harald van Dijk wrote: >> 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? > > Yes, it will absolutely be better than a fatal error. I'm using > switch_root in initramfs and of course I'd like to clean up root, but this > way at least I can use switch_root from busybox. I'm +1 for util-linux's approach. It's simple and addresses Alexey's overlayfs problem without being destructive. Alexey has said that overlayfs won't touch the lower layer, and thus in this case, deleting files from an overlayfs root might not free memory that much as you would think. Here, it might be better to leave the files alone and not 'rm -rf' them. _______________________________________________ busybox mailing list busybox@busybox.net https://lists.busybox.net/mailman/listinfo/busybox