Added mounting of /proc and /sys into initrd for grub2 installation
Kyle Sheumaker [Wed, 28 Jan 2015 17:02:18 +0000 (11:02 -0600)]
etc/cloner3/installer.sh

index 7afc41d..5838e03 100755 (executable)
@@ -154,6 +154,36 @@ then
        fi
 fi
 
+# mounting 
+header "Mounting proc & sys filesystem in deployed image"
+if [! -d /cloner/mnt/proc ]
+then
+       mkdir /cloner/mnt/proc
+fi
+
+msg -n "Mounting /cloner/mnt/proc"
+mount -t proc none /cloner/mnt/proc
+if [ "$?" = "0" ]
+then
+       ok_msg
+else
+       fail_msg
+fi
+       
+if [! -d /cloner/mnt/sys ]
+then
+       mkdir /cloner/mnt/sys
+fi
+msg -n "Mounting /cloner/mnt/proc"
+mount -t sysfs none /cloner/mnt/sys
+if [ "$?" = "0" ]
+then
+       ok_msg
+else
+       fail_msg
+fi
+       
+
 header "Installing bootloader"
 while read line
 do
@@ -233,7 +263,7 @@ do
        fi
 
        # if grub2 we generate a grub2 config file too
-       if [ "${GRUB2}" = "9" ]
+       if [ "${GRUB2}" = "1" ]
        then
                if [ -x /cloner/mnt/sbin/grub2-mkconfig ]
                 then
@@ -278,6 +308,10 @@ sort -r -k2 /cloner/setup/filesystems \
 
 header "Unmounting filesystems"
 server_log "Unmounting filesystems" "${_node}"
+
+umount /cloner/mnt/proc
+umount /cloner/mnt/sys
+
 while read line
 do
        FS_DEVICE=`echo $line | awk '{print $1}'`