Updated cloner3 to support installing images from a disk partition with an ext4 LABEL=
[bootimage-initfs.git] / etc / cloner3 / installer.sh
index da31b5d..26d83ef 100755 (executable)
@@ -57,6 +57,21 @@ then
        # revert back to our old directory
        cd - >> /tmp/stdout.log 2>>/tmp/stderr.log
 
+elif [ "${_srclabel}" != "" ]
+then
+       msg -n "Syncing data from ${ANSI_BLUE}LABEL=${_srclabel}${ANSI_DONE} image ${ANSI_BLUE}${_image}${ANSI_DONE}"
+
+       /usr/bin/rsync -avz --numeric-ids \
+               /mnt/media/${_image}/data/  /cloner/mnt/
+       if [ "$?" = "0" ]
+       then
+               ok_msg
+       else
+               fail_msg
+               clone_fatal_error "Failed to sync filesystem data from LABEL=${_srclabel}!"
+       fi
+
+
 # --------------
 #  A standard network RSYNC based install
 # --------------
@@ -131,6 +146,21 @@ then
                        fail_msg
                        fatal_error "Failed to sync node data from CD/DVD"
                fi
+       elif [ "${_srclabel}" != "" ]
+       then
+               header "Installing node specific data"
+               msg -n "Syning node ${ANSI_BLUE}${_node}${ANSI_DONE} data from LABEL=${_srclabel}"
+               rsync -avzc -I --numeric-ids --exclude /.valid \
+                       /cloner/setup/node/ /cloner/mnt \
+                       >> /tmp/stdout.log 2>> /tmp/stderr.log
+
+               if [ "$?" = "0" ]
+               then
+                       ok_msg
+               else
+                       fail_msg
+                       fatal_error "Failed to sync node data from LABEL=${_srclabel}"
+               fi
        else
                header "Installing node specific data"
                server_log "Syncing node ${_node} data from ${_server}" "${_node}"