  	if [ $? -eq 0 ]; then
  		lvremove $rootdev
 diff -Naurp lxc.orig/src/lxc/lxc-ls.in lxc/src/lxc/lxc-ls.in
---- lxc.orig/src/lxc/lxc-ls.in	2011-12-15 11:54:49.048950070 +0100
-+++ lxc/src/lxc/lxc-ls.in	2011-12-15 11:54:58.769002040 +0100
+--- lxc.orig/src/lxc/lxc-ls.in	2012-01-10 14:10:12.548528394 +0100
++++ lxc/src/lxc/lxc-ls.in	2012-01-20 23:53:18.973343197 +0100
 @@ -1,4 +1,4 @@
 -#!/bin/bash
 +#!/bin/sh

 #
 # lxc: linux Container library
diff -Naurp lxc.orig/src/lxc/lxc-version.in lxc/src/lxc/lxc-version.in
--- lxc.orig/src/lxc/lxc-version.in	2011-12-15 11:54:49.048950070 +0100
+++ lxc/src/lxc/lxc-version.in	2011-12-15 11:54:58.773001543 +0100
@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/bin/sh

Description: Avoid using bashisms in lxc commands.

diff -Naurp lxc.orig/src/lxc/lxc-checkconfig.in lxc/src/lxc/lxc-checkconfig.in
--- lxc.orig/src/lxc/lxc-checkconfig.in	2012-01-10 14:10:12.544528369 +0100
+++ lxc/src/lxc/lxc-checkconfig.in	2012-01-20 23:53:35.001427792 +0100
@@ -1,32 +1,35 @@
-#!/bin/bash
+#!/bin/sh
 
 # Allow environment variables to override grep and config
 : ${CONFIG:=/proc/config.gz}
 : ${GREP:=zgrep}
 
-SETCOLOR_SUCCESS="echo -en \\033[1;32m"
-SETCOLOR_FAILURE="echo -en \\033[1;31m"
-SETCOLOR_WARNING="echo -en \\033[1;33m"
-SETCOLOR_NORMAL="echo -en \\033[0;39m"
+SETCOLOR_SUCCESS () { printf '\033[1;32m'; }
+SETCOLOR_FAILURE () { printf '\033[1;31m'; }
+SETCOLOR_WARNING () { printf '\033[1;33m'; }
+SETCOLOR_NORMAL  () { printf '\033[0;39m'; }
 
-is_set() {
-    $GREP -q "$1=[y|m]" $CONFIG
+is_set () {
+    $GREP -q "$1=[y|m]" "$CONFIG"
     return $?
 }
 
-is_enabled() {
-    mandatory=$2
+is_enabled () {
+    prefix=$1
+    option=$2
+    mandatory=$3
 
-    is_set $1
+    is_set "$option"
     RES=$?
 
+    echo -n "$prefix"
     if [ $RES -eq 0 ]; then
-	$SETCOLOR_SUCCESS && echo -e "enabled" && $SETCOLOR_NORMAL
+	SETCOLOR_SUCCESS && echo "enabled" && SETCOLOR_NORMAL
     else
-	if [ ! -z "$mandatory" -a "$mandatory" = yes ]; then
-	    $SETCOLOR_FAILURE && echo -e "required" && $SETCOLOR_NORMAL
+	if [ ! -z "$mandatory" ] && [ "$mandatory" = yes ]; then
+	    SETCOLOR_FAILURE && echo "required" && SETCOLOR_NORMAL
 	else
-	    $SETCOLOR_WARNING && echo -e "missing" && $SETCOLOR_NORMAL
+	    SETCOLOR_WARNING && echo "missing" && SETCOLOR_NORMAL
 	fi
     fi
 }
@@ -39,7 +42,7 @@ if [ ! -f $CONFIG ]; then
     [ -f "${HEADERS_CONFIG}" ] && CONFIG=${HEADERS_CONFIG}
     [ -f "${BOOT_CONFIG}" ] && CONFIG=${BOOT_CONFIG}
     GREP=grep
-    if [ ! -f $CONFIG ]; then
+    if [ ! -f "$CONFIG" ]; then
         echo
         echo "The kernel configuration can not be retrieved."
         echo "Please recompile with IKCONFIG_PROC, or"
@@ -53,45 +56,45 @@ if [ ! -f $CONFIG ]; then
 fi
 
 echo "--- Namespaces ---"
-echo -n "Namespaces: " && is_enabled CONFIG_NAMESPACES yes
-echo -n "Utsname namespace: " && is_enabled CONFIG_UTS_NS
-echo -n "Ipc namespace: " && is_enabled CONFIG_IPC_NS yes
-echo -n "Pid namespace: " && is_enabled CONFIG_PID_NS yes
-echo -n "User namespace: " && is_enabled CONFIG_USER_NS
-echo -n "Network namespace: " && is_enabled CONFIG_NET_NS
-echo -n "Multiple /dev/pts instances: " && is_enabled DEVPTS_MULTIPLE_INSTANCES
+is_enabled "Namespaces: " CONFIG_NAMESPACES yes
+is_enabled "Utsname namespace: " CONFIG_UTS_NS
+is_enabled "Ipc namespace: " CONFIG_IPC_NS yes
+is_enabled "Pid namespace: " CONFIG_PID_NS yes
+is_enabled "User namespace: " CONFIG_USER_NS
+is_enabled "Network namespace: " CONFIG_NET_NS
+is_enabled "Multiple /dev/pts instances: " DEVPTS_MULTIPLE_INSTANCES
 echo
 echo "--- Control groups ---"
 
 CGROUP_MNT_PATH=$(grep -m1 "^cgroup" /proc/self/mounts | awk '{ print $2 }')
 
-echo -n "Cgroup: " && is_enabled CONFIG_CGROUPS yes
+is_enabled "Cgroup: " CONFIG_CGROUPS yes
 
-if [ -f $CGROUP_MNT_PATH/cgroup.clone_children ]; then
+if [ -f "$CGROUP_MNT_PATH/cgroup.clone_children" ]; then
     echo -n "Cgroup clone_children flag: " &&
-    $SETCOLOR_SUCCESS && echo -e "enabled" && $SETCOLOR_NORMAL
+    SETCOLOR_SUCCESS && echo "enabled" && SETCOLOR_NORMAL
 else
-    echo -n "Cgroup namespace: " && is_enabled CONFIG_CGROUP_NS yes
+    is_enabled "Cgroup namespace: " CONFIG_CGROUP_NS yes
 fi
-echo -n "Cgroup device: " && is_enabled CONFIG_CGROUP_DEVICE
-echo -n "Cgroup sched: " && is_enabled CONFIG_CGROUP_SCHED
-echo -n "Cgroup cpu account: " && is_enabled CONFIG_CGROUP_CPUACCT
-echo -n "Cgroup memory controller: " && is_enabled CONFIG_CGROUP_MEM_RES_CTLR
-is_set CONFIG_SMP && echo -n "Cgroup cpuset: " && is_enabled CONFIG_CPUSETS
+is_enabled "Cgroup device: " CONFIG_CGROUP_DEVICE
+is_enabled "Cgroup sched: " CONFIG_CGROUP_SCHED
+is_enabled "Cgroup cpu account: " CONFIG_CGROUP_CPUACCT
+is_enabled "Cgroup memory controller: " CONFIG_CGROUP_MEM_RES_CTLR
+is_set CONFIG_SMP && is_enabled "Cgroup cpuset: " CONFIG_CPUSETS
 echo
 echo "--- Misc ---"
-echo -n "Veth pair device: " && is_enabled CONFIG_VETH
-echo -n "Macvlan: " && is_enabled CONFIG_MACVLAN
-echo -n "Vlan: " && is_enabled CONFIG_VLAN_8021Q
-KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
-    sed -r 's/.*2.6.([0-9]{2}).*/\1/')
-echo -n "File capabilities: " &&
-    [[ ${KVER_MINOR} < 33 ]] && is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ||
-    [[ ${KVER_MINOR} > 32 ]] &&  $SETCOLOR_SUCCESS && echo -e "enabled" &&
-    $SETCOLOR_NORMAL
-
+is_enabled "Veth pair device: " CONFIG_VETH
+is_enabled "Macvlan: " CONFIG_MACVLAN
+is_enabled "Vlan: " CONFIG_VLAN_8021Q
+KVER=$($GREP "^# Linux" "$CONFIG" | sed -r "s/.*([23])\.([0-9])+\.([0-9]+).*/\1 \2 \3/")
+kernel_version () { echo $(( ( $1 << 16 ) + ( $2 << 8 ) + $3)); }
+echo -n "File capabilities: "
+if [ $(kernel_version $KVER) -le $(kernel_version 2 6 32) ]; then
+        is_enabled CONFIG_SECURITY_FILE_CAPABILITIES
+else
+        SETCOLOR_SUCCESS && echo "enabled" && SETCOLOR_NORMAL
+fi
 echo
 echo "Note : Before booting a new kernel, you can check its configuration"
 echo "usage : CONFIG=/path/to/config $0"
 echo
-
diff -Naurp lxc.orig/src/lxc/lxc-clone.in lxc/src/lxc/lxc-clone.in
--- lxc.orig/src/lxc/lxc-clone.in	2012-01-10 14:10:12.544528369 +0100
+++ lxc/src/lxc/lxc-clone.in	2012-01-20 23:53:18.973343197 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
