浏览代码

Handle disks marked as SCSI, removable=yes when there are no USB ones

skippie81 8 年之前
父节点
当前提交
7f9810746e
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      platform-upgrade

+ 4 - 1
platform-upgrade

@@ -114,7 +114,10 @@ fi
 
 echo -n "Checking current boot device..."
 if [[ -z $1 ]] ; then
-        removables=($(diskinfo | awk '/^USB/ { print $2 }'))
+        removables=($(diskinfo -pH | awk '/^USB/ { print $2 }'))
+        if [[ ${#removables[@]} -eq 0 ]]; then
+                 removables=($(diskinfo -pH | awk '/^USB|^SCSI.*[0-9]+[ \s\t]+yes/ { print $2 }'))
+        fi
         echo -n " detected ${removables[@]}"
         if [[ ${#removables[@]} -gt 1 ]]; then
                   echo