mkdir romnamecd romnamegit config --global user.email "yourname@mail.com" && git config --global user.name "yourname" repo init -u https://github.com/romname/android_manifest.git -b branchesrepo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tagsRefer to your ROM's Manifest for detailed clone guide.
I have opted for begonia so clone your DT's according to the device you are going to build for.
Check your device on your ROM's Official Devices Repo to figure out all the trees required for it.
Cloning Device Tree:
git clone https://github.com/username/device_redmi_begonia -b 13.0 device/redmi/begonia
Cloning Kernel Tree:
git clone https://github.com/username/kernel_xiaomi_mt6785 -b 13.0 kernel/xiaomi/mt6785
Cloning Vendor Tree:
git clone https://github.com/username/vendor_redmi_begonia -b 13.0 vendor/redmi/begoniagit clone https://github.com/username/vendor_redmi_begonia-ims -b 13.0 vendor/redmi/begonia-imsgit clone https://github.com/username/vendor_redmi_begonia-firmware -b 13.0 vendor/redmi/begonia-firmware
Cloning Sepolicy Tree:
git clone https://github.com/username/device_mediatek_sepolicy -b 13.0 device/mediatek/sepolicycd device/devicename/codenameRename the aosp.dependencies & aosp_devicename.mk to your current ROM.
Edit AndroidProducts.mk. Rename the pre-existing aosp to your current ROM.
Edit aosp_devicename.mk. Adapt the flags according to your ROM. Check Devices Repo for more information on flags.
Setup Build Environment:
. build/envsetup.shSetup Lunch:
lunch romname_devicename-userdebugCompile:
mka bacon -j$(nproc --all)Refer to your ROM's Manifest for Compile Flags.
Fixing errors that arise during a ROM Development is a whole another branch of headache. Your build might get an error. It might not get an error. Each build might get an different error. It takes a lot of research and understanding to figure out the solutions. Wishing you Best of Luck !!
