Hi, I’m working on trying to get CoreElec to boot on a FireTV 2nd gen Cube (S922X). I don’t know that Amazon based the Cube board on any of the S922X development boards like the w400. But I would still like to try booting the Cube on the available S922X DTBs for CoreElec to see if any work. The amlogic-dt-id for the Cube is g12brevb_raven_2g (raven is the code name for the Cube). The Cube won’t accept the DTB unless it uses the raven amlogic-dt-id.
So I need to decompile the existing S922X DTB to DTS, change the amlogic-dt-id and recompile to DTB. This is easy enough with the linux dtc tool, but since most of the CoreElec DTBs have include files, I need to compile the DTS files through CoreElec.
And because I only want to compile the DTS files, I built with
5) Project=Amlogic-cd DEVICE=Amlogic-ng ./scripts/build linux:host
Then I got lost. I was told I needed to edit a package.mk file.
Which package.mk file?
What do I edit in it?
And how to I execute/start compiling after i have edited this file?
I guess he wants to build from a modified dts in the kernel source tree (thus he can include other .dtsi file) without modifying the linux package’s pacakge.mk and constantly rebuild it? @YadaYada
Then you can create a package at projects/Amlogic-ce/devices/Amlogic-ng/packages/device-tree-firecube, with its package.mk containing the following lines:
PKG_NAME="device-tree-firecube"
PKG_VERSION="1"
PKG_SITE=""
PKG_URL=""
PKG_DEPENDS_TARGET="toolchain"
PKG_DEPENDS_UNPACK="linux"
PKG_LONGDESC="Device trees for Amazon cube"
PKG_IS_KERNEL_PKG="yes"
PKG_TOOLCHAIN="manual"
DTS_PATH="/absolute/path/to/your/dts"
PKG_NEED_UNPACK="${DTS_PATH}"
make_target() {
pushd "$(get_build_dir linux)" > /dev/null
cp -f "${DTS_PATH}" "arch/${TARGET_KERNEL_ARCH}/boot/dts/amlogic/"
DTB_NAME="$(basename "${DTS_PATH}" .dts).dtb"
kernel_make "${DTB_NAME}"
cp "arch/${TARGET_KERNEL_ARCH}/boot/dts/amlogic/${DTB_NAME}" "${PKG_BUILD}/"
popd > /dev/null
}
makeinstall_target() {
: # Since you are not building a whole pacakge, then there's no much use to install it to image
}
Replace the /absolute/path/to/your/dts to the one you’re tinkering with in the kernel source, for example /home/myuser/development/coreelec-linux-amlogic/arch/arm64/boot/dts/amlogic/firecube.dts
(You could omit the two vars PROJECT and DEVICE since these are actually their default values, but I don’t know if you are using a version of build system with this feature)
The result dtb will be at build.DISTRO.DEVICE.ARCH.MAJOR/build/device-tree-firecube-1/whatever.dtb
After you update and save that dts file, you can use the same command to rebuild the dtb (Thanks to PKG_NEED_UNPACK)
When the dtb is ready for tests I think it would be a better idea to add the finished dts to linux-amlogic and open a PR to merge into CE’s linux-amlogic repo, instead of keeping it as a single device-tree package