diff --git a/packages/linux/package.mk b/packages/linux/package.mk index cf3a5aa8c8..42c5e33639 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -36,6 +36,7 @@ case "$LINUX" in PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*" PKG_PATCH_DIRS="amlogic-3.10" + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host" ;; amlogic-3.14) PKG_VERSION="2e193b8" @@ -43,6 +44,7 @@ case "$LINUX" in PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*" PKG_PATCH_DIRS="amlogic-3.14" + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host" ;; *) PKG_VERSION="4.14.4" @@ -187,9 +189,24 @@ make_target() { LDFLAGS="" make $KERNEL_TARGET $KERNEL_MAKE_EXTRACMD if [ "$BUILD_ANDROID_BOOTIMG" = "yes" ]; then + DTB_BLOBS=($(ls arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/*.dtb 2>/dev/null || true)) + DTB_BLOBS_COUNT="${#DTB_BLOBS[@]}" + DTB_BLOB_OUTPUT="arch/$TARGET_KERNEL_ARCH/boot/dtb.img" + ANDROID_BOOTIMG_SECOND="--second $DTB_BLOB_OUTPUT" + + if [ "$DTB_BLOBS_COUNT" -gt 1 ]; then + $TOOLCHAIN/bin/dtbTool -o arch/$TARGET_KERNEL_ARCH/boot/dtb.img -p scripts/dtc/ arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/ + elif [ "$DTB_BLOBS_COUNT" -eq 1 ]; then + cp -PR $DTB_BLOBS $DTB_BLOB_OUTPUT + else + ANDROID_BOOTIMG_SECOND="" + fi + LDFLAGS="" mkbootimg --kernel arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET --ramdisk $BUILD/image/initramfs.cpio \ - $ANDROID_BOOTIMG_OPTIONS --output arch/$TARGET_KERNEL_ARCH/boot/boot.img + $ANDROID_BOOTIMG_SECOND $ANDROID_BOOTIMG_OPTIONS --output arch/$TARGET_KERNEL_ARCH/boot/boot.img + mv -f arch/$TARGET_KERNEL_ARCH/boot/boot.img arch/$TARGET_KERNEL_ARCH/boot/$KERNEL_TARGET + fi } diff --git a/packages/tools/aml-dtbtools/package.mk b/packages/tools/aml-dtbtools/package.mk new file mode 100644 index 0000000000..aaad0dd625 --- /dev/null +++ b/packages/tools/aml-dtbtools/package.mk @@ -0,0 +1,35 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="aml-dtbtools" +PKG_VERSION="cce100f" +PKG_SHA256="8bcaa83fcc9e85c9c04930e7411447d96a97da0809c5ecd9af91c8b554133c41" +PKG_ARCH="any" +PKG_LICENSE="free" +PKG_SITE="https://github.com/Wilhansen/aml-dtbtools" +PKG_URL="https://github.com/Wilhansen/aml-dtbtools/archive/${PKG_VERSION}.tar.gz" +PKG_SECTION="tools" +PKG_SHORTDESC="AML DTB Tools" +PKG_LONGDESC="AML DTB Tools" + +PKG_MAKE_OPTS_HOST="dtbTool" + +makeinstall_host() { + mkdir -p $TOOLCHAIN/bin + cp dtbTool $TOOLCHAIN/bin +} diff --git a/projects/WeTek_Core/options b/projects/WeTek_Core/options index d726943b3e..0ad46760aa 100644 --- a/projects/WeTek_Core/options +++ b/projects/WeTek_Core/options @@ -57,9 +57,6 @@ # Build Android kernel image using mkbootimg BUILD_ANDROID_BOOTIMG="yes" - # Additional options to be passed to Android mkbootimg - ANDROID_BOOTIMG_OPTIONS="--second arch/arm/boot/dts/amlogic/meson8m2_wetek_core.dtb" - # Additional kernel make parameters (for example to specify the u-boot loadaddress) KERNEL_MAKE_EXTRACMD="" diff --git a/projects/WeTek_Hub/options b/projects/WeTek_Hub/options index 4eb080dbf2..0664e781fd 100644 --- a/projects/WeTek_Hub/options +++ b/projects/WeTek_Hub/options @@ -55,7 +55,7 @@ BUILD_ANDROID_BOOTIMG="yes" # Additional options to be passed to Android mkbootimg - ANDROID_BOOTIMG_OPTIONS="--second arch/arm64/boot/dts/amlogic/gxbb_p200_1G_wetek_hub.dtb --base 0x0 --kernel_offset 0x1080000" + ANDROID_BOOTIMG_OPTIONS="--base 0x0 --kernel_offset 0x1080000" # Additional kernel make parameters (for example to specify the u-boot loadaddress) KERNEL_MAKE_EXTRACMD="" diff --git a/projects/WeTek_Play_2/options b/projects/WeTek_Play_2/options index ae82409cde..25dae6cdb9 100644 --- a/projects/WeTek_Play_2/options +++ b/projects/WeTek_Play_2/options @@ -55,7 +55,7 @@ BUILD_ANDROID_BOOTIMG="yes" # Additional options to be passed to Android mkbootimg - ANDROID_BOOTIMG_OPTIONS="--second arch/arm64/boot/dts/amlogic/gxbb_p200_2G_wetek_play_2.dtb --base 0x0 --kernel_offset 0x1080000" + ANDROID_BOOTIMG_OPTIONS="--base 0x0 --kernel_offset 0x1080000" # Additional kernel make parameters (for example to specify the u-boot loadaddress) KERNEL_MAKE_EXTRACMD=""