Dear danielt,
I gave it a try but I am now stuck, hopefully you can help me to find a way out. Let me explain what I did so far:
-
Use multistrap to create a debian root file system (arch=arm64, suite=jessie). I am able to chroot into it and succesfully run ‘dpkg --configure -a’
-
Create an empty image file:
dd if=/dev/zero of=arm64_linux_root_file_system.img bs=1M count=2560
-
Format the newly created file:
mkfs ext3 -F arm64_linux_root_file_system.img
-
Mount the image file and copy the root file system into it:
sudo mount -o loop,rw,sync arm64_linux_root_file_system.img /tmp/mount_tmp
sudo cp -rf dev-arm64/* /tmp/mount_tmp/
-
Download your version of the Linux kernel (commit: ece0e740c5492b51790c86dd2e9dabf04e829110)
-
Crosscompile the kernel:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- amt6797_64_open_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 Imag
So far, so good, but now is when it gets fuzzy. I am able to read the following partition table of my mediatek X20 through the UART0:
[1940] Part Info.(1blk=512B):
[1940] [0x0000000000008000-0x0000000001007fff] ( 32768 blocks): “recovery”
[1940] [0x0000000001008000-0x0000000001087fff] ( 1024 blocks): “para”
[1940] [0x0000000001088000-0x0000000001a87fff] ( 20480 blocks): “expdb”
[1940] [0x0000000001a88000-0x0000000001b87fff] ( 2048 blocks): “frp”
[1940] [0x0000000001b88000-0x0000000002387fff] ( 16384 blocks): “nvcfg”
[1940] [0x0000000002388000-0x0000000004387fff] ( 65536 blocks): “nvdata”
[1940] [0x0000000004388000-0x0000000006387fff] ( 65536 blocks): “metadata”
[1940] [0x0000000006388000-0x0000000006b87fff] ( 16384 blocks): “protect1”
[1940] [0x0000000006b88000-0x00000000077fffff] ( 25536 blocks): “protect2”
[1940] [0x0000000007800000-0x0000000007ffffff] ( 16384 blocks): “seccfg”
[1940] [0x0000000008000000-0x00000000081fffff] ( 4096 blocks): “oemkeystore”
[1940] [0x0000000008200000-0x00000000084fffff] ( 6144 blocks): “proinfo”
[1960] [0x0000000008500000-0x0000000009cfffff] ( 49152 blocks): “md1img”
[1960] [0x0000000009d00000-0x000000000a0fffff] ( 8192 blocks): “md1dsp”
[1960] [0x000000000a100000-0x000000000a3fffff] ( 6144 blocks): “md1arm7”
[1960] [0x000000000a400000-0x000000000a8fffff] ( 10240 blocks): “md3img”
[1960] [0x000000000a900000-0x000000000a9fffff] ( 2048 blocks): “scp1”
[1960] [0x000000000aa00000-0x000000000aafffff] ( 2048 blocks): “scp2”
[1960] [0x000000000ab00000-0x000000000affffff] ( 10240 blocks): “nvram”
[1960] [0x000000000b000000-0x000000000b07ffff] ( 1024 blocks): “lk”
[1960] [0x000000000b080000-0x000000000b0fffff] ( 1024 blocks): “lk2”
[1960] [0x000000000b100000-0x000000000c0fffff] ( 32768 blocks): “boot”
[1960] [0x000000000c100000-0x000000000c8fffff] ( 16384 blocks): “logo”
[1960] [0x000000000c900000-0x000000000cdfffff] ( 10240 blocks): “tee1”
[1960] [0x000000000ce00000-0x000000000d2fffff] ( 10240 blocks): “tee2”
[1980] [0x000000000d300000-0x000000000dffffff] ( 26624 blocks): “keystore”
[1980] [0x000000000e000000-0x00000000adffffff] ( 5242880 blocks): “system”
[1980] [0x00000000ae000000-0x00000000c8ffffff] ( 884736 blocks): “cache”
[1980] [0x00000000c9000000-0x00000001d0ffbdff] ( 8650719 blocks): “userdata”
[1980] [0x00000001d0ffbe00-0x00000001d1ffbdff] ( 32768 blocks): “flashinfo”
Based on one of your previous posts, I replaced the “system” (2560M) partition with my root file system image (arm64_linux_root_file_system.img). However, I don’t know how to go about the patched Linux kernel. I assume that I should replace the partition “boot” with a new “boot.img” including the new kernel? If so, shall I use a tool such as “mkbooting” to build it? Shall I first unpack the original “boot.img” to get some parts/info? As you can see, I can use some help here and thus, I would very much appreciate if you could walk me through this part of the porting procedure
Best,
David