[linux-lvm] IOP selection scripts (was: '/etc/init.d/lvm' script in debian package)
Claudio Matsuoka
claudio at conectiva.com
Thu Dec 21 23:06:33 UTC 2000
On Thu, 21 Dec 2000, Andreas Dilger wrote:
> Why not simply install it as one of the commands (e.g. vgscan) and make
> hard links to it. Hard links don't even take up inodes - only directory
> entries.
Uhm.. yes, why not?
> gcc -I . -I lib -o lvmiopversion lvmiopversion.c lib/lvm_get_iop_version.c
> lib/lvm_check_special.c
> and stripped it is only 4408 bytes on my system.
Ok, lvm-base SRPM updated and uploaded to
http://distro.conectiva.com.br/experimental/.
Using hardlinks and lvmiopversion the script becomes:
#!/bin/sh
#
# This is a wrapper to call the appropriate LVM userspace tools based
# on the IOP version in use.
#
# 20001221 Claudio Matsuoka <clausio at conectiva.com>
# - using lvmiopversion to get the IOP version
#
# 20001220 Andreas Dilger <adilger at turbolinux.com>
# - fixed return values
# - better error messages
#
# 20001217 Claudio Matsuoka <claudio at conectiva.com>
# - first version
util=`basename $0`
iopver=/sbin/lvmiopversion
if [ ! -x $iopver ]; then
echo "$util: $iopver not found (can't determine IOP version)" 1>&2
exit 1
fi
IOP=`/sbin/lvmiopversion`
liblvm=/lib/lvm-iop${IOP}
lvmpkg=lvm-iop${IOP}
if [ ! -d $liblvm ]; then
echo "$util: $liblvm not found. Is $lvmpkg installed?" 1>&2
exit 3
fi
exec $liblvm/$util "$@" # this will print out a localized error message for us
More information about the linux-lvm
mailing list