mirror of https://github.com/OpenIPC/firmware.git
unmount sdcard, check for autoupdate files.
parent
5111f09276
commit
3a27a3fcba
|
@ -130,11 +130,21 @@ self_update() {
|
|||
}
|
||||
|
||||
check_sdcard() {
|
||||
if mount | grep /mnt/mmc >/dev/null; then
|
||||
echo_c 31 "\nCannot upgrade! There is a mounted SD card in the slot!"
|
||||
echo_c 37 "Please remove the card from the slot and restart sysupgrade."
|
||||
exit 1
|
||||
fi
|
||||
echo_c 33 "\nUnmounting SD card"
|
||||
stoplist="autoupdate-kernel.img autoupdate-rootfs.img autoupdate-uboot.img"
|
||||
while [ -n "$(mount | grep /mnt/mmc)" ]; do
|
||||
_d=$(mount | grep /mnt/mmc | tail -1 | awk '{print $1}')
|
||||
echo_c 34 "$_d"
|
||||
for _f in $stoplist; do
|
||||
echo "- checking for ${_d}/${_f}"
|
||||
if [ -f "${_d}/${_f}" ]; then
|
||||
echo_c 31 "\nCannot upgrade! Recovery file ${_d}/${_f} found on the mounted SD card!"
|
||||
echo_c 37 "Please remove the card from the slot and restart sysupgrade."
|
||||
exit 1
|
||||
fi
|
||||
done; unset _f
|
||||
umount $_d
|
||||
done; unset _d
|
||||
}
|
||||
|
||||
create_lock() {
|
||||
|
|
Loading…
Reference in New Issue