On Sun, 15 Jun 2025 at 19:10, Alexey Gladkov <leg...@kernel.org> wrote:
>

> This is debatable because there might be something valuable on tmpfs which
> is rootfs too, but I won't insist :)

Correct and insting here is wasting your time AFAIK. Try to upstream
your code here:

https://github.com/NadavTasher/BusyBox

>
> I'm not very familiar with the busybox codebase.
> Does this patch look acceptable ?

Nope, but in this way it looks much better to me.

@@ -244,8 +247,9 @@ int switch_root_main(int argc UNUSED_PARAM, char **argv)
        statfs("/", &stfs); // this never fails
        if ((unsigned)stfs.f_type != RAMFS_MAGIC
         && (unsigned)stfs.f_type != TMPFS_MAGIC
        ) {
+ /* whatever is the current standard, but non-default option anyway */
+ #ifdef OVERLAYFS_MAGIC_MENU_OPTION
+ f ((unsigned)stfs.f_type != OVERLAYFS_MAGIC)
+   bb_simple_error_msg_and_die("root filesystem is not ramfs/tmpfs/overlayfs");
+ else
+ #endif
   bb_simple_error_msg_and_die("root filesystem is not ramfs/tmpfs");
        }

        if (!dry_run) {

Best regards, R-
_______________________________________________
busybox mailing list
busybox@busybox.net
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to