From: <smi...@us...> - 2004-03-13 00:27:16
|
Update of /cvsroot/devil-linux/build/config/etc/init.d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26081/config/etc/init.d Modified Files: boot mountfs Log Message: - updated bind to v9.2.3 (Heiko / Oliver Jehle) - fixed error building squid without LDAP support (Heiko / Martin Glazer) - added support for LVM2 to mountfs script (Heiko / Oliver Jehle) - added sys directory when kernel 2.6 is used (Heiko + Oliver Jehle) Index: boot =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/boot,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- boot 5 Mar 2004 01:55:21 -0000 1.18 +++ boot 13 Mar 2004 00:18:35 -0000 1.19 @@ -27,6 +27,14 @@ echo -n "Mounting base Filesystems" mount -n -t proc proc /proc + +# +# mount sys for 2.6 +# +if [ -d /sys ]; then + mount -n -t sysfs sys /sys +fi +# rm -f /etc/mtab cat /proc/mounts > /etc/mtab #mount -t devpts devtps /dev/pts Index: mountfs =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/mountfs,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- mountfs 5 Mar 2004 01:55:21 -0000 1.33 +++ mountfs 13 Mar 2004 00:18:35 -0000 1.34 @@ -25,18 +25,26 @@ # supported LVs LVMTAB="/etc/sysconfig/lvmtab" LVMSYS="devil-linux" -LVMPROC="/proc/lvm/VGs/devil-linux/LVs" +LVM="1" lvm_scan () { local do_display=$1 # scan volume groups and display logical volumes - VGS=$(vgdisplay -c 2>&1 | grep -v "no volume groups found" | cut -f1 -d:) + if [ "$LVM" == "1" ]; then + VGS=$(vgdisplay -c 2>&1 | grep -v "no volume groups found" | cut -f1 -d:) + else + VGS=$(vgdisplay 2>&1 | grep -v "no volume groups found" | grep "VG Name" | awk '{print $3}') + fi if [ -n "$VGS" ]; then for VG in $VGS; do [ -n "$do_display" ] && echo " volume group \"${VG}\"" - LVS=$(lvdisplay -c /dev/$VG/* 2>/dev/null | cut -f1 -d:) + if [ "$LVM" == "1" ]; then + LVS=$(lvdisplay -c /dev/$VG/* 2>/dev/null | cut -f1 -d:) + else + LVS=$(lvdisplay -c /dev/$VG 2>/dev/null | cut -f1 -d:) + fi for LV in $LVS; do [ -n "$do_display" ] && echo " logical volume \"${LV}\"" done @@ -88,25 +96,34 @@ # start LVM if tools are installed if [ -x /sbin/vgscan ] && [ -x /sbin/vgchange ]; then echo "Starting LVM" - modprobe -k lvm-mod - # scan for volume groups and activate them - /sbin/vgscan &> /dev/null + + # if we have lvm2 + if [ -x /sbin/dmsetup ]; then + modprobe -k dm-mod + LVM="2" + /sbin/vgscan --ignorelockingfailure &> /dev/null + else + modprobe -k lvm-mod + /sbin/vgscan &> /dev/null + fi /sbin/vgchange -a y &> /dev/null + # scan for volume groups and activate them + lvm_scan print # if we found the devil-linux vg mount the filesystems - if [ -d $LVMPROC ]; then + if [ -d /dev/$LVMSYS ]; then echo "Devil-Linux Harddisk found, activating..." while read LV LD LT LO L1 L2 LX; do [ $(echo ${LV:-#} | cut -c1) = "#" ] && continue - [ ! -e $LVMPROC/$LV ] && continue + [ ! -e $/dev/LVMSYS/$LV ] && continue eval lv_$LV=1 lvm_mount done < $LVMTAB - for lv in $(ls $LVMPROC); do + for lv in $(ls /dev/$LVMSYS); do if [ $(expand $LVMTAB | grep -c "^$lv ") -eq 1 ]; then read LV LD LT LO L1 L2 LX <<< $(expand $LVMTAB | grep "^$lv ") else |