mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
crosutils: add --hwid_updater in make_factory_package.sh
A new parameter --hwid_updater is added to support updating HWID component list by mini-omaha server. BUG=chrome-os-partner:4276 TEST=./make_factory_package --release RELEASE --factory FACTORY \ --firmware FIRMWARE --hwid hwid_updater.sh # success Change-Id: I5889bf63545f0ed118320b60963e22ebc00c76f7 Reviewed-on: http://gerrit.chromium.org/gerrit/1826 Reviewed-by: Nick Sanders <nsanders@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
This commit is contained in:
parent
981555b638
commit
fbc89da362
@ -50,6 +50,8 @@ DEFINE_string factory "" \
|
||||
"Directory and file containing factory image: /path/chromiumos_test_image.bin"
|
||||
DEFINE_string firmware_updater "" \
|
||||
"If set, include the firmware shellball into the server configuration"
|
||||
DEFINE_string hwid_updater "" \
|
||||
"If set, include the component list updater for HWID validation"
|
||||
DEFINE_string release "" \
|
||||
"Directory and file containing release image: /path/chromiumos_image.bin"
|
||||
DEFINE_string subfolder "" \
|
||||
@ -80,6 +82,12 @@ if [ -n "${FLAGS_firmware_updater}" ] &&
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "${FLAGS_hwid_updater}" ] &&
|
||||
[ ! -f "${FLAGS_hwid_updater}" ]; then
|
||||
echo "Cannot find HWID component list updater ${FLAGS_hwid_updater}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Convert args to paths. Need eval to un-quote the string so that shell
|
||||
# chars like ~ are processed; just doing FOO=`readlink -f ${FOO}` won't work.
|
||||
OMAHA_DIR="${SRC_ROOT}/platform/dev"
|
||||
@ -340,17 +348,18 @@ generate_omaha() {
|
||||
popd >/dev/null
|
||||
|
||||
if [ -n "${FLAGS_firmware_updater}" ]; then
|
||||
SHELLBALL="${FLAGS_firmware_updater}"
|
||||
if [ ! -f "$SHELLBALL" ]; then
|
||||
echo "Failed to find firmware updater: $SHELLBALL."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
firmware_hash="$(compress_and_hash_file "$SHELLBALL" "firmware.gz")"
|
||||
firmware_hash="$(compress_and_hash_file "${FLAGS_firmware_updater}" \
|
||||
"firmware.gz")"
|
||||
mv firmware.gz "${OMAHA_DATA_DIR}"
|
||||
echo "firmware: ${firmware_hash}"
|
||||
fi
|
||||
|
||||
if [ -n "${FLAGS_hwid_updater}" ]; then
|
||||
hwid_hash="$(compress_and_hash_file "${FLAGS_hwid_updater}" "hwid.gz")"
|
||||
mv hwid.gz "${OMAHA_DATA_DIR}"
|
||||
echo "hwid: ${hwid_hash}"
|
||||
fi
|
||||
|
||||
# If the file does exist and we are using the subfolder flag we are going to
|
||||
# append another config.
|
||||
if [ -n "${FLAGS_subfolder}" ] &&
|
||||
@ -404,6 +413,12 @@ generate_omaha() {
|
||||
'firmware_checksum': '${firmware_hash}'," >>"${OMAHA_CONF}"
|
||||
fi
|
||||
|
||||
if [ -n "${FLAGS_hwid_updater}" ] ; then
|
||||
echo -n "
|
||||
'hwid_image': '${subfolder}hwid.gz',
|
||||
'hwid_checksum': '${hwid_hash}'," >>"${OMAHA_CONF}"
|
||||
fi
|
||||
|
||||
echo -n "
|
||||
},
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user