developer | 23f9f0f | 2023-06-15 13:06:25 +0800 | [diff] [blame] | 1 | --- a/package/base-files/files/lib/upgrade/nand.sh |
| 2 | +++ b/package/base-files/files/lib/upgrade/nand.sh |
| 3 | @@ -460,6 +460,11 @@ ubi_do_upgrade() { |
| 4 | local dual_boot=$(cat /sys/module/boot_param/parameters/dual_boot 2>/dev/null) |
| 5 | local file_type=$(identify $1) |
| 6 | |
| 7 | + if [ -b /dev/dm-0 ]; then |
| 8 | + v "Detach all device mapper devices" |
| 9 | + dmsetup remove_all |
| 10 | + fi |
| 11 | + |
| 12 | if [ x"${dual_boot}" != xY ]; then |
| 13 | nand_do_upgrade "$1" |
| 14 | return |
| 15 | --- a/target/linux/mediatek/base-files/lib/upgrade/mmc.sh |
| 16 | +++ b/target/linux/mediatek/base-files/lib/upgrade/mmc.sh |
| 17 | @@ -217,6 +217,11 @@ mtk_mmc_do_upgrade_dual_boot() { |
| 18 | mtk_mmc_do_upgrade() { |
| 19 | local dual_boot=$(cat /sys/module/boot_param/parameters/dual_boot 2>/dev/null) |
| 20 | |
| 21 | + if [ -b /dev/dm-0 ]; then |
| 22 | + v "Detach all device mapper devices" |
| 23 | + dmsetup remove_all |
| 24 | + fi |
| 25 | + |
| 26 | if [ x"${dual_boot}" = xY ]; then |
| 27 | mtk_mmc_do_upgrade_dual_boot "$1" |
| 28 | else |
| 29 | --- a/target/linux/mediatek/mt7981/base-files/lib/upgrade/platform.sh |
| 30 | +++ b/target/linux/mediatek/mt7981/base-files/lib/upgrade/platform.sh |
| 31 | @@ -1,4 +1,4 @@ |
| 32 | -RAMFS_COPY_BIN='mkfs.f2fs blkid blockdev fw_printenv fw_setenv' |
| 33 | +RAMFS_COPY_BIN='mkfs.f2fs blkid blockdev fw_printenv fw_setenv dmsetup' |
| 34 | RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock" |
| 35 | platform_do_upgrade() { |
| 36 | local board=$(board_name) |
| 37 | --- a/target/linux/mediatek/mt7986/base-files/lib/upgrade/platform.sh |
| 38 | +++ b/target/linux/mediatek/mt7986/base-files/lib/upgrade/platform.sh |
| 39 | @@ -1,4 +1,4 @@ |
| 40 | -RAMFS_COPY_BIN='mkfs.f2fs blkid blockdev fw_printenv fw_setenv' |
| 41 | +RAMFS_COPY_BIN='mkfs.f2fs blkid blockdev fw_printenv fw_setenv dmsetup' |
| 42 | RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock" |
| 43 | |
| 44 | platform_do_upgrade() { |