Added support for a post_install.sh script in the image directory
Kyle Sheumaker [Wed, 7 Jan 2015 21:01:09 +0000 (15:01 -0600)]
etc/cloner3/installer.sh

index 7f9f5f1..9c911a5 100755 (executable)
@@ -231,6 +231,20 @@ do
 
 done < /cloner/setup/bootloader
 
+# if a post install script exists we execute it
+if [ -e /cloner/setup/post_install.sh ]
+do
+       msg -n "Found a post_install.sh script executing it"
+       server_log "Executing post_install.sh '${_node}' '${_image}' '${_server}'" "${_node}"
+
+       cp /cloner/setup/post_install.sh /cloner/mnt/tmp/post_install.sh
+       chmod +x /cloner/mnt/tmp/post_install.sh
+
+       chroot /cloner/mnt /tmp/post_install.sh "${_node}" "${_image}" "${_server}"
+       rm -f /cloner/mnt/tmp/post_install.sh
+       
+done
+
 # we want to sort our filesystems via the mntpoint field so we can unmount them in
 # the reverse order
 sort -r -k2 /cloner/setup/filesystems \