]> xenbits.xen.org Git - xenclient/build.git/commitdiff
Add support for installing files
authorJames Mckenzie <jamesmck@taoand.(none)>
Fri, 11 Sep 2009 16:02:32 +0000 (17:02 +0100)
committerJames Mckenzie <jamesmck@taoand.(none)>
Fri, 11 Sep 2009 16:02:32 +0000 (17:02 +0100)
target/generic/target_xenclient_installer_skeleton/install/stages/Trash-and-install
target/generic/target_xenclient_installer_skeleton/install/stages/Upgrade
target/generic/target_xenclient_installer_skeleton/install/stages/functions

index a97bf9d2839d67625ad8a5695be7d75383082e9b..89405c16b1d4152f8a0f4b1d6620b7d95e77aa90 100755 (executable)
@@ -123,6 +123,7 @@ install_xc_packages()
             ;;
             iovm) install_iovm_rootfs "${PACKAGE_FILE}" "${PACKAGE_TYPE}"
             ;;
+           file) install_file "${PACKAGE_FILE}" "${DESTINATION}"
             *) [ 1 = 0 ]
             ;;
         esac
index 14eab2c03941df09c0eea7e89de19015d552d59d..460151e35d36c6c2590e08559bd7e0e7ece8f037 100755 (executable)
@@ -64,6 +64,9 @@ upgrade_iovm()
         fi
         break
     ;;
+    file) install_file "${PACKAGE_FILE}" "${DESTINATION}"
+       break
+    ;;
     esac
 }
 iterate_over_packages upgrade_iovm
index 196427ca661e0121ba13d53bf96bb1434c1ed43d..b3ca0bb391f74797950266e8a2672749c459a362 100644 (file)
@@ -358,6 +358,35 @@ bootfs_includes_packages()
     return 1
 }
 
+#--------------
+#Install a file
+#--------------
+install_file()
+{
+    SRC="$1"
+    DST="$2"
+
+    file_unwind()
+    {
+        do_cmd umount /mnt/xenclient/storage 2>/dev/null
+        do_cmd umount /mnt/xenclient
+        return 1 # this enables "file_unwind || return 1" for error handling below
+    }
+
+    mkdir -p /mnt/xenclient                                                       || return 1
+    do_cmd mount /dev/xenclient/root /mnt/xenclient >&2                           || return 1
+    do_cmd mount /dev/xenclient/storage /mnt/xenclient/storage >&2 || file_unwind || return 1
+
+    cp "${SRC}" "/mnt/xenclient/${DST}"                            || file_unwind || return 1
+
+
+    file_unwind 
+    
+    return 0
+}
+
+
+
 #-----------------------------------------------------------
 # IOVM install/upgrade function
 # This function will erase any previous existing IOVM
@@ -434,6 +463,7 @@ iterate_over_packages()
            COMPONENT="$(echo "${LINE}" | cut -f1 -d,)"
         PACKAGE_TYPE="$(echo "${LINE}" | cut -f4 -d,)"
             FILENAME="$(echo "${LINE}" | cut -f6 -d,)"
+         DESTINATION="$(echo "${LINE}" | cut -f7 -d,)"
 
         "${func_to_run}" || return "$?"
     done