Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fw-initramfs.git;a=commitdiff;h=fe52952336bf8bd813cd2fe71bad5da9f5b871a8

commit fe52952336bf8bd813cd2fe71bad5da9f5b871a8
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Thu Nov 5 22:55:10 2009 +0100

init_functions.sh
*add some functions for lvm

diff --git a/init_functions.sh b/init_functions.sh
index 68ce182..13f782c 100644
--- a/init_functions.sh
+++ b/init_functions.sh
@@ -137,3 +137,62 @@ swsusp_resume() {
local device=$(ls -lL "${REAL_RESUME}" | sed 's/\  */ /g' | cut -d \  -f 5-6 | 
sed 's/,\ */:/')
[ -f /sys/power/resume ] && echo "${device}" > /sys/power/resume
}
+
+setup_md_device() {
+       local device
+
+       [ -z "$1" ] && device="${root}" || device="$1"
+       [ -z "${device}" ] && return
+
+       if [ `echo ${device}|sed -e 
's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#'` = "/dev/md" ]
+       then
+               good_msg 'Detected real_root as a md device. Setting up the 
device node...'
+               MD_NUMBER=`echo ${device}|sed -e 
's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#'`
+               if [ ! -e /dev/md${MD_NUMBER} ]
+               then
+                       mknod /dev/md${MD_NUMBER} b 9 ${MD_NUMBER} >/dev/null 
2>&1
+                       [ "$?" -ne 0 ] && bad_msg "Creation of 
/dev/md${MD_NUMBER} failed..."
+               fi
+               mdstart ${MDPART} /dev/md${MD_NUMBER}
+       fi
+}
+
+startVolumes() {
+
+       # Here, we check for /dev/device-mapper, and if it exists, we setup a
+       # a symlink, which should hopefully fix bug #142775 and bug #147015
+       if [ -e /dev/device-mapper ] && [ ! -e /dev/mapper/control ]
+       then
+               mkdir -p /dev/mapper
+               ln -sf /dev/device-mapper /dev/mapper/control
+       fi
+
+       if [ "${USE_LVM_NORMAL}" = '1' ]
+       then
+               if [ -e '/bin/vgscan' -a -e '/bin/vgchange' ]
+               then
+                       for dev in ${RAID_DEVICES}
+                       do
+                               setup_md_device "${dev}"
+                       done
+
+                       good_msg "Scanning for Volume Groups"
+                       /bin/vgscan --ignorelockingfailure --mknodes 2>/dev/null
+                       sleep 2
+                       good_msg "Activating Volume Groups"
+                       /bin/vgchange -ay --ignorelockingfailure 2>/dev/null
+
+                       # Disable EVMS since lvm is activated and they dont 
work together.
+                       if [ "${USE_EVMS_NORMAL}" = '1' ]
+                       then
+                               bad_msg "Disabling EVMS Support because LVM 
started"
+                               bad_msg "Do not add dolvm to the cmdline if 
this is not what you want"
+                               bad_msg "LVM and EVMS do not work well together"
+                               USE_EVMS_NORMAL=0
+                       fi
+               else
+                       bad_msg "vgscan or vgchange not found: skipping LVM 
volume group activation!"
+               fi
+       fi
+
+}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to