]> git.proxmox.com Git - grub2.git/commitdiff
Tolerate camcontrol failing to read capacity of IDE devices, until such
authorColin Watson <cjwatson@debian.org>
Wed, 9 Feb 2011 13:29:08 +0000 (13:29 +0000)
committerColin Watson <cjwatson@debian.org>
Wed, 9 Feb 2011 13:29:08 +0000 (13:29 +0000)
time as we know how to do this properly (see #612128).

debian/changelog
debian/postinst.in

index c258afa22d3f4a20cb5230cbad773fd6bbe344a5..362f3aff65307e199e65a589408e0df631f40566 100644 (file)
@@ -6,6 +6,8 @@ grub2 (1.99~rc1-3) UNRELEASED; urgency=low
     #612538).
   * We need at least freebsd-utils (>= 8.0-4) on kFreeBSD architectures for
     camcontrol, so depend on it.
+  * Tolerate camcontrol failing to read capacity of IDE devices, until such
+    time as we know how to do this properly (see #612128).
 
  -- Colin Watson <cjwatson@debian.org>  Wed, 09 Feb 2011 01:04:06 +0000
 
index 81791f4f2829d0c8b38c99beea73c9d3c2b982e1..16d79e31d0aeeecf63ecf44af1242b57bca5fed6 100644 (file)
@@ -149,11 +149,12 @@ sysfs_size()
 # for kFreeBSD
 camcontrol_size()
 {
-  local num_sectors sector_size size
+  local num_sectors sector_size size=
 
-  num_sectors="$(camcontrol readcap "$1" -q -s -N)"
-  sector_size="$(camcontrol readcap "$1" -q -b)"
-  size="$(expr "$num_sectors" \* "$sector_size" / 1000 / 1000)"
+  if num_sectors="$(camcontrol readcap "$1" -q -s -N)"; then
+    sector_size="$(camcontrol readcap "$1" -q -b)"
+    size="$(expr "$num_sectors" \* "$sector_size" / 1000 / 1000)"
+  fi
 
   [ "$size" ] || size='???'
   echo "$size"