Skip to content

Commit

Permalink
Improve compilation speed for android build
Browse files Browse the repository at this point in the history
Ensure bootloader is repacked

Tracked-On: OAM-112083
Signed-off-by: sgnanase <[email protected]>
  • Loading branch information
sgnanase authored and swaroopbalan committed Nov 22, 2023
1 parent bc8cf8f commit b4431b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
7 changes: 4 additions & 3 deletions releasetools/bootloader_from_target_files
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ def main(argv):
sys.exit(1)

print "unzipping target-files..."
OPTIONS.input_tmp = common.UnzipTemp(args[0])
input_zip = zipfile.ZipFile(args[0], "r")
OPTIONS.info_dict = common.LoadInfoDict(input_zip)
#OPTIONS.input_tmp = common.UnzipTemp(args[0])
OPTIONS.input_tmp = args[0]
#input_zip = zipfile.ZipFile(args[0], "r")
#OPTIONS.info_dict = common.LoadInfoDict(input_zip)

extras = []
if OPTIONS.bootable:
Expand Down
16 changes: 13 additions & 3 deletions releasetools/flashfiles_from_target_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ flashfile_dir=`echo $flashfile | sed 's/\.tar\.gz//g'`
PRODUCT_OUT=`dirname $1`
VARIANT=`grep -i "ro.system.build.type=" $PRODUCT_OUT/system/build.prop | cut -d '=' -f2`
TARGET=`grep -i "ro.build.product=" $PRODUCT_OUT/system/build.prop | cut -d '=' -f2`
ANDROID_ROOT=${PWD}

echo "========================"
echo "Images / Files to be packed"
Expand Down Expand Up @@ -49,23 +50,32 @@ do
if [[ $i == "startup.nsh" ]]; then
cp efi/startup.nsh $flashfile_dir/.
else
cp $i $flashfile_dir/.
if [[ $i == "bootloader.img" ]]; then
cd $ANDROID_ROOT
device/intel/build/releasetools/bootloader_from_target_files $PRODUCT_OUT/obj/PACKAGING/target_files_intermediates/$TARGET-target_files-*/ $PRODUCT_OUT/$flashfile_dir/bootloader.img
cd -
else
cp $i $flashfile_dir/.
fi
fi
fi
fi
done

cd $ANDROID_ROOT
echo "========================"
echo "Generate installer.cmd"
echo "========================"
./device/intel/build/releasetools/flash_cmd_generator.py device/intel/project-celadon/$TARGET/flashfiles.ini $TARGET $VARIANT | sed '$d' | sed '$d' | sed -n '/installer.cmd/,$p' | sed '1d' > $flashfile_dir/installer.cmd
device/intel/build/releasetools/flash_cmd_generator.py device/intel/project-celadon/$TARGET/flashfiles.ini $TARGET $VARIANT | sed '$d' | sed '$d' | sed -n '/installer.cmd/,$p' | sed '1d' > $PRODUCT_OUT/$flashfile_dir/installer.cmd
sed -i 's/flash super super.img/flash super super.img.part00 super.img.part01/g' $PRODUCT_OUT/$flashfile_dir/installer.cmd

echo "========================"
echo "Generate flash.json"
echo "========================"
./device/intel/build/releasetools/flash_cmd_generator.py device/intel/project-celadon/$TARGET/flashfiles.ini $TARGET $VARIANT | sed -n '/installer.cmd/q;p' | sed '1d' > $flashfile_dir/flash.json
device/intel/build/releasetools/flash_cmd_generator.py device/intel/project-celadon/$TARGET/flashfiles.ini $TARGET $VARIANT | sed -n '/installer.cmd/q;p' | sed '1d' > $PRODUCT_OUT/$flashfile_dir/flash.json

if [[ $SUPER_IMG == "true" ]]; then
cd $PRODUCT_OUT
rm -f $flashfile_dir/system.img $flashfile_dir/vendor.img $flashfile_dir/product.img
fi

Expand Down

0 comments on commit b4431b6

Please sign in to comment.