mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB

  1. #
  2. # This script (which must be sourced and not executed)
  3. # checks kernel version and modifies PATH to use lvm2
  4. # when linux-2.6 is detected.
  5. #
  6. # It creates a directory containing symlinks to /sbin/lvm2
  7. # and inserts it in $PATH as first element.
  8. #
  9. # Thus calling vgscan, vgchange, vgdisplay and so on
  10. # calls the lvm2 binary - when kernel version is 2.6.
  11. #
  12. # Tobias Hintze (c) 2004
  13. #
  14. # $Revision: 1.4 $
  15. #
  16. LVMBINS="
  17. dumpconfig lvchange lvcreate lvdisplay lvextend
  18. lvmchange lvmdiskscan lvmsadc lvmsar lvreduce
  19. lvremove lvrename lvresize lvs lvscan
  20. pvchange pvcreate pvdata pvdisplay pvmove
  21. pvremove pvresize pvs pvscan vgcfgbackup
  22. vgcfgrestore vgchange vgck vgconvert vgcreate
  23. vgdisplay vgexport vgextend vgimport vgmerge
  24. vgmknodes vgreduce vgremove vgrename vgs
  25. vgscan vgsplit lvm
  26. "
  27. LVM2WRAPDIR=/sbin/lvm2-wrapper-dir
  28. if [[ `uname -r` == 2.6.* ]]
  29. then
  30. # create symlink-dir
  31. (
  32. mkdir -p $LVM2WRAPDIR
  33. cd $LVM2WRAPDIR
  34. for x in $LVMBINS
  35. do
  36. rm -f $x
  37. ln /sbin/lvm2 $x
  38. done
  39. )
  40. # check kernel/lvm version
  41. PATH=$LVM2WRAPDIR:$PATH
  42. fi
  43. export PATH