Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Issue 2792013: Pack firmware into an image and do update in factory install (separated git). (Closed)

Created:
10 years, 6 months ago by Tom Wai-Hong Tam
Modified:
9 years, 5 months ago
CC:
chromium-os-reviews_chromium.org
Base URL:
ssh://git@chromiumos-git/crosutils.git
Visibility:
Public.

Description

Pack firmware into an image and do update in factory install (separated git). Since different platforms have different instructions to update their firmware. In order not to depend on the install shim, we pack all firmware update files into a single file, i.e. an executable shell script with embedded files. The original CL (http://codereview.chromium.org/2366001) is reviewed and is broken down into 5 CLs. This is one of them.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -7 lines) Patch
M make_factory_package.sh View 6 chunks +34 lines, -7 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Tom Wai-Hong Tam
10 years, 6 months ago (2010-06-11 07:11:16 UTC) #1
adlr
10 years, 6 months ago (2010-06-11 17:22:09 UTC) #2
LGTM

On Fri, Jun 11, 2010 at 12:11 AM, <waihong@chromium.org> wrote:

> Reviewers: adlr, tammo, Nick Sanders,
>
> Description:
> Pack firmware into an image and do update in factory install (separated
> git).
>
> Since different platforms have different instructions to update their
> firmware.
> In order not to depend on the install shim, we pack all firmware update
> files
> into a single file, i.e. an executable shell script with embedded files.
>
> The original CL (http://codereview.chromium.org/2366001) is reviewed and
> is
> broken down into 5 CLs. This is one of them.
>
> Please review this at http://codereview.chromium.org/2792013/show
>
> SVN Base: ssh://git@chromiumos-git/crosutils.git
>
> Affected files:
>  M make_factory_package.sh
>
>
> Index: make_factory_package.sh
> diff --git a/make_factory_package.sh b/make_factory_package.sh
> index
>
005fd255c8c8aabe2e0bcf61306d4082bb8f4c1e..13bcfca99099f6852ebf2d5641683d0e96f9984e
> 100755
> --- a/make_factory_package.sh
> +++ b/make_factory_package.sh
> @@ -24,6 +24,8 @@ get_default_board
>  DEFINE_string board "${DEFAULT_BOARD}" "Board for which the image was
> built"
>  DEFINE_string factory "" \
>   "Directory and file containing factory image:
> /path/chromiumos_test_image.bin"
> +DEFINE_boolean include_firmware $FLAGS_FALSE \
> +  "If set, include the firmware image to the server configuration"
>  DEFINE_string release "" \
>   "Directory and file containing release image: /path/chromiumos_image.bin"
>
> @@ -46,6 +48,7 @@ fi
>  # chars like ~ are processed; just doing FOO=`readlink -f ${FOO}` won't
> work.
>  OMAHA_DIR=${SRC_ROOT}/platform/dev
>  OMAHA_DATA_DIR=${OMAHA_DIR}/static/
> +FIRMWARE_DIR=${SRC_ROOT}/platform/firmware/${FLAGS_board}
>
>  if [ ${INSIDE_CHROOT} -eq 0 ]; then
>   echo "Caching sudo authentication"
> @@ -82,7 +85,7 @@ prepare_dir() {
>  prepare_omaha
>
>  # Get the release image.
> -pushd ${RELEASE_DIR}
> +pushd ${RELEASE_DIR} > /dev/null
>  echo "Generating omaha release image from ${FLAGS_release}"
>  echo "Generating omaha factory image from ${FLAGS_factory}"
>  echo "Output omaha image to ${OMAHA_DATA_DIR}"
> @@ -108,10 +111,10 @@ efi_hash=`cat efi.gz | openssl sha1 -binary | openssl
> base64`
>  mv efi.gz ${OMAHA_DATA_DIR}
>  echo "efi: ${efi_hash}"
>
> -popd
> +popd > /dev/null
>
>  # Go to retrieve the factory test image.
> -pushd ${FACTORY_DIR}
> +pushd ${FACTORY_DIR} > /dev/null
>  prepare_dir
>
>
> @@ -128,7 +131,24 @@ state_hash=`cat state.gz | openssl sha1 -binary |
> openssl base64`
>  mv state.gz ${OMAHA_DATA_DIR}
>  echo "state: ${state_hash}"
>
> -echo "
> +popd > /dev/null
> +
> +if [ ${FLAGS_include_firmware} -eq ${FLAGS_TRUE} ] ; then
> +  pushd ${FIRMWARE_DIR} > /dev/null
> +
> +  ./pack_firmware.sh | gzip -9 > firmware.gz
> +  if [ "${PIPESTATUS[*]}" != "0 0" ]; then
> +    echo "Failed to pack the firmware image."
> +    exit 1
> +  fi
> +  firmware_hash=`cat firmware.gz | openssl sha1 -binary | openssl base64`
> +  mv firmware.gz ${OMAHA_DATA_DIR}
> +  echo "firmware: ${firmware_hash}"
> +
> +  popd > /dev/null
> +fi
> +
> +echo -n "
>  config = [
>  {
>    'qual_ids': set([\"${FLAGS_board}\"]),
> @@ -141,12 +161,19 @@ config = [
>    'efipartitionimg_image': 'efi.gz',
>    'efipartitionimg_checksum': '${efi_hash}',
>    'stateimg_image': 'state.gz',
> -   'stateimg_checksum': '${state_hash}'
> +   'stateimg_checksum': '${state_hash}'," > ${OMAHA_DIR}/miniomaha.conf
> +
> +if [ ! -z ${FLAGS_include_firmware} ] ; then
> +  echo -n "
> +   'firmware_image': 'firmware.gz',
> +   'firmware_checksum': '${firmware_hash}'," >>
> ${OMAHA_DIR}/miniomaha.conf
> +fi
> +
> +echo -n "
>  },
>  ]
> -" > ${OMAHA_DIR}/miniomaha.conf
> +" >> ${OMAHA_DIR}/miniomaha.conf
>
> -popd
>  echo "The miniomaha server lives in src/platform/dev"
>  echo "to validate the configutarion, run:"
>  echo "  python2.6 devserver.py --factory_config miniomaha.conf \
>
>
>

Powered by Google App Engine
This is Rietveld 408576698