base-files: sysupgrade stage2: fix losetup detection (#7601)

If the busybox applet losetup was selected, `command -v` selects that
during sysupgrade. As this applet is in another path and doesn't cover
the '-D' option which is used to make sure user-defined loop devices
are no longer active during sysupgrade.
Detect losetup at the path of the full utility to avoid error messages
in case of the busybox applet being selected.

Reported-by: fda77 <fda77@users.noreply.github.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Co-authored-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Beginner 2021-08-06 09:29:44 +08:00 committed by GitHub
parent a8c2fab607
commit 401af3c26f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ supivot() { # <new_root> <old_root>
}
switch_to_ramfs() {
RAMFS_COPY_LOSETUP="$(command -v losetup)"
RAMFS_COPY_LOSETUP="$(command -v /usr/sbin/losetup)"
RAMFS_COPY_LVM="$(command -v lvm)"
for binary in \