hammerhead, bacon ແລະ FP2¶
ໜ້ານີ້ບັນທຶກວິທີການສ້າງ Kernel ແລະ Android image ສຳລັບ LG Nexus 5 (hammerhead), OnePlus One (bacon) ຫຼື Fairphone 2 (FP2).
Note
ພວກເຮົາແນະນຳຢ່າງຍິ່ງໃຫ້ທ່ານປະຕິບັດຕາມ ຄູ່ມືການພອດ Halium ຖ້າທ່ານຕ້ອງການນຳໃຊ້ອຸປະກອນໃໝ່. ຂັ້ນຕອນໃນທີ່ນີ້ແມ່ນກ່ຽວຂ້ອງກັບ hammerhead, bacon ແລະ FP2 ເທົ່ານັ້ນ.
ເອກະສານນີ້ສົມມຸດວ່າທ່ານມີຄວາມຮູ້ກ່ຽວກັບການສ້າງ Android ຫຼື Halium ແລ້ວ. ມັນຍັງສົມມຸດວ່າອຸປະກອນຂອງທ່ານໄດ້ຕິດຕັ້ງ Ubuntu Touch ແລ້ວ.
ການຕັ້ງຄ່າ¶
ພອດ ubp-5.1 ຕ້ອງໄດ້ຮັບການສ້າງໂດຍນຳໃຊ້ Ubuntu 16.04. ແນະນຳໃຫ້ນຳໃຊ້ container ຫຼື virtual machine ທີ່ອີງໃສ່ 16.04 ສຳລັບຈຸດປະສົງນີ້.
Let's get started by installing some build dependencies:
sudo dpkg --add-architecture i386 && sudo apt update
sudo apt install schedtool gcc g++ g++-multilib zlib1g-dev:i386 \
zip libxml2-utils bc python-launchpadlib phablet-tools
Create a directory for your ubp-5.1 source:
mkdir ~/ubp-5.1
cd ~/ubp-5.1
Next, we'll initialize the repository:
repo init -u https://github.com/ubports/android -b ubp-5.1-allthefixings --depth=1
Note
ບຣານຊ໌ (branch) allthefixings ຖືກຈັດຫາໃຫ້ເພື່ອຄວາມສະດວກ. ມັນເພີ່ມພອດອຸປະກອນ UT ປັດຈຸບັນທັງໝົດໃສ່ໃນ tree ໂດຍແລກກັບຂໍ້ມູນທີ່ດາວໂຫຼດຫຼາຍຂຶ້ນເລັກນ້ອຍ. ຖ້າທ່ານກັງວົນເລື່ອງປະລິມານການດາວໂຫຼດ, ໃຫ້ initialize ໂດຍໃຊ້ -b ubp-5.1 ແລະ ນຳໃຊ້ manifest ໃນ build-scripts ເພື່ອເລືອກ repo ທີ່ທ່ານຕ້ອງການ.
Finally, we'll download the source:
repo sync -j10 -c
ຕັ້ງຄ່າ ແລະ ການສ້າງ¶
ເມື່ອດາວໂຫຼດຊອຣ໌ສ (sources) ແລ້ວ, ພວກເຮົາຈຳເປັນຕ້ອງຕັ້ງຄ່າສະພາບແວດລ້ອມ (environment) ແລະ ສ້າງ images. ໃຫ້ແນ່ໃຈວ່າທ່ານຢູ່ໃນ directory ubp-5.1 ຂອງທ່ານ ເພື່ອດຳເນີນຂັ້ນຕອນເຫຼົ່ານີ້.
First, bring in the default Android build environment:
source build/envsetup.sh
Run lunch and pick the appropriate combo for your device. The name of the combination should start with cm_, followed by the device name and ending with -userdebug:
lunch
With that done, the build can be started:
mka
ຕິດຕັ້ງ Image ໃໝ່¶
ຕອນນີ້ການສ້າງສຳເລັດແລ້ວ, ພວກເຮົາສາມາດ flash ມັນລົງໃນອຸປະກອນໄດ້. ໃຫ້ສັງເກດວ່າຄຳສັ່ງເຫຼົ່ານີ້ທັງໝົດຄວນແລ່ນຜ່ານ terminal ທີ່ໄດ້ຮັບການຕັ້ງຄ່າດ້ວຍ source build/envsetup.sh ແລະ lunch ເພື່ອຮັບປະກັນວ່າເຄື່ອງມືທີ່ຈຳເປັນຢູ່ໃນ PATH ຂອງທ່ານ.
We'll begin with the boot and recovery images. Boot your device into fastboot mode and run the following commands:
cout
fastboot flash boot boot.img
fastboot flash recovery recovery.img
ຕອນນີ້ໃຫ້ບູດອຸປະກອນຂອງທ່ານເພື່ອຮັບປະກັນວ່າ kernel ທີ່ສ້າງຂຶ້ນນັ້ນສາມາດໃຊ້ງານໄດ້ປົກກະຕິ. ທ່ານອາດຈະຕ້ອງການບູດເຂົ້າ recovery ເພື່ອກວດສອບວ່າມັນເຮັດວຽກໄດ້ດີເຊັ່ນກັນ.
To install your new build of the system image, use the replace-android-system script. It can be run as follows with your device attached:
./replace-android-system system.img