diff --git a/make_factory_package.sh b/make_factory_package.sh index 30e244c61f..dcbf9449a2 100755 --- a/make_factory_package.sh +++ b/make_factory_package.sh @@ -52,6 +52,8 @@ DEFINE_string firmware_updater "" \ "If set, include the firmware shellball into the server configuration" DEFINE_string hwid_updater "" \ "If set, include the component list updater for HWID validation" +DEFINE_string complete_script "" \ + "If set, include the script for the last-step execution of factory install" DEFINE_string release "" \ "Directory and file containing release image: /path/chromiumos_image.bin" DEFINE_string subfolder "" \ @@ -88,6 +90,12 @@ if [ -n "${FLAGS_hwid_updater}" ] && exit 1 fi +if [ -n "${FLAGS_complete_script}" ] && + [ ! -f "${FLAGS_complete_script}" ]; then + echo "Cannot find complete script ${FLAGS_complete_script}" + exit 1 +fi + # Convert args to paths. Need eval to un-quote the string so that shell # chars like ~ are processed; just doing FOO=`readlink -f ${FOO}` won't work. OMAHA_DIR="${SRC_ROOT}/platform/dev" @@ -360,6 +368,13 @@ generate_omaha() { echo "hwid: ${hwid_hash}" fi + if [ -n "${FLAGS_complete_script}" ]; then + complete_hash="$(compress_and_hash_file "${FLAGS_complete_script}" \ + "complete.gz")" + mv complete.gz "${OMAHA_DATA_DIR}" + echo "complete: ${complete_hash}" + fi + # If the file does exist and we are using the subfolder flag we are going to # append another config. if [ -n "${FLAGS_subfolder}" ] && @@ -419,6 +434,12 @@ generate_omaha() { 'hwid_checksum': '${hwid_hash}'," >>"${OMAHA_CONF}" fi + if [ -n "${FLAGS_complete_script}" ] ; then + echo -n " + 'complete_image': '${subfolder}complete.gz', + 'complete_checksum': '${complete_hash}'," >>"${OMAHA_CONF}" + fi + echo -n " }, ]