From af9c1d946309b4a36577586987c0b0952c9fc0eb Mon Sep 17 00:00:00 2001 From: Chinyue Chen Date: Thu, 15 Sep 2011 16:30:40 +0800 Subject: [PATCH] Make the path and folder of config file available when parsing config. The path and folder of config file is available as env variables and can be used to reference images and updater scripts in config file. BUG=chrome-os-partner:5850 TEST=1. Create a config file (mp_factory.conf) under src/mp_bundle with the following content: [x86-zgb] --factory ${MFP_CONFIG_DIR}/../build/images/${BOARD}/latest/chromiumos_factory_image.bin --release ${MFP_CONFIG_DIR}/../build/images/${BOARD}/latest/[Cc]hromiumos_image.bin --hwid_updater ${MFP_CONFIG_DIR}/../platform/[Cc]hromeos-hwid/hwid_bundle_zgb.sh --firmware_updater none --detect_release_image # Comment. # More comments. [x86-zgb-he] --subfolder x86-zgb-he --factory ${MFP_CONFIG_DIR}/../build/images/${BOARD}/latest/chromiumos_factory_image.bin --release ${MFP_CONFIG_DIR}/../build/images/${BOARD}/latest/chromiumos_image.bin --hwid_updater ${MFP_CONFIG_DIR}/../platform/chromeos-hwid/hwid_bundle_zgb.sh --firmware_updater none --detect_release_image 2. Under src, execute BOARD=x86-zgb scripts/make_factory_package.sh --config mp_bundle/mp_factory.conf Change-Id: I3c9693febe1f7f1efc92ab845d63226911114031 Reviewed-on: http://gerrit.chromium.org/gerrit/7764 Tested-by: Chinyue Chen Reviewed-by: Hung-Te Lin --- make_factory_package.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/make_factory_package.sh b/make_factory_package.sh index 268c817686..429127bd70 100755 --- a/make_factory_package.sh +++ b/make_factory_package.sh @@ -682,6 +682,10 @@ main() { check_empty_param FLAGS_diskimg "when using config file" check_empty_param FLAGS_subfolder "when using config file" + # Make the path and folder of config file available when parsing config. + MFP_CONFIG_PATH="$(readlink -f "$FLAGS_config")" + MFP_CONFIG_DIR="$(dirname "$MFP_CONFIG_PATH")" + parse_and_run_config "$FLAGS_config" exit fi