[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

lvm-version -- beginning of wrapper (was: Re: lvm - I'll maintain it. - ITP lvm24)



Hi

lewis@sistina.com schrieb:
> I can almost guarantee that the protocol will change during the 2.4.* kernels.
> And I can also tell you that there is a backpatch for the 2.2.x kernels.  LVM
> 0.8.1 and LVM 0.9 work with both 2.2.x and 2.4.x. 

Regardless of this it should be possible to have multiple
versions of the lvm tools installed at once, and it should Just
Work (TM).

Probably we should come up with a lvm-common package that
contains a wrapper. I tried to script a LVM version detector,
but don't have any other versions than 0.8i around, thus I'd
appreciate if others could verify that this works:

------ lvm-version
#! /bin/sh

set -e

# figure out the version of LVM in the kernel.

# mount proc in case it is not yet there
if [ ! -f /proc/uptime ]; then
        [ -d /proc || mkdir /proc
        mount -t proc none /proc
fi

# check for lvm support
if [ ! -f /proc/lvm ]; then
        echo 'No lvm support in kernel.'
        exit 1
fi

# extract version number.
head -1 /proc/lvm |tr ' ' "\n"|grep '[0-9]\.[0-9]'

-----------

Around this it should be fairly easy to write a wrapper.

ciao, 2ri
-- 
No, I'm not going to explain it.  If you can't figure it out, you didn't
want to know anyway...  :-)
             -- Larry Wall in <1991Aug7.180856.2854@netlabs.com>



Reply to: