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

Issue 2794006: 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/factory_installer.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 (+19 lines, -11 lines) Patch
M factory_install.sh View 2 chunks +19 lines, -11 lines 0 comments Download

Messages

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

On Fri, Jun 11, 2010 at 12:36 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/2794006/show
>
> SVN Base: ssh://git@chromiumos-git/factory_installer.git
>
> Affected files:
>  M factory_install.sh
>
>
> Index: factory_install.sh
> diff --git a/factory_install.sh b/factory_install.sh
> index
>
42bfea5f8d57521b4d05fb7e4b34b8766c552628..fdae9ad493243a946eddcacf0760d91ea01c6e3e
> 100644
> --- a/factory_install.sh
> +++ b/factory_install.sh
> @@ -16,38 +16,45 @@ sleep 10
>
>  # TODO(adlr): pick an install device in a matter that works on x86 and
> ARM.
>  # This works on x86 only, afaik.
> -DST=/dev/sda
> +DST_DRIVE=/dev/sda
>  DST_FACTORY_PART=3
>  DST_RELEASE_PART=5
>  DST_OEM_PART=8
>  DST_EFI_PART=12
>  DST_STATE_PART=1
> +DST_FIRMWARE=/tmp/firmware.sh
>
>  log "Factory Install: Setting partition table"
>
> -/usr/sbin/chromeos-install --dst "${DST}" --skip_rootfs --run_as_root
> --yes \
> -  2>&1 | cat >> "$MEMENTO_AU_LOG"
> +/usr/sbin/chromeos-install --dst "${DST_DRIVE}" --skip_rootfs
> --run_as_root \
> +  --yes 2>&1 | cat >> "$MEMENTO_AU_LOG"
>
>  # Load the new partition table. The autoupdater has trouble with loop
> devices.
>  sync
>  echo 3 > /proc/sys/vm/drop_caches
> -/sbin/sfdisk -R "$DST"
> +/sbin/sfdisk -R "$DST_DRIVE"
>
>  FACTORY_CHANNEL_ARG='--force_track=factory-channel'
>  RELEASE_CHANNEL_ARG='--force_track=release-channel'
>  OEM_CHANNEL_ARG='--force_track=oempartitionimg-channel'
>  EFI_CHANNEL_ARG='--force_track=efipartitionimg-channel'
>  STATE_CHANNEL_ARG='--force_track=stateimg-channel'
> +FIRMWARE_CHANNEL_ARG='--force_track=firmware-channel'
>
>  # Install the partitions
> -for i in EFI OEM STATE RELEASE FACTORY; do
> -  PART=$(eval "echo \$DST_${i}_PART")
> -  CHANNEL_ARG=$(eval "echo \$${i}_CHANNEL_ARG")
> -  KPART="none"
> +for i in EFI OEM STATE RELEASE FACTORY FIRMWARE; do
> +  if [ "$i" = "FIRMWARE" ]; then
> +    DST="${DST_FIRMWARE}"
> +  else
> +    PART=$(eval "echo \$DST_${i}_PART")
> +    DST="${DST_DRIVE}${PART}"
> +  fi
>
> -  log "Factory Install: Installing $i partition to $PART"
> +  log "Factory Install: Installing $i image to $DST"
>
> +  CHANNEL_ARG=$(eval "echo \$${i}_CHANNEL_ARG")
>   SKIP_POSTINST_ARG="--skip_postinst"
> +  KPART="none"
>   if [ "$i" = "FACTORY" -o "$i" = "RELEASE" ]; then
>     # Set up kernel partition
>     SKIP_POSTINST_ARG=""
> @@ -55,10 +62,11 @@ for i in EFI OEM STATE RELEASE FACTORY; do
>   fi
>
>   RESULT="$(/opt/google/memento_updater/memento_updater.sh --dst_partition
> \
> -    "${DST}${PART}" --kernel_partition "${KPART}" \
> +    "${DST}" --kernel_partition "${KPART}" \
>     --allow_removable_boot $CHANNEL_ARG $SKIP_POSTINST_ARG)"
>
> -  if [ "$RESULT" != "UPDATED" ]; then
> +  # Firmware update is optional; still OK if it does not be updated.
> +  if [ "$RESULT" != "UPDATED" -a "$i" != "FIRMWARE" ]; then
>     log "Factory Install: AU failed"
>     exit 1
>   fi
>
>
>

Powered by Google App Engine
This is Rietveld 408576698