From 95bdf47a1a22c483893bfdf9e1aeaf83ed0f6533 Mon Sep 17 00:00:00 2001 From: Denis Romanov Date: Mon, 12 Jul 2010 22:44:42 +0400 Subject: [PATCH] Added command line parameter to specify OEM content location. Added populating OEM partner partition with content. Added creating flag file .consider_oobe for OEM partition to get mounted on OOBE. BUG=http://crosbug.com/3828 TEST=Install Chrome OS on the device from USB stick. /mnt/partner_partition contains etc/... directory with customization manifests on first boot. Review URL: http://codereview.chromium.org/2938003 --- build_image | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build_image b/build_image index ad7f11c9da..8d0e7ccdd1 100755 --- a/build_image +++ b/build_image @@ -74,6 +74,10 @@ DEFINE_integer verity_max_ios 1024 \ DEFINE_string verity_algorithm "sha1" \ "Cryptographic hash algorithm used for kernel vboot. Default : sha1" +DEFINE_string oem_customization \ + "$GCLIENT_ROOT/src/platform/assets/oem_customization" \ + "Path to directory containing OEM partner partition contents" + # Parse command line. FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" @@ -532,6 +536,20 @@ create_base_image() { sudo tune2fs -L "${DISK_LABEL}" -U "${UUID}" -c 0 -i 0 "${OEM_LOOP_DEV}" sudo mount "${OEM_LOOP_DEV}" "${OEM_FS_DIR}" + # Populate OEM partner partition. + if [ -n ${FLAGS_oem_customization} ]; then + if [ ! -d ${FLAGS_oem_customization} ]; then + echo "Specified OEM content directory does not exist. exiting." + exit 1 + fi + for ITEM in `ls -A ${FLAGS_oem_customization}` + do sudo cp -a "${FLAGS_oem_customization}/$ITEM" "${OEM_FS_DIR}" + done + sudo find "${OEM_FS_DIR}" -type d -exec chmod 755 "{}" \; + sudo find "${OEM_FS_DIR}" -type f -exec chmod 644 "{}" \; + sudo chown -R root:root "${OEM_FS_DIR}" + fi + # -- Install packages into the root file system -- # We need to install libc manually from the cross toolchain.