From 11d62387412bceca8ea0ab0987c081f0a1618e4e Mon Sep 17 00:00:00 2001 From: Radostan Riedel Date: Fri, 3 Nov 2017 09:13:36 +0100 Subject: [PATCH] Odroid_C2/u-boot: move to project specific package --- packages/tools/u-boot/package.mk | 42 +++-------- packages/tools/u-boot/release | 12 ---- projects/Odroid_C2/bootloader/release | 31 ++++++++ projects/Odroid_C2/packages/u-boot/package.mk | 70 +++++++++++++++++++ .../packages}/u-boot/scripts/update-c2.sh | 2 +- ...0001-use-arm-eabi-for-bl301-scp_task.patch | 0 .../patches/u-boot}/u-boot-0002-gcc7.patch | 0 ...-boot-0003-set-default-boot-options.patch} | 0 ... u-boot-0004-update_cec_wakeup_code.patch} | 0 ...oot-0005-update_cec_simplink_wakeup.patch} | 0 10 files changed, 110 insertions(+), 47 deletions(-) create mode 100755 projects/Odroid_C2/bootloader/release create mode 100644 projects/Odroid_C2/packages/u-boot/package.mk rename {packages/tools => projects/Odroid_C2/packages}/u-boot/scripts/update-c2.sh (98%) rename {packages/tools/u-boot/patches/6e4e886 => projects/Odroid_C2/patches/u-boot}/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch (100%) rename {packages/tools/u-boot/patches/6e4e886 => projects/Odroid_C2/patches/u-boot}/u-boot-0002-gcc7.patch (100%) rename projects/Odroid_C2/patches/u-boot/{u-boot-0001-set-default-boot-options.patch => u-boot-0003-set-default-boot-options.patch} (100%) rename projects/Odroid_C2/patches/u-boot/{u-boot-0002-update_cec_wakeup_code.patch => u-boot-0004-update_cec_wakeup_code.patch} (100%) rename projects/Odroid_C2/patches/u-boot/{u-boot-0003-update_cec_simplink_wakeup.patch => u-boot-0005-update_cec_simplink_wakeup.patch} (100%) diff --git a/packages/tools/u-boot/package.mk b/packages/tools/u-boot/package.mk index f9c8b19257..5085821348 100644 --- a/packages/tools/u-boot/package.mk +++ b/packages/tools/u-boot/package.mk @@ -1,19 +1,20 @@ ################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv +# This file is part of LibreELEC - https://libreelec.tv # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) +# Copyright (C) 2017-present Team LibreELEC # -# OpenELEC is free software: you can redistribute it and/or modify +# 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. # -# OpenELEC is distributed in the hope that it will be useful, +# 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 OpenELEC. If not, see . +# along with LibreELEC. If not, see . ################################################################################ PKG_NAME="u-boot" @@ -27,12 +28,6 @@ if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then PKG_SOURCE_NAME="$PKG_NAME-sr-$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="$PKG_NAME-imx6-${PKG_COMMIT}*" [ -n "$UBOOT_CONFIG_V2" ] && PKG_DEPENDS_TARGET="toolchain u-boot-v2" -elif [ "$UBOOT_VERSION" = "hardkernel" ]; then - PKG_VERSION="6e4e886" - PKG_SHA256="0d05829e07e226d1acbc6b23ff038d6c92fa3ed738ddc28703d51987c0fab3bb" - PKG_SITE="https://github.com/hardkernel/u-boot" - PKG_URL="https://github.com/hardkernel/u-boot/archive/$PKG_VERSION.tar.gz" - PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET gcc-linaro-aarch64-elf:host gcc-linaro-arm-eabi:host" else exit 0 fi @@ -71,16 +66,9 @@ make_target() { done for UBOOT_TARGET in $UBOOT_CONFIG; do - if [ "$PROJECT" = "Odroid_C2" ]; then - export PATH=$TOOLCHAIN/lib/gcc-linaro-aarch64-elf/bin/:$TOOLCHAIN/lib/gcc-linaro-arm-eabi/bin/:$PATH - CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make mrproper - CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make $UBOOT_TARGET - CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make HOSTCC="$HOST_CC" HOSTSTRIP="true" - else - make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm mrproper - make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm $UBOOT_TARGET - make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm HOSTCC="$HOST_CC" HOSTSTRIP="true" - fi + make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm mrproper + make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm $UBOOT_TARGET + make CROSS_COMPILE="$TARGET_PREFIX" ARCH=arm HOSTCC="$HOST_CC" HOSTSTRIP="true" # rename files in case of multiple targets if [ $UBOOT_TARGET_CNT -gt 1 ]; then @@ -131,18 +119,4 @@ makeinstall_target() { cp -PR $PROJECT_DIR/$PROJECT/bootloader/uEnv*.txt $INSTALL/usr/share/bootloader 2>/dev/null || : - case $PROJECT in - Odroid_C2) - cp -PRv $PKG_DIR/scripts/update-c2.sh $INSTALL/usr/share/bootloader/update.sh - cp -PRv $PKG_BUILD/u-boot.bin $INSTALL/usr/share/bootloader/u-boot - if [ -f $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz ]; then - cp -PRv $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz $INSTALL/usr/share/bootloader - elif [ -f $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz ]; then - cp -PRv $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz $INSTALL/usr/share/bootloader - fi - ;; - imx6) - cp -PRv $PKG_DIR/scripts/update.sh $INSTALL/usr/share/bootloader - ;; - esac } diff --git a/packages/tools/u-boot/release b/packages/tools/u-boot/release index 6787a2f3fc..6b21b21d3c 100755 --- a/packages/tools/u-boot/release +++ b/packages/tools/u-boot/release @@ -36,15 +36,3 @@ mkdir -p $RELEASE_DIR/3rdparty/bootloader cp -PR $PROJECT_DIR/$PROJECT/bootloader/uEnv*.txt $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || : cp -PR $BUILD/linux-*/arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || : - - case $PROJECT in - Odroid_C2) - cp -PR $BUILD/$BOOTLOADER-*/u-boot.bin $RELEASE_DIR/3rdparty/bootloader/u-boot - cp -PR $PROJECT_DIR/$PROJECT/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader - if [ -f $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz ]; then - cp -PR $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz $RELEASE_DIR/3rdparty/bootloader - elif [ -f $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz ]; then - cp -PR $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz $RELEASE_DIR/3rdparty/bootloader - fi - ;; - esac diff --git a/projects/Odroid_C2/bootloader/release b/projects/Odroid_C2/bootloader/release new file mode 100755 index 0000000000..c3e9af0c98 --- /dev/null +++ b/projects/Odroid_C2/bootloader/release @@ -0,0 +1,31 @@ +#!/bin/sh + +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2017-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 . +################################################################################ + +. config/options $1 + +mkdir -p $RELEASE_DIR/3rdparty/bootloader + cp -PR $BUILD/linux-*/arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb $RELEASE_DIR/3rdparty/bootloader 2>/dev/null || : + cp -PR $BUILD/$BOOTLOADER-*/u-boot.bin $RELEASE_DIR/3rdparty/bootloader/u-boot + cp -PR $PROJECT_DIR/$PROJECT/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader + if [ -f $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz ]; then + cp -PR $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz $RELEASE_DIR/3rdparty/bootloader + elif [ -f $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz ]; then + cp -PR $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz $RELEASE_DIR/3rdparty/bootloader + fi diff --git a/projects/Odroid_C2/packages/u-boot/package.mk b/projects/Odroid_C2/packages/u-boot/package.mk new file mode 100644 index 0000000000..4c09a6c079 --- /dev/null +++ b/projects/Odroid_C2/packages/u-boot/package.mk @@ -0,0 +1,70 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2017-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="u-boot" +PKG_VERSION="6e4e886" +PKG_SHA256="0d05829e07e226d1acbc6b23ff038d6c92fa3ed738ddc28703d51987c0fab3bb" +PKG_SITE="https://github.com/hardkernel/u-boot" +PKG_URL="https://github.com/hardkernel/u-boot/archive/$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain gcc-linaro-aarch64-elf:host gcc-linaro-arm-eabi:host" +PKG_ARCH="arm aarch64" +PKG_LICENSE="GPL" +PKG_SECTION="tools" +PKG_SHORTDESC="u-boot: Universal Bootloader project (Hardkernel Fork)" +PKG_LONGDESC="Das U-Boot is a cross-platform bootloader for embedded systems, used as the default boot loader by several board vendors. It is intended to be easy to port and to debug, and runs on many supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS, and Microblaze." +PKG_AUTORECONF="no" + +pre_configure_target() { + if [ -z "$UBOOT_CONFIG" ]; then + echo "$TARGET_PLATFORM does not define any u-boot configuration, aborting." + echo "Please add UBOOT_CONFIG to your project options file." + exit 1 + fi + + unset LDFLAGS + +# dont build in parallel because of problems + MAKEFLAGS=-j1 + +# copy compiler-gcc5.h to compiler-gcc6. for fake building + cp include/linux/compiler-gcc5.h include/linux/compiler-gcc6.h +} + +make_target() { + export PATH=$TOOLCHAIN/lib/gcc-linaro-aarch64-elf/bin/:$TOOLCHAIN/lib/gcc-linaro-arm-eabi/bin/:$PATH + CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make mrproper + CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make $UBOOT_CONFIG + CROSS_COMPILE=aarch64-elf- ARCH=arm CFLAGS="" LDFLAGS="" make HOSTCC="$HOST_CC" HOSTSTRIP="true" +} + +makeinstall_target() { + mkdir -p $TOOLCHAIN/bin + cp build/tools/mkimage $TOOLCHAIN/bin + + mkdir -p $INSTALL/usr/share/bootloader + + cp $PKG_BUILD/$UBOOT_CONFIGFILE $INSTALL/usr/share/bootloader 2>/dev/null || : + + cp -PRv $PKG_DIR/scripts/update-c2.sh $INSTALL/usr/share/bootloader/update.sh + cp -PRv $PKG_BUILD/u-boot.bin $INSTALL/usr/share/bootloader/u-boot + if [ -f $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz ]; then + cp -PRv $PROJECT_DIR/$PROJECT/splash/boot-logo.bmp.gz $INSTALL/usr/share/bootloader + elif [ -f $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz ]; then + cp -PRv $DISTRO_DIR/$DISTRO/splash/boot-logo.bmp.gz $INSTALL/usr/share/bootloader + fi +} diff --git a/packages/tools/u-boot/scripts/update-c2.sh b/projects/Odroid_C2/packages/u-boot/scripts/update-c2.sh similarity index 98% rename from packages/tools/u-boot/scripts/update-c2.sh rename to projects/Odroid_C2/packages/u-boot/scripts/update-c2.sh index c063567c0a..4593a2ba0a 100644 --- a/packages/tools/u-boot/scripts/update-c2.sh +++ b/projects/Odroid_C2/packages/u-boot/scripts/update-c2.sh @@ -2,7 +2,7 @@ ################################################################################ # This file is part of LibreELEC - https://libreelec.tv -# Copyright (C) 2016 Team LibreELEC +# 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 diff --git a/packages/tools/u-boot/patches/6e4e886/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch similarity index 100% rename from packages/tools/u-boot/patches/6e4e886/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch rename to projects/Odroid_C2/patches/u-boot/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch diff --git a/packages/tools/u-boot/patches/6e4e886/u-boot-0002-gcc7.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0002-gcc7.patch similarity index 100% rename from packages/tools/u-boot/patches/6e4e886/u-boot-0002-gcc7.patch rename to projects/Odroid_C2/patches/u-boot/u-boot-0002-gcc7.patch diff --git a/projects/Odroid_C2/patches/u-boot/u-boot-0001-set-default-boot-options.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0003-set-default-boot-options.patch similarity index 100% rename from projects/Odroid_C2/patches/u-boot/u-boot-0001-set-default-boot-options.patch rename to projects/Odroid_C2/patches/u-boot/u-boot-0003-set-default-boot-options.patch diff --git a/projects/Odroid_C2/patches/u-boot/u-boot-0002-update_cec_wakeup_code.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0004-update_cec_wakeup_code.patch similarity index 100% rename from projects/Odroid_C2/patches/u-boot/u-boot-0002-update_cec_wakeup_code.patch rename to projects/Odroid_C2/patches/u-boot/u-boot-0004-update_cec_wakeup_code.patch diff --git a/projects/Odroid_C2/patches/u-boot/u-boot-0003-update_cec_simplink_wakeup.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0005-update_cec_simplink_wakeup.patch similarity index 100% rename from projects/Odroid_C2/patches/u-boot/u-boot-0003-update_cec_simplink_wakeup.patch rename to projects/Odroid_C2/patches/u-boot/u-boot-0005-update_cec_simplink_wakeup.patch