Updated cloner3 to support installing images from a disk partition with an ext4 LABEL=
[bootimage-initfs.git] / etc / cloner3 / get_setup.sh
index c8fe38a..d5c945c 100755 (executable)
@@ -24,6 +24,8 @@ write_client_conf () {
 if [ "${_srcpath}" != "" ]
 then
        header "Copying setup information from ${_srcpath}"
+elif [ "${_srclabel}" != ""]
+       header "Using setup from LABEL=${_srclabel}"
 else
        if [ "${_server}" = "" ]
        then
@@ -108,6 +110,35 @@ then
                fi
        fi
 
+elif [ "${_srclabel}" != "" ]
+then
+
+       msg -n "Copying setup data for image ${_image} from LABEL=${_srclabel}"
+       rsync -v /mnt/media/${_image}/* /cloner/setup \
+               >> /tmp/stdout.log 2>> /tmp/stderr.log
+       if [ "$?" = 0 ]
+       then
+               ok_msg
+       else
+               fail_msg
+       
+               clone_fatal_error "Can't get setup information from /mnt/media/${_image}"
+       fi
+
+       if [ "${_node}" != "" ]
+       then
+               msg -n "Copying node specific data for image=${_image} node=${_node}"
+               cp -av /mnt/media/${_image}/nodes/${_node}/* /cloner/setup/node \
+                       >> /tmp/stdout.log 2>> /tmp/stderr.log
+               if [ "$?" = 0 ]
+               then
+                       ok_msg
+               else
+                       fail_msg
+                       clone_fatal_error "Can't get node specific information from /mnt/media"
+               fi
+       fi
+
 # we are installing from the network
 else
        msg -n "Downloading setup data for image ${_image}"