The Debian image I compiled is a bit of frnakenstein creation. I took the orange-pi image bacause it has most convenient partition layout to work with. mmcblk0p6 partition is the fat16 partition where the kernel and the dtb file is stored, so I could just easily mount it via command 'mount /dev/mmcblk0p6 <my_directory>' then replace files at will. Note that the other partitions (1-5) nicely match the booting sequence the rockchip CPU's require (see here: http://opensource.rock-chips.com/wiki_Boot_option). I did not particularly like the orange-pi Ubuntu-like greeter (and also the image was too big), so I chose to use Odroid's rootfs. So I needed to extract it from the odroid image and then reimplant it to the orange-pi image. First I used gparted to check the odroid's rootfs partition fits into the space on the orange-pi image, then I extracted it via 'dd' command, and then I overwrote the orrange-pi rootfs partition via dd like this 'dd if=odroid-rootfs.part of=/dev/mmcblk0p7 bs=64k'. Then I used gparted on the orange-pi image to fix the partition size differences (I think it's the partititon/check option in the menu). So that was it. It can be possible to use this technique to use rootfs from other distros for other rk3399 development boards (FriendlyElec's NanoPC-T4 board has Armbian and Ubuntu images, so it might be interesting to try those).
After that I only had to fiddle with the kernel and the dtbs. The dtb file can be decompiled and compiled via 'dtc' command. To decompile use 'dtc -I dtb -O dts rk3399-h96max.dtb > rk3399-h96max.dts'. And compiled back via 'dtc -I dts -O dtb rk3300-h96max.dts > rk3399-h96max.dtb'. The dtc file is a text file where I made changes by looking into the odrdoid's dtbs and orange-pi's dtb, comparing how they map devices to which addressees, then copied / fixed things in the h96max dtb.
The kernel I used was from Friendly Elec, because they seem use the most recent version of 4.4 kernel (4.4.138). They have an instruction page how to compile their kernel (http://wiki.friendlyarm.com/wiki/ind...Lubuntu_Kernel) so I followed that to compile it. Then I put the kernel Image itself to the mmcblk0p6 partititon (also the /boot directory on my release) and the modules to the rootfs partition (/lib/modules directory).
Edit: clarity
Comment