I'm guessing the kernel for N2 comes from here:
https://github.com/hardkernel/linux/tre ... .y-android. Though this branch doesn't have all the patches from the non-android one.
Do I need to use a cross compiler as stated here - https://wiki.odroid.com/odroid-n2/softw ... ng_android, or can I compile it on ubuntu 18.04 arm64 with gcc 7.5.0? I see the original one was built with gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05).
I can get the default configuration from /proc/config.gz, so no problem there.
What commands do I need to build the kernel? I'm thinking of:
Code: Select all
make -j 4 Image dtbs modules
Kernel and dtb seem to be flashed in two partitions:
Code: Select all
[ 1.269566] meson-mmc: [mmc_read_partition_tbl] mmc read partition OK!
[ 1.269568] meson-mmc: add_emmc_partition
[ 1.269661] meson-mmc: [mmcblk0p01] bootloader offset 0x000000000001, size 0x00000000077f
[ 1.269738] meson-mmc: [mmcblk0p02] env offset 0x000000000780, size 0x000000000080
[ 1.269817] meson-mmc: [mmcblk0p03] ptable offset 0x000000000800, size 0x000000000008
[ 1.269891] meson-mmc: [mmcblk0p04] misc offset 0x000000000808, size 0x000000000008
[ 1.269974] meson-mmc: [mmcblk0p05] logo offset 0x000000000810, size 0x000000001000
[ 1.270054] meson-mmc: [mmcblk0p06] dtbs offset 0x000000001810, size 0x000000000100
[ 1.270138] meson-mmc: [mmcblk0p07] boot offset 0x000000001910, size 0x000000008000
[ 1.270231] meson-mmc: [mmcblk0p08] recovery offset 0x000000009910, size 0x00000000c000
[ 1.270312] meson-mmc: [mmcblk0p09] cache offset 0x000000015910, size 0x000000200000
[ 1.270394] meson-mmc: [mmcblk0p10] odm offset 0x000000215910, size 0x000000010000
[ 1.270475] meson-mmc: [mmcblk0p11] system offset 0x000000225910, size 0x000000380000
[ 1.270552] meson-mmc: [mmcblk0p12] vendor offset 0x0000005a5910, size 0x000000100000
[ 1.270633] meson-mmc: [mmcblk0p13] product offset 0x0000006a5910, size 0x000000010000
So my plan is - compile the new kernel (ideally on a c2, but I can do it on a pc if I must), dd the new kernel (is it in Image format?) and dtb to their partitions (e.g. with dd from android directly or offline with dd + offset) and copy over the modules.
Am I missing something?
Edit:
I extracted the kernel, dtb from their partitions and they look ok:
Code: Select all
root@localhost:~# file /kernel.img
/kernel.img: Android bootimg, kernel (0x1080000), ramdisk (0x1000000), page size: 2048, cmdline (otg_device=1 buildvariant=userdebug)
root@localhost:~# file /dtb.img
/dtb.img: Device Tree Blob version 17, size=74368, boot CPU=0, string block size=7632, DT structure block size=66680
root@localhost:~#