编译安卓

准备

编译

注意

在开始编译前,确保已经搭建好如上准备所述的环境。

android 10.0:

编译 U-boot:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd u-boot
$ make mrproper
$ ./make.sh kedge

编译 kernel:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd kernel
$ make ARCH=arm64 kedge_defconfig android-10.config rk3399.config
$ make ARCH=arm64 rk3399-khadas-edge-android.img -jN

编译 android:

1
2
3
4
5
6
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch rk3399_Android10-userdebug
$ make installclean
$ make -jN
$ ./mkimage.sh
注意

替换N为你自己电脑实际的线程数。

执行./mkimage.sh后,在 rockdev/Image-xxx/目录生成完整的固件包(xxx 是具体 lunch的产品名)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
rockdev/Image-xxx/
├── MiniLoaderAll.bin
├── boot.img
├── dtbo.img
├── kernel.img
├── misc.img
├── odm.img
├── parameter.txt
├── pcba_small_misc.img
├── pcba_whole_misc.img
├── recovery.img
├── resource.img
├── system.img
├── trust.img
├── uboot.img
├── update.img
├── vbmeta.img
├── super.img
└── vendor.img

打包 update.img:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch rk3399_Android10-userdebug
$ ./pack_image.sh

android 9.0:

编译 U-boot:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd u-boot
$ make mrproper
$ ./make.sh kedge

编译 kernel:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd kernel
$ make ARCH=arm64 kedge_defconfig -jN
$ make ARCH=arm64 rk3399-khadas-edge-android.img -jN

编译 android:

1
2
3
4
5
6
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch rk3399-userdebug
$ make installclean
$ make -jN
$ ./mkimage.sh
注意

替换N为你自己电脑实际的线程数。

执行./mkimage.sh后,在 rockdev/Image-xxx/目录生成完整的固件包(xxx 是具体 lunch的产品名)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
rockdev/Image-xxx/
├── MiniLoaderAll.bin
├── boot.img
├── dtbo.img
├── kernel.img
├── misc.img
├── oem.img
├── parameter.txt
├── pcba_small_misc.img
├── pcba_whole_misc.img
├── recovery.img
├── resource.img
├── system.img
├── trust.img
├── uboot.img
├── update.img
├── vbmeta.img
└── vendor.img

打包 update.img:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch rk3399-userdebug
$ ./pack_image.sh

android 7.1:

编译 U-boot:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd uboot
$ make kedge_defconfig
$ make ARCHV=aarch64

编译 kernel:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd kernel
$ make ARCH=arm64 kedge_defconfig -jN
$ make ARCH=arm64 rk3399-khadas-edge-android.img -jN

编译 android:

1
2
3
4
5
6
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch rk3399_all-userdebug
$ make installclean
$ make -jN
$ ./mkimage.sh
注意

替换N为你自己电脑实际的线程数。

执行./mkimage.sh后,在 rockdev/Image-xxx/目录生成完整的固件包(xxx 是具体 lunch的产品名)

1
2
3
4
5
6
7
8
9
10
11
rockdev/Image-xxx/
├── boot.img
├── kernel.img
├── misc.img
├── parameter.txt
├── recovery.img
├── resource.img
├── RK3399MiniLoaderAll.bin
├── system.img
├── trust.img
└── uboot.img

打包 update.img:

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch rk3399_all-userdebug
$ ./pack_image.sh

参考