Index: build_image |
diff --git a/build_image b/build_image |
index 9b94d99c5647889d739952f3e650b1a238e417a2..c521f4bef6c6c3d61b1d28e2cfc7c972dcebc6f2 100755 |
--- a/build_image |
+++ b/build_image |
@@ -74,6 +74,10 @@ DEFINE_integer vboot_max_ios 1024 \ |
DEFINE_string vboot_algorithm "sha1" \ |
"Cryptographic hash algorithm used for 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}" |
@@ -530,6 +534,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. |