* [linux-lvm] Please remove bash from lvm2
@ 2008-08-12 4:30 Paul Smith
0 siblings, 0 replies; only message in thread
From: Paul Smith @ 2008-08-12 4:30 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 554 bytes --]
I've been trying to pack a bunch of tools onto an embedded systems and
it's very frustrating how man of them have requirements on bash, for no
real reason. Just a bit more care could easily take care of this
problem. I definitely don't want to be forced to include bash, instead
of using busybox sh for example, only because of a few scripts that
could just as easily be written in standard sh.
Here's a patch that removes bash requirements from lvm_dump. The init
scripts I looked at can be fixed by just changing #!/bin/bash to
#!/bin/sh.
Cheers!
[-- Attachment #2: no-bash.patch --]
[-- Type: text/x-patch, Size: 1630 bytes --]
diff -ubB -r LVM2.2.02.25-orig/scripts/lvm_dump.sh LVM2.2.02.25/scripts/lvm_dump.sh
--- LVM2.2.02.25-orig/scripts/lvm_dump.sh 2007-04-25 10:49:27.000000000 -0400
+++ LVM2.2.02.25/scripts/lvm_dump.sh 2008-08-11 23:09:21.000000000 -0400
@@ -1,5 +1,4 @@
-#!/bin/bash
-# we use some bash-isms (getopts?)
+#!/bin/sh
# lvm_dump: This script is used to collect pertinent information for
# the debugging of lvm issues.
@@ -50,17 +49,17 @@
exit 1
}
-advanced=0
-clustered=0
-metadata=0
+advanced=false
+clustered=false
+metadata=false
while getopts :acd:hm opt; do
case $opt in
- s) sysreport=1 ;;
- a) advanced=1 ;;
- c) clustered=1 ;;
+ s) sysreport=true ;;
+ a) advanced=true ;;
+ c) clustered=true ;;
d) userdir=$OPTARG ;;
h) usage ;;
- m) metadata=1 ;;
+ m) metadata=true ;;
:) echo "$0: $OPTARG requires a value:"; usage ;;
\?) echo "$0: unknown option $OPTARG"; usage ;;
*) usage ;;
@@ -94,7 +93,7 @@
myecho "Creating dump directory: $dir"
echo " "
-if (( $advanced )); then
+if $advanced; then
myecho "Gathering LVM volume info..."
myecho " vgscan..."
@@ -113,7 +112,7 @@
log "$LVM vgs -v > $dir/vgs 2>> $log"
fi
-if (( $clustered )); then
+if $clustered; then
myecho "Gathering cluster info..."
echo "STATUS: " > $dir/cluster_info
echo "----------------------------------" >> $dir/cluster_info
@@ -152,7 +151,7 @@
myecho "Gathering /sys/block listing..."
log "$LS -laR /sys/block > $dir/sysblock_listing"
-if (( $metadata )); then
+if $metadata; then
myecho "Gathering LVM metadata from Physical Volumes..."
log "$MKDIR -p $dir/metadata"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-08-12 4:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-12 4:30 [linux-lvm] Please remove bash from lvm2 Paul Smith
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.