From 0706555513c955296d2586af09f7787efbace053 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Mon, 4 Mar 2002 11:12:57 +0000 Subject: [PATCH] fix various issues --- debian/changelog | 10 ++++++++++ debian/control | 5 +++-- debian/dirs | 1 + debian/init.d | 46 ++++++++++++++++++++++++++++++--------------- debian/postinst | 4 ++-- debian/postrm | 2 +- debian/rules | 5 +++-- debian/undocumented | 14 ++++++++++++++ 8 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 debian/undocumented diff --git a/debian/changelog b/debian/changelog index b2bab224f..cfe99dabd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +lvm2 (0.95.04cvs20020304) unstable; urgency=low + + * CVS updated. + * Enhance init script; create devmapper control device, etc. + * Add dmsetup as a suggestion. + * Add /etc/lvm/lvm.conf conffile. + * Add undocumented(7) for the commands missing manpages. + + -- Andres Salomon Mon, 4 Mar 2002 04:51:26 -0500 + lvm2 (0.95.02cvs20020220) unstable; urgency=low * Initial Release. diff --git a/debian/control b/debian/control index 22eb4e052..71d1e76cd 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Source: lvm2 -Section: devel +Section: admin Priority: optional Maintainer: Andres Salomon Build-Depends: debhelper (>> 3.0.0), libdevmapper-dev, libreadline4-dev @@ -7,9 +7,10 @@ Standards-Version: 3.5.2 Package: lvm2 Architecture: any -Depends: libdevmapper +Depends: libdevmapper0 Replaces: lvm10, lvm-common Provides: lvm-binaries +Suggests: dmsetup Description: The Linux Logical Volume Manager This is LVM2, the rewrite of The Linux Logical Volume Manager. LVM supports enterprise level volume management of disk and disk subsystems diff --git a/debian/dirs b/debian/dirs index c7993967b..90b7cb4d1 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,3 +1,4 @@ +etc/lvm usr/share/man/man5 usr/share/man/man8 sbin diff --git a/debian/init.d b/debian/init.d index 9037a9bf7..673899187 100644 --- a/debian/init.d +++ b/debian/init.d @@ -9,34 +9,50 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=lvm2 DESC=LVM -test -f $DAEMON || exit 0 +test -x /sbin/vgchange || exit 0 +modprobe dm-mod >/dev/null 2>&1 + +# Create necessary files in /dev for device-mapper +create_devfiles() { + DIR="/dev/device-mapper" + FILE="$DIR/control" + major=$(awk '$2 ~ /^misc$/ {print $1}' /proc/devices) + minor=$(awk "\$2 ~ /^$DM_NAME\$/ {print \$1}" /proc/misc) + + if test ! -d $DIR; then + mkdir --mode=755 $DIR >/dev/null 2>&1 + fi + + if test ! -c $FILE -a ! -z "$minor"; then + mknod --mode=600 $FILE c $major $minor >/dev/null 2>&1 + fi +} case "$1" in start) echo -n "Initializing $DESC: " - modprobe dm-mod >/dev/null 2>&1 - vgchange -a y 2>/dev/null - # TODO: attempt to mount all lvm devices; mount -a? + create_devfiles + vgchange -a y + +# # Mount all LVM devices +# for vg in $( vgchange -a y 2>/dev/null | grep active | awk -F\" '{print $2}' ); do +# MTPT=$( grep $vg /etc/fstab | awk '{print $2}' ) +# mount $MTPT +# done echo "$NAME." ;; stop) echo -n "Shutting down $DESC: " - # TODO: attempt to umount all lvm devices; umount -a? - vgchange -a n 2>/dev/null - rmmod dm-mod >/dev/null 2>&1 + # We don't really try all that hard to shut it down; far too many + # things that can keep it from successfully shutting down. + vgchange -a n echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " - # TODO: attempt to umount all lvm devices; umount -a? - vgchange -a n 2>/dev/null - rmmod dm-mod >/dev/null 2>&1 - + vgchange -a n sleep 1 - modprobe dm-mod >/dev/null 2>&1 - vgchange -a y 2>/dev/null - # TODO: attempt to mount all lvm devices; mount -a? - + vgchange -a y echo "$NAME." ;; *) diff --git a/debian/postinst b/debian/postinst index d8c379171..8ee9095df 100755 --- a/debian/postinst +++ b/debian/postinst @@ -25,8 +25,8 @@ set -e case "$1" in configure) -# update-rc.d lvm2 start 25 S . start 50 0 6 . >/dev/null -# /etc/init.d/lvm2 start + update-rc.d lvm2 start 25 S . start 50 0 6 . >/dev/null + /etc/init.d/lvm2 start ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/postrm b/debian/postrm index 35114ee89..3f8e9b1e4 100755 --- a/debian/postrm +++ b/debian/postrm @@ -20,7 +20,7 @@ set -e case "$1" in purge|remove) - # update-rc.d lvm2 remove >/dev/null + update-rc.d lvm2 remove >/dev/null ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/debian/rules b/debian/rules index bde485da1..679cacd78 100755 --- a/debian/rules +++ b/debian/rules @@ -78,6 +78,7 @@ install: build # Add here commands to install the package into debian/lvm2. $(MAKE) install prefix=$(CURDIR)/debian/lvm2 + install -m 0644 doc/example.conf debian/lvm2/etc/lvm/lvm.conf # Build architecture-independent files here. @@ -97,11 +98,11 @@ binary-arch: build install # dh_installemacsen -a # dh_installpam -a # dh_installmime -a - dh_installinit + dh_installinit -n dh_installcron dh_installman dh_installinfo -# dh_undocumented -a + dh_undocumented dh_installchangelogs dh_strip dh_link diff --git a/debian/undocumented b/debian/undocumented new file mode 100644 index 000000000..35ebbefc3 --- /dev/null +++ b/debian/undocumented @@ -0,0 +1,14 @@ +e2fsadm.8 +lvmdiskscan.8 +lvmsadc.8 +lvmsar.8 +lvresize.8 +pvdata.8 +pvmove.8 +pvresize.8 +version.8 +vgcfgrestore.8 +vgexport.8 +vgimport.8 +vgmknodes.8 +vgsplit.8