[PATCH] RSB: update dtc 1.6.0 -> dtc 1.6.1

2021-11-13 Thread Karel Gardas
Fixes #4221

Note: the patch updates only dtc 1.6.0 occurrences. It leaves all other
dtc (1.4.x) usages as they are just to not break anything which depends
on older dtc versions.
---
 bare/config/devel/dtc-1.6.1-1.cfg  | 18 ++
 bare/config/devel/qemu-couverture.bset |  2 +-
 rtems/config/6/rtems-default.bset  |  2 +-
 rtems/config/7/rtems-default.bset  |  2 +-
 4 files changed, 21 insertions(+), 3 deletions(-)
 create mode 100644 bare/config/devel/dtc-1.6.1-1.cfg

diff --git a/bare/config/devel/dtc-1.6.1-1.cfg 
b/bare/config/devel/dtc-1.6.1-1.cfg
new file mode 100644
index 000..d711f7d
--- /dev/null
+++ b/bare/config/devel/dtc-1.6.1-1.cfg
@@ -0,0 +1,18 @@
+#
+# DTC (Device Tree Compiler) 1.6.1
+#
+
+%if %{release} == %{nil}
+%define release 1
+%endif
+
+%include %{_configdir}/base.cfg
+
+%define dtc_version 1.6.1
+
+%hash sha256 dtc-%{dtc_version}.tar.gz 
38a6257f2c23cb9dfa1781ac4ad122d8358e1a22d33b2da0eb492c190644a376  
+
+#
+# The DTC build instructions. We use 1.x.x Release 1.
+#
+%include %{_configdir}/dtc-1-1.cfg
diff --git a/bare/config/devel/qemu-couverture.bset 
b/bare/config/devel/qemu-couverture.bset
index fd5547c..60bec8e 100644
--- a/bare/config/devel/qemu-couverture.bset
+++ b/bare/config/devel/qemu-couverture.bset
@@ -22,5 +22,5 @@ devel/gettext-0.18.3.1-1
 devel/libffi-3.0.13-1
 devel/pixman-0.32.4-1
 devel/glib-2.48.2-1
-devel/dtc-1.6.0-1
+devel/dtc-1.6.1-1
 devel/qemu-couverture-git-1
diff --git a/rtems/config/6/rtems-default.bset 
b/rtems/config/6/rtems-default.bset
index 5ee1daf..e602126 100644
--- a/rtems/config/6/rtems-default.bset
+++ b/rtems/config/6/rtems-default.bset
@@ -8,7 +8,7 @@
 # GDB needs expat so it needs to be built before.
 #
 
-devel/dtc-1.6.0-1
+devel/dtc-1.6.1-1
 
 devel/expat-2.1.0-1
 devel/gmp-6.1.0
diff --git a/rtems/config/7/rtems-default.bset 
b/rtems/config/7/rtems-default.bset
index 69bdd5b..83adf89 100644
--- a/rtems/config/7/rtems-default.bset
+++ b/rtems/config/7/rtems-default.bset
@@ -5,7 +5,7 @@
 # GDB needs expat so it needs to be built before.
 #
 
-devel/dtc-1.6.0-1
+devel/dtc-1.6.1-1
 
 devel/expat-2.1.0-1
 devel/gmp-6.1.0
-- 
2.25.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] RSB: add GRUB2 to the RTEMS tools and use it in 6/rtems-x86_64 build set

2021-11-13 Thread Karel Gardas
---
 rtems/config/6/rtems-x86_64.bset   |  5 ++
 rtems/config/tools/rtems-grub-2.06.cfg |  8 +++
 source-builder/config/grub2.cfg| 75 ++
 3 files changed, 88 insertions(+)
 create mode 100644 rtems/config/tools/rtems-grub-2.06.cfg
 create mode 100644 source-builder/config/grub2.cfg

diff --git a/rtems/config/6/rtems-x86_64.bset b/rtems/config/6/rtems-x86_64.bset
index dbfc9e6..088c9f5 100644
--- a/rtems/config/6/rtems-x86_64.bset
+++ b/rtems/config/6/rtems-x86_64.bset
@@ -1,4 +1,9 @@
 %define release 1
 %define rtems_arch x86_64
 %define with_libgomp
+%define grub2_platform efi
+%define grub2_target x86_64
+
 %include 6/rtems-default.bset
+
+tools/rtems-grub-2.06
diff --git a/rtems/config/tools/rtems-grub-2.06.cfg 
b/rtems/config/tools/rtems-grub-2.06.cfg
new file mode 100644
index 000..977e230
--- /dev/null
+++ b/rtems/config/tools/rtems-grub-2.06.cfg
@@ -0,0 +1,8 @@
+%include %{_configdir}/checks.cfg
+%include %{_configdir}/base.cfg
+
+%define grub2_version 2.06
+
+%hash sha512 grub-%{grub2_version}.tar.xz 
4f11c648f3078567e53fc0c74d5026fdc6da4be27d188975e79d9a4df817ade0fe5ad2ddd694238a07edc45adfa02943d83c57767dd51548102b375e529e8efe
+
+%include %{_configdir}/grub2.cfg
diff --git a/source-builder/config/grub2.cfg b/source-builder/config/grub2.cfg
new file mode 100644
index 000..2333d6a
--- /dev/null
+++ b/source-builder/config/grub2.cfg
@@ -0,0 +1,75 @@
+#
+# GNU GRUB, the GRand Unified Bootloader
+#
+# This configuration file configure's, make's and install's GRUB2.
+#
+
+%define grub2_platform_supported = 1
+
+%ifos darwin
+%undefine grub2_platform_supported
+%{echo "Darwin does not support Grub2 compilation by default."}
+%{echo "If you need Grub2 on Darwin, please install objconv"}
+%{echo "and enable it by removing '%undefine grub2_platform_supported' above"}
+%endif
+
+%if %{defined grub2_platform_supported}
+
+%if %{release} == %{nil}
+%define release 1
+%endif
+
+Name:  grub2-%{grub2_version}-%{_host}-%{release}
+Summary:   GNU GRUB, the GRand Unified Bootloader v%{grub2_version} for target 
%{_target} on host %{_host}
+Version:   %{grub2_version}
+Release:   %{release}
+URL:  https://www.gnu.org/software/grub/index.html
+
+#
+# Source
+#
+%source set grub2 https://ftp.gnu.org/gnu/grub/grub-%{grub2_version}.tar.xz
+
+#
+# Prepare the source code.
+#
+%prep
+  build_top=$(pwd)
+
+  %source setup grub2 -q -n grub-%{grub2_version}
+
+  cd ${build_top}
+
+%build
+  build_top=$(pwd)
+
+  cd grub-%{grub2_version}
+
+  %{host_build_flags}
+
+  ./configure \
+--build=%{_build} --host=%{_host} \
+--verbose \
+--prefix=%{_prefix} --bindir=%{_bindir} \
+--exec-prefix=%{_exec_prefix} \
+--includedir=%{_includedir} --libdir=%{_libdir} \
+--mandir=%{_mandir} --infodir=%{_infodir} \
+--with-platform=%{grub2_platform} \
+--target=%{grub2_target} \
+--disable-libzfs   # broken on FreeBSD and not needed at all
+
+  %{__make} %{?_smp_mflags} all
+
+  cd ${build_top}
+
+%install
+  build_top=$(pwd)
+
+  rm -rf $SB_BUILD_ROOT
+
+  cd grub-%{grub2_version}
+  %{__make} DESTDIR=$SB_BUILD_ROOT install
+
+  cd ${build_top}
+
+%endif
-- 
2.25.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] RSB: add GRUB2 to the RTEMS tools and use it in 6/rtems-x86_64 build set

2021-11-13 Thread Karel Gardas


This patch is tested on Ubuntu 20.04, FreeBSD 13 and Mac OS X Catalina.
It is not tested on Windows due to IMHO current documentation for
Windows host to be either out-dated or not correct and I'm not able to
follow it to even build RSB without the patch.

Yes, on FreeBSD 13 the patch is tested after applying dtc 1.6.1 update
patch to unbreak FreeBSD build first.

Karel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] RSB: fix hash setup for binutils 2.37

2021-11-13 Thread Karel Gardas
---
 rtems/config/tools/rtems-binutils-2.37.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rtems/config/tools/rtems-binutils-2.37.cfg 
b/rtems/config/tools/rtems-binutils-2.37.cfg
index dbdc38c..8cbe738 100644
--- a/rtems/config/tools/rtems-binutils-2.37.cfg
+++ b/rtems/config/tools/rtems-binutils-2.37.cfg
@@ -4,7 +4,7 @@
 %define binutils_version 2.37
 #%define binutils_external 1
 
-%hash sha512 %{binutils_version}.tar.bz2 
s/UYRpf3fpTJXUj2h53iFOteF6pu+OlvZVMNFX5RWxri8pDphFPk/xJkYlIPoPY4UrbhyPuzl+0uQZhDNrx4xg==
+%hash sha512 binutils-%{binutils_version}.tar.bz2 
s/UYRpf3fpTJXUj2h53iFOteF6pu+OlvZVMNFX5RWxri8pDphFPk/xJkYlIPoPY4UrbhyPuzl+0uQZhDNrx4xg==
 
 %define with_deterministic_archives 1
 %define with_64_bit_bfd 1
-- 
2.25.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] waf: Add --rtems-version as a configure option

2021-11-13 Thread chrisj
From: Chris Johns 

- Provide the option `--rtems-version` to set the major version
  number

- Add a method to handle setting action values

- Return the spec YAML file back to it's original values
  as it does not allow a user to change the version.

Closes #4548
---
 spec/build/cpukit/optvermaj.yml |  6 +++---
 wscript | 22 ++
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/spec/build/cpukit/optvermaj.yml b/spec/build/cpukit/optvermaj.yml
index e1a5eae5b3..8cb87c29f3 100644
--- a/spec/build/cpukit/optvermaj.yml
+++ b/spec/build/cpukit/optvermaj.yml
@@ -1,16 +1,16 @@
 SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
 actions:
-- get-string: null
+- set-value: '6'
 - env-assign: null
 build-type: option
 copyrights:
 - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
-default: 6
+default: null
 default-by-variant: []
 description: |
   Major Component of the RTEMS Version Number
 enabled-by: true
-format: '{}' 
+format: '{}'
 links: []
 name: __RTEMS_MAJOR__
 type: build
diff --git a/wscript b/wscript
index 8903f1f97a..225cf671dc 100755
--- a/wscript
+++ b/wscript
@@ -1250,6 +1250,11 @@ def options(ctx):
 metavar="UID",
 help="the UID of the top-level group [default: '/grp']; it may be used 
in the bsp_defaults and configure commands",
 )
+rg.add_option(
+"--rtems-version",
+metavar="VERSION",
+help="the versinon of RTEMS to build; this is a developer option to 
test newer versions",
+)
 
 
 def check_environment(conf):
@@ -1276,6 +1281,21 @@ def check_environment(conf):
 conf.msg("Environment variable set", ev, color="RED")
 
 
+def item_set_action_value(ctx, path, value):
+item_path = os.path.dirname(path)
+if item_path not in items:
+ctx.fatal("Item '{}' was not found".format(item_path))
+item = items[item_path]
+if 'actions' not in item.data:
+ctx.fatal("Item '{}' does not contain 'actions'".format(item_path))
+action_name = os.path.basename(path)
+for action in item.data['actions']:
+if action_name in action:
+action[action_name] = value
+return
+ctx.fatal("Item '{}' does not contain action '{}'".format(item_path, 
action_name))
+
+
 def load_config_files(ctx):
 cp = configparser.ConfigParser()
 files = ctx.options.rtems_config
@@ -1454,6 +1474,8 @@ def configure(conf):
 bsp_map = resolve_option_inheritance(conf, cp)
 path_list = get_path_list(conf)
 variant_list = []
+if conf.options.rtems_version is not None:
+item_set_action_value(conf, '/cpukit/optvermaj/set-value', 
conf.options.rtems_version)
 for variant in cp.sections():
 variant = no_unicode(variant)
 variant_list.append(variant)
-- 
2.24.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel