Avoid noise when /proc/swaps does not exist. Closes: #673566
authorJoey Hess <joey@kitenet.net>
Sat, 19 May 2012 19:02:47 +0000 (15:02 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 19 May 2012 19:02:47 +0000 (15:02 -0400)
debian/changelog
os-prober

index 0131869..332dd01 100644 (file)
@@ -1,3 +1,9 @@
+os-prober (1.54) UNRELEASED; urgency=low
+
+  * Avoid noise when /proc/swaps does not exist. Closes: #673566
+
+ -- Joey Hess <joeyh@debian.org>  Sat, 19 May 2012 15:02:26 -0400
+
 os-prober (1.53) unstable; urgency=low
 
   * Team upload
index fc4de2c..2a08736 100755 (executable)
--- a/os-prober
+++ b/os-prober
@@ -110,7 +110,10 @@ done
 # We need to properly canonicalize partitions with mount points and partitions
 # used in RAID
 grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
-grep "^/dev/" /proc/swaps | parse_proc_swaps >"$OS_PROBER_TMP/swaps-map" || true
+: >"$OS_PROBER_TMP/swaps-map"
+if [ -f /proc/swaps ]; then
+       grep "^/dev/" /proc/swaps | parse_proc_swaps >"$OS_PROBER_TMP/swaps-map" || true
+fi
 : >"$OS_PROBER_TMP/raided-map"
 if [ -f /proc/mdstat ] ; then
        grep "^md" /proc/mdstat | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true