Android Customizing the Linux kernel: Difference between revisions

From Variscite Wiki
No edit summary
Line 1: Line 1:
<!-- Set release according to "release" parameter in URL and use RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6 as default
<!-- Set release according to "release" parameter in URL and use RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6 as default
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_P9.0.0_2.0.0_GA_DART-MX8M-MINI}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} - Customizing the Linux kernel}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Android}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} - Customizing the Linux kernel}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Android}} __toc__
== Manual build and customizing Android Linux Kernel ==
This section describes how to make changes and flash the new kernel - aka. Android boot image(s) to {{#var:HARDWARE_NAME}}


== Making changes to kernel configuration ==
== Making changes to kernel configuration ==
Line 18: Line 15:
  $ cp defconfig arch/{{#ifeq: {{#var:HARDWARE_NAME}} |VAR-SOM-MX6|arm|arm64}}/configs/
  $ cp defconfig arch/{{#ifeq: {{#var:HARDWARE_NAME}} |VAR-SOM-MX6|arm|arm64}}/configs/


== Making changes to device tree ==
== Making changes to the device tree ==
Edit {{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX6| * VAR-SOM-MX6 : arch/arm/boot/dts/imx6qdl-var-som.dtsi <br>
Edit {{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX6| * VAR-SOM-MX6 : arch/arm/boot/dts/imx6qdl-var-som.dtsi <br>
*DART-MX6: arch/arm/boot/dts/imx6qdl-var-dart.dtsi| arch/arm64/boot/dts/{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |freescale/fsl-imx8mq-var-dart-common.dtsi | freescale/fsl-imx8mm-var-dart.dts}}}} <br>
*DART-MX6: arch/arm/boot/dts/imx6qdl-var-dart.dtsi| arch/arm64/boot/dts/{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |freescale/fsl-imx8mq-var-dart-common.dtsi | freescale/fsl-imx8mm-var-dart.dts}}}} <br>
Line 24: Line 21:
Refer to: {{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX6 |[[{{#var:HARDWARE_NAME}} SPI|SPI]]|{{Varlink|DART-MX8M SPI|{{#var:RELEASE_LINK}}|SPI}}}}
Refer to: {{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX6 |[[{{#var:HARDWARE_NAME}} SPI|SPI]]|{{Varlink|DART-MX8M SPI|{{#var:RELEASE_LINK}}|SPI}}}}


== Build New boot.img ==
== Build a new boot.img ==
When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.
When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.
  $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}
  $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}
Line 31: Line 28:
  $ make bootimage
  $ make bootimage


== Flashing bootimage to target ==
== Flashing the boot image to the target ==
Make sure device is in the fastboot mode if not , reboot in fastboot mode by using below commands. <br>
Boot the device into fastboot mode by using below commands:<br>
 
  $ adb reboot bootloader
  $ adb reboot bootloader
  $ fastboot flash boot{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX6 | out/target/product/var_mx6/boot-<setup-name>.img |_a out/target/product/out/target/product/{{#var:ANDROID_MACHINE_NAME}}/boot.img }}
  $ fastboot flash boot{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX6 | out/target/product/var_mx6/boot-<setup-name>.img |_a out/target/product/out/target/product/{{#var:ANDROID_MACHINE_NAME}}/boot.img }}
Line 42: Line 38:
  $ sudo flash dtbo_a out/target/product/{{#var:ANDROID_MACHINE_NAME}}/dtbo-<name>.img
  $ sudo flash dtbo_a out/target/product/{{#var:ANDROID_MACHINE_NAME}}/dtbo-<name>.img
  $ sudo flash vbmeta_a out/target/product/{{#var:ANDROID_MACHINE_NAME}}/vbmeta-<name>.img
  $ sudo flash vbmeta_a out/target/product/{{#var:ANDROID_MACHINE_NAME}}/vbmeta-<name>.img
Replace <name> with the actual desired setup name according to the table in the [[#Images_created_by_the_Android_build_for_Variscite_MX8M_system|"images created" section]].
Replace <name> with the actual desired setup name according to the table in the [[Android_NXP_Guide#Images_created_by_the_Android_build_for_Variscite_MX8M_system|"images created by the Android build" section]] in the .
}}
}}
  $ sudo fastboot reboot
  $ sudo fastboot reboot

Revision as of 13:14, 31 December 2019

DART-MX8M-MINI - Android Pie Android P9.0.0_r30 - Customizing the Linux kernel

Making changes to kernel configuration

$ cd ~/var_imx-p9.0.0_2.0.0-ga/android_build/vendor/variscite/kernel_imx/
$ make ARCH=arm64 mrproper
$ make ARCH=arm64 imx8_var_android_defconfig
$ make ARCH=arm64 menuconfig

Navigate the menu and select the desired kernel functionality Exit the menu and answer "Yes" when asked "Do you wish to save your new configuration?"

$ make ARCH=arm64 savedefconfig
$ cp arch/arm64/configs/imx8_var_android_defconfig arch/arm64/configs/imx8_var_android_defconfig.orig 
$ cp defconfig arch/arm64/configs/

Making changes to the device tree

Edit arch/arm64/boot/dts/freescale/fsl-imx8mm-var-dart.dts
For example we want to make device tree changes for SPI configuration
Refer to: SPI

Build a new boot.img

When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.

$ cd ~/var_imx-p9.0.0_2.0.0-ga/android_build
$ source build/envsetup.sh
$ lunch dart_mx8mm-userdebug
$ make bootimage

Flashing the boot image to the target

Boot the device into fastboot mode by using below commands:

$ adb reboot bootloader
$ fastboot flash boot_a out/target/product/out/target/product/dart_mx8mm/boot.img
$ sudo flash dtbo_a out/target/product/dart_mx8mm/dtbo-<name>.img
$ sudo flash vbmeta_a out/target/product/dart_mx8mm/vbmeta-<name>.img

Replace <name> with the actual desired setup name according to the table in the "images created by the Android build" section in the .

$ sudo fastboot reboot