Installation of JDK 8 http://qiita.com/niusounds/items/1f32dcd6fa1f57ade98a
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir -p aosp/7.1.2
$ cd aosp
$ ~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.2_r17
$ ~/bin/repo sync
...
Checking out files: 100% (6377/6377), done. out files: 26% (1719/6377)
Checking out files: 100% (1717/1717), done.
Checking out files: 100% (44431/44431), done.
Checking out files: 100% (62/62), done.king out files: 14% (9/62)
Checking out files: 100% (1756/1756), done.
Checking out files: 100% (8484/8484), done.
Checking out files: 100% (539/539), done.ng out files: 28% (151/539)
Checking out files: 100% (15774/15774), done.ut files: 7% (1128/15774)
Checking out files: 100% (25/25), done.
Syncing work tree: 100% (529/529), done.
Java settings
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
$ export PATH=$PATH:$JAVA_HOME/bin
Build settings
$ source build/envsetup.sh
$ lunch
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. full_fugu-userdebug
8. aosp_fugu-userdebug
9. mini_emulator_arm64-userdebug
10. m_e_arm-userdebug
11. m_e_mips-userdebug
12. m_e_mips64-eng
13. mini_emulator_x86-userdebug
14. mini_emulator_x86_64-userdebug
15. aosp_dragon-userdebug
16. aosp_dragon-eng
17. aosp_marlin-userdebug
18. aosp_sailfish-userdebug
19. aosp_flounder-userdebug
20. aosp_angler-userdebug
21. aosp_bullhead-userdebug
22. hikey-userdebug
23. aosp_shamu-userdebug
Which would you like? [aosp_arm-eng] aosp_flounder-eng ← Select according to the terminal you want to build(https://forum.xda-developers.com/wiki/Google/Device_Codenames)
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=aosp_flounder
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=denver64
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=denver
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-78-generic-x86_64-with-debian-stretch-sid
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47B
OUT_DIR=out
============================================
Build
$ make -j8 &> makelog_`date "+%Y%m%d_%H%M%S"`.txt
makelog_20170627_010549.txt
...
[ 99% 49532/49533] host C++: primitives_tests_32 <= system/media/audio_utils/tests/primitives_tests.cpp
[100% 49533/49533] host Executable: primitives_tests_32 (out/host/linux-x86/obj32/EXECUTABLES/primitives_tests_intermediates/primitives_tests32)
[0;32m#### make completed successfully (02:12:53 (hh:mm:ss)) ####[00m
Write the build product below. /out/target/product/flounder/system.img /out/target/product/flounder/boot.img
$ adb reboot bootloader
$ fastboot flash boot <boot.Folder path with img>/boot.img
$ fastboot flash system <system.Folder path with img>/system.img
$ fastboot reboot
Hello, World!
Customize to display the "Hellor, World!" Dialog at startup.
Put the following modifications at the end of ActivityManagerService # finishBooting called when boot is completed.
https://android.googlesource.com/platform/frameworks/base/+/android-7.1.2_r17/services/core/java/com/android/server/am/ActivityManagerService.java#finishBooting
ActivityManagerService.java
...
mUserController.sendBootCompletedLocked(
new IIntentReceiver.Stub() {
@Override
public void performReceive(Intent intent, int resultCode,
String data, Bundle extras, boolean ordered,
boolean sticky, int sendingUser) {
synchronized (ActivityManagerService.this) {
requestPssAllProcsLocked(SystemClock.uptimeMillis(),
true, false);
}
}
});
scheduleStartProfilesLocked();
}
}
+ AlertDialog.Builder builder = new AlertDialog.Builder(mContext)
+ .setTitle("Hello, World!");
+ Dialog dialog = builder.create();
+ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
+ dialog.show();
}
"Build Build the corrected part with pinpoint
~/AOSP/7.1.2$ mmm frameworks/base/services
...
#### make completed successfully (32 seconds) ####
The build product is output to the following
out/target/product/flounder/system/framework/services.jar
Replace services.jar in the terminal with the built services.jar
$ adb remount
$ adb push <services.Folder path with jar>/services.jar /system/framework/.
$ adb reboot
Recommended Posts