Skip to content

TheParasiteProject/build-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build-Scripts

Sync, build script for TheParasiteProject.
Only supports Ubuntu 23.04 and up, Debian, Arch Linux.
These are not fancy scripts. Just for personal use :P

Desc

  • Edit options.txt to match your own needs.
  • Although there's args exist, you can hardcoded those options on options.txt
    (e.g. Setting VERBOSE=true on options.txt will have same effect with arg -v)

sync.sh

  • Sync rom sources.
  • Automatically install all dependancies.
  • If there're any manifests files found under .configs/additional-manifests dir,
    those files will be copied under .repo/local_manifests.
  • If there're any manifests files found under .configs/device-manifests: dir,
    those files will be copied under .repo/local_manifests.
    Make sure device-manifests and additional-manifests have not same file name or contents.
  • If there're no vars set, will use default values.
  • If source dir already exists, it will update repos.

You can find example device-manifests from our Project's devices repo.

Vars

  • ROMNAME: Name of this project. This var will use as folder name, main org name of sources.
  • MANIFEST_URL: Manifest URL to init/sync with repo command.
  • BRANCH: Target branch to sync.
  • BUILDBASE: Parent directory of rom sources storage. Default to $HOME.
    Will synced under $BUILDBASE/android/$ROMNAME
  • FORCEINIT: Enforce initialization when updating manifest fails.
    Default to true.
  • SHALLOWSYNC: Shallow sync repos to save storage.
    Default to true.

Args

  • --verbose or -v: Verbose mode. Show all excuted commands while sync.
  • --clean-sync or -cs: Clean sync mode. Remove entire source directory and sync from scratch.

patch.sh

  • Apply patches to rom sources.
  • If there're any patch files found under .configs/additional-patches dir,
    those patches will be applied to correspond repos.
    You need to follow the naming style. (build/soong -> build+soong)

Vars

  • ROMNAME: Name of this project. This var will use as folder name, main org name of sources.
  • BUILDBASE: Parent directory of rom sources storage. Default to $HOME.
    Patches will applied to the directories under $BUILDBASE/android/$ROMNAME

build.sh

  • Build rom or boot images and move those under current directory where this script located.
  • If there're no vars set, will use default values.
  • CCache and ThinLTO Cache are enabled by default.

Vars

  • BUILDBASE: Parent directory of where rom sources is located. Default to $HOME.
    Should be same as sync.sh's $BUILDBASE.
  • BUILD_OUT: Output directory of build.
  • BUILD_TARGET_OUT: Output directory of build target.
  • OUTDIR: Output directory to copy built files.
  • BUILD_PROC: Set multi process jobs number for build.
  • CCACHE: Enable CCache
  • CCACHEDIR: Dir to store CCache.
  • CCACHESIZE: Size of CCache.
  • CUSTOM_GO_CACHE_DIR: Enable custom Go Build Cache.
  • GOCACHEDIR: Dir to store Go Build Cache.
  • TCACHE: Enable ThinLTO Cache.
  • GTLTO: Enable Global ThinLTO.
  • ROMNAME: Name of this project. This var will use as folder name.
  • DEVICE: Target device of rom to build. DEVICE=common.
  • BUILDTYPE: Build type of rom to build. e.g. BUILDTYPE=user.
  • BUILD_TARGET: Target to build.
    e.g. BUILD_TARGET="bootimage recoveryimage"
  • OUT_FILE: Output file names after built.
    e.g. OUT_FILE="boot.img recovery.img"
  • LUNCHCOMMAND: Lunch command of rom to build. e.g. aosp_$DEVICE-$BUILDTYPE.

Args

  • --verbose or -v: Verbose mode. Show all excuted commands while sync.
  • --ccache or -ec: Enable CCache.
  • --thinlto-cache or -tc: Enable ThinLTO Cache.
  • --clean or -c: Clean mode. Build rom from scratch instead of dirty build.
  • --aclean or -ac: Clean-up All Cache.
  • --installclean or -ic: Install clean mode. Clean installed module.
  • --shutdown or -s: Shutdown system after build complete.

Credits

switchroot-script-builder