summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-04-25 22:58:25 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-05-01 14:45:49 +0100
commiteee2d202ead1a5ee151f39378b670086c1ef17c7 (patch)
tree722ebd72a470703790721914b566e58292ab5fc1
parenta5deda163641d9cc4c8fcee009f27958a0912d14 (diff)
downloadlibguestfs-eee2d202ead1a5ee151f39378b670086c1ef17c7.tar.gz
libguestfs-eee2d202ead1a5ee151f39378b670086c1ef17c7.tar.xz
libguestfs-eee2d202ead1a5ee151f39378b670086c1ef17c7.zip
appliance: Remove some unnecessary errors.
virt-rescue prints errors such as: rm: cannot remove `/proc': Is a directory mkdir: cannot create directory `/proc': File exists rm: cannot remove `/sys': Is a directory mkdir: cannot create directory `/sys': File exists People have reported these errors (which are nothing to worry about) as bugs in the past, so avoid them where possible. (cherry picked from commit beaa5288558fc78304bcd008b9254ae2725017f2)
-rwxr-xr-xappliance/init6
1 files changed, 4 insertions, 2 deletions
diff --git a/appliance/init b/appliance/init
index f44ad7b1..15ced714 100755
--- a/appliance/init
+++ b/appliance/init
@@ -12,9 +12,11 @@ export RUNLEVEL PREVLEVEL
mkdir -p /sysroot
-rm -f /proc; mkdir /proc
+if [ ! -d /proc ]; then rm -f /proc; fi
+mkdir -p /proc
mount -t proc /proc /proc
-rm -f /sys; mkdir /sys
+if [ ! -d /sys ]; then rm -f /sys; fi
+mkdir -p /sys
mount -t sysfs /sys /sys
mkdir -p /run/lock