base-files: upgrade: nand.sh: mute umount error
authorDaniel Golle <daniel@makrotopia.org>
Thu, 25 Jan 2024 03:06:45 +0000 (03:06 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 1 Feb 2024 00:52:54 +0000 (00:52 +0000)
Send error output of umount to /dev/null to mute error in case
ubiblock device has already been unmounted (which is usually the
case).
Gets rid of bogus error message:
umount: can't unmount /dev/ubiblock0_4: Invalid argument

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/base-files/files/lib/upgrade/nand.sh

index d910bf17915982ed01376f2d74fbece8125ba420..0a6fd8432d4623452b70f3732dfa7fb8efa1622c 100644 (file)
@@ -111,7 +111,7 @@ nand_remove_ubiblock() {
 
        local ubiblk="ubiblock${ubivol:3}"
        if [ -e "/dev/$ubiblk" ]; then
-               umount "/dev/$ubiblk" && echo "unmounted /dev/$ubiblk" || :
+               umount "/dev/$ubiblk" 2>/dev/null && echo "unmounted /dev/$ubiblk" || :
                if ! ubiblock -r "/dev/$ubivol"; then
                        echo "cannot remove $ubiblk"
                        return 1