#1123810 u-boot-menu: silent failure in the absence of rsync

#1123810#5
Date:
2025-12-22 08:37:03 UTC
From:
To:
Hi,

On my custom Debian + Mobian system, I've installed u-boot-menu while
having apt configured with no-recommends. rsync is just a recommendation
so it was not installed.

However, rsync is used by postinst.d/zz-u-boot-menu script to copy the
devicetree files when the sync dtbs flag is true. So, in my case, those
files were not copied and no warning or error was emitted. So, a silent
failure to copy the devicetree files. The system is unbootable without
those.

That /etc/kernel/postinst.d/zz-u-boot-menu script tests for the present
of rsync command and silently and wrongly skips the syncing if not
found.

Possible solutions:
1. entirely replace rsync with cp(1). (my preferred solution).
Instead of:
        rsync -a "${srcdir}/" "${destdir}/"
use:
	cp -a "${srcdir}/." "${destdir}/"
That seems equivalent to me (I did some local tests). Notice the dot
('.') at the end of $srcdir.

2. make rsync a dependency of u-boot-menu, not just a recommendation

3. fallback to other sync mechanisms, like cp (see 1.), if rsync is
absent

4. print an error if rsync is absent and syncing cannot be done

Thanks,
  Eugen

#1123810#10
Date:
2026-01-27 08:14:08 UTC
From:
To:
So I agree silent failure and unbootable is bad news...

Though the feature is disabled by default, and Recommends are supposed
to be present in all but unusual circumstances...

If the feature was enabled through some other package (one of the Mobian
packages, perhaps?), and you did not disable Recommends yourself (or
maybe ... even if you did), then whatever enabled it should take care to
make sure the required functionality is present.

Agreed that the silent part is definitely a bit unfortunate, although I
vaguely recall we have to be a very careful with stderr/stdout in the
kernel/initramfs hooks...

I originally tried using "cp -a" but quickly found it to be less than
satisfactory due to a handful of real world corner cases, behaving
differently when a directory was or was not already present, some quirks
with handling symlinks, etc. So it requires somme additional
code... whereas rsync "just worked".

I would be amenable to this, but it would definitely require making sure
all the various potential states are handled well...

I think that is overly broad for a non-default feature!

That would require immplementing all the functionality that rsync is
effectively used for, at which point there is no reason to use rsync.

This seems like an avenue worth exploring...


So a well implemented and tested "cp -a" implementation, or at the very
least coming up with some way to notify the user about the suboptimal
configuration seem like the best ways forward...

And of course, possibly better documentation! If nothing else, a comment
in the configuration file next to the U_BOOT_SYNC_DTBS option...


live well,
  vagrant