Chromium Code Reviews| Index: make_factory_package.sh |
| diff --git a/make_factory_package.sh b/make_factory_package.sh |
| index 9e17ad432ad281a86c6b6e87305cebde8ad402ed..b91182d3d19707afaf41adbf307c2fb207e89d72 100755 |
| --- a/make_factory_package.sh |
| +++ b/make_factory_package.sh |
| @@ -28,7 +28,8 @@ DEFINE_string firmware_updater "" \ |
| "If set, include the firmware shellball into the server configuration" |
| DEFINE_string release "" \ |
| "Directory and file containing release image: /path/chromiumos_image.bin" |
| - |
| +DEFINE_string subfolder "" \ |
|
Nick Sanders
2010/10/22 18:06:08
Can you add a comment somewhere in the file that m
|
| + "If set, the name of the subfolder to put the payload items inside" |
| # Parse command line |
| FLAGS "$@" || exit 1 |
| @@ -55,6 +56,10 @@ fi |
| OMAHA_DIR=${SRC_ROOT}/platform/dev |
| OMAHA_DATA_DIR=${OMAHA_DIR}/static/ |
| +if [ ! -z "${FLAGS_subfolder}" ] ; then |
|
Hung-Te
2010/10/22 09:18:12
"! -z" should be replaced by "-n"
|
| + OMAHA_DATA_DIR=${OMAHA_DIR}/static/${FLAGS_subfolder}/ |
| +fi |
| + |
| if [ ${INSIDE_CHROOT} -eq 0 ]; then |
| echo "Caching sudo authentication" |
| sudo -v |
| @@ -68,13 +73,16 @@ RELEASE_IMAGE=`basename ${FLAGS_release}` |
| FACTORY_IMAGE=`basename ${FLAGS_factory}` |
|
Hung-Te
2010/10/22 09:18:12
looks like no need of the blank line here
|
| + |
| prepare_omaha() { |
| sudo rm -rf ${OMAHA_DATA_DIR}/rootfs-test.gz |
| sudo rm -rf ${OMAHA_DATA_DIR}/rootfs-release.gz |
| rm -rf ${OMAHA_DATA_DIR}/efi.gz |
| rm -rf ${OMAHA_DATA_DIR}/oem.gz |
| rm -rf ${OMAHA_DATA_DIR}/state.gz |
| - rm -rf ${OMAHA_DIR}/miniomaha.conf |
| + if [ ! -f "${OMAHA_DATA_DIR}" ] ; then |
| + mkdir -p ${OMAHA_DATA_DIR} |
| + fi |
| } |
| prepare_dir() { |
| @@ -151,20 +159,28 @@ if [ ! -z ${FLAGS_firmware_updater} ] ; then |
| echo "firmware: ${firmware_hash}" |
| fi |
| -echo -n " |
| -config = [ |
| - { |
| +# Are we appending another config? |
| +if [ ! -z "${FLAGS_subfolder}" ] && \ |
|
Hung-Te
2010/10/22 09:18:12
No need the trailing \ . The && implies line conca
|
| + [ -f ${OMAHA_DIR}"/miniomaha.conf" ] ; then |
|
Hung-Te
2010/10/22 09:18:12
Please include the variable in quote, like
-f "${
|
| + sed '$d' < ${OMAHA_DIR}/miniomaha.conf > ${OMAHA_DIR}/miniomaha_tmp.conf |
|
Nick Sanders
2010/10/22 18:06:08
Can you also comment that this is deleting the las
|
| + mv ${OMAHA_DIR}/miniomaha_tmp.conf ${OMAHA_DIR}/miniomaha.conf |
|
Hung-Te
2010/10/22 09:18:12
The sed + mv can be changed to
sed -i '$d' "${OMA
|
| + subfolder=${FLAGS_subfolder}"/" |
|
Hung-Te
2010/10/22 09:18:12
I'd prefer to write this as subfolder="${FLAGS_sub
|
| +else |
| + echo -e "config = [\n" > ${OMAHA_DIR}/miniomaha.conf |
|
Hung-Te
2010/10/22 09:18:12
This will create one more extra line.
I think 'ech
|
| +fi |
| + |
| +echo -n "{ |
| 'qual_ids': set([\"${FLAGS_board}\"]), |
| - 'factory_image': 'rootfs-test.gz', |
| + 'factory_image': '"$subfolder"rootfs-test.gz', |
|
Nick Sanders
2010/10/22 18:06:08
Can you add curly braces around ${subfolder}
|
| 'factory_checksum': '${test_hash}', |
| - 'release_image': 'rootfs-release.gz', |
| + 'release_image': '"$subfolder"rootfs-release.gz', |
| 'release_checksum': '${release_hash}', |
| - 'oempartitionimg_image': 'oem.gz', |
| + 'oempartitionimg_image': '"$subfolder"oem.gz', |
| 'oempartitionimg_checksum': '${oem_hash}', |
| - 'efipartitionimg_image': 'efi.gz', |
| + 'efipartitionimg_image': '"$subfolder"efi.gz', |
| 'efipartitionimg_checksum': '${efi_hash}', |
| - 'stateimg_image': 'state.gz', |
| - 'stateimg_checksum': '${state_hash}'," > ${OMAHA_DIR}/miniomaha.conf |
| + 'stateimg_image': '"$subfolder"state.gz', |
| + 'stateimg_checksum': '${state_hash}'," >> ${OMAHA_DIR}/miniomaha.conf |
| if [ ! -z "${FLAGS_firmware_updater}" ] ; then |
| echo -n " |