Add toolchain rules
This commit is contained in:
@@ -18,3 +18,7 @@ Scanning ...
|
|||||||
```
|
```
|
||||||
|
|
||||||
https://askubuntu.com/questions/248817/how-to-i-connect-a-raw-serial-terminal-to-a-bluetooth-connection
|
https://askubuntu.com/questions/248817/how-to-i-connect-a-raw-serial-terminal-to-a-bluetooth-connection
|
||||||
|
|
||||||
|
|
||||||
|
# System buidlroot complet.
|
||||||
|
https://www.blaess.fr/christophe/articles/creer-un-systeme-complet-avec-buildroot/
|
||||||
|
|||||||
12
bsp/board/rpi/main.mk
Normal file
12
bsp/board/rpi/main.mk
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#
|
||||||
|
# Main rules for domo board targets.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: msg buildroot
|
||||||
|
|
||||||
|
include ../../bsp/include/rules.mk
|
||||||
|
include ../../bsp/include/buildroot.mk
|
||||||
|
include ../../bsp/include/toolchain.mk
|
||||||
|
include ../../bsp/include/dtb.mk
|
||||||
@@ -14,6 +14,12 @@ buildroot.menuconfig: buildroot.config
|
|||||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
||||||
@echo "Saving defconfig done."
|
@echo "Saving defconfig done."
|
||||||
|
|
||||||
|
toolchain.menuconfig: toolchain.config
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ menuconfig
|
||||||
|
@echo "Saving defconfig (Waiting) ...."
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
||||||
|
@echo "Saving defconfig done."
|
||||||
|
|
||||||
buildroot.nconfig: buildroot.config
|
buildroot.nconfig: buildroot.config
|
||||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ nconfig
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ nconfig
|
||||||
@echo "Saving defconfig (Waiting) ...."
|
@echo "Saving defconfig (Waiting) ...."
|
||||||
@@ -30,6 +36,11 @@ buildroot.shell: buildroot.config
|
|||||||
|
|
||||||
buildroot.config: $(BR_STAGING)/buildroot/.config
|
buildroot.config: $(BR_STAGING)/buildroot/.config
|
||||||
|
|
||||||
|
toolchain.config: $(BR_PROJECT)/configs/toolchain_defconfig
|
||||||
|
@mkdir -p $(BR_STAGING)/buildroot/
|
||||||
|
@cp $(BR_PROJECT)/configs/toolchain_defconfig $(BR_STAGING)/buildroot/.config
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ defconfig
|
||||||
|
|
||||||
$(BR_STAGING)/buildroot/.config: $(BR_PROJECT)/configs/buildroot_defconfig
|
$(BR_STAGING)/buildroot/.config: $(BR_PROJECT)/configs/buildroot_defconfig
|
||||||
@mkdir -p $(BR_STAGING)/buildroot/
|
@mkdir -p $(BR_STAGING)/buildroot/
|
||||||
@cp $(BR_PROJECT)/configs/buildroot_defconfig $(BR_STAGING)/buildroot/.config
|
@cp $(BR_PROJECT)/configs/buildroot_defconfig $(BR_STAGING)/buildroot/.config
|
||||||
@@ -39,4 +50,4 @@ buildroot.check-package:
|
|||||||
find $(BR_PROJECT)/../../bsp/buildroot_external/package/ -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) -exec $(BR_PROJECT)/../../bsp/buildroot/utils/check-package -b {} \;
|
find $(BR_PROJECT)/../../bsp/buildroot_external/package/ -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) -exec $(BR_PROJECT)/../../bsp/buildroot/utils/check-package -b {} \;
|
||||||
|
|
||||||
install.sd:
|
install.sd:
|
||||||
sudo dd if=$(BR_STAGING)/buildroot/images/sdcard.img of=/dev/sdb && sync && sync
|
sudo dd if=$(BR_STAGING)/buildroot/images/sdcard.img of=/dev/sdc && sync && sync
|
||||||
|
|||||||
26
bsp/include/toolchain.mk
Normal file
26
bsp/include/toolchain.mk
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
BR2_EXTERNAL ?= $(BR_PROJECT)/../../bsp/buildroot_external/
|
||||||
|
|
||||||
|
BR_ENV = BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(BR_STAGING)/buildroot/ WORKSPACE_DIR=$(BR_STAGING)
|
||||||
|
BR_ENV += BUILDS_ROOT=$(BR_LOCAL_BUILDS_ROOT) BOARD=$(BR_BOARD) PROJECT=$(BR_PROJECT)
|
||||||
|
BR_ENV += BR2_DEFCONFIG=$(BR_PROJECT)/configs/toolchain_defconfig BR2_DEFCONFIG_FROM_ENV=1
|
||||||
|
BR_ENV += LD_LIBRARY_PATH=$(BR_STAGING)/cross/opt/ext-toolchain/lib/
|
||||||
|
|
||||||
|
toolchain.menuconfig: toolchain.config
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ menuconfig
|
||||||
|
@echo "Saving defconfig (Waiting) ...."
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
||||||
|
@echo "Saving defconfig done."
|
||||||
|
|
||||||
|
toolchain.config: $(BR_PROJECT)/configs/toolchain_defconfig
|
||||||
|
@mkdir -p $(BR_STAGING)/buildroot/
|
||||||
|
@cp $(BR_PROJECT)/configs/toolchain_defconfig $(BR_STAGING)/buildroot/.config
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ defconfig
|
||||||
|
|
||||||
|
toolchain: toolchain.config
|
||||||
|
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ $(BR_TARGET)
|
||||||
|
|
||||||
|
toolchain.archive:
|
||||||
|
$(BR_PROJECT)/../../bsp/scripts/toolchain_build.sh $(BR_STAGING)/cross $(BR_LOCAL_BUILDS_ROOT)/delivery/
|
||||||
0
bsp/scripts/clean_external_packages.sh
Normal file → Executable file
0
bsp/scripts/clean_external_packages.sh
Normal file → Executable file
35
bsp/scripts/toolchain_build.sh
Executable file
35
bsp/scripts/toolchain_build.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Catch build Error
|
||||||
|
function error {
|
||||||
|
|
||||||
|
echo "Docker build Failed."
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
cross_compiler_path=$1
|
||||||
|
delivery_path=$2
|
||||||
|
|
||||||
|
echo "Cross Compiler Path: $cross_compiler_path"
|
||||||
|
echo "Delivery Path: $delivery_path"
|
||||||
|
|
||||||
|
BASE=`$cross_compiler_path/bin/*-*-gcc --version | head -n 1 | cut -d ' ' -f 1 | cut -d '.' -f 1`
|
||||||
|
GCC_VERSION=`$cross_compiler_path/bin/*-*-gcc --version | head -n 1 | cut -d ' ' -f 4`
|
||||||
|
VERSION=`$cross_compiler_path/bin/*-*-gcc --version | head -n 1 | cut -d ' ' -f 3 | cut -d '-' -f 1`
|
||||||
|
|
||||||
|
LIBC=unknown
|
||||||
|
cat configs/toolchain_defconfig | grep BR2_TOOLCHAIN_BUILDROOT_GLIBC
|
||||||
|
if test $? -eq 0; then LIBC=glibc; fi
|
||||||
|
cat configs/toolchain_defconfig | grep BR2_TOOLCHAIN_BUILDROOT_UCLIBC
|
||||||
|
if test $? -eq 0; then LIBC=uclibc; fi
|
||||||
|
cat configs/toolchain_defconfig | grep BR2_TOOLCHAIN_BUILDROOT_MUSL
|
||||||
|
if test $? -eq 0; then LIBC=musl; fi
|
||||||
|
|
||||||
|
echo "BASE: $BASE"
|
||||||
|
echo "GCC_VERSION: $GCC_VERSION"
|
||||||
|
echo "VERSION: $VERSION"
|
||||||
|
echo "LIBC: $LIBC"
|
||||||
|
|
||||||
|
mkdir -p $delivery_path
|
||||||
|
cd $cross_compiler_path
|
||||||
|
tar cvzf $delivery_path/toochain_${BASE}-${GCC_VERSION}-${LIBC}-${VERSION}.tgz .
|
||||||
10
projects/rpi_minimal/Makefile
Normal file
10
projects/rpi_minimal/Makefile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# Entry point for the project.
|
||||||
|
|
||||||
|
# Define the target.
|
||||||
|
export BR_PROJECT:=$(shell pwd)
|
||||||
|
export BR_PROJECT_NAME:=rpi_minimal
|
||||||
|
|
||||||
|
export BR_BOARD:=$(shell pwd)/../../bsp/board/rpi/
|
||||||
|
|
||||||
|
include $(BR_BOARD)/main.mk
|
||||||
13
projects/rpi_minimal/configs/toolchain_defconfig
Normal file
13
projects/rpi_minimal/configs/toolchain_defconfig
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
BR2_arm=y
|
||||||
|
BR2_arm1176jzf_s=y
|
||||||
|
BR2_DL_DIR="$(BUILDS_ROOT)/dl"
|
||||||
|
BR2_HOST_DIR="$(WORKSPACE_DIR)/cross"
|
||||||
|
BR2_PRIMARY_SITE="http://cdn.nadal-fr.com/buildroot"
|
||||||
|
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||||
|
BR2_KERNEL_HEADERS_4_14=y
|
||||||
|
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||||
|
BR2_PACKAGE_HOST_GDB=y
|
||||||
|
BR2_INIT_NONE=y
|
||||||
|
BR2_SYSTEM_BIN_SH_NONE=y
|
||||||
|
# BR2_PACKAGE_BUSYBOX is not set
|
||||||
|
# BR2_TARGET_ROOTFS_TAR is not set
|
||||||
28
projects/rpi_minimal/configs/toolchain_defconfig.ok
Normal file
28
projects/rpi_minimal/configs/toolchain_defconfig.ok
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
BR2_arm=y
|
||||||
|
BR2_arm1176jzf_s=y
|
||||||
|
BR2_DL_DIR="$(BUILDS_ROOT)/dl"
|
||||||
|
BR2_HOST_DIR="$(WORKSPACE_DIR)/cross"
|
||||||
|
BR2_PRIMARY_SITE="http://cdn.nadal-fr.com/buildroot"
|
||||||
|
BR2_PACKAGE_OVERRIDE_FILE="$(BOARD)/local.mk"
|
||||||
|
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL)/patches"
|
||||||
|
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||||
|
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||||
|
BR2_PACKAGE_HOST_GDB=y
|
||||||
|
BR2_TARGET_GENERIC_HOSTNAME="rpi_Domo"
|
||||||
|
BR2_TARGET_GENERIC_ISSUE="Welcome to Domo"
|
||||||
|
BR2_INIT_NONE=y
|
||||||
|
BR2_ROOTFS_DEVICE_TABLE=""
|
||||||
|
BR2_SYSTEM_BIN_SH_NONE=y
|
||||||
|
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
|
||||||
|
# BR2_PACKAGE_BUSYBOX is not set
|
||||||
|
BR2_PACKAGE_WIRINGPI=y
|
||||||
|
BR2_PACKAGE_LIBDAEMON=y
|
||||||
|
BR2_PACKAGE_LIBUBOX=y
|
||||||
|
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
|
||||||
|
# BR2_TARGET_ROOTFS_TAR is not set
|
||||||
|
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||||
|
BR2_PACKAGE_HOST_DTC=y
|
||||||
|
BR2_PACKAGE_HOST_E2FSPROGS=y
|
||||||
|
BR2_PACKAGE_HOST_GENIMAGE=y
|
||||||
|
BR2_PACKAGE_HOST_MTOOLS=y
|
||||||
|
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
|
||||||
29
projects/rpi_minimal/post-build.sh
Executable file
29
projects/rpi_minimal/post-build.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Catch Postbuild Error
|
||||||
|
function error {
|
||||||
|
|
||||||
|
echo "Postbuild Failed."
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
set -e
|
||||||
|
trap error ERR
|
||||||
|
|
||||||
|
echo "==> POSTBUILD:"
|
||||||
|
|
||||||
|
echo "BR_STAGING: ${BR_STAGING}"
|
||||||
|
echo "BR_PROJECT: " ${BR_PROJECT}
|
||||||
|
|
||||||
|
cp -a ${BR_PROJECT}/configs/config.txt ${BR_STAGING}/buildroot/images/
|
||||||
|
|
||||||
|
if [ ! -f ${AW_STAGING}/buildroot/images/data.ext2 ];
|
||||||
|
then
|
||||||
|
echo "generate data image (10M)."
|
||||||
|
dd if=/dev/zero of=${BR_STAGING}/buildroot/images/data.ext2 bs=1k count=10000
|
||||||
|
${BR_STAGING}/cross/usr/sbin/mkfs.ext2 -i 1024 -b 1024 -F ${BR_STAGING}/buildroot/images/data.ext2
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -a ${BR_STAGING}/buildroot/images/uboot-env.bin ${BR_STAGING}/buildroot/images/uboot.env
|
||||||
|
|
||||||
|
make -C ${BR_PROJECT} dtb
|
||||||
Reference in New Issue
Block a user