]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
dtc: add device tree compiler on aarch64
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 3 Oct 2021 07:30:57 +0000 (07:30 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 3 Oct 2021 07:30:57 +0000 (07:30 +0000)
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 <arne_f@ipfire.org>
config/rootfiles/common/aarch64/dtc [new file with mode: 0644]
lfs/dtc [new file with mode: 0644]
make.sh
src/patches/dtc/dtc-1.6.1-disable_Werror.patch [new file with mode: 0644]

diff --git a/config/rootfiles/common/aarch64/dtc b/config/rootfiles/common/aarch64/dtc
new file mode 100644 (file)
index 0000000..01a6127
--- /dev/null
@@ -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 (file)
index 0000000..894b84a
--- /dev/null
+++ b/lfs/dtc
@@ -0,0 +1,81 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2021  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# 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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# 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 5c60f029bf558a47ee3777ead97ab718a3444c95..2b89eb4ec67daabac5b7b826bb9273f4f8309063 100755 (executable)
--- 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 (file)
index 0000000..89870df
--- /dev/null
@@ -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