mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-30 06:36:34 +00:00
fwupdate: fix partition detection when /boot is unmounted
This commit is contained in:
parent
a5a74b302c
commit
16cfb28aa9
@ -97,9 +97,16 @@ function cleanup_on_exit() {
|
|||||||
#### disk & partition devices ####
|
#### disk & partition devices ####
|
||||||
|
|
||||||
BOOT_DEV=$(mount | grep /boot | cut -d ' ' -f 1)
|
BOOT_DEV=$(mount | grep /boot | cut -d ' ' -f 1)
|
||||||
ROOT_DEV=${BOOT_DEV:0:-1}2
|
if [[ -n "${BOOT_DEV}" ]]; then
|
||||||
DATA_DEV=${BOOT_DEV:0:-1}3
|
ROOT_DEV=${BOOT_DEV:0:-1}2
|
||||||
DISK_DEV=$(mount | grep /boot | cut -d ' ' -f 1)
|
DATA_DEV=${BOOT_DEV:0:-1}3
|
||||||
|
else # boot partition not mounted, trying with data partition
|
||||||
|
DATA_DEV=$(mount | grep /data | cut -d ' ' -f 1)
|
||||||
|
BOOT_DEV=${DATA_DEV:0:-1}1
|
||||||
|
ROOT_DEV=${BOOT_DEV:0:-1}2
|
||||||
|
fi
|
||||||
|
|
||||||
|
DISK_DEV=${BOOT_DEV}
|
||||||
if [[ "${ROOT_DEV}" =~ ^([/a-z0-9]+)(p[0-9])$ ]]; then # e.g. /dev/mmcblk0p2
|
if [[ "${ROOT_DEV}" =~ ^([/a-z0-9]+)(p[0-9])$ ]]; then # e.g. /dev/mmcblk0p2
|
||||||
DISK_DEV=${BASH_REMATCH[1]}
|
DISK_DEV=${BASH_REMATCH[1]}
|
||||||
elif [[ "${ROOT_DEV}" =~ ^([/a-z0-9]+)([0-9])$ ]]; then # e.g. /dev/sdc2
|
elif [[ "${ROOT_DEV}" =~ ^([/a-z0-9]+)([0-9])$ ]]; then # e.g. /dev/sdc2
|
||||||
@ -431,8 +438,12 @@ function extract_status() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f ${FW_FILE_EXTR} && -f ${ROOT_INFO_FILE} ]]; then
|
if [[ -f ${FW_FILE_EXTR} ]]; then
|
||||||
|
if [[ -f ${ROOT_INFO_FILE} ]]; then
|
||||||
echo "done"
|
echo "done"
|
||||||
|
else
|
||||||
|
echo "running"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user