#1092255 overlayroot actually depends on busybox

#1092255#5
Date:
2025-01-06 15:23:25 UTC
From:
To:
When attempting to use overlayroot on a debian (nocloud) stable (bookworm) image,
overlayroot will not work if 'busybox' is not also installed (though it is not
a dependency for overlayroot).

Reproduction:
1. Download a nocloud bookworm image (I'm doing this on an arm64 device)
2. Boot the image, apt-get install overlayroot
3. Edit 'overlayroot.conf' to enable a simple tmpfs
4. Reboot

Expected:
Boot into overlayroot-based system

Actual:
Warnings in overlayroot.log from init, not in an overlayroot-based system

Resolution:
If I install "busybox" at this point, everything will work

#1092255#10
Date:
2025-12-23 11:09:50 UTC
From:
To:
Not sure if the original reporter had the exact same problem as me, but
I can add some analysis and confirm the conclusion "overlayroot
actually depends on busybox"


Note: My case, as well as the original report refers to bookworm,
however I see no changes in either klibc, overlayroot or the Debian
dependencies that would prevent the exact same problem from happening
on trixie.


In my case

- debootstrap bookworm
- apt install --no-install-recommends grub-pc overlayroot linux-image-amd64
- in /etc/overlayroot.local.conf set overlayroot_cfgdisk=/dev/xvdb
- in [/dev/xvdb]/overlayroot.conf set overlayroot=/dev/xvdb

the system booted, but overlayroot did not activate.

I eventually traced the failure down to line 474 of
/usr/share/initramfs-tools/scripts/init-bottom/overlayroot
where trying to mount the cfgdisk using

| mount -o ro "$cfgdev" "$mp"

fails with the error message

| mount [-r] [-w] [-o options] [-t type] [-f] [-i] [-n] device directory


This error message comes from klibc's mount command.
klibc's utils get included in the initramfs as a fallback if busybox is
NOT installed (which is the case with the above setup).

The error message is a bit misleading: The actual cause of the error is
that the overlayroot script does not pass the filesystem type to the
mount command via the -t option.

klibc's mount implementation _requires_ the caller to specify the
filesystem type. (I reported the misleading error message as
https://lists.zytor.com/archives/klibc/2025-December/004856.html )

In this respect klibc's mount differs from busybox, where -t is
optional and busybox will iterate through the supported filesystems
until one works.

In the overlayroot script, mounting of the backing device in line 764
also calls mount without the -t option. This is where the non-cfgdisk
case would fail with klibc.


The conclusion is that overlayroot can not work with klibc's mount
implementation.

In other words: overlayroot needs busybox to work and therefore
should declare it as dependency.


Just like the original reporter, I can confirm that after installing
busybox, rebuilding the initramfs and rebooting, the overlayroot worked.