mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 06:01:41 +02:00
crosutils: add HWID folder when building factory test image
To always have HWID bundles in build output, this CL copies the HWID bundle files from board temporary space into build output folder. The HWID folder in make_netboot is also removed. BUG=chrome-os-partner:5796 TEST=./build_image --factory # see "hwid" folder in build output Change-Id: I8c2cd32c257b117261fba3654b52929c71310c82 Reviewed-on: http://gerrit.chromium.org/gerrit/7331 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
This commit is contained in:
parent
d37eb67163
commit
920482f7f4
@ -63,6 +63,22 @@ emerge_chromeos_test() {
|
||||
emerge_to_image --root="${root_dev_dir}" chromeos-test
|
||||
}
|
||||
|
||||
prepare_hwid_for_factory() {
|
||||
local hwid_dest="$1/hwid"
|
||||
local hwid_src="${BOARD_ROOT}/usr/share/chromeos-hwid"
|
||||
|
||||
# Force refreshing source folder in build root folder
|
||||
sudo rm -rf "${hwid_src}" "${hwid_dest}"
|
||||
emerge_to_image chromeos-hwid
|
||||
if [ -d "${hwid_src}" ]; then
|
||||
# TODO(hungte) After being archived by chromite, the HWID files will be in
|
||||
# factory_test/hwid; we should move it to top level folder.
|
||||
cp -r "${hwid_src}" "${hwid_dest}"
|
||||
else
|
||||
echo "Skipping HWID: No HWID bundles found."
|
||||
fi
|
||||
}
|
||||
|
||||
install_autotest_for_factory() {
|
||||
local autotest_src="${BOARD_ROOT}/usr/local/autotest"
|
||||
local stateful_root="${ROOT_FS_DIR}/usr/local"
|
||||
@ -121,6 +137,7 @@ mod_image_for_test () {
|
||||
if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then
|
||||
emerge_to_image --root="${ROOT_FS_DIR}" factorytest-init
|
||||
|
||||
prepare_hwid_for_factory "${image_dir}"
|
||||
install_autotest_for_factory
|
||||
|
||||
local mod_factory_script
|
||||
|
@ -85,23 +85,6 @@ else
|
||||
echo "Skipping legacy fw: ${SYSROOT}/u-boot/legacy_image.bin not present?"
|
||||
fi
|
||||
|
||||
# Get HWID bundle if available.
|
||||
# TODO(hungte) Move this to chromite because HWID bundles should be archived for
|
||||
# every factory archive instead of builds with netboot.
|
||||
hwid_dir="usr/share/chromeos-hwid"
|
||||
sudo rm -rf hwid
|
||||
mkdir -p hwid
|
||||
if hwid_files=$(ls "${SYSROOT}/${hwid_dir}/" | grep ^hwid_bundle); then
|
||||
echo "Copying HWID bundles: $hwid_files"
|
||||
for file in $hwid_files; do
|
||||
cp "${SYSROOT}/${hwid_dir}/${file}" "hwid/"
|
||||
done
|
||||
else
|
||||
echo "Skipping HWID: ${SYSROOT}/${hwid_dir}/" \
|
||||
"does not contain HWID bundle"
|
||||
fi
|
||||
|
||||
|
||||
# Prepare to mount rootfs.
|
||||
umount_loop() {
|
||||
sudo umount r || true
|
||||
|
Loading…
x
Reference in New Issue
Block a user