From 4c59cad1c0f8ee5846c39007bd6734b35d66264c Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Sun, 3 Oct 2021 07:30:57 +0000 Subject: [PATCH] dtc: add device tree compiler on aarch64 u-boot for nanopi r2s (rockchip rk3328) need dtc to build the image so this adds dtc as build dependency for u-boot Signed-off-by: Arne Fitzenreiter --- config/rootfiles/common/aarch64/dtc | 20 +++++ lfs/dtc | 81 +++++++++++++++++++ make.sh | 1 + .../dtc/dtc-1.6.1-disable_Werror.patch | 12 +++ 4 files changed, 114 insertions(+) create mode 100644 config/rootfiles/common/aarch64/dtc create mode 100644 lfs/dtc create mode 100644 src/patches/dtc/dtc-1.6.1-disable_Werror.patch diff --git a/config/rootfiles/common/aarch64/dtc b/config/rootfiles/common/aarch64/dtc new file mode 100644 index 0000000000..01a6127994 --- /dev/null +++ b/config/rootfiles/common/aarch64/dtc @@ -0,0 +1,20 @@ +#bin/convert-dtsv0 +#bin/dtc +#bin/dtdiff +#bin/fdtdump +#bin/fdtget +#bin/fdtoverlay +#bin/fdtput +#include +#include/fdt.h +#include/libfdt.h +#include/libfdt_env.h +#lib/libfdt-1.6.1.so +#lib/libfdt.a +#lib/libfdt.so +#lib/libfdt.so.1 +#lib/python3.8 +#lib/python3.8/site-packages +#lib/python3.8/site-packages/_libfdt.cpython-38-aarch64-linux-gnu.so +#lib/python3.8/site-packages/libfdt-1.6.1-py3.8.egg-info +#lib/python3.8/site-packages/libfdt.py diff --git a/lfs/dtc b/lfs/dtc new file mode 100644 index 0000000000..894b84accb --- /dev/null +++ b/lfs/dtc @@ -0,0 +1,81 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2021 IPFire Team # +# # +# This program 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 3 of the License, or # +# (at your option) any later version. # +# # +# This program 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 this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.6.1 + +THISAPP = dtc-$(VER) +DL_FILE = $(THISAPP).tar.xz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +SUP_ARCH = aarch64 + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 709888bac3aad657e6020d0e491fc0ba + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dtc/dtc-1.6.1-disable_Werror.patch + + cd $(DIR_APP) && make HOME= $(MAKETUNING) + cd $(DIR_APP) && make HOME= install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 5c60f029bf..2b89eb4ec6 100755 --- a/make.sh +++ b/make.sh @@ -1515,6 +1515,7 @@ buildipfire() { lfsmake2 powertop lfsmake2 parted lfsmake2 swig + lfsmake2 dtc lfsmake2 u-boot lfsmake2 u-boot-friendlyarm lfsmake2 wireless-regdb diff --git a/src/patches/dtc/dtc-1.6.1-disable_Werror.patch b/src/patches/dtc/dtc-1.6.1-disable_Werror.patch new file mode 100644 index 0000000000..89870df818 --- /dev/null +++ b/src/patches/dtc/dtc-1.6.1-disable_Werror.patch @@ -0,0 +1,12 @@ +diff -Naur dtc-1.6.1.org/Makefile dtc-1.6.1/Makefile +--- dtc-1.6.1.org/Makefile 2021-06-08 07:00:49.000000000 +0000 ++++ dtc-1.6.1/Makefile 2021-10-01 07:57:58.344551140 +0000 +@@ -23,7 +23,7 @@ + CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK) + WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ + -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow +-CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS) ++CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) $(EXTRA_CFLAGS) + + BISON = bison + LEX = flex -- 2.39.5