From 401af3c26f64731470b9429b54ad488f4c9689a5 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Fri, 6 Aug 2021 09:29:44 +0800 Subject: [PATCH] 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 Signed-off-by: Daniel Golle Co-authored-by: Daniel Golle --- package/base-files/files/lib/upgrade/stage2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index e2259e347..0d2e06033 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -33,7 +33,7 @@ supivot() { # } 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 \