1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-18 16:37:08 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Usama Arif 56514201ad tc0/spm: boot SP according to boot order specified in manifest
This is currently in review at:
https://review.trustedfirmware.org/c/hafnium/hafnium/+/4997/36

Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-27 17:35:35 +00:00
Arunachalam Ganapathy 86f9419b9d arm-bsp: Enable SPM build option in yocto framework
This patch adds:
spm, tf-a-tests recipes.
This builds tf-a with SPM at S-EL2 and test secure partitions at S-EL1.

Change-Id: Ia2f44f4000aa0786b945bc8fb66c9edb1a0094e8
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-27 17:35:26 +00:00
Usama Arif da57312334 arm-bsp/images: Add tc0-kernel-image
This depends on trusted-firmware-a which is the last component to be built.
Calling bitbake tc0-kernel-image will create all the required images
to boot poky.

Change-Id: Ia8675b048db4a127d32394f536632ce88fe20826
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-26 18:26:37 +00:00
Usama Arif 70a9c4991e arm-bsp/u-boot: update SHA for tc0
Change-Id: Ideb4866df92d05bdc07b53f47346ae4f381dfc6d
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-26 18:26:35 +00:00
Usama Arif 29cee51f84 arm-bsp/tc0: Enable verified u-boot
This involes creating the fitImage which contains
both the kernel and ramdisk. The fitImage is also
signed.

Change-Id: Iaedffd54751585a7ef6b467d63f5f8fb6e744aa7
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-26 18:20:22 +00:00
159 changed files with 3178 additions and 2916 deletions
@@ -62,7 +62,7 @@ XENGUEST_IMAGE_DISK_PARTITIONS ??= "1:${XENGUEST_IMAGE_DISK_SIZE}:ext4:rootfs.ta
# The "bridge" type will share the physical eth interface from dom0 with the
# domU. This will allow the domU to have access to the external network.
# The "nat" type will setup a virtual network between dom0 and domU and also
# configure and run the kea dhcp4 server on dom0 to serve the domU.
# configure and run the dhcpd on dom0 to serve the domU.
# The "none" type will not affect any networking setting between on dom0 and
# domU.
XENGUEST_IMAGE_NETWORK_TYPE ??= "bridge"
@@ -9,6 +9,10 @@ DISTRO_FEATURES_NATIVE_append = " arm-autonomy-host"
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
RDEPENDS_${KERNEL_PACKAGE_NAME}-base ?= ""
# Until we don't move to use the kea dhcp-server we build dhcp_4.4.2.bb recipe
# which depends on bind_9.11.22.bb recipe.
PREFERRED_VERSION_bind ?= "9.11%"
# Require extra machine specific settings from meta-arm-bsp dynamic-layers only
# if meta-arm-bsp is in the bblayers.conf
# Directory for meta-arm-autonomy/dynamic-layers/meta-arm-bsp machine extra settings
@@ -48,16 +48,16 @@ project compilation (those can be set in your project local.conf, for example).
The following parameters are available:
- XENGUEST_MANAGER_VOLUME_DEVICE: This is the device path used by the
- XENGUEST_MANAGER_VOLUME_DEVICE: This is the device path used by the
xenguest-manager on the device to create LVM disks when guests have a disk
configuration.
This is set by default to "/dev/sda2".
- XENGUEST_MANAGER_VOLUME_NAME: This is the LVM volume name that the
- XENGUEST_MANAGER_VOLUME_NAME: This is the LVM volume name that the
xenguest-manager will create and use to create guest LVM disks.
This is set by default to "vg-xen".
- XENGUEST_MANAGER_GUEST_DIR: This is the directory on Dom0 where the
- XENGUEST_MANAGER_GUEST_DIR: This is the directory on Dom0 where the
xenguest-manager will look for xenguest images to create during init. That's
the place where xenguest images can be added to have them automatically
created during next Dom0 boot. The xenguests found there will only be created
@@ -65,37 +65,3 @@ The following parameters are available:
name).
This is set by default to "/usr/share/guests".
Init scripts
------------
Shell scripts can be executed on the host when a guest is started. Depending on
when the script should be executed it should be installed in a different
directory on the target:
- /etc/xenguest/init.pre : Executed first, prior to guest creation
- /etc/xenguest/init.d : Executed after guest creation, but before it is started
- /etc/xenguest/init.post : Executed after starting the guest
Inside the directory, scripts will be executed in alphabetical order.
Since these scripts are sourced by xenguest-manager they can acccess functions
and variables from the parent file's scope, including:
- ${guestname} : The name of the guest being created
- ${guestdir} : The path to the guest directory
- ${guestcfgfile} : The name of the config file for the starting guest
- ${LOGFILE} : The file to append any logging to, e.g.
echo "Hello, World" >> ${LOGFILE}
Sourcing also allows the script to access params.cfg.
An example of how to create the directory and install an init shell script can
be found in:
recipes-extended/xenguest/xenguest-network.bb
Where network-bridge.sh is installed from network-bridge.sh.in
@@ -12,10 +12,9 @@ At the moment 3 types of network arrangements are provided:
- Bridge: where the guest vif is added to the created bridge interface;
- NAT: where a private subnet is created for the guest,
a kea dhcp4 server is started on the host to serve the guest
and the proper iptables rules are created
to allow the guest to access the external network;
- NAT: where a private subnet is created for the guest, a dhcpd is started on
the host to serve the guest and the proper iptables rules are created to
allow the guest to access the external network;
- None: the guest vif is not connected to the bridge.
@@ -56,20 +55,17 @@ The following parameters are available:
contains the dom0 physical interface giving the guest direct access to the
external network.
The **nat** type will setup a private network between dom0 and domU, setup
the appropriate routing table, configure and run the kea dhcp4 server
on dom0 to serve the domU and apply the iptables rules to allow the guest
to acess the external network. The kea dhcp4 server configuration for
the guest can be customised by replacing the
"meta-arm-autonomy/recipes-extended/xenguest/files/kea-subnet4.json" file
in a xenguest-network.bbappend. The kea-subnet4.json file is installed in
the appropriate routing table, configure and run the dhcpd on dom0 to serve
the domU and apply the iptables rules to allow the guest to acess the
external network. The dhcpd configuration for the guest can be customised by
replacing the
"meta-arm-autonomy/recipes-extended/xenguest/files/dhcpd-params.cfg" file
in a xenguest-network.bbappend. The dhcpd-params.cfg file is installed in
the xenguest image and copied to
"/etc/xenguest/guests/${guestname}/files/kea-subnet4.json" when the guest
"/etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg" when the guest
image is created. It will be consumed by the
"/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" script which is called by
"/etc/xen/scripts/vif-nat" script when starting/stopping the xenguest.
After guest start, "/etc/xenguest/init.post/xenguest-network-init-post.sh"
script is called to reload kea dhcp4 server with updated configuration,
after virtual network interface is ready.
In the guest project, the NAT port forward can be customised by changing
the XENGUEST_IMAGE_HOST_PORT (default: "1000 + ${domid}") and
XENGUEST_IMAGE_GUEST_PORT (default: "22") variables in local.conf or
@@ -0,0 +1,4 @@
For now, arm-autonomy-host-image-minimal installs the dhcp-server package and
the dchp-4.4.2 depends on bind 9.11 which recipe was copied from oe-core tree
https://git.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/bind?id=087e4fafeef82cfd3d71402d6b200fe831f48697
since it got removed in the https://git.openembedded.org/openembedded-core/commit/meta/recipes-connectivity?id=29949cd7cf3a660fb3bcf251f5127a4cdb2804ec patch.
@@ -0,0 +1,27 @@
From 31dde3562f287429eea94b77250d184818b49063 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 15 Oct 2018 16:55:09 +0800
Subject: [PATCH] avoid start failure with bind user
Upstream-Status: Pending
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
init.d | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.d b/init.d
index b2eec60..6e03936 100644
--- a/init.d
+++ b/init.d
@@ -57,6 +57,7 @@ case "$1" in
modprobe capability >/dev/null 2>&1 || true
if [ ! -f /etc/bind/rndc.key ]; then
/usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
+ chown root:bind /etc/bind/rndc.key >/dev/null 2>&1 || true
chmod 0640 /etc/bind/rndc.key
fi
if [ -f /var/run/named/named.pid ]; then
--
2.7.4
@@ -0,0 +1,30 @@
From 2325a92f1896a2a7f586611686801b41fbc91b50 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 27 Aug 2018 15:00:51 +0800
Subject: [PATCH] configure.in: remove useless `-L$use_openssl/lib'
Since `--with-openssl=${STAGING_DIR_HOST}${prefix}' is used in bind recipe,
the `-L$use_openssl/lib' has a hardcoded suffix, removing it is harmless
and helpful for clean up host build path in isc-config.sh
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index e85a5c6..2bbfc58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1631,7 +1631,7 @@ If you don't want OpenSSL, use --without-openssl])
fi
;;
*)
- DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
+ DST_OPENSSL_LIBS="-lcrypto"
;;
esac
fi
@@ -0,0 +1,34 @@
From a3af4a405baf5ff582e82aaba392dd9667d94bdc Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 27 Aug 2018 21:24:20 +0800
Subject: [PATCH] `named/lwresd -V' and start log hide build options
The build options expose build path directories, so hide them.
[snip]
$ named -V
|built by make with *** (options are hidden)
[snip]
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
bin/named/include/named/globals.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/named/include/named/globals.h b/bin/named/include/named/globals.h
index ba3457e..7741da7 100644
--- a/bin/named/include/named/globals.h
+++ b/bin/named/include/named/globals.h
@@ -68,7 +68,7 @@ EXTERN const char * ns_g_version INIT(VERSION);
EXTERN const char * ns_g_product INIT(PRODUCT);
EXTERN const char * ns_g_description INIT(DESCRIPTION);
EXTERN const char * ns_g_srcid INIT(SRCID);
-EXTERN const char * ns_g_configargs INIT(CONFIGARGS);
+EXTERN const char * ns_g_configargs INIT("*** (options are hidden)");
EXTERN const char * ns_g_builder INIT(BUILDER);
EXTERN in_port_t ns_g_port INIT(0);
EXTERN isc_dscp_t ns_g_dscp INIT(-1);
--
2.7.4
@@ -0,0 +1,47 @@
From edda20fb5a6e88548f85e39d34d6c074306e15bc Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Tue, 9 Jun 2015 11:22:00 -0400
Subject: [PATCH] bind: ensure searching for json headers searches sysroot
Bind can fail configure by detecting headers w/o libs[1], or
it can fail the host contamination check as per below:
ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
Rerun configure task after fixing this. The path was 'build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/build'
ERROR: Function failed: do_qa_configure
ERROR: Logfile of failure stored in: build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/temp/log.do_configure.5242
ERROR: Task 5 (meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 773 tasks of which 768 didn't need to be rerun and 1 failed.
No currently running tasks (773 of 781)
Summary: 1 task failed:
/meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure
One way to fix it would be to unconditionally disable json in bind
configure[2] but here we fix it by using the path to where we would
put the header if we had json in the sysroot, in case someone wants
to make use of the combination some day.
[1] https://trac.macports.org/ticket/45305
[2] https://trac.macports.org/changeset/126406
Upstream-Status: Inappropriate [OE Specific]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 17392fd..e85a5c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2449,7 +2449,7 @@ case "$use_libjson" in
libjson_libs=""
;;
auto|yes)
- for d in /usr /usr/local /opt/local
+ for d in "${STAGING_INCDIR}"
do
if test -f "${d}/include/json/json.h"
then
@@ -0,0 +1,2 @@
# startup options for the server
OPTIONS="-u bind"
@@ -0,0 +1,330 @@
Upstream-Status: Inappropriate [configuration]
the patch is imported from openembedded project
11/30/2010 - Qing He <qing.he@intel.com>
diff -urN bind-9.3.1.orig/conf/db.0 bind-9.3.1/conf/db.0
--- bind-9.3.1.orig/conf/db.0 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/db.0 2005-07-10 22:14:00.000000000 +0200
@@ -0,0 +1,12 @@
+;
+; BIND reverse data file for broadcast zone
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
diff -urN bind-9.3.1.orig/conf/db.127 bind-9.3.1/conf/db.127
--- bind-9.3.1.orig/conf/db.127 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/db.127 2005-07-10 22:14:00.000000000 +0200
@@ -0,0 +1,13 @@
+;
+; BIND reverse data file for local loopback interface
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
+1.0.0 IN PTR localhost.
diff -urN bind-9.3.1.orig/conf/db.empty bind-9.3.1/conf/db.empty
--- bind-9.3.1.orig/conf/db.empty 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/db.empty 2005-07-10 22:14:00.000000000 +0200
@@ -0,0 +1,14 @@
+; BIND reverse data file for empty rfc1918 zone
+;
+; DO NOT EDIT THIS FILE - it is used for multiple zones.
+; Instead, copy it, edit named.conf, and use that copy.
+;
+$TTL 86400
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 86400 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
diff -urN bind-9.3.1.orig/conf/db.255 bind-9.3.1/conf/db.255
--- bind-9.3.1.orig/conf/db.255 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/db.255 2005-07-10 22:14:00.000000000 +0200
@@ -0,0 +1,12 @@
+;
+; BIND reserve data file for broadcast zone
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
diff -urN bind-9.3.1.orig/conf/db.local bind-9.3.1/conf/db.local
--- bind-9.3.1.orig/conf/db.local 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/db.local 2005-07-10 22:14:00.000000000 +0200
@@ -0,0 +1,13 @@
+;
+; BIND data file for local loopback interface
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
+@ IN A 127.0.0.1
diff -urN bind-9.3.1.orig/conf/db.root bind-9.3.1/conf/db.root
--- bind-9.3.1.orig/conf/db.root 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/db.root 2005-07-10 22:14:00.000000000 +0200
@@ -0,0 +1,45 @@
+
+; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
+;; global options: printcmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
+;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
+
+;; QUESTION SECTION:
+;. IN NS
+
+;; ANSWER SECTION:
+. 518400 IN NS A.ROOT-SERVERS.NET.
+. 518400 IN NS B.ROOT-SERVERS.NET.
+. 518400 IN NS C.ROOT-SERVERS.NET.
+. 518400 IN NS D.ROOT-SERVERS.NET.
+. 518400 IN NS E.ROOT-SERVERS.NET.
+. 518400 IN NS F.ROOT-SERVERS.NET.
+. 518400 IN NS G.ROOT-SERVERS.NET.
+. 518400 IN NS H.ROOT-SERVERS.NET.
+. 518400 IN NS I.ROOT-SERVERS.NET.
+. 518400 IN NS J.ROOT-SERVERS.NET.
+. 518400 IN NS K.ROOT-SERVERS.NET.
+. 518400 IN NS L.ROOT-SERVERS.NET.
+. 518400 IN NS M.ROOT-SERVERS.NET.
+
+;; ADDITIONAL SECTION:
+A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
+B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
+C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
+D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
+E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
+F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
+G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
+H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
+I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
+J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
+K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
+L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12
+M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
+
+;; Query time: 81 msec
+;; SERVER: 198.41.0.4#53(a.root-servers.net.)
+;; WHEN: Sun Feb 1 11:27:14 2004
+;; MSG SIZE rcvd: 436
+
diff -urN bind-9.3.1.orig/conf/named.conf bind-9.3.1/conf/named.conf
--- bind-9.3.1.orig/conf/named.conf 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/named.conf 2005-07-10 22:33:46.000000000 +0200
@@ -0,0 +1,49 @@
+// This is the primary configuration file for the BIND DNS server named.
+//
+// If you are just adding zones, please do that in /etc/bind/named.conf.local
+
+include "/etc/bind/named.conf.options";
+
+// prime the server with knowledge of the root servers
+zone "." {
+ type hint;
+ file "/etc/bind/db.root";
+};
+
+// be authoritative for the localhost forward and reverse zones, and for
+// broadcast zones as per RFC 1912
+
+zone "localhost" {
+ type master;
+ file "/etc/bind/db.local";
+};
+
+zone "127.in-addr.arpa" {
+ type master;
+ file "/etc/bind/db.127";
+};
+
+zone "0.in-addr.arpa" {
+ type master;
+ file "/etc/bind/db.0";
+};
+
+zone "255.in-addr.arpa" {
+ type master;
+ file "/etc/bind/db.255";
+};
+
+// zone "com" { type delegation-only; };
+// zone "net" { type delegation-only; };
+
+// From the release notes:
+// Because many of our users are uncomfortable receiving undelegated answers
+// from root or top level domains, other than a few for whom that behaviour
+// has been trusted and expected for quite some length of time, we have now
+// introduced the "root-delegations-only" feature which applies delegation-only
+// logic to all top level domains, and to the root domain. An exception list
+// should be specified, including "MUSEUM" and "DE", and any other top level
+// domains from whom undelegated responses are expected and trusted.
+// root-delegation-only exclude { "DE"; "MUSEUM"; };
+
+include "/etc/bind/named.conf.local";
diff -urN bind-9.3.1.orig/conf/named.conf.local bind-9.3.1/conf/named.conf.local
--- bind-9.3.1.orig/conf/named.conf.local 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/named.conf.local 2005-07-10 22:14:06.000000000 +0200
@@ -0,0 +1,8 @@
+//
+// Do any local configuration here
+//
+
+// Consider adding the 1918 zones here, if they are not used in your
+// organization
+//include "/etc/bind/zones.rfc1918";
+
diff -urN bind-9.3.1.orig/conf/named.conf.options bind-9.3.1/conf/named.conf.options
--- bind-9.3.1.orig/conf/named.conf.options 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/named.conf.options 2005-07-10 22:14:06.000000000 +0200
@@ -0,0 +1,24 @@
+options {
+ directory "/var/cache/bind";
+
+ // If there is a firewall between you and nameservers you want
+ // to talk to, you might need to uncomment the query-source
+ // directive below. Previous versions of BIND always asked
+ // questions using port 53, but BIND 8.1 and later use an unprivileged
+ // port by default.
+
+ // query-source address * port 53;
+
+ // If your ISP provided one or more IP addresses for stable
+ // nameservers, you probably want to use them as forwarders.
+ // Uncomment the following block, and insert the addresses replacing
+ // the all-0's placeholder.
+
+ // forwarders {
+ // 0.0.0.0;
+ // };
+
+ auth-nxdomain no; # conform to RFC1035
+
+};
+
diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918
--- bind-9.3.1.orig/conf/zones.rfc1918 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/conf/zones.rfc1918 2005-07-10 22:14:10.000000000 +0200
@@ -0,0 +1,20 @@
+zone "10.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+
+zone "16.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "17.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "18.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "19.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "20.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "21.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "22.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "23.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "24.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "25.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "26.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "27.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "28.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+
+zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d
--- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100
+++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# for a chrooted server: "-u bind -t /var/lib/named"
+# Don't modify this line, change or create /etc/default/bind9.
+OPTIONS=""
+
+test -f /etc/default/bind9 && . /etc/default/bind9
+
+test -x /usr/sbin/rndc || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting domain name service: named"
+
+ modprobe capability >/dev/null 2>&1 || true
+ if [ ! -f /etc/bind/rndc.key ]; then
+ /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
+ chmod 0640 /etc/bind/rndc.key
+ fi
+ if [ -f /var/run/named/named.pid ]; then
+ ps `cat /var/run/named/named.pid` > /dev/null && exit 1
+ fi
+
+ # dirs under /var/run can go away on reboots.
+ mkdir -p /var/run/named
+ mkdir -p /var/cache/bind
+ chmod 775 /var/run/named
+ chown root:bind /var/run/named >/dev/null 2>&1 || true
+
+ if [ ! -x /usr/sbin/named ]; then
+ echo "named binary missing - not starting"
+ exit 1
+ fi
+ if start-stop-daemon --start --quiet --exec /usr/sbin/named \
+ --pidfile /var/run/named/named.pid -- $OPTIONS; then
+ if [ -x /sbin/resolvconf ] ; then
+ echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo
+ fi
+ fi
+ echo "."
+ ;;
+
+ stop)
+ echo -n "Stopping domain name service: named"
+ if [ -x /sbin/resolvconf ]; then
+ /sbin/resolvconf -d lo
+ fi
+ /usr/sbin/rndc stop >/dev/null 2>&1
+ echo "."
+ ;;
+
+ reload)
+ /usr/sbin/rndc reload
+ ;;
+
+ restart|force-reload)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
@@ -0,0 +1,8 @@
#!/bin/sh
if [ ! -s /etc/bind/rndc.key ]; then
echo -n "Generating /etc/bind/rndc.key:"
/usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
chown root:bind /etc/bind/rndc.key
chmod 0640 /etc/bind/rndc.key
fi
@@ -0,0 +1,65 @@
Subject: init.d: add support for read-only rootfs
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
init.d | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/init.d b/init.d
index 0111ed4..24677c8 100644
--- a/init.d
+++ b/init.d
@@ -6,8 +6,48 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
# Don't modify this line, change or create /etc/default/bind9.
OPTIONS=""
+test -f /etc/default/rcS && . /etc/default/rcS
test -f /etc/default/bind9 && . /etc/default/bind9
+# This function is here because it's possible that /var and / are on different partitions.
+is_on_read_only_partition () {
+ DIRECTORY=$1
+ dir=`readlink -f $DIRECTORY`
+ while true; do
+ if [ ! -d "$dir" ]; then
+ echo "ERROR: $dir is not a directory"
+ exit 1
+ else
+ for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
+ END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
+ [ "$flag" = "FOUND" ] && partition="read-write"
+ [ "$flag" = "ro" ] && { partition="read-only"; break; }
+ done
+ if [ "$dir" = "/" -o -n "$partition" ]; then
+ break
+ else
+ dir=`dirname $dir`
+ fi
+ fi
+ done
+ [ "$partition" = "read-only" ] && echo "yes" || echo "no"
+}
+
+bind_mount () {
+ olddir=$1
+ newdir=$2
+ mkdir -p $olddir
+ cp -a $newdir/* $olddir
+ mount --bind $olddir $newdir
+}
+
+# Deal with read-only rootfs
+if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
+ [ "$VERBOSE" != "no" ] && echo "WARN: start bind service in read-only rootfs"
+ [ `is_on_read_only_partition /etc/bind` = "yes" ] && bind_mount /var/volatile/bind/etc /etc/bind
+ [ `is_on_read_only_partition /var/named` = "yes" ] && bind_mount /var/volatile/bind/named /var/named
+fi
+
test -x /usr/sbin/rndc || exit 0
case "$1" in
--
1.7.9.5
@@ -0,0 +1,42 @@
bind: make "/etc/init.d/bind stop" work
Upstream-Status: Inappropriate [configuration]
Add some configurations, make rndc command be able to controls
the named daemon.
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
conf/named.conf | 5 +++++
conf/rndc.conf | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
create mode 100644 conf/rndc.conf
diff --git a/conf/named.conf b/conf/named.conf
index 95829cf..c8899e7 100644
--- a/conf/named.conf
+++ b/conf/named.conf
@@ -47,3 +47,8 @@ zone "255.in-addr.arpa" {
// root-delegation-only exclude { "DE"; "MUSEUM"; };
include "/etc/bind/named.conf.local";
+include "/etc/bind/rndc.key" ;
+controls {
+ inet 127.0.0.1 allow { localhost; }
+ keys { rndc-key; };
+};
diff --git a/conf/rndc.conf b/conf/rndc.conf
new file mode 100644
index 0000000..a0b481d
--- /dev/null
+++ b/conf/rndc.conf
@@ -0,0 +1,5 @@
+include "/etc/bind/rndc.key";
+options {
+ default-server localhost;
+ default-key rndc-key;
+};
--
1.7.5.4
@@ -0,0 +1,22 @@
[Unit]
Description=Berkeley Internet Name Domain (DNS)
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target
[Service]
Type=forking
EnvironmentFile=-/etc/default/bind9
PIDFile=/run/named/named.pid
ExecStartPre=@SBINDIR@/generate-rndc-key.sh
ExecStart=@SBINDIR@/named $OPTIONS
ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID'
ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID'
PrivateTmp=true
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,140 @@
SUMMARY = "ISC Internet Domain Name Server"
HOMEPAGE = "http://www.isc.org/sw/bind/"
SECTION = "console/network"
LICENSE = "ISC & BSD"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bf39058a7f64b2a934ce14dc9ec1dd45"
DEPENDS = "openssl libcap zlib"
SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
file://conf.patch \
file://named.service \
file://bind9 \
file://generate-rndc-key.sh \
file://make-etc-initd-bind-stop-work.patch \
file://init.d-add-support-for-read-only-rootfs.patch \
file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \
file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
file://0001-avoid-start-failure-with-bind-user.patch \
"
SRC_URI[sha256sum] = "afc6d8015006f1cabf699ff19f517bb8fd9c1811e5231f26baf51c3550262ac9"
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
# stay at 9.11 until 9.16, from 9.16 follow the ESV versions divisible by 4
UPSTREAM_CHECK_REGEX = "(?P<pver>9.(11|16|20|24|28)(\.\d+)+(-P\d+)*)/"
# BIND >= 9.11.2 need dhcpd >= 4.4.0,
# don't report it here since dhcpd is already recent enough.
CVE_CHECK_WHITELIST += "CVE-2019-6470"
inherit autotools update-rc.d systemd useradd pkgconfig multilib_script multilib_header
MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh"
# PACKAGECONFIGs readline and libedit should NOT be set at same time
PACKAGECONFIG ?= "readline"
PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,,"
PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \
--disable-devpoll --enable-epoll --with-gost=no \
--with-gssapi=no --with-ecdsa=yes --with-eddsa=no \
--with-lmdb=no \
--sysconfdir=${sysconfdir}/bind \
--with-openssl=${STAGING_DIR_HOST}${prefix} \
"
inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
# dhcp needs .la so keep them
REMOVE_LIBTOOL_LA = "0"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
--user-group bind"
INITSCRIPT_NAME = "bind"
INITSCRIPT_PARAMS = "defaults"
SYSTEMD_SERVICE_${PN} = "named.service"
do_install_prepend() {
# clean host path in isc-config.sh before the hardlink created
# by "make install":
# bind9-config -> isc-config.sh
sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
}
do_install_append() {
rmdir "${D}${localstatedir}/run"
rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
install -d -o bind "${D}${localstatedir}/cache/bind"
install -d "${D}${sysconfdir}/bind"
install -d "${D}${sysconfdir}/init.d"
install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
${D}${sbindir}/dnssec-coverage \
${D}${sbindir}/dnssec-checkds \
${D}${sbindir}/dnssec-keymgr
fi
# Install systemd related files
install -d ${D}${sbindir}
install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-e 's,@SBINDIR@,${sbindir},g' \
${D}${systemd_unitdir}/system/named.service
install -d ${D}${sysconfdir}/default
install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/tmpfiles.d
echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
fi
oe_multilib_header isc/platform.h
}
CONFFILES_${PN} = " \
${sysconfdir}/bind/named.conf \
${sysconfdir}/bind/named.conf.local \
${sysconfdir}/bind/named.conf.options \
${sysconfdir}/bind/db.0 \
${sysconfdir}/bind/db.127 \
${sysconfdir}/bind/db.empty \
${sysconfdir}/bind/db.local \
${sysconfdir}/bind/db.root \
"
ALTERNATIVE_${PN}-utils = "nslookup"
ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
ALTERNATIVE_PRIORITY = "100"
PACKAGE_BEFORE_PN += "${PN}-utils"
FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
FILES_${PN}-dev += "${bindir}/isc-config.h"
FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
PACKAGE_BEFORE_PN += "${PN}-libs"
FILES_${PN}-libs = "${libdir}/*.so*"
FILES_${PN}-staticdev += "${libdir}/*.la"
PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
RDEPENDS_${PN}-dev = ""
RDEPENDS_python3-bind = "python3-core python3-ply"
@@ -0,0 +1,3 @@
For now, arm-autonomy-host-image-minimal installs the dhcp-server package and
the dchp recipe was copied from oe-core tree https://git.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/dhcp?id=087e4fafeef82cfd3d71402d6b200fe831f48697
since it got removed in the https://git.openembedded.org/openembedded-core/commit/meta/recipes-connectivity?id=7e3357892f204788162747e907d68f857118cf42 patch.
@@ -0,0 +1,149 @@
SECTION = "console/network"
SUMMARY = "Internet Software Consortium DHCP package"
DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \
which allows individual devices on an IP network to get their own \
network configuration information from a server. DHCP helps make it \
easier to administer devices."
HOMEPAGE = "http://www.isc.org/"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=004a4db50a1e20972e924a8618747c01"
DEPENDS = "openssl bind"
SRC_URI = "http://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
file://init-relay file://default-relay \
file://init-server file://default-server \
file://dhclient.conf file://dhcpd.conf \
file://dhclient-systemd-wrapper \
file://dhclient.service \
file://dhcpd.service file://dhcrelay.service \
file://dhcpd6.service \
"
UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
inherit autotools-brokensep systemd useradd update-rc.d
USERADD_PACKAGES = "${PN}-server"
USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client"
SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service"
SYSTEMD_AUTO_ENABLE_${PN}-server = "disable"
SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service"
SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable"
SYSTEMD_SERVICE_${PN}-client = "dhclient.service"
SYSTEMD_AUTO_ENABLE_${PN}-client = "disable"
INITSCRIPT_PACKAGES = "dhcp-server"
INITSCRIPT_NAME_dhcp-server = "dhcp-server"
INITSCRIPT_PARAMS_dhcp-server = "defaults"
CFLAGS += "-D_GNU_SOURCE"
EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
--with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
--with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \
--enable-paranoia --disable-static \
--with-randomdev=/dev/random \
--with-libbind=${STAGING_DIR_HOST} \
--enable-libtool \
"
#Enable shared libs per dhcp README
do_configure_prepend () {
cp configure.ac+lt configure.ac
}
do_install_append () {
install -d ${D}${sysconfdir}/init.d
install -d ${D}${sysconfdir}/default
install -d ${D}${sysconfdir}/dhcp
install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
rm -f ${D}${sysconfdir}/dhclient.conf*
rm -f ${D}${sysconfdir}/dhcpd.conf*
install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
install -d ${D}${base_sbindir}/
if [ "${sbindir}" != "${base_sbindir}" ]; then
mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
fi
install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
install -d ${D}${base_sbindir}
install -m 0755 ${WORKDIR}/dhclient-systemd-wrapper ${D}${base_sbindir}/dhclient-systemd-wrapper
install -m 0644 ${WORKDIR}/dhclient.service ${D}${systemd_unitdir}/system
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhclient.service
sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/dhclient.service
}
PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
PACKAGES_remove = "${PN}"
RDEPENDS_${PN}-client += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'iproute2', '', d)}"
RDEPENDS_${PN}-dev = ""
RDEPENDS_${PN}-staticdev = ""
FILES_${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0* ${libdir}/libdhcp.so.0*"
FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server"
RRECOMMENDS_${PN}-server = "dhcp-server-config"
FILES_${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
FILES_${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
FILES_${PN}-client = "${base_sbindir}/dhclient \
${base_sbindir}/dhclient-script \
${sysconfdir}/dhcp/dhclient.conf \
${base_sbindir}/dhclient-systemd-wrapper \
"
FILES_${PN}-omshell = "${bindir}/omshell"
pkg_postinst_dhcp-server() {
mkdir -p $D/${localstatedir}/lib/dhcp
touch $D/${localstatedir}/lib/dhcp/dhcpd.leases
touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases
}
pkg_postinst_dhcp-client() {
mkdir -p $D/${localstatedir}/lib/dhcp
}
pkg_postrm_dhcp-server() {
rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases
rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases
if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
fi
}
pkg_postrm_dhcp-client() {
rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases
rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases
if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
fi
}
@@ -0,0 +1,27 @@
From 7cc29144535a622fc671dc86eb1da65b0473a7c4 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 16:14:22 +0800
Subject: [PATCH 01/11] define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF
Upstream-Status: Inappropriate [OE specific]
Rebase to 4.3.6
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
includes/site.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: dhcp-4.4.1/includes/site.h
===================================================================
--- dhcp-4.4.1.orig/includes/site.h
+++ dhcp-4.4.1/includes/site.h
@@ -148,7 +148,8 @@
/* Define this if you want the dhcpd.conf file to go somewhere other than
the default location. By default, it goes in /etc/dhcpd.conf. */
-/* #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" */
+#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
+#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
/* Network API definitions. You do not need to choose one of these - if
you don't choose, one will be chosen for you in your system's config
@@ -0,0 +1,65 @@
From eec0503cfc36f63d777f5cb3f2719cecedcb8468 Mon Sep 17 00:00:00 2001
From: Haris Okanovic <haris.okanovic@ni.com>
Date: Mon, 7 Jan 2019 13:22:09 -0600
Subject: [PATCH] Workaround busybox limitation in Linux dhclient-script
Busybox is a lightweight implementation of coreutils commonly used on
space-constrained embedded Linux distributions. It's implementation of
chown and chmod doesn't provide a "--reference" option added to
client/scripts/linux as of commit 9261cb14. This change works around
that limitation by using stat to read ownership and permissions flags
and simple chown/chmod calls supported in both coreutils and busybox.
modified: client/scripts/linux
Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Upstream-Status: Pending [ISC-Bugs #48771]
---
client/scripts/linux | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/client/scripts/linux b/client/scripts/linux
index 0c429697..2435a44b 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -32,6 +32,17 @@
# if your system holds ip tool in a non-standard location.
ip=/sbin/ip
+chown_chmod_by_reference() {
+ local reference_file="$1"
+ local target_file="$2"
+
+ local owner=$(stat -c "%u:%g" "$reference_file")
+ local perm=$(stat -c "%a" "$reference_file")
+
+ chown "$owner" "$target_file"
+ chmod "$perm" "$target_file"
+}
+
# update /etc/resolv.conf based on received values
# This updated version mostly follows Debian script by Andrew Pollock et al.
make_resolv_conf() {
@@ -74,8 +85,7 @@ make_resolv_conf() {
fi
if [ -f /etc/resolv.conf ]; then
- chown --reference=/etc/resolv.conf $new_resolv_conf
- chmod --reference=/etc/resolv.conf $new_resolv_conf
+ chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf
fi
mv -f $new_resolv_conf /etc/resolv.conf
# DHCPv6
@@ -101,8 +111,7 @@ make_resolv_conf() {
fi
if [ -f /etc/resolv.conf ]; then
- chown --reference=/etc/resolv.conf $new_resolv_conf
- chmod --reference=/etc/resolv.conf $new_resolv_conf
+ chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf
fi
mv -f $new_resolv_conf /etc/resolv.conf
fi
--
2.20.0
@@ -0,0 +1,117 @@
From be7540d31c356e80ee02e90e8bf162b7ac6e5ba5 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 14:56:56 +0800
Subject: [PATCH 02/11] dhclient dbus
Upstream-Status: Inappropriate [distribution]
Rebase to 4.3.6
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
client/scripts/bsdos | 5 +++++
client/scripts/freebsd | 5 +++++
client/scripts/linux | 5 +++++
client/scripts/netbsd | 5 +++++
client/scripts/openbsd | 5 +++++
client/scripts/solaris | 5 +++++
6 files changed, 30 insertions(+)
diff --git a/client/scripts/bsdos b/client/scripts/bsdos
index d69d0d8..095b143 100755
--- a/client/scripts/bsdos
+++ b/client/scripts/bsdos
@@ -45,6 +45,11 @@ exit_with_hooks() {
. /etc/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
diff --git a/client/scripts/freebsd b/client/scripts/freebsd
index 8f3e2a2..ad7fb44 100755
--- a/client/scripts/freebsd
+++ b/client/scripts/freebsd
@@ -89,6 +89,11 @@ exit_with_hooks() {
. /etc/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
diff --git a/client/scripts/linux b/client/scripts/linux
index 5fb1612..3d447b6 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -174,6 +174,11 @@ exit_with_hooks() {
exit_status=$?
fi
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
diff --git a/client/scripts/netbsd b/client/scripts/netbsd
index 07383b7..aaba8e8 100755
--- a/client/scripts/netbsd
+++ b/client/scripts/netbsd
@@ -45,6 +45,11 @@ exit_with_hooks() {
. /etc/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
diff --git a/client/scripts/openbsd b/client/scripts/openbsd
index e7f4746..56b980c 100644
--- a/client/scripts/openbsd
+++ b/client/scripts/openbsd
@@ -45,6 +45,11 @@ exit_with_hooks() {
. /etc/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
diff --git a/client/scripts/solaris b/client/scripts/solaris
index af553b9..4a2aa69 100755
--- a/client/scripts/solaris
+++ b/client/scripts/solaris
@@ -26,6 +26,11 @@ exit_with_hooks() {
. /etc/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
--
1.8.3.1
@@ -0,0 +1,35 @@
From d80bd792323dbd56269309f85b4506eb6b1b60e9 Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei@gherzan.ro>
Date: Tue, 15 Aug 2017 15:05:47 +0800
Subject: [PATCH 03/11] link with lcrypto
From 4.2.0 final release, -lcrypto check was removed and we compile
static libraries
from bind that are linked to libcrypto. This is why i added a patch in
order to add
-lcrypto to LIBS.
Upstream-Status: Pending
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Rebase to 4.3.6
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure.ac | 4 ++++
1 file changed, 4 insertions(+)
Index: dhcp-4.4.1/configure.ac
===================================================================
--- dhcp-4.4.1.orig/configure.ac
+++ dhcp-4.4.1/configure.ac
@@ -612,6 +612,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
# Look for optional headers.
AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+# find an MD5 library
+AC_SEARCH_LIBS(MD5_Init, [crypto])
+AC_SEARCH_LIBS(MD5Init, [crypto])
+
# Solaris needs some libraries for functions
AC_SEARCH_LIBS(socket, [socket])
AC_SEARCH_LIBS(inet_ntoa, [nsl])
@@ -0,0 +1,95 @@
From cccec0344d68dac4100b6f260ee24e7c2da9dfda Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 15:08:22 +0800
Subject: [PATCH 04/11] Fix out of tree builds
Upstream-Status: Pending
RP 2013/03/21
Rebase to 4.3.6
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
client/Makefile.am | 4 ++--
common/Makefile.am | 3 ++-
dhcpctl/Makefile.am | 2 ++
omapip/Makefile.am | 1 +
relay/Makefile.am | 2 +-
server/Makefile.am | 2 +-
6 files changed, 9 insertions(+), 5 deletions(-)
Index: dhcp-4.4.1/common/Makefile.am
===================================================================
--- dhcp-4.4.1.orig/common/Makefile.am
+++ dhcp-4.4.1/common/Makefile.am
@@ -1,4 +1,5 @@
-AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
+AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
+
AM_CFLAGS = $(LDAP_CFLAGS)
lib_LIBRARIES = libdhcp.a
Index: dhcp-4.4.1/dhcpctl/Makefile.am
===================================================================
--- dhcp-4.4.1.orig/dhcpctl/Makefile.am
+++ dhcp-4.4.1/dhcpctl/Makefile.am
@@ -3,6 +3,8 @@ BINDLIBDNSDIR=@BINDLIBDNSDIR@
BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
BINDLIBISCDIR=@BINDLIBISCDIR@
+AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
+
bin_PROGRAMS = omshell
lib_LIBRARIES = libdhcpctl.a
noinst_PROGRAMS = cltest
Index: dhcp-4.4.1/server/Makefile.am
===================================================================
--- dhcp-4.4.1.orig/server/Makefile.am
+++ dhcp-4.4.1/server/Makefile.am
@@ -4,7 +4,7 @@
# production code. Sadly, we are not there yet.
SUBDIRS = . tests
-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
+AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
dist_sysconf_DATA = dhcpd.conf.example
sbin_PROGRAMS = dhcpd
Index: dhcp-4.4.1/client/Makefile.am
===================================================================
--- dhcp-4.4.1.orig/client/Makefile.am
+++ dhcp-4.4.1/client/Makefile.am
@@ -5,7 +5,7 @@
SUBDIRS = . tests
AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"'
-AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"'
+AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"' -I$(top_srcdir)/includes
dist_sysconf_DATA = dhclient.conf.example
sbin_PROGRAMS = dhclient
Index: dhcp-4.4.1/omapip/Makefile.am
===================================================================
--- dhcp-4.4.1.orig/omapip/Makefile.am
+++ dhcp-4.4.1/omapip/Makefile.am
@@ -2,6 +2,7 @@ BINDLIBIRSDIR=@BINDLIBIRSDIR@
BINDLIBDNSDIR=@BINDLIBDNSDIR@
BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
BINDLIBISCDIR=@BINDLIBISCDIR@
+AM_CPPFLAGS = -I$(top_srcdir)/includes
lib_LIBRARIES = libomapi.a
noinst_PROGRAMS = svtest
Index: dhcp-4.4.1/relay/Makefile.am
===================================================================
--- dhcp-4.4.1.orig/relay/Makefile.am
+++ dhcp-4.4.1/relay/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = . tests
-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
+AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
sbin_PROGRAMS = dhcrelay
dhcrelay_SOURCES = dhcrelay.c
@@ -0,0 +1,36 @@
From 2e8ff0e4f6d39e346ea86b8c514ab4ccc78fa359 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 15:24:14 +0800
Subject: [PATCH 05/11] dhcp-client: fix invoke dhclient-script failed on
Read-only file system
In read-only file system, '/etc' is on the readonly partition,
and '/etc/resolv.conf' is symlinked to a separate writable
partition.
In this situation, we create temp files 'resolv.conf.dhclient-new'
in /tmp dir.
Upstream-Status: Pending
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
client/scripts/linux | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/scripts/linux b/client/scripts/linux
index 3d447b6..3122a75 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -40,7 +40,7 @@ make_resolv_conf() {
# DHCPv4
if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
[ -n "$new_domain_name_servers" ]; then
- new_resolv_conf=/etc/resolv.conf.dhclient-new
+ new_resolv_conf=/tmp/resolv.conf.dhclient-new
rm -f $new_resolv_conf
if [ -n "$new_domain_name" ]; then
--
1.8.3.1
@@ -0,0 +1,62 @@
From 7107511fd209f08f9a96f8938041ae48f3295895 Mon Sep 17 00:00:00 2001
From: Christopher Larson <chris_larson@mentor.com>
Date: Tue, 15 Aug 2017 16:17:49 +0800
Subject: [PATCH 07/11] Add configure argument to make the libxml2 dependency
explicit and determinisitic.
Upstream-Status: Pending
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Rebase to 4.3.6
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure.ac | 11 +++++++++++
1 file changed, 11 insertions(+)
Index: dhcp-4.4.1/configure.ac
===================================================================
--- dhcp-4.4.1.orig/configure.ac
+++ dhcp-4.4.1/configure.ac
@@ -642,6 +642,17 @@ if test "$have_nanosleep" = "rt"; then
LIBS="-lrt $LIBS"
fi
+AC_ARG_WITH(libxml2,
+ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
+ with_libxml2="$withval", with_libxml2="no")
+
+if test x$with_libxml2 != xno; then
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
+ [if test x$with_libxml2 != xauto; then
+ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
+ fi])
+fi
+
# check for /dev/random (declares HAVE_DEV_RANDOM)
AC_MSG_CHECKING(for random device)
AC_ARG_WITH(randomdev,
Index: dhcp-4.4.1/configure.ac+lt
===================================================================
--- dhcp-4.4.1.orig/configure.ac+lt
+++ dhcp-4.4.1/configure.ac+lt
@@ -909,6 +909,18 @@ elif test "$want_libtool" = "yes" -a "$u
fi
AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
+AC_ARG_WITH(libxml2,
+ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
+ with_libxml2="$withval", with_libxml2="no")
+
+if test x$with_libxml2 != xno; then
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
+ [if test x$with_libxml2 != xauto; then
+ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
+ fi])
+fi
+
+
# OpenLDAP support.
AC_ARG_WITH(ldap,
AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
@@ -0,0 +1,28 @@
From f3f8b7726e50e24ef3edf5fa5a17e31d39118d7e Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Tue, 15 Aug 2017 15:49:31 +0800
Subject: [PATCH 09/11] remove dhclient-script bash dependency
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Rebase to 4.3.6
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
client/scripts/linux | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/scripts/linux b/client/scripts/linux
index 3122a75..1712d7d 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# dhclient-script for Linux. Dan Halbert, March, 1997.
# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
# No guarantees about this. I'm a novice at the details of Linux
--
1.8.3.1
@@ -0,0 +1,34 @@
From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001
From: Awais Belal <awais_belal@mentor.com>
Date: Wed, 25 Oct 2017 21:00:05 +0500
Subject: [PATCH] dhcp: correct the intention for xml2 lib search
A missing case breaks the build when libxml2 is
required and found appropriately. The third argument
to the function AC_SEARCH_LIB is action-if-found which
was mistakenly been used for the case where the library
is not found and hence breaks the configure phase
where it shoud actually pass.
We now pass on silently when action-if-found is
executed.
Upstream-Status: Pending
Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: dhcp-4.4.1/configure.ac
===================================================================
--- dhcp-4.4.1.orig/configure.ac
+++ dhcp-4.4.1/configure.ac
@@ -647,7 +647,7 @@ AC_ARG_WITH(libxml2,
with_libxml2="$withval", with_libxml2="no")
if test x$with_libxml2 != xno; then
- AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
[if test x$with_libxml2 != xauto; then
AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
fi])
@@ -0,0 +1,64 @@
lib and include path is hardcoded for use_libbind
use libdir and includedir vars
Upstream-Status: Pending
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Index: dhcp-4.4.1/configure.ac+lt
===================================================================
--- dhcp-4.4.1.orig/configure.ac+lt
+++ dhcp-4.4.1/configure.ac+lt
@@ -801,22 +801,22 @@ no)
if test ! -d "$use_libbind"; then
AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
fi
- if test ! -d "$use_libbind/include" -o \
- ! -f "$use_libbind/include/isc/buffer.h"
+ if test ! -d "$use_libbind/$includedir" -o \
+ ! -f "$use_libbind/$includedir/isc/buffer.h"
then
- AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
+ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/$includedir])
fi
- if test ! -d "$use_libbind/lib" -o \
- \( ! -f "$use_libbind/lib/libisc.a" -a \
- ! -f "$use_libbind/lib/libisc.la" \)
+ if test ! -d "$use_libbind/$libdir" -o \
+ \( ! -f "$use_libbind/$libdir/libisc.a" -a \
+ ! -f "$use_libbind/$libdir/libisc.la" \)
then
- AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
+ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/$libdir])
fi
BINDDIR="$use_libbind"
- BINDLIBIRSDIR="$BINDDIR/lib"
- BINDLIBDNSDIR="$BINDDIR/lib"
- BINDLIBISCCFGDIR="$BINDDIR/lib"
- BINDLIBISCDIR="$BINDDIR/lib"
+ BINDLIBIRSDIR="$BINDDIR/$libdir"
+ BINDLIBDNSDIR="$BINDDIR/$libdir"
+ BINDLIBISCCFGDIR="$BINDDIR/$libdir"
+ BINDLIBISCDIR="$BINDDIR/$libdir"
DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
;;
esac
@@ -856,14 +856,14 @@ AC_ARG_ENABLE(libtool,
if test "$use_libbind" != "no"; then
if test "$want_libtool" = "yes" -a \
- ! -f "$use_libbind/lib/libisc.la"
+ ! -f "$use_libbind/$libdir/libisc.la"
then
- AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
+ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/$libdir])
fi
if test "$want_libtool" = "no" -a \
- ! -f "$use_libbind/lib/libisc.a"
+ ! -f "$use_libbind/$libdir/libisc.a"
then
- AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
+ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/$libdir])
fi
fi
@@ -0,0 +1,23 @@
require dhcp.inc
SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \
file://0002-dhclient-dbus.patch \
file://0003-link-with-lcrypto.patch \
file://0004-Fix-out-of-tree-builds.patch \
file://0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch \
file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \
file://0009-remove-dhclient-script-bash-dependency.patch \
file://0012-dhcp-correct-the-intention-for-xml2-lib-search.patch \
file://0013-fixup_use_libbind.patch \
file://0001-workaround-busybox-limitation-in-linux-dhclient-script.patch \
"
SRC_URI[md5sum] = "2afdaf8498dc1edaf3012efdd589b3e1"
SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521"
LDFLAGS_append = " -pthread"
PACKAGECONFIG ?= ""
PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2"
CFLAGS += "-fcommon"
@@ -0,0 +1,12 @@
# Defaults for dhcp-relay initscript
# sourced by /etc/init.d/dhcp-relay
# What servers should the DHCP relay forward requests to?
# e.g: SERVERS="192.168.0.1"
SERVERS=""
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
INTERFACES=""
# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""
@@ -0,0 +1,7 @@
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp-server
# installed at /etc/default/dhcp-server by the maintainer scripts
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=""
@@ -0,0 +1,39 @@
#!/bin/sh
# In case the interface is used for nfs, skip it.
nfsroot=0
interfaces=""
exec 9<&0 < /proc/mounts
while read dev mtpt fstype rest; do
if test $mtpt = "/" ; then
case $fstype in
nfs | nfs4)
nfsroot=1
nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
break
;;
*)
;;
esac
fi
done
exec 0<&9 9<&-
if [ $nfsroot -eq 0 ]; then
interfaces="$INTERFACES"
else
if [ -x /bin/ip -o -x /sbin/ip ] ; then
nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
fi
for i in $INTERFACES; do
if test "x$i" = "x$nfs_iface"; then
echo "dhclient skipping nfsroot interface $i"
else
interfaces="$interfaces $i"
fi
done
fi
if test "x$interfaces" != "x"; then
/sbin/dhclient -d -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $interfaces
fi
@@ -0,0 +1,50 @@
# Configuration file for /sbin/dhclient, which is included in Debian's
# dhcp3-client package.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
#send host-name "andare.fugue.com";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}
@@ -0,0 +1,13 @@
[Unit]
Description=Dynamic Host Configuration Protocol (DHCP)
Wants=network.target
Before=network.target
After=systemd-udevd.service
[Service]
EnvironmentFile=-@SYSCONFDIR@/default/dhcp-client
ExecStart=@BASE_SBINDIR@/dhclient-systemd-wrapper
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,108 @@
#
# Sample configuration file for ISC dhcpd for Debian
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}
# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.
#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}
@@ -0,0 +1,15 @@
[Unit]
Description=DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
After=network.target
After=time-sync.target
[Service]
PIDFile=@localstatedir@/run/dhcpd.pid
EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server
ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases
ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,15 @@
[Unit]
Description=DHCPv6 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
After=network.target
After=time-sync.target
[Service]
PIDFile=@localstatedir@/run/dhcpd6.pid
EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6
ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases
ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd6.conf -pf @localstatedir@/run/dhcpd6.pid $DHCPDARGS -q $INTERFACES
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,10 @@
[Unit]
Description=DHCP Relay Agent Daemon
After=network.target
[Service]
EnvironmentFile=@SYSCONFDIR@/default/dhcp-relay
ExecStart=@SBINDIR@/dhcrelay -d --no-pid -q $SERVERS
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,44 @@
#!/bin/sh
#
# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
#
# It is not safe to start if we don't have a default configuration...
if [ ! -f /etc/default/dhcp-relay ]; then
echo "/etc/default/dhcp-relay does not exist! - Aborting..."
echo "create this file to fix the problem."
exit 1
fi
# Read init script configuration (interfaces the daemon should listen on
# and the DHCP server we should forward requests to.)
. /etc/default/dhcp-relay
# Build command line for interfaces (will be passed to dhrelay below.)
IFCMD=""
if test "$INTERFACES" != ""; then
for I in $INTERFACES; do
IFCMD=${IFCMD}"-i "${I}" "
done
fi
DHCRELAYPID=/var/run/dhcrelay.pid
case "$1" in
start)
start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
;;
stop)
start-stop-daemon -K -x /usr/sbin/dhcrelay
;;
restart | force-reload)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
exit 1
esac
exit 0
@@ -0,0 +1,44 @@
#!/bin/sh
#
# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
#
test -f /usr/sbin/dhcpd || exit 0
# It is not safe to start if we don't have a default configuration...
if [ ! -f /etc/default/dhcp-server ]; then
echo "/etc/default/dhcp-server does not exist! - Aborting..."
exit 0
fi
# Read init script configuration (so far only interfaces the daemon
# should listen on.)
. /etc/default/dhcp-server
case "$1" in
start)
echo -n "Starting DHCP server: "
test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES -user dhcp -group dhcp
echo "."
;;
stop)
echo -n "Stopping DHCP server: dhcpd3"
start-stop-daemon -K -x /usr/sbin/dhcpd
echo "."
;;
restart | force-reload)
$0 stop
sleep 2
$0 start
if [ "$?" != "0" ]; then
exit 1
fi
;;
*)
echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
exit 1
esac
exit 0
@@ -106,14 +106,7 @@ python add_extern_guests () {
_, _, path, _, _, parm = bb.fetch.decodeurl(entry)
if 'guestname' in parm:
if os.path.islink(path):
realpath = os.path.realpath(path)
if not os.path.exists(realpath):
bb.fatal("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS link does not resolve: " + path)
bb.note("Guest file is a symlink:\n " + path + "\nResolved to:\n " + realpath)
path = realpath
bb.fatal("Guest file is a symlink: " + path)
bb.utils.mkdirhier(guestdir)
dstname = parm['guestname']
# Add file extension if not there
@@ -0,0 +1,45 @@
Upstream-Status: Pending
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Copy temp files used to add/remove dhcpd configurations to avoid
replacing potential symlinks.
Index: git/tools/hotplug/Linux/vif-nat
===================================================================
--- git.orig/tools/hotplug/Linux/vif-nat
+++ git/tools/hotplug/Linux/vif-nat
@@ -99,7 +100,8 @@ dhcparg_remove_entry()
then
rm "$tmpfile"
else
- mv "$tmpfile" "$dhcpd_arg_file"
+ cp "$tmpfile" "$dhcpd_arg_file"
+ rm "$tmpfile"
fi
}
@@ -109,11 +111,11 @@ dhcparg_add_entry()
local tmpfile=$(mktemp)
# handle Red Hat, SUSE, and Debian styles, with or without quotes
sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"${dev} "'"/' \
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
sed -e 's/^DHCPD_INTERFACE="*\([^"]*\)"*/DHCPD_INTERFACE="\1'"${dev} "'"/' \
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
sed -e 's/^INTERFACES="*\([^"]*\)"*/INTERFACES="\1'"${dev} "'"/' \
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
rm -f "$tmpfile"
}
@@ -125,7 +127,8 @@ dhcp_remove_entry()
then
rm "$tmpfile"
else
- mv "$tmpfile" "$dhcpd_conf_file"
+ cp "$tmpfile" "$dhcpd_conf_file"
+ rm "$tmpfile"
fi
dhcparg_remove_entry
}
@@ -1,6 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-vif-nat-fix-hostname.patch \
file://0002-vif-nat-fix-symlink-removal.patch \
"
PACKAGECONFIG_remove = "\
@@ -18,8 +18,6 @@
domid=$(xenstore_read "${XENBUS_PATH}/frontend-id")
guestname=$(xenstore_read "/local/domain/${domid}/name")
bridge=$(xenstore_read "${XENBUS_PATH}/bridge")
mac=$(xenstore_read "$XENBUS_PATH/mac")
kea_conf_file="/etc/kea/kea-dhcp4.conf"
if [ ! -f /etc/xenguest/guests/${guestname}/params.cfg ]; then
log debug "No /etc/xenguest/guests/${guestname}/params.cfg. Exiting."
@@ -38,48 +36,63 @@ get_subnet_prefix() {
subnetprefix=$(get_subnet_prefix)
kea_remove_conf_entry()
dhcpd_remove_conf_entry()
{
log debug "kea_remove_conf_entry"
claim_lock "vif-nat-kea"
local tmpfile=$(mktemp)
# Remove the the xenguest kea config file inclusion in the kea main config
sed -i "/${kea_guest_config//'/'/'\/'}/d" "${kea_conf_file}"
# Remove the the xenguest dhcpd config file inclusion in the dhcpd
# main config
grep -v "include \"${XENGUEST_DHCPD_CONF_FILE}\";" \
"${dhcpd_conf_file}" >"${tmpfile}"
if ! diff "${tmpfile}" "${dhcpd_conf_file}" >/dev/null
then
cp "${tmpfile}" "${dhcpd_conf_file}"
fi
rm ${tmpfile}
# Remove interface entry 1st case: [ "dev1", "dev_to_remove" ]
sed -i "s/,\ \"$dev\"//" "${kea_conf_file}"
# Remove interface entry 2nd case: [ "dev_to_remove", "dev1" ]
sed -i "s/\"$dev\",\ //" "${kea_conf_file}"
# Remove interface entry 3rd case: [ "dev_to_remove" ]
sed -i "s/\[\ \"$dev\"\ \]/\[\ \]/" "${kea_conf_file}"
# Remove the generated the xenguest kea subnet conf file
rm ${XENGUEST_KEA_SUBNET_CONFIG}
keactrl reload
release_lock "vif-nat-kea"
# Remove the generated the xenguest dhcpd file
rm ${XENGUEST_DHCPD_CONF_FILE}
}
kea_add_conf_entries()
# This function removes the dhcpd options added by the vif-nat script and
# adds the user provided options under the ${XENGUEST_DHCPD_HOST_OPTIONS}
# variable set in "/etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg"
# file.
dhcpd_add_conf_entries()
{
log debug "kea_add_conf_entries"
claim_lock "vif-nat-kea"
# We need to remove the previous added entry from vif-nat script
dhcp_remove_entry
# Include vif in the interfaces 1st case - no other entries:
search_for='\"interfaces\": \[ '
sed -i "/${search_for}\"*\"\ */ s/\ \]/,\ \"${dev}\"\ \]/g" "${kea_conf_file}"
sed -i "s/${search_for}]/${search_for}\"${dev}\"\ \]/g" "${kea_conf_file}"
# Include the xenguest dhcpd config file in the dhcpd main config
echo >>"${dhcpd_conf_file}" "include \"${XENGUEST_DHCPD_CONF_FILE}\";"
# Include the xenguest kea subnet conf file in the kea main config
search_for='\"subnet4\": \['
sed -i "/$search_for/a $kea_guest_config" "${kea_conf_file}"
# Generate the xenguest dhcpd file
echo -e "$(eval "echo -e \"$(cat ${XENGUEST_DHCPD_PARAMS_FILE})\"")" \
>> "${XENGUEST_DHCPD_CONF_FILE}"
# Generate the xenguest kea subnet conf file
echo -e "$(eval "echo -e \"$(cat ${XENGUEST_KEA_SUBNET_TEMPLATE})\"")" \
> "${XENGUEST_KEA_SUBNET_CONFIG}"
# Re-add the dhcpargs entries removed by dhcp_remove_entry call
dhcparg_add_entry
}
release_lock "vif-nat-kea"
dhcpd_online(){
log debug "dhcpd_online"
claim_lock "vif-nat-dhcp"
dhcpd_add_conf_entries
release_lock "vif-nat-dhcp"
"$dhcpd_init_file" restart || true
}
dhcpd_offline(){
log debug "dhcpd_offline"
claim_lock "vif-nat-dhcp"
dhcpd_remove_conf_entry
release_lock "vif-nat-dhcp"
"$dhcpd_init_file" restart || true # We need to ignore failure because
# ISC dhcpd 3 borks if there is nothing
# for it to do, which is the case if
# the outgoing interface is not
# configured to offer leases and there
# are no vifs.
}
call_extra_hooks() {
@@ -98,29 +111,24 @@ call_extra_hooks() {
case "${XENGUEST_NETWORK_TYPE}" in
nat)
XENGUEST_KEA_SUBNET_TEMPLATE=${XENGUEST_KEA_SUBNET_TEMPLATE:-"/etc/xenguest/guests/${guestname}/files/kea-subnet4.json"}
if [ ! -f ${XENGUEST_KEA_SUBNET_TEMPLATE} ]; then
log debug "No ${XENGUEST_KEA_SUBNET_TEMPLATE} file. Aborting"
XENGUEST_DHCPD_PARAMS_FILE=${XENGUEST_DHCPD_PARAMS_FILE:-"/etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg"}
if [ ! -f ${XENGUEST_DHCPD_PARAMS_FILE} ]; then
log debug "No ${XENGUEST_DHCPD_PARAMS_FILE} file. Aborting"
return
fi
XENGUEST_KEA_SUBNET_CONFIG="/etc/kea/kea-subnet4.dom$domid.json"
if [ ! -d "$(dirname ${XENGUEST_KEA_SUBNET_CONFIG})" ]; then
log debug "No kea configuration directory. Aborting"
return
fi
kea_guest_config="\ \ \ \ <?include \"${XENGUEST_KEA_SUBNET_CONFIG}\"?>"
XENGUEST_DHCPD_CONF_FILE="/etc/dhcp/dhcpd.dom$domid.conf"
case "$command" in
online)
kea_add_conf_entries
dhcpd_online
# Enable ip forwarding and NAT for the ${bridge} interface
sysctl -w net.ipv4.ip_forward=1
iptables_w -t nat -A POSTROUTING -o ${bridge} -j MASQUERADE -m comment --comment "dom${domid}"
;;
offline)
kea_remove_conf_entry
dhcpd_offline
# Remove the NAT iptables rules created for the dom${domid}
guest_ipt_rule=$(iptables_w -t nat -vL POSTROUTING -n --line-number | grep -w dom${domid} | awk '{print $1}' | tac)
@@ -0,0 +1,30 @@
# This file holds the guest dhcpd options running on Dom0.
# The "/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" called in the end of
# the vif-nat script will use this file to generate the final dhcpd
# configuration.
# This file is added in the xenguest image and installed in dom0 under
# /etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg when the guest
# image is created.
# Any customizations to it should be performed by replacing it via a bbappend.
# The \${hostname}, \${mac}, \${vif_ip} and \${router_ip} variables are set in
# the vif-nat script context. The \${subnetprefix} variable is set in the
# 00-vif-xenguest.hook script context.
# The "subnet" configuration node is mandatory in order to have the dhcpd
# properly running.
host ${hostname} {
hardware ethernet ${mac};
fixed-address ${vif_ip};
option routers ${router_ip};
option subnet-mask 255.255.255.0;
option broadcast-address ${subnetprefix}.255;
option domain-name-servers 8.8.8.8;
option host-name \"${hostname}\";
option domain-name \"example.com\";
}
subnet ${subnetprefix}.0 netmask 255.255.255.0 {
}
@@ -1,30 +0,0 @@
# This file holds the minimal kea dhcp4 server configuration.
# It replaces existing kea dhcp configuration file via
# "/etc/init.d/kea-restore-default-config" on every system boot.
# The "/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" called in the end of
# the vif-nat script will append each xenguest configuration to this file,
# to generate the final dhcp configuration.
# This file can be replaced with xenguest-network.bbappend.
{
"Dhcp4": {
"interfaces-config": {
"interfaces": [ ]
},
"lease-database": {
"type": "memfile",
"persist": false
},
"subnet4": [
{
"subnet": "192.0.2.0/24"
}
],
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [ { "output": "/var/log/kea-dhcp4.log" } ],
"severity": "INFO"
}
]
}
}
@@ -1,29 +0,0 @@
#!/bin/sh
#
# Xenguest Restore default kea dhcp4 configuration
# This script restores a dhcp4 server configuration, to prevent
# kea startup failures after random board hangs or powercuts.
#
case "$1" in
start)
ret=$(keactrl status | grep -i "dhcpv4 server" | cut -d ' ' -f 3)
if [ "$ret" = "active" ]; then
echo "WARNING: cowardly refusing to replace dhcp4 configuration"
echo "kea dhcp4 server is up and running!"
else
echo "Resetting kea dhcp4 configuration."
cp -f /etc/kea/kea-dhcp4.conf.original /etc/kea/kea-dhcp4.conf
fi
;;
status|stop|reload|force-reload|restart)
true
;;
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
exit 1
esac
exit $?
@@ -1,35 +0,0 @@
# This file holds the guest kea dhcp4 server options running on Dom0.
# The "/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" called in the end of
# the vif-nat script will use this file to generate the final dhcp
# configuration.
# This file is added in the xenguest image and installed in dom0 under
# /etc/xenguest/guests/${guestname}/files/kea-subnet4.json when the guest
# image is created.
# Any customizations to it should be performed by replacing it via a bbappend.
# The \${vif_ip} and \${router_ip} variables are set in
# the vif-nat script context. The \${subnetprefix} and \${mac} variable are set in the
# 00-vif-xenguest.hook script context.
# The "subnet" configuration node is mandatory in order to have the dhcp
# properly running.
{
\"subnet\": \"${subnetprefix}.0/24\",
\"option-data\": [
{
\"name\": \"routers\",
\"data\": \"${router_ip}\"
},
{
\"name\": \"domain-name-servers\",
\"data\": \"8.8.8.8, 8.8.4.4\"
}
],
\"reservations\": [
{
\"hw-address\": \"${mac}\",
\"ip-address\": \"${vif_ip}\"
}
]
},
@@ -1,19 +1,30 @@
#!/bin/sh
# This script is setting up a virtual network interface connected to the
# xenguest-network-bridge if NETWORK_BRIDGE is set to 1 in the guest params
#
# Since this script is sourced by xenguest-manager, it can access variables
# such as ${guestname} from the parent file's scope, as well as those in
# params.cfg, for example XENGUEST_NETWORK_TYPE
guestname="${1}"
BRIDGE_NAME="###BRIDGE_NAME###"
case "${XENGUEST_NETWORK_TYPE:=}" in
# get guest parameters
. ./params.cfg
case "${XENGUEST_NETWORK_TYPE:-}" in
nat)
echo "vif = ['script=vif-nat']" >> ${guestcfgfile}
# Create the symlinks for the files that vif-nat script expects
if [ ! -f /etc/dhcpd.conf ]; then
ln -s dhcp/dhcpd.conf /etc/dhcpd.conf
fi
if [ ! -f /etc/init.d/dhcp3-server ]; then
ln -s dhcp-server /etc/init.d/dhcp3-server
fi
if [ ! -f /etc/default/dhcp3-server ]; then
ln -s dhcp-server /etc/default/dhcp3-server
fi
echo "vif = ['script=vif-nat']" >> ${guestname}.cfg
;;
bridge)
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestcfgfile}
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestname}.cfg
;;
*)
echo "${@}: XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
@@ -465,21 +465,16 @@ function xenguest_guest_start()
guestname="${1}"
guestdir=${XENGUEST_CONF_BASE}/guests/${guestname}
guestcfgfile=$(mktemp -u "${guestname}.XXXXXX" --tmpdir="${guestdir}" --suffix=".cfg")
# Get guest configuration
source ${guestdir}/params.cfg
pushd ${guestdir} > /dev/null 2>&1
# create config by merging all configurations together
cat guest.cfg $(find guest.d -type f 2> /dev/null) > ${guestcfgfile}
cat guest.cfg $(find guest.d -type f 2> /dev/null) > ${guestname}.cfg
# Build init script lists (ignore non existing dirs errors,
# sort alphabetically and run global scripts first)
#
# These scripts are sourced throughout the start operation if they
# are executable
init_pre="$(find ${XENGUEST_CONF_BASE}/init.pre -type f 2> /dev/null | \
sort) $(find ${guestdir}/init.pre -type f 2> /dev/null | sort)"
init_d="$(find ${XENGUEST_CONF_BASE}/init.d -type f 2> /dev/null | \
@@ -489,26 +484,21 @@ function xenguest_guest_start()
# call pre init scripts
for f in ${init_pre}; do
if [ -x "$f" ]; then
echo "( . $f )" >> ${LOGFILE} 2>&1
( . $f ) >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestcfgfile}
popd > /dev/null 2>&1
echo "Error in init script $f" >> ${LOGFILE} 2>&1
echo "${PREF} Error during pre init script of ${guestname}"
exit 1
fi
else
echo "$f is not executable. Skipping." >> ${LOGFILE}
echo "$f ${guestname}" >> ${LOGFILE} 2>&1
$f ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
echo "${PREF} Error during pre init script of ${guestname}"
exit 1
fi
done
# Create non started guest
echo "xl create -p ${guestcfgfile}" >> ${LOGFILE} 2>&1
xl create -p ${guestcfgfile} >> ${LOGFILE} 2>&1
echo "xl create -p ${guestname}.cfg" >> ${LOGFILE} 2>&1
xl create -p ${guestname}.cfg >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestcfgfile}
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
echo "${PREF} Error starting ${guestname}"
exit 1
@@ -516,20 +506,15 @@ function xenguest_guest_start()
# call init scripts
for f in ${init_d}; do
if [ -x "$f" ]; then
echo "( . $f )" >> ${LOGFILE} 2>&1
( . $f ) >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestcfgfile}
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1
echo "Error in init script $f" >> ${LOGFILE} 2>&1
echo "${PREF} Error during init script of ${guestname}"
exit 1
fi
else
echo "$f is not executable. Skipping." >> ${LOGFILE}
echo "$f ${guestname}" >> ${LOGFILE} 2>&1
$f ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1
echo "${PREF} Error during init script of ${guestname}"
exit 1
fi
done
@@ -537,7 +522,7 @@ function xenguest_guest_start()
echo "xl unpause ${guestname}" >> ${LOGFILE} 2>&1
xl unpause ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestcfgfile}
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
echo "${PREF} Error starting ${guestname}"
exit 1
@@ -545,24 +530,19 @@ function xenguest_guest_start()
# call post init scripts
for f in ${init_post}; do
if [ -x "$f" ]; then
echo "( . $f )" >> ${LOGFILE} 2>&1
( . $f ) >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestcfgfile}
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1
echo "Error in init script $f" >> ${LOGFILE} 2>&1
echo "${PREF} Error during post init script of ${guestname}"
exit 1
fi
else
echo "$f is not executable. Skipping." >> ${LOGFILE}
echo "$f ${guestname}" >> ${LOGFILE} 2>&1
$f ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1
echo "${PREF} Error during post init script of ${guestname}"
exit 1
fi
done
rm -f ${guestcfgfile}
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
}
@@ -597,22 +577,11 @@ function check_guest_exist()
fi
}
function xl_list_contains()
{
guestname="${1}"
# Select first column of xl list, and find guestname exactly using regex
running=$(xl list | awk 'NR > 1 {print $1}' | grep "^${guestname}$" || echo)
if [ "${running}" = "${guestname}" ]; then
return 0
fi
return 1
}
function check_guest_running()
{
guestname="${1}"
if ! xl_list_contains $guestname; then
running=$(xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" || echo)
if [ ! "${running}" = "${guestname}" ]; then
echo "${PREF} Guest ${guestname} is not running"
exit 1
fi
@@ -621,7 +590,8 @@ function check_guest_running()
function check_guest_not_running()
{
guestname="${1}"
if xl_list_contains $guestname; then
running=$(xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" || echo)
if [ "${running}" = "${guestname}" ]; then
echo "${PREF} Guest ${guestname} is running"
exit 1
fi
@@ -678,8 +648,10 @@ case ${cmd} in
guestname="${arg1:-}"
check_guest_arg ${cmd} ${guestname}
check_guest_exist ${guestname}
# We need to stop the guest first if it is running
if xl_list_contains $guestname; then
# We need to stop the guest first
running=$(xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" \
|| echo)
if [ "${running}" = "${guestname}" ]; then
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
@@ -727,25 +699,20 @@ case ${cmd} in
fi
;;
status)
single_status() (
guestname="${1}"
guestname="${arg1}"
if [ -n "${guestname}" ]; then
check_guest_exist ${guestname}
if xl_list_contains $guestname; then
if xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" > \
/dev/null 2>&1; then
echo "${guestname}: Running"
else
echo "${guestname}: Stopped"
fi
)
guestname="${arg1}"
if [ -n "${guestname}" ]; then
single_status ${guestname}
else
guestlist=$($this list)
if [ -n "${guestlist}" ]; then
for f in ${guestlist}; do
single_status $f
$this status $f
done
fi
fi
@@ -1,45 +0,0 @@
#!/bin/sh
# This script is to reload kea dhcp4 server when guest interface will be ready
# include locking functions
. /etc/xen/scripts/locking.sh
set +u
# $1 is vif name, e.g. "vif/15/0"
# returns 0 on success,
# 1 otherwize
#
check_if_vif_is_ready() {
ret=($(xl network-list "${guestname}" | grep "${1}"))
# ${ret[4]} is network interface status value
# 1 means vif is not ready
# 4 means vif is ready
[ "${ret[4]}" = "4" ] && return 0
return 1
}
case "${XENGUEST_NETWORK_TYPE:-}" in
nat)
vif_name="$(xl network-list ${guestname} | grep -o vif.*)"
for try in {1..20}
do
if check_if_vif_is_ready "${vif_name}"; then
claim_lock "vif-nat-kea"
keactrl reload
release_lock "vif-nat-kea"
exit 0
fi
echo "Waiting for ${vif_name} - network interface is not ready..."\
" try #${try}" >> "${LOGFILE}" 2>&1
sleep 1
done
echo "ERROR: Failed to get ${vif_name} "\
"network interface ready!" >> "${LOGFILE}" 2>&1
exit 1
;;
*)
echo "No action needed" >> "${LOGFILE}" 2>&1
;;
esac
@@ -47,13 +47,12 @@ XENGUEST_IMAGE_SRC_URI_DISK_FILES ??= ""
# Add xen files
# Any extrafiles files to be added to XENGUEST_IMAGE_SRC_URI_XEN_FILES should
# be performed via XENGUEST_IMAGE_SRC_URI_XEN_FILES_append.
# The kea-subnet4.json holds the kea dhcp4 subnet configuration for Dom0.
# And it is used when XENGUEST_IMAGE_NETWORK_TYPE="nat".
# Any customizations to it should be performed by replacing it
# via a xenguest-network.bbappend.
# The dhcpd-params.cfg holds the dhcpd configuration for Dom0. And it is used
# when XENGUEST_IMAGE_NETWORK_TYPE="nat". Any customizations to it should be
# performed by replacing it via a xenguest-network.bbappend.
# The XENGUEST_IMAGE_NAT_PORT_FORWARD_SCRIPT file is only added if the
# variable is set.
XENGUEST_IMAGE_SRC_URI_XEN_FILES = "file://kea-subnet4.json \
XENGUEST_IMAGE_SRC_URI_XEN_FILES = "file://dhcpd-params.cfg \
${@ "file://" + d.getVar('XENGUEST_IMAGE_NAT_PORT_FORWARD_SCRIPT') \
if d.getVar('XENGUEST_IMAGE_NAT_PORT_FORWARD_SCRIPT') else "" } \
"
@@ -21,22 +21,12 @@ SRC_URI = " \
file://xenguest-network-bridge-dhcp.cfg.in \
file://network-bridge.sh.in \
file://00-vif-xenguest.hook \
file://xenguest-network-init-post.sh \
file://kea-dhcp4.conf \
file://kea-restore-default-config \
"
PACKAGES =+ "${PN}-kea-dhcp4"
# Bridge configurator needs to run before S01networking init script
# Prefix with a_ to make sure it is executed in runlevel 01 before others
INITSCRIPT_PACKAGES = "${PN} ${PN}-kea-dhcp4"
INITSCRIPT_NAME_${PN} = "a_xenguest-network-bridge"
INITSCRIPT_PARAMS_${PN} = "defaults 01"
# Kea configuration needs to be restored before kea init scripts:
# Kea dhcp4 server is 30, so lets use 20, to have higher priority
INITSCRIPT_NAME_${PN}-kea-dhcp4 = "kea-restore-default-config"
INITSCRIPT_PARAMS_${PN}-kea-dhcp4 = "defaults 20"
INITSCRIPT_NAME = "a_xenguest-network-bridge"
INITSCRIPT_PARAMS = "defaults 01"
inherit update-rc.d
@@ -53,7 +43,7 @@ do_install() {
> ${WORKDIR}/network-bridge.sh
install -d -m 755 ${D}${sysconfdir}/init.d
install -m 755 ${WORKDIR}/xenguest-network-bridge \
${D}${sysconfdir}/init.d/${INITSCRIPT_NAME_${PN}}
${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
install -d -m 755 ${D}${sysconfdir}/network/interfaces.d
install -m 755 ${WORKDIR}/xenguest-network-bridge.cfg \
${D}${sysconfdir}/network/interfaces.d/.
@@ -64,22 +54,11 @@ do_install() {
install -d ${D}${sysconfdir}/xen/scripts/vif-post.d
install -m 755 ${WORKDIR}/00-vif-xenguest.hook \
${D}${sysconfdir}/xen/scripts/vif-post.d/.
install -d -m 755 ${D}${sysconfdir}/xenguest/init.post
install -m 755 ${WORKDIR}/xenguest-network-init-post.sh \
${D}${sysconfdir}/xenguest/init.post/.
install -m 755 ${WORKDIR}/kea-restore-default-config \
${D}${sysconfdir}/init.d/.
install -d -m 755 ${D}${sysconfdir}/kea/
install -m 755 ${WORKDIR}/kea-dhcp4.conf \
${D}${sysconfdir}/kea/kea-dhcp4.conf.original
}
RDEPENDS_${PN} += "bridge-utils \
iptables \
kea \
${PN}-kea-dhcp4 \
dhcp-server \
kernel-module-xt-tcpudp \
kernel-module-xt-physdev \
kernel-module-xt-comment \
@@ -89,7 +68,3 @@ RDEPENDS_${PN} += "bridge-utils \
FILES_${PN} += "${sysconfdir}/network/interfaces.d/xenguest-network-bridge.cfg"
FILES_${PN} += "${sysconfdir}/xenguest/init.pre/network-bridge.sh"
FILES_${PN} += "${sysconfdir}/xen/scripts/vif-post.d/00-vif-xenguest.hook"
FILES_${PN}-kea-dhcp4 = "${sysconfdir}/kea/kea-dhcp4.conf.original"
FILES_${PN}-kea-dhcp4 += "${sysconfdir}/init.d/${INITSCRIPT_NAME_${PN}-kea-dhcp4}"
FILES_${PN}-kea-dhcp4 += "${sysconfdir}/xenguest/init.post/xenguest-network-init-post.sh"
@@ -1,4 +1,3 @@
CONFIG_OVERLAY_FS=y
CONFIG_NAMESPACES=y
CONFIG_NET_NS=y
CONFIG_PID_NS=y
@@ -1,31 +0,0 @@
CONFIG_PARAVIRT=y
CONFIG_XEN=y
CONFIG_BLOCK=y
CONFIG_SCSI=y
CONFIG_NET=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_WATCHDOG=y
CONFIG_XEN_WDT=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_EFI=y
CONFIG_XEN_AUTO_XLATE=y
@@ -1,5 +0,0 @@
define KFEATURE_DESCRIPTION "Common XEN (Host and Guest) configs and patches on autonomy systems"
kconf non-hardware xen-common.cfg
patch 0001-xen-arm-do-not-setup-the-runstate-info-page-if-kpti-.patch
@@ -1,15 +1,27 @@
CONFIG_PARAVIRT=y
CONFIG_XEN=y
CONFIG_BLOCK=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_SCSI=y
CONFIG_XEN_SCSI_FRONTEND=y
CONFIG_NET=y
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_INPUT=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
CONFIG_WATCHDOG=y
CONFIG_XEN_WDT=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
@@ -17,7 +29,21 @@ CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_EFI=y
CONFIG_XEN_AUTO_XLATE=y
CONFIG_DRM=y
CONFIG_DRM_XEN=y
@@ -1,3 +1,5 @@
define KFEATURE_DESCRIPTION "Enable XEN Guest Frontend Drivers"
kconf non-hardware xen-guest.cfg
patch 0001-xen-arm-do-not-setup-the-runstate-info-page-if-kpti-.patch
@@ -1,10 +1,38 @@
CONFIG_PARAVIRT=y
CONFIG_XEN=y
CONFIG_BLOCK=y
CONFIG_XEN_BLKDEV_BACKEND=y
CONFIG_SCSI=y
CONFIG_TARGET_CORE=y
CONFIG_XEN_SCSI_BACKEND=y
CONFIG_NET=y
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_WATCHDOG=y
CONFIG_XEN_WDT=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_EFI=y
CONFIG_XEN_AUTO_XLATE=y
# For LVM2 we need Multiple Devices and Device Mapper support
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
@@ -1,3 +1,5 @@
define KFEATURE_DESCRIPTION "Enable XEN Host Drivers on autonomy systems"
kconf non-hardware xen-host.cfg
patch 0001-xen-arm-do-not-setup-the-runstate-info-page-if-kpti-.patch
@@ -7,11 +7,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}:"
#
SRC_URI_append = " file://arm-autonomy-kmeta;type=kmeta;name=arm-autonomy-kmeta;destsuffix=arm-autonomy-kmeta"
# Add common Xen (host and guest) configs and patches
KERNEL_FEATURES += "${@bb.utils.contains_any('DISTRO_FEATURES', \
'arm-autonomy-host arm-autonomy-guest', \
'features/arm-autonomy/xen-common.scc', '', d)}"
# Add xen host drivers to kernel if arm-autonomy-host is activated
KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
@@ -25,7 +20,6 @@ KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
'arm-autonomy-guest', 'features/arm-autonomy/xen-guest.scc', '', d)}"
# Add support for arm64-autonomy-guest machine
COMPATIBLE_MACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
KMACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
-3
View File
@@ -15,6 +15,3 @@ LAYERDEPENDS_meta-arm-bsp = "core meta-arm meta-kernel"
# This won't be used by layerindex-fetch, but works everywhere else
LAYERDEPENDS_meta-arm-bsp_append_musca-b1 = " meta-python"
LAYERDEPENDS_meta-arm-bsp_append_musca-s1 = " meta-python"
# Additional license directories.
LICENSE_PATH += "${LAYERDIR}/custom-licenses"
@@ -11,6 +11,7 @@ TUNECONFLICTS[armv7em] = "armv4 armv5 armv6 armv7a"
require conf/machine/include/arm/arch-armv7m.inc
AVAILTUNES += "armv7em"
ARMPKGARCH_tune-armv7em = "armv7em"
TUNE_FEATURES_tune-armv7em = "armv7em"
@@ -1,3 +1,15 @@
#
# Tune Settings for Cortex-M3
#
TUNEVALID[cortexm3] = "Enable Cortex-M3 specific processor optimizations"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm3', ' -mcpu=cortex-m3', '', d)}"
AVAILTUNES += "cortexm3"
ARMPKGARCH_tune-cortexm3 = "cortexm3"
TUNE_FEATURES_tune-cortexm3 = "${TUNE_FEATURES_tune-armv7m} cortexm3"
PACKAGE_EXTRA_ARCHS_tune-cortexm3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7m} cortexm3"
#
# Defaults for ARMv7-m
#
@@ -11,6 +23,7 @@ TUNECONFLICTS[armv7m] = "armv4 armv5 armv6 armv7a"
require conf/machine/include/arm/arch-armv6m.inc
AVAILTUNES += "armv7m"
ARMPKGARCH_tune-armv7m = "armv7m"
TUNE_FEATURES_tune-armv7m = "armv7m"
@@ -12,6 +12,7 @@ TUNECONFLICTS[armv8-1m-main] = "armv4 armv5 armv6 armv7a"
require conf/machine/include/arm/arch-armv8m-main.inc
AVAILTUNES += "armv8-1m-main"
ARMPKGARCH_tune-armv8-1m-main = "armv8-1m-main"
TUNE_FEATURES_tune-armv8-1m-main = "armv8-1m-main"
@@ -7,6 +7,7 @@ MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-2a', 'armv8-2a
require conf/machine/include/arm/arch-armv8a.inc
AVAILTUNES += "armv8-2a armv8-2a-crypto"
ARMPKGARCH_tune-armv8-2a ?= "armv8-2a"
ARMPKGARCH_tune-armv8-2a-crypto ?= "armv8-2a"
@@ -11,6 +11,7 @@ TUNECONFLICTS[armv8m-base] = "armv4 armv5 armv6 armv7a"
require conf/machine/include/arm/arch-armv7m.inc
AVAILTUNES += "armv8m-base"
ARMPKGARCH_tune-armv8m-base = "armv8m-base"
TUNE_FEATURES_tune-armv8m-base = "armv8m-base"
@@ -1,36 +1,19 @@
#
# Defaults for ARMv8-m.main
#
# Defaults for ARMv8-M.main
#
DEFAULTTUNE ?= "armv8m-main"
require conf/machine/include/arm/arch-armv8m-base.inc
TUNEVALID[armv8m-main] = "Enable instructions for ARMv8-m.main"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-main', ' -march=armv8-m.main${MARCH_DSP}${MARCH_FPU}', '', d)}"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-main', ' -march=armv8-m.main', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-main', 'armv8m-main:', '', d)}"
TUNECONFLICTS[armv8m-main] = "armv4 armv5 armv6 armv7a"
# FIXME - below taken from meta/conf/machine/include/arm/arch-armv5-dsp.inc and should be put into something more generic
TUNEVALID[dsp] = "ARM DSP functionality"
ARMPKGSFX_DSP = "${@bb.utils.contains('TUNE_FEATURES', [ 'dsp' ], 'e', '', d)}"
MARCH_DSP = "${@bb.utils.contains('TUNE_FEATURES', [ 'dsp' ], '+dsp', '+nodsp', d)}"
require conf/machine/include/arm/arch-armv8m-base.inc
# FIXME - Below belongs in meta/conf/machine/include/arm/feature-arm-neon.inc
TUNEVALID[vfpv5spd16] = "Enable Vector Floating Point Version 5, Single Precision. with 16 registers (fpv5-sp-d16) unit."
TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfpv5spd16', 'fpv5-sp-d16', '', d)}"
MARCH_FPU = "${@bb.utils.contains('TUNE_FEATURES', [ 'vfpv5spd16' ], '+fp', '+nofp', d)}"
AVAILTUNES += "armv8m-main armv8m-mainearmv8m-main-vfpv5spd16 armv8m-maine-vfpv5spd16"
ARMPKGARCH_tune-armv8m-main = "armv8m-main"
ARMPKGARCH_tune-armv8m-maine = "armv8m-main"
ARMPKGARCH_tune-armv8m-main-vfpv5spd16 = "armv8m-main"
ARMPKGARCH_tune-armv8m-maine-vfpv5spd16 = "armv8m-main"
TUNE_FEATURES_tune-armv8m-main = "armv8m-main"
TUNE_FEATURES_tune-armv8m-maine = "${TUNE_FEATURES_tune-armv8m-main} dsp"
TUNE_FEATURES_tune-armv8m-main-vfpv5spd16 = "${TUNE_FEATURES_tune-armv8m-main} vfpv5spd16"
TUNE_FEATURES_tune-armv8m-maine-vfpv5spd16 = "${TUNE_FEATURES_tune-armv8m-main-vfpv5spd16} dsp"
PACKAGE_EXTRA_ARCHS_tune-armv8m-main = "armv8m-main"
PACKAGE_EXTRA_ARCHS_tune-armv8m-maine = "${PACKAGE_EXTRA_ARCHS_tune-armv8m-main} armv8m-maine"
PACKAGE_EXTRA_ARCHS_tune-armv8m-main-vfpv5spd16 = "${PACKAGE_EXTRA_ARCHS_tune-armv8m-main} armv8m-main-fpv5-spd16"
PACKAGE_EXTRA_ARCHS_tune-armv8m-maine-vfpv5spd16 = "${PACKAGE_EXTRA_ARCHS_tune-armv8m-main} armv8m-maine-fpv5-spd16"
AVAILTUNES += "armv8m-main"
ARMPKGARCH_tune-armv8m-main = "armv8m-main"
TUNE_FEATURES_tune-armv8m-main = "armv8m-main"
PACKAGE_EXTRA_ARCHS_tune-armv8m-main = "armv8m-main"
@@ -8,6 +8,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm1', ' -mcpu=cortex
require conf/machine/include/arm/arch-armv6m.inc
AVAILTUNES += "cortexm1"
ARMPKGARCH_tune-cortexm1 = "cortexm1"
TUNE_FEATURES_tune-cortexm1 = "${TUNE_FEATURES_tune-armv6m} cortexm1"
@@ -8,6 +8,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm23', ' -mcpu=corte
require conf/machine/include/arm/arch-armv8m-base.inc
AVAILTUNES += "cortexm23"
ARMPKGARCH_tune-cortexm23 = "cortexm23"
TUNE_FEATURES_tune-cortexm23 = "${TUNE_FEATURES_tune-armv8m-base} cortexm23"
@@ -8,6 +8,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm3', ' -mcpu=cortex
require conf/machine/include/arm/arch-armv7m.inc
AVAILTUNES += "cortexm3"
ARMPKGARCH_tune-cortexm3 = "cortexm3"
TUNE_FEATURES_tune-cortexm3 = "${TUNE_FEATURES_tune-armv7m} cortexm3"
@@ -1,17 +1,15 @@
#
# Tune Settings for Cortex-M33
#
DEFAULTTUNE ?= "cortexm33"
DEFAULTTUNE ?= "armv8m"
TUNEVALID[cortexm33] = "Enable Cortex-M33 specific processor optimizations"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm33', ' -mcpu=cortex-m33', '', d)}"
TUNEVALID[armv8m] = "Enable instructions for ARMv8-m"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8m', ' -march=armv7-m', '', d)}"
require conf/machine/include/arm/arch-armv8m-main.inc
# GCC thnks that DSP and VFP are required, but Arm docs say it is
# optional. So forcing below so that compiling works, but this should
# be fixed in GCC
AVAILTUNES += "cortexm33"
ARMPKGARCH_tune-cortexm33 = "cortexm33"
TUNE_FEATURES_tune-cortexm33 = "${TUNE_FEATURES_tune-armv8m-maine-vfpv5spd16} cortexm33"
PACKAGE_EXTRA_ARCHS_tune-cortexm33 = "${PACKAGE_EXTRA_ARCHS_tune-armv8m-maine-vfpv5spd16} cortexm33e-fpv5-spd16"
AVAILTUNES += "armv8m"
ARMPKGARCH_tune-armv8m ?= "armv8m"
TUNE_FEATURES_tune-armv8m = "armv8m"
PACKAGE_EXTRA_ARCHS_tune-armv8m = "armv8m"
@@ -1,17 +1,15 @@
#
# Tune Settings for Cortex-M35P
#
DEFAULTTUNE ?= "cortexm35p"
DEFAULTTUNE ?= "cortexm33p"
TUNEVALID[cortexm35p] = "Enable Cortex-M35p specific processor optimizations"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm35p', ' -mcpu=cortex-m35p', '', d)}"
require conf/machine/include/arm/arch-armv8m-main.inc
# GCC thnks that DSP and VFP are required, but Arm docs say it is
# optional. So forcing below so that compiling works, but this should
# be fixed in GCC
AVAILTUNES += "cortexm35p"
ARMPKGARCH_tune-cortexm35p = "cortexm35p"
TUNE_FEATURES_tune-cortexm35p = "${TUNE_FEATURES_tune-armv8m-maine-vfpv5spd16} cortexm35p"
PACKAGE_EXTRA_ARCHS_tune-cortexm35p = "${PACKAGE_EXTRA_ARCHS_tune-armv8m-maine-vfpv5spd16} cortexm35pe-fpv5-spd16"
TUNE_FEATURES_tune-cortexm35p = "${TUNE_FEATURES_tune-armv8m-main} cortexm35p"
PACKAGE_EXTRA_ARCHS_tune-cortexm35p = "${PACKAGE_EXTRA_ARCHS_tune-armv8m-main} cortexm35p"
@@ -8,6 +8,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm4', ' -mcpu=cortex
require conf/machine/include/arm/arch-armv7em.inc
AVAILTUNES += "cortexm4"
ARMPKGARCH_tune-cortexm4 = "cortexm4"
TUNE_FEATURES_tune-cortexm4 = "${TUNE_FEATURES_tune-armv7em} cortexm4"
@@ -8,6 +8,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm55', ' -mcpu=corte
require conf/machine/include/arm/arch-armv8-1m-main.inc
AVAILTUNES += "cortexm55"
ARMPKGARCH_tune-cortexm55 = "cortexm55"
TUNE_FEATURES_tune-cortexm55 = "${TUNE_FEATURES_tune-armv8-1m-main} cortexm55"
@@ -8,6 +8,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm7', ' -mcpu=cortex
require conf/machine/include/arm/arch-armv7em.inc
AVAILTUNES += "cortexm7"
ARMPKGARCH_tune-cortexm7 = "cortexm7"
TUNE_FEATURES_tune-cortexm7 = "${TUNE_FEATURES_tune-armv7em} cortexm7"
-1
View File
@@ -7,7 +7,6 @@
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
PREFERRED_VERSION_trusted-firmware-m = "1.0"
DEFAULTTUNE ?= "armv8m-main"
require conf/machine/include/tune-cortexm33.inc
# GLIBC will not work with Cortex-M.
-3
View File
@@ -37,6 +37,3 @@ EXTRA_IMAGEDEPENDS += "virtual/uefi-firmware"
#grub-efi
EFI_PROVIDER ?= "grub-efi"
MACHINE_FEATURES += "efi"
# SD-Card firmware
EXTRA_IMAGEDEPENDS += "sdcard-image-n1sdp"
+16 -5
View File
@@ -14,15 +14,26 @@ UBOOT_MACHINE ?= "total_compute_defconfig"
# Trusted firmware A v2.3
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm64-ack"
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
# Cannot use the default zImage on arm64
KERNEL_IMAGETYPE = "Image"
KERNEL_BOOTCMD = "booti"
IMAGE_FSTYPES += "cpio.gz.u-boot"
KERNEL_IMAGETYPES += " fitImage "
KERNEL_CLASSES = " kernel-fitimage "
IMAGE_FSTYPES += "cpio.gz"
INITRAMFS_IMAGE = "core-image-minimal"
UBOOT_RD_LOADADDRESS = "0x88000000"
UBOOT_RD_ENTRYPOINT = "0x88000000"
UBOOT_LOADADDRESS = "0x80080000"
UBOOT_ENTRYPOINT = "0x80080000"
UBOOT_SIGN_ENABLE = "1"
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb"
UBOOT_SIGN_KEYNAME = "dev_key"
UBOOT_SIGN_KEYDIR = "${DEPLOY_DIR_IMAGE}/keys"
FIT_GENERATE_KEYS = "1"
SERIAL_CONSOLES = "115200;ttyAMA0"
@@ -1,18 +0,0 @@
SLA0044 Rev5/February 2018
BY INSTALLING COPYING, DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE OR ANY PART THEREOF (AND THE RELATED DOCUMENTATION) FROM STMICROELECTRONICS INTERNATIONAL N.V, SWISS BRANCH AND/OR ITS AFFILIATED COMPANIES (STMICROELECTRONICS), THE RECIPIENT, ON BEHALF OF HIMSELF OR HERSELF, OR ON BEHALF OF ANY ENTITY BY WHICH SUCH RECIPIENT IS EMPLOYED AND/OR ENGAGED AGREES TO BE BOUND BY THIS SOFTWARE LICENSE AGREEMENT.
Under STMicroelectronics intellectual property rights, the redistribution, reproduction and use in source and binary forms of the software or any part thereof, with or without modification, are permitted provided that the following conditions are met:
1. Redistribution of source code (modified or not) must retain any copyright notice, this list of conditions and the disclaimer set forth below as items 10 and 11.
2. Redistributions in binary form, except as embedded into microcontroller or microprocessor device manufactured by or for STMicroelectronics or a software update for such device, must reproduce any copyright notice provided with the binary code, this list of conditions, and the disclaimer set forth below as items 10 and 11, in documentation and/or other materials provided with the distribution.
3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software or part thereof without specific written permission.
4. This software or any part thereof, including modifications and/or derivative works of this software, must be used and execute solely and exclusively on or in combination with a microcontroller or microprocessor device manufactured by or for STMicroelectronics.
5. No use, reproduction or redistribution of this software partially or totally may be done in any manner that would subject this software to any Open Source Terms. “Open Source Terms” shall mean any open source license which requires as part of distribution of software that the source code of such software is distributed therewith or otherwise made available, or open source license that substantially complies with the Open Source definition specified at www.opensource.org and any other comparable open source license such as for example GNU General Public License (GPL), Eclipse Public License (EPL), Apache Software License, BSD license or MIT license.
6. STMicroelectronics has no obligation to provide any maintenance, support or updates for the software.
7. The software is and will remain the exclusive property of STMicroelectronics and its licensors. The recipient will not take any action that jeopardizes STMicroelectronics and its licensors' proprietary rights or acquire any rights in the software, except the limited rights specified hereunder.
8. The recipient shall comply with all applicable laws and regulations affecting the use of the software or any part thereof including any applicable export control law or regulation.
9. Redistribution and use of this software or any part thereof other than as permitted under this license is void and will automatically terminate your rights under this license.
10. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, WHICH ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11. EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS, WHETHER EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY.
-21
View File
@@ -1,21 +0,0 @@
# Corstone-700
## Overview
Corstone-700 is a flexible compute architecture combining Cortex-A and Cortex-M
processors and a secure enclave, aimed at building secure IoT SoCs. There are
machines for both Corstone-700 for Fixed Virtual Platform (`corstone700-fvp`)
and Corstone-700 for MPS3 FPGA (`corstone700-mps3`).
Further details are available in the [User Guide].
## Building
Corstone-700 is tested in 'tiny' configurations, such as `DISTRO="poky-tiny"`.
## Running
For detailed instructions as to how to run the image in a FVP model, or on the
MPS3 board, see the [User Guide].
[User Guide]: https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/about/docs/corstone-700/user-guide.rst
@@ -4,7 +4,7 @@
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "foundation-armv8"
MACHINE ?= "foundation-v8"
### Build:
```bash$ bitbake core-image-minimal```
-64
View File
@@ -1,64 +0,0 @@
# N1SDP Development Platform Support in meta-arm-bsp
## Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "n1sdp"
## Building
```bash$ bitbake core-image-minimal```
## Running
# Update Firmware on SD card:
(*) To use n1sdp board in single chip mode, flash:
n1sdp-board-firmware_primary.tar.gz firmware.
(*) To use n1sdp board in multi chip mode, flash:
n1sdp-board-firmware_primary.tar.gz firmware to primary board,
n1sdp-board-firmware_secondary.tar.gz firmware to secondary board.
The SD card content is generated during the build here:
tmp/deploy/images/n1sdp/n1sdp-board-firmware_primary.tar.gz
tmp/deploy/images/n1sdp/n1sdp-board-firmware_secondary.tar.gz
Its content must be written on the N1SDP firmware SD card.
To do this:
- insert the sdcard of the N1SDP in an SD card reader and mount it:
```bash$ sudo mount /dev/sdx1 /mnt```
(replace sdx by the device of the SD card)
- erase its content and put the new one:
```bash$ sudo rm -rf /mnt/*```
```bash$ sudo tar --no-same-owner -xzf tmp/deploy/images/n1sdp/n1sdp-board-firmware_primary.tar.gz -C /mnt/```
```bash$ sudo umount /mnt```
- reinsert the SD card in the N1SDP board
Firmware tarball contains iofpga configuration files, scp and uefi binaries.
**NOTE**:
If the N1SDP board was manufactured after November 2019 (Serial Number greater
than 36253xxx), a different PMIC firmware image must be used to prevent
potential damage to the board. More details can be found in [1].
The `MB/HBI0316A/io_v123f.txt` file located in the microSD needs to be updated.
To update it, set the PMIC image (300k_8c2.bin) to be used in the newer models
by running the following commands on your host PC:
$ sudo umount /dev/sdx1
$ sudo mount /dev/sdx1 /mnt
$ sudo sed -i '/^MBPMIC: pms_0V85.bin/s/^/;/g' /mnt/MB/HBI0316A/io_v123f.txt
$ sudo sed -i '/^;MBPMIC: 300k_8c2.bin/s/^;//g' /mnt/MB/HBI0316A/io_v123f.txt
$ sudo umount /mnt
# Prepare an USB hard drive:
Grub boot partition is placed on first partition of the *.wic image,
Linux root file system is placed on the second partition of the *.wic image:
tmp/deploy/images/n1sdp/core-image-minimal-n1sdp.wic
This *.wic image should be copied to USB stick with simple dd call.
[1]: https://community.arm.com/developer/tools-software/oss-platforms/w/docs/604/notice-potential-damage-to-n1sdp-boards-if-using-latest-firmware-release
@@ -23,14 +23,14 @@ NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02900000 ;Image Flash Address
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x029C0000 ;Image Flash Address
NOR4ADDRESS: 0x025C0000 ;Image Flash Address
NOR4FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
@@ -56,13 +56,13 @@ NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x02A00000 ;Image Flash Address
NOR8ADDRESS: 0x02600000 ;Image Flash Address
NOR8FILE: \SOFTWARE\selftest ;Image File Name
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
NOR9ADDRESS: 0x02780000 ;Image Flash Address
NOR9NAME: uEnv.txt
NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
@@ -23,14 +23,14 @@ NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02900000 ;Image Flash Address
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-r1.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x029C0000 ;Image Flash Address
NOR4ADDRESS: 0x025C0000 ;Image Flash Address
NOR4FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
@@ -56,13 +56,13 @@ NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x02A00000 ;Image Flash Address
NOR8ADDRESS: 0x02600000 ;Image Flash Address
NOR8FILE: \SOFTWARE\selftest ;Image File Name
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
NOR9ADDRESS: 0x02780000 ;Image Flash Address
NOR9NAME: uEnv.txt
NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
@@ -23,14 +23,14 @@ NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02900000 ;Image Flash Address
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-r2.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x029C0000 ;Image Flash Address
NOR4ADDRESS: 0x025C0000 ;Image Flash Address
NOR4FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
@@ -56,13 +56,13 @@ NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x02A00000 ;Image Flash Address
NOR8ADDRESS: 0x02600000 ;Image Flash Address
NOR8FILE: \SOFTWARE\selftest ;Image File Name
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
NOR9ADDRESS: 0x02780000 ;Image Flash Address
NOR9NAME: uEnv.txt
NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
@@ -1,11 +1,11 @@
uenvcmd=run mybootcmd
mybootcmd=echo Loading custom boot command; \
echo Loading kernel; \
afs load ${kernel_name} ${kernel_addr_r} ; \
if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr_r}; fi; \
afs load ${kernel_name} ${kernel_addr} ; \
if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr}; fi; \
echo Loading device tree; \
afs load ${fdtfile} ${fdt_addr_r}; \
afs load ${fdtfile} ${fdt_addr}; \
if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
afs load ${fdt_alt_name} ${fdt_addr_r}; fi; fdt addr ${fdt_addr_r}; fdt resize; \
booti ${kernel_addr_r} - ${fdt_addr_r};
afs load ${fdt_alt_name} ${fdt_addr}; fi; fdt addr ${fdt_addr}; fdt resize; \
booti ${kernel_addr} - ${fdt_addr};
@@ -1,34 +0,0 @@
SUMMARY = "Board Firmware binaries for N1SDP"
SECTION = "firmware"
LICENSE = "STM-SLA0044-Rev5"
LIC_FILES_CHKSUM = "file://LICENSES/STM.TXT;md5=4b8dab81d0bfc0a5f63c9a983402705b"
inherit deploy
INHIBIT_DEFAULT_DEPS = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "n1sdp"
SRC_URI = "https://git.linaro.org/landing-teams/working/arm/n1sdp-board-firmware.git/snapshot/${BPN}-N1SDP-${PV}.tar.gz"
SRC_URI[sha256sum] = "57feba404026f2d6d49c167d63e0e84653ad8b808b13e2244b81fea9e0d58d66"
S = "${WORKDIR}/${BPN}-N1SDP-${PV}"
INSTALL_DIR = "/n1sdp-board-firmware_source"
do_install() {
rm -rf ${S}/SOFTWARE
install -d ${D}${INSTALL_DIR}
cp -Rp --no-preserve=ownership ${S}/* ${D}${INSTALL_DIR}
}
FILES_${PN} = "${INSTALL_DIR}"
SYSROOT_DIRS += "${INSTALL_DIR}"
do_deploy() {
install -d ${DEPLOYDIR}${INSTALL_DIR}
cp -Rp --no-preserve=ownership ${S}/* ${DEPLOYDIR}${INSTALL_DIR}
}
addtask deploy after do_install before do_build
@@ -1,84 +0,0 @@
SUMMARY = "Firmware image recipe for generating SD-Card artifacts."
inherit deploy nopackages
DEPENDS = "virtual/uefi-firmware \
virtual/control-processor-firmware \
n1sdp-board-firmware"
LICENSE = "MIT"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "n1sdp"
RM_WORK_EXCLUDE += "${PN}"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install[noexec] = "1"
FIRMWARE_DIR = "n1sdp-board-firmware_source"
PRIMARY_DIR = "${WORKDIR}/n1sdp-board-firmware_primary"
SECONDARY_DIR = "${WORKDIR}/n1sdp-board-firmware_secondary"
SOC_BINARIES_PRIMARY = "mcp_fw.bin scp_fw.bin ${SOC_BINARIES_SECONDARY}"
SOC_BINARIES_SECONDARY = "mcp_rom.bin scp_rom.bin"
prepare_package() {
cd ${WORKDIR}
# Master/Primary
cp -av ${RECIPE_SYSROOT}/${FIRMWARE_DIR}/* ${PRIMARY_DIR}
mkdir -p ${PRIMARY_DIR}/SOFTWARE/
# Copy uefi binary
cp -v ${RECIPE_SYSROOT}/firmware/uefi.bin ${PRIMARY_DIR}/SOFTWARE/
# Copy SOC binaries
for f in ${SOC_BINARIES_PRIMARY}; do
cp -v ${RECIPE_SYSROOT}/firmware/${f} ${PRIMARY_DIR}/SOFTWARE/
done
sed -i -e 's|^C2C_ENABLE.*|C2C_ENABLE: TRUE ;C2C enable TRUE/FALSE|' \
${PRIMARY_DIR}/MB/HBI0316A/io_v123f.txt
sed -i -e 's|^C2C_SIDE.*|C2C_SIDE: MASTER ;C2C side SLAVE/MASTER|' \
${PRIMARY_DIR}/MB/HBI0316A/io_v123f.txt
sed -i -e 's|.*SOCCON: 0x1170.*PLATFORM_CTRL.*|SOCCON: 0x1170 0x00000100 ;SoC SCC PLATFORM_CTRL|' \
${PRIMARY_DIR}/MB/HBI0316A/io_v123f.txt
# Slave/Secondary
cp -av ${RECIPE_SYSROOT}/${FIRMWARE_DIR}/* ${SECONDARY_DIR}
mkdir -p ${SECONDARY_DIR}/SOFTWARE/
# Copy SOC binaries
for f in ${SOC_BINARIES_SECONDARY}; do
cp -v ${RECIPE_SYSROOT}/firmware/${f} ${SECONDARY_DIR}/SOFTWARE/
done
sed -i -e 's|^C2C_ENABLE.*|C2C_ENABLE: TRUE ;C2C enable TRUE/FALSE|' \
${SECONDARY_DIR}/MB/HBI0316A/io_v123f.txt
sed -i -e 's|^C2C_SIDE.*|C2C_SIDE: SLAVE ;C2C side SLAVE/MASTER|' \
${SECONDARY_DIR}/MB/HBI0316A/io_v123f.txt
sed -i -e 's|.*SOCCON: 0x1170.*PLATFORM_CTRL.*|SOCCON: 0x1170 0x00000101 ;SoC SCC PLATFORM_CTRL|' \
${SECONDARY_DIR}/MB/HBI0316A/io_v123f.txt
sed -i -e '/^TOTALIMAGES:/ s|5|2|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
sed -i -e 's|^IMAGE[^23]|;&|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
sed -i -e 's|^IMAGE2|IMAGE0|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
sed -i -e 's|^IMAGE3|IMAGE1|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
}
do_deploy() {
# prepare Master & Slave packages
prepare_package
for dir in ${PRIMARY_DIR} ${SECONDARY_DIR}; do
dir_name=$(basename ${dir})
mkdir -p ${D}/${dir_name}
cp -av ${dir} ${D}
# Compress the files
tar -C ${D}/${dir_name} -zcvf ${DEPLOYDIR}/${dir_name}.tar.gz ./
done
}
do_deploy[dirs] += "${PRIMARY_DIR} ${SECONDARY_DIR}"
do_deploy[cleandirs] += "${PRIMARY_DIR} ${SECONDARY_DIR}"
do_deploy[umask] = "022"
addtask deploy after do_populate_sysroot
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2020 Arm Limited
#
SUMARY = "Total Compute Images"
DESCRIPTION = "Build all the images required for Total Compute platform"
LICENSE = "Apache-2.0"
# The last image to be built is trusted-firmware-a
DEPENDS += " trusted-firmware-a"
@@ -0,0 +1,539 @@
From f409ffb29aa2fd9d531b5cf079e16dbe97f9054f Mon Sep 17 00:00:00 2001
From: J-Alves <joao.alves@arm.com>
Date: Thu, 22 Oct 2020 12:29:21 +0100
Subject: [PATCH] FF-A: Booting SPs according to 'boot-order'
Secure Hafnium boots partitions according to boot-order in the manifest.
In this patch:
- Added manifest parsing of "boot-order", and populated VM structure
with it;
- Added the field "next_boot" to the VM structure, in order to create a
boot list that is sorted by the "boot-order";
- If VMs have been configured with "boot-order" field at the partition's
manifest, a boot list will be created with the VM structure;
- The root of the list points to the highest priority VM;
- Booting consists on traversing the list upon use of MSG_WAIT
interface from the highest priority VMs;
- After traversing the whole boot list, returns execution to SPMD;
- If no partition has been configured with "boot-order" field, only the
primary VM will boot;
- "Manifest_Test.cc" updated to include "boot-order" field in
tests to the partition manifest;
- "vm_test.cc" updated to include unit test for the main logic of this
patch.
Change-Id: I43adf90447eed3bc24c8eb2ccb8eb979b471f3c3
Signed-off-by: J-Alves <Joao.Alves@arm.com>
---
inc/hf/api.h | 1 +
inc/hf/manifest.h | 2 +
inc/hf/vm.h | 10 ++++
src/api.c | 17 ++++++
src/arch/aarch64/hypervisor/cpu.c | 5 ++
src/arch/aarch64/hypervisor/handler.c | 48 ++++++++++++++++-
src/load.c | 12 +++++
src/main.c | 19 ++++++-
src/manifest.c | 19 +++++++
src/manifest_test.cc | 11 ++++
src/vm.c | 39 ++++++++++++++
src/vm_test.cc | 75 ++++++++++++++++++++++++++-
12 files changed, 255 insertions(+), 3 deletions(-)
diff --git a/inc/hf/api.h b/inc/hf/api.h
index a28c1d0..907d60b 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -37,6 +37,7 @@ struct ffa_value api_ffa_msg_send(ffa_vm_id_t sender_vm_id,
ffa_vm_id_t receiver_vm_id, uint32_t size,
uint32_t attributes, struct vcpu *current,
struct vcpu **next);
+struct ffa_value api_ffa_msg_wait(struct vcpu *current, struct vcpu **next);
struct ffa_value api_ffa_msg_recv(bool block, struct vcpu *current,
struct vcpu **next);
struct ffa_value api_ffa_rx_release(struct vcpu *current, struct vcpu **next);
diff --git a/inc/hf/manifest.h b/inc/hf/manifest.h
index 3e9eaf4..17b2ac9 100644
--- a/inc/hf/manifest.h
+++ b/inc/hf/manifest.h
@@ -29,6 +29,8 @@
/** Mask for getting read/write/execute permission */
#define MM_PERM_MASK 0x7
+#define DEFAULT_BOOT_ORDER 0xFF
+
enum run_time_el {
EL1 = 0,
S_EL0,
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index 01aaaca..0e4d23f 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -120,6 +120,13 @@ struct vm {
atomic_bool aborting;
+ /**
+ * Booting parameters.
+ */
+ bool initialized;
+ uint16_t boot_order;
+ struct vm *next_boot;
+
/** Arch-specific VM information. */
struct arch_vm arch;
};
@@ -159,3 +166,6 @@ void vm_identity_commit(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
bool vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
struct mpool *ppool);
bool vm_unmap_hypervisor(struct vm_locked vm_locked, struct mpool *ppool);
+
+void vm_update_boot(struct vm *vm);
+struct vm *vm_get_first_boot(void);
diff --git a/src/api.c b/src/api.c
index 1457d58..1da5df3 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1260,6 +1260,23 @@ out:
return return_code;
}
+struct ffa_value api_ffa_msg_wait(struct vcpu *current, struct vcpu **next)
+{
+ struct vm *current_vm = current->vm;
+
+ /* If this a SP */
+ if (current_vm->id & HF_VM_ID_WORLD_MASK) {
+ *next = api_switch_to_other_world(
+ current, (struct ffa_value){.func = FFA_MSG_WAIT_32},
+ VCPU_STATE_BLOCKED_MAILBOX);
+
+ return (struct ffa_value){.func = FFA_INTERRUPT_32};
+ }
+
+ /* If NWd VM */
+ return api_ffa_msg_recv(true, current, next);
+}
+
/**
* Retrieves the next VM whose mailbox became writable. For a VM to be notified
* by this function, the caller must have called api_mailbox_send before with
diff --git a/src/arch/aarch64/hypervisor/cpu.c b/src/arch/aarch64/hypervisor/cpu.c
index 21bf6cf..0f6710e 100644
--- a/src/arch/aarch64/hypervisor/cpu.c
+++ b/src/arch/aarch64/hypervisor/cpu.c
@@ -65,7 +65,12 @@ void arch_regs_reset(struct vcpu *vcpu)
{
ffa_vm_id_t vm_id = vcpu->vm->id;
bool is_primary = vm_id == HF_PRIMARY_VM_ID;
+#if SECURE_WORLD == 0
cpu_id_t vcpu_id = is_primary ? vcpu->cpu->id : vcpu_index(vcpu);
+#else
+ cpu_id_t vcpu_id = vcpu_index(vcpu);
+#endif
+
paddr_t table = vcpu->vm->ptable.root;
struct arch_regs *r = &vcpu->regs;
uintreg_t pc = r->pc;
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 4d3a462..f63b3c0 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -19,6 +19,7 @@
#include "hf/cpu.h"
#include "hf/dlog.h"
#include "hf/ffa.h"
+#include "hf/ffa_internal.h"
#include "hf/panic.h"
#include "hf/vm.h"
@@ -259,6 +260,46 @@ static void set_virtual_interrupt_current(bool enable)
write_msr(hcr_el2, hcr_el2);
}
+#if SECURE_WORLD == 1
+static bool sp_boot_next(struct vcpu *current, struct vcpu **next,
+ struct ffa_value *ret)
+{
+ struct vm_locked current_vm_locked = vm_lock(current->vm);
+ struct vm *vm_next;
+
+ /*
+ * If VM hasn't been initialized, initialize it and traverse
+ * booting list following "next_boot" field in the VM structure.
+ * Once all the SPs have been booted (when "next_boot" is NULL),
+ * return execution to the NWd.
+ */
+ if (current_vm_locked.vm->initialized == false) {
+ current_vm_locked.vm->initialized = true;
+ dlog_verbose("Initialized VM: %#x, boot_order: %u\n",
+ current_vm_locked.vm->id,
+ current_vm_locked.vm->boot_order);
+
+ if (current_vm_locked.vm->next_boot != NULL) {
+ current->state = VCPU_STATE_BLOCKED_MAILBOX;
+ vm_next = current_vm_locked.vm->next_boot;
+ *next = vm_get_vcpu(vm_next, vcpu_index(current));
+ arch_regs_reset(*next);
+ (*next)->cpu = current->cpu;
+ (*next)->state = VCPU_STATE_RUNNING;
+
+ *ret = (struct ffa_value){.func = FFA_INTERRUPT_32};
+ return true;
+ }
+
+ dlog_verbose("Finished initializing all VMs.\n");
+ }
+
+ vm_unlock(&current_vm_locked);
+
+ return false;
+}
+#endif
+
/**
* Checks whether to block an SMC being forwarded from a VM.
*/
@@ -371,7 +412,12 @@ static bool ffa_handler(struct ffa_value *args, struct vcpu *current,
ffa_msg_send_attributes(*args), current, next);
return true;
case FFA_MSG_WAIT_32:
- *args = api_ffa_msg_recv(true, current, next);
+#if SECURE_WORLD == 1
+ if (sp_boot_next(current, next, args)) {
+ return true;
+ }
+#endif
+ *args = api_ffa_msg_wait(current, next);
return true;
case FFA_MSG_POLL_32:
*args = api_ffa_msg_recv(false, current, next);
diff --git a/src/load.c b/src/load.c
index f820204..ed57a70 100644
--- a/src/load.c
+++ b/src/load.c
@@ -148,7 +148,19 @@ static bool load_common(struct mm_stage1_locked stage1_locked,
return false;
}
}
+
+ /*
+ * If DEFAULT_BOOT_ORDER is set, it means
+ * boot-order hasn't been set.
+ */
+ if (manifest_vm->sp.boot_order != DEFAULT_BOOT_ORDER) {
+ vm_locked.vm->boot_order = manifest_vm->sp.boot_order;
+
+ /* Updating Boot list according to boot_order */
+ vm_update_boot(vm_locked.vm);
+ }
}
+
/* Initialize architecture-specific features. */
arch_vm_features_set(vm_locked.vm);
diff --git a/src/main.c b/src/main.c
index 8a495db..c5604b4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,13 +16,30 @@
struct vcpu *cpu_main(struct cpu *c)
{
struct vcpu *vcpu;
+#if SECURE_WORLD == 1
+ struct vm *first_boot = vm_get_first_boot();
+ /*
+ * If `vm_get_first_boot` returns a valid VM, the first partition to
+ * execute is in accordance to the boot-order field of the partition's
+ * manifest.
+ * Else, no partition has been configured with the "boot-order" field
+ * in its manifest, and primary VM should be booted.
+ */
+ if (!first_boot) {
+ first_boot = vm_find(HF_PRIMARY_VM_ID);
+ }
+
+ vcpu = vm_get_vcpu(first_boot, cpu_index(c));
+#else
vcpu = vm_get_vcpu(vm_find(HF_PRIMARY_VM_ID), cpu_index(c));
+#endif
+
vcpu->cpu = c;
arch_cpu_init();
- /* Reset the registers to give a clean start for the primary's vCPU. */
+ /* Reset the registers to give a clean start for vCPU. */
arch_regs_reset(vcpu);
return vcpu;
diff --git a/src/manifest.c b/src/manifest.c
index 60b0fa3..ab61b12 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -195,6 +195,21 @@ static enum manifest_return_code read_uint16(const struct fdt_node *node,
return MANIFEST_SUCCESS;
}
+static enum manifest_return_code read_optional_uint16(
+ const struct fdt_node *node, const char *property,
+ uint16_t default_value, uint16_t *out)
+{
+ enum manifest_return_code ret;
+
+ ret = read_uint16(node, property, out);
+ if (ret == MANIFEST_ERROR_PROPERTY_NOT_FOUND) {
+ *out = default_value;
+ return MANIFEST_SUCCESS;
+ }
+
+ return MANIFEST_SUCCESS;
+}
+
static enum manifest_return_code read_uint8(const struct fdt_node *node,
const char *property, uint8_t *out)
{
@@ -530,6 +545,10 @@ static enum manifest_return_code parse_ffa_manifest(struct fdt *fdt,
TRY(read_uint64(&root, "entrypoint-offset", &vm->sp.ep_offset));
dlog_verbose(" SP entry point offset %#x\n", vm->sp.ep_offset);
+ TRY(read_optional_uint16(&root, "boot-order", DEFAULT_BOOT_ORDER,
+ &vm->sp.boot_order));
+ dlog_verbose(" SP boot order %#u\n", vm->sp.boot_order);
+
TRY(read_uint8(&root, "xlat-granule", (uint8_t *)&vm->sp.xlat_granule));
dlog_verbose(" SP translation granule %d\n", vm->sp.xlat_granule);
diff --git a/src/manifest_test.cc b/src/manifest_test.cc
index 98caf85..890ab26 100644
--- a/src/manifest_test.cc
+++ b/src/manifest_test.cc
@@ -235,6 +235,7 @@ class ManifestDtBuilder
Property("load-address", "<0x7000000>");
Property("entrypoint-offset", "<0x00001000>");
Property("xlat-granule", "<0>");
+ Property("boot-order", "<0>");
Property("messaging-method", "<1>");
return *this;
}
@@ -730,6 +731,10 @@ TEST(manifest, ffa_missing_property)
TEST(manifest, ffa_validate_sanity_check)
{
+ /*
+ * TODO: write test excluding all optional fields of the manifest, in
+ * accordance with specification.
+ */
struct manifest m;
/* Incompatible version */
@@ -744,6 +749,7 @@ TEST(manifest, ffa_validate_sanity_check)
.Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
+ .Property("boot-order", "<0>")
.Property("messaging-method", "<1>")
.Build();
/* clang-format on */
@@ -762,6 +768,7 @@ TEST(manifest, ffa_validate_sanity_check)
.Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<3>")
+ .Property("boot-order", "<0>")
.Property("messaging-method", "<1>")
.Build();
/* clang-format on */
@@ -780,6 +787,7 @@ TEST(manifest, ffa_validate_sanity_check)
.Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
+ .Property("boot-order", "<0>")
.Property("messaging-method", "<1>")
.Build();
/* clang-format on */
@@ -798,6 +806,7 @@ TEST(manifest, ffa_validate_sanity_check)
.Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
+ .Property("boot-order", "<0>")
.Property("messaging-method", "<1>")
.Build();
/* clang-format on */
@@ -816,6 +825,7 @@ TEST(manifest, ffa_validate_sanity_check)
.Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
+ .Property("boot-order", "<0>")
.Property("messaging-method", "<3>")
.Build();
/* clang-format on */
@@ -1054,6 +1064,7 @@ TEST(manifest, ffa_valid)
ASSERT_EQ(m.vm[0].sp.load_addr, 0x7000000);
ASSERT_EQ(m.vm[0].sp.ep_offset, 0x00001000);
ASSERT_EQ(m.vm[0].sp.xlat_granule, PAGE_4KB);
+ ASSERT_EQ(m.vm[0].sp.boot_order, 0);
ASSERT_EQ(m.vm[0].sp.messaging_method, INDIRECT_MESSAGING);
ASSERT_EQ(m.vm[0].sp.mem_regions[0].base_address, 0x7100000);
ASSERT_EQ(m.vm[0].sp.mem_regions[0].page_count, 4);
diff --git a/src/vm.c b/src/vm.c
index fbbdc9f..96e1212 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -21,6 +21,7 @@
static struct vm vms[MAX_VMS];
static struct vm other_world;
static ffa_vm_count_t vm_count;
+static struct vm *first_boot_vm;
struct vm *vm_init(ffa_vm_id_t id, ffa_vcpu_count_t vcpu_count,
struct mpool *ppool)
@@ -292,3 +293,41 @@ bool vm_unmap_hypervisor(struct vm_locked vm_locked, struct mpool *ppool)
vm_unmap(vm_locked, layout_data_begin(), layout_data_end(),
ppool);
}
+
+/**
+ * Gets the first partition to boot, according to Boot Protocol from FFA spec.
+ */
+struct vm *vm_get_first_boot(void)
+{
+ return first_boot_vm;
+}
+
+/**
+ * Insert in boot list, sorted by `boot_order` parameter in the vm structure
+ * and rooted in `first_boot_vm`.
+ */
+void vm_update_boot(struct vm *vm)
+{
+ struct vm *current = NULL;
+ struct vm *previous = NULL;
+
+ if (first_boot_vm == NULL) {
+ first_boot_vm = vm;
+ return;
+ }
+
+ current = first_boot_vm;
+
+ while (current != NULL && current->boot_order >= vm->boot_order) {
+ previous = current;
+ current = current->next_boot;
+ }
+
+ if (previous != NULL) {
+ previous->next_boot = vm;
+ } else {
+ first_boot_vm = vm;
+ }
+
+ vm->next_boot = current;
+}
diff --git a/src/vm_test.cc b/src/vm_test.cc
index 6fb2bce..4a0c119 100644
--- a/src/vm_test.cc
+++ b/src/vm_test.cc
@@ -13,6 +13,7 @@ extern "C" {
#include "hf/vm.h"
}
+#include <list>
#include <memory>
#include <span>
#include <vector>
@@ -29,7 +30,7 @@ using ::testing::SizeIs;
using struct_vm = struct vm;
-constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 16;
+constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 32;
const int TOP_LEVEL = arch_mm_stage2_max_level();
class vm : public ::testing::Test
@@ -49,6 +50,12 @@ class vm : public ::testing::Test
protected:
struct mpool ppool;
+
+ public:
+ static bool BootOrderBiggerThan(struct_vm *vm1, struct_vm *vm2)
+ {
+ return vm1->boot_order > vm2->boot_order;
+ }
};
/**
@@ -70,4 +77,70 @@ TEST_F(vm, vm_unmap_hypervisor_not_mapped)
vm_unlock(&vm_locked);
}
+/**
+ * Validate the "boot_list" is created properly, according to vm's "boot_order"
+ * field.
+ */
+TEST_F(vm, vm_boot_order)
+{
+ struct_vm *vm_cur;
+ std::list<struct_vm *> expected_final_order;
+
+ EXPECT_FALSE(vm_get_first_boot());
+
+ /*
+ * Insertion when no call to "vm_update_boot" has been made yet.
+ * The "boot_list" is expected to be empty.
+ */
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur));
+ vm_cur->boot_order = 1;
+ vm_update_boot(vm_cur);
+ expected_final_order.push_back(vm_cur);
+
+ EXPECT_EQ(vm_get_first_boot()->id, vm_cur->id);
+
+ /* Insertion at the head of the boot list */
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur));
+ vm_cur->boot_order = 3;
+ vm_update_boot(vm_cur);
+ expected_final_order.push_back(vm_cur);
+
+ EXPECT_EQ(vm_get_first_boot()->id, vm_cur->id);
+
+ /* Insertion of two in the middle of the boot list */
+ for (int i = 0; i < 2; i++) {
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur));
+ vm_cur->boot_order = 2;
+ vm_update_boot(vm_cur);
+ expected_final_order.push_back(vm_cur);
+ }
+
+ /*
+ * Insertion in the end of the list.
+ * This tests shares the data with "vm_unmap_hypervisor_not_mapped".
+ * As such, a VM is expected to have been initialized before this
+ * test, with ID 1 and boot_order 0.
+ */
+ vm_cur = vm_find(1);
+ EXPECT_FALSE(vm_cur == NULL);
+ vm_update_boot(vm_cur);
+ expected_final_order.push_back(vm_cur);
+
+ /*
+ * Number of VMs initialized should be the same as in the
+ * "expected_final_order", before the final verification.
+ */
+ EXPECT_EQ(expected_final_order.size(), vm_get_count())
+ << "Something went wrong with the test itself...\n";
+
+ /* Sort "expected_final_order" by "boot_order" field */
+ expected_final_order.sort(vm::BootOrderBiggerThan);
+
+ std::list<struct_vm *>::iterator it;
+ for (it = expected_final_order.begin(), vm_cur = vm_get_first_boot();
+ it != expected_final_order.end() && vm_cur != NULL;
+ it++, vm_cur = vm_cur->next_boot) {
+ EXPECT_EQ((*it)->id, vm_cur->id);
+ }
+}
} /* namespace */
--
2.17.1
@@ -0,0 +1,15 @@
# TF-A spm
SRCREV_FORMAT = "spm"
SRCREV_spm = "764fd2eb2ece8b5bddc802cc8369743a283cd7d7"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI_append_tc0 = " file://0001-FF-A-Booting-SPs-according-to-boot-order.patch"
LIC_FILES_CHKSUM = "file://LICENSE;md5=782b40c14bad5294672c500501edc103"
COMPATIBLE_MACHINE = "tc0"
SPM_PLATFORM = "secure_tc0_clang"
SPM_INSTALL_TARGET = "hafnium.bin"
@@ -0,0 +1,13 @@
# tf-a-tests
SRCREV_FORMAT = "tfa-tests"
SRCREV_tfa-tests = "b3bcf77a65880049e40fa6f1b764a19dbd9faead"
LIC_FILES_CHKSUM = "file://docs/license.rst;md5=6175cc0aa2e63b6d21a32aa0ee7d1b4a"
COMPATIBLE_MACHINE = "tc0"
TFA_TESTS_PLATFORM = "tc0"
TFA_TESTS_BUILD_TARGET = "all"
TFA_TESTS_INSTALL_TARGET = "tftf.bin cactus.bin sp_layout.json \
cactus.dts cactus-secondary.dts cactus-tertiary.dts"
@@ -1,9 +1,16 @@
# TCO specific TFA configuration
# Intermediate SHA with 2.3 baseline version
SRCREV_tfa = "16796a25fefc4ecf780211bf554d3b8dc5436fa4"
SRCREV_tfa = "00ad74c7afe67b2ffaf08300710f18d3dafebb45"
DEPENDS += "scp-firmware"
DEPENDS += "spm"
# Currenly only test partition images are available to be executed at S-EL1.
SP_AT_SEL1 = "cactus"
# Enable test secure partitions if SP_AT_SEL1 is cactus
DEPENDS += " tf-a-tests "
COMPATIBLE_MACHINE = "tc0"
@@ -12,8 +19,15 @@ TFA_BUILD_TARGET = "all fip"
TFA_UBOOT = "1"
TFA_INSTALL_TARGET = "bl1 fip"
TFA_MBEDTLS = "1"
TFA_DEBUG = "1"
EXTRA_OEMAKE += "SCP_BL2=${RECIPE_SYSROOT}/firmware/scp_ramfw.bin"
EXTRA_OEMAKE += "TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem"
do_compile[depends] += " spm:do_deploy "
EXTRA_OEMAKE += " SPD=spmd CTX_INCLUDE_EL2_REGS=1 ARM_ARCH_MINOR=4 BL32=${DEPLOY_DIR_IMAGE}/hafnium.bin"
# Enable test secure partitions if SP_AT_SEL1 is cactus
do_compile[depends] += " tf-a-tests:do_deploy "
EXTRA_OEMAKE += " SP_LAYOUT_FILE=${DEPLOY_DIR_IMAGE}/sp_layout.json "
@@ -1,39 +1,16 @@
From 5372743bab931e0f31e37c3767077abd504eca2b Mon Sep 17 00:00:00 2001
From: Damodar Santhapuri <damodar.santhapuri@arm.com>
Date: Thu, 5 Nov 2020 22:40:48 +0530
Subject: [PATCH] arm: juno: add custom bootcmd to autoboot from uEnv.txt file
enable autoboot support with custom bootcmd loads uEnv.txt
from NOR to DRAM and import.
Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>
Upstream-Status: Pending
---
include/configs/vexpress_aemv8a.h | 40 ++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 09cdd3dab5..9c9f8dfd16 100644
index 09cdd3dab5..7d6d231bd9 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -131,11 +131,39 @@
"kernel_name=norkern\0" \
"kernel_alt_name=Image\0" \
"kernel_addr_r=0x80080000\0" \
- "ramdisk_name=ramdisk.img\0" \
- "ramdisk_addr_r=0x88000000\0" \
+ "initrd_name=ramdisk.img\0" \
+ "initrd_addr_r=0x88000000\0" \
@@ -136,6 +136,32 @@
"fdtfile=board.dtb\0" \
"fdt_alt_name=juno\0" \
"fdt_addr_r=0x80000000\0" \
+ "fdt_high=0xffffffffffffffff\0" \
+ "initrd_high=0xffffffffffffffff\0" \
+ "bootenvfile=uEnv.txt\0" \
+ "bootcmd=run envboot\0" \
+ "envboot=if run loadbootenv; then echo Loading env from ${bootenvfile}; run importbootenv; else run default_bootcmd; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd;fi;\0" \
+ "bootenvfile=uEnv.txt\0" \
+ "bootcmd=run envboot\0" \
+ "envboot=if run loadbootenv; then echo Loading env from ${bootenvfile}; run importbootenv; else run default_bootcmd; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd;fi;\0" \
+ "importbootenv=echo Importing environment from memory, size ${filesize}; env import -t ${loadaddr} ${filesize}\0" \
+ "loadaddr=0x84000000\0" \
+ "loadaddr=0x82000000\0" \
+ "filesize=0x4000\0" \
+ "loadbootenv=mw.l ${loadaddr} 0 0x1000; afs load ${bootenvfile} ${loadaddr}\0" \
+ "default_bootcmd=echo running default boot command; afs load ${kernel_name} ${kernel_addr_r} ; " \
@@ -49,32 +26,12 @@ index 09cdd3dab5..9c9f8dfd16 100644
+ " afs load ${fdt_alt_name} ${fdt_addr_r}; "\
+ "fi ; "\
+ "fdt addr ${fdt_addr_r}; fdt resize; " \
+ "if afs load ${initrd_name} ${initrd_addr_r} ; "\
+ "if afs load ${ramdisk_name} ${ramdisk_addr_r} ; "\
+ "then "\
+ " setenv initrd_param ${initrd_addr_r}; "\
+ " else setenv initrd_param -; "\
+ " setenv ramdisk_param ${ramdisk_addr_r}; "\
+ " else setenv ramdisk_param -; "\
+ "fi ; " \
+ "booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}\0"
+ "booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}\0"
/* Copy the kernel and FDT to DRAM memory and boot */
#define CONFIG_BOOTCOMMAND "afs load ${kernel_name} ${kernel_addr_r} ;"\
@@ -151,12 +179,12 @@
" afs load ${fdt_alt_name} ${fdt_addr_r}; "\
"fi ; "\
"fdt addr ${fdt_addr_r}; fdt resize; " \
- "if afs load ${ramdisk_name} ${ramdisk_addr_r} ; "\
+ "if afs load ${initrd_name} ${initrd_addr_r} ; "\
"then "\
- " setenv ramdisk_param ${ramdisk_addr_r}; "\
- " else setenv ramdisk_param -; "\
+ " setenv initrd_param ${initrd_addr_r}; "\
+ " else setenv initrd_param -; "\
"fi ; " \
- "booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}"
+ "booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}"
#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
--
2.17.1
@@ -1,307 +0,0 @@
From 854c5d7b8a010d47da38735f15a31d0b7d10ae3c Mon Sep 17 00:00:00 2001
From: Usama Arif <usama.arif@arm.com>
Date: Fri, 3 Jul 2020 10:26:56 +0100
Subject: [PATCH] Add support for Total Compute
This includes basic platform patch support and boots
kernel and ramdisk that have been sideloaded in DRAM.
Change-Id: I2e35a1d983efd1d27572f671cad5a9fe4ad68ee6
Signed-off-by: Usama Arif <usama.arif@arm.com>
Upstream-Status: Pending
---
arch/arm/Kconfig | 9 +++
board/armltd/totalcompute/Kconfig | 12 ++++
board/armltd/totalcompute/MAINTAINERS | 6 ++
board/armltd/totalcompute/Makefile | 6 ++
board/armltd/totalcompute/totalcompute.c | 74 +++++++++++++++++++++++
configs/total_compute_defconfig | 39 ++++++++++++
include/configs/total_compute.h | 77 ++++++++++++++++++++++++
7 files changed, 223 insertions(+)
create mode 100644 board/armltd/totalcompute/Kconfig
create mode 100644 board/armltd/totalcompute/MAINTAINERS
create mode 100644 board/armltd/totalcompute/Makefile
create mode 100644 board/armltd/totalcompute/totalcompute.c
create mode 100644 configs/total_compute_defconfig
create mode 100644 include/configs/total_compute.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 36c9c2fecd0..b423b7655b6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -635,6 +635,14 @@ config TARGET_VEXPRESS_CA15_TC2
select CPU_V7_HAS_VIRT
select PL011_SERIAL
+config TARGET_TOTAL_COMPUTE
+ bool "Support Total Compute Platform"
+ select ARM64
+ select PL01X_SERIAL
+ select DM
+ select DM_SERIAL
+ select DM_ETH
+
config ARCH_BCMSTB
bool "Broadcom BCM7XXX family"
select CPU_V7A
@@ -1774,6 +1782,7 @@ source "arch/arm/cpu/armv8/Kconfig"
source "arch/arm/mach-imx/Kconfig"
+source "board/armltd/totalcompute/Kconfig"
source "board/bosch/shc/Kconfig"
source "board/bosch/guardian/Kconfig"
source "board/CarMediaLab/flea3/Kconfig"
diff --git a/board/armltd/totalcompute/Kconfig b/board/armltd/totalcompute/Kconfig
new file mode 100644
index 00000000000..8bd8c30a6b5
--- /dev/null
+++ b/board/armltd/totalcompute/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_TOTAL_COMPUTE
+
+config SYS_BOARD
+ default "totalcompute"
+
+config SYS_VENDOR
+ default "armltd"
+
+config SYS_CONFIG_NAME
+ default "total_compute"
+
+endif
diff --git a/board/armltd/totalcompute/MAINTAINERS b/board/armltd/totalcompute/MAINTAINERS
new file mode 100644
index 00000000000..bb09a90a309
--- /dev/null
+++ b/board/armltd/totalcompute/MAINTAINERS
@@ -0,0 +1,6 @@
+TOTAL_COMPUTE BOARD
+M: Usama Arif <usama.arif@arm.com>
+S: Maintained
+F: board/armltd/totalcompute/
+F: include/configs/total_compute.h
+F: configs/total_compute_defconfig
diff --git a/board/armltd/totalcompute/Makefile b/board/armltd/totalcompute/Makefile
new file mode 100644
index 00000000000..4c40afef723
--- /dev/null
+++ b/board/armltd/totalcompute/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2020 ARM Limited
+# Usama Arif <usama.arif@arm.com>
+
+obj-y := totalcompute.o
diff --git a/board/armltd/totalcompute/totalcompute.c b/board/armltd/totalcompute/totalcompute.c
new file mode 100644
index 00000000000..21247e4ef0f
--- /dev/null
+++ b/board/armltd/totalcompute/totalcompute.c
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2020 ARM Limited
+ * Usama Arif <usama.arif@arm.com>
+ */
+#include <common.h>
+#include <dm.h>
+#include <init.h>
+#include <malloc.h>
+#include <errno.h>
+#include <netdev.h>
+#include <asm/io.h>
+#include <linux/compiler.h>
+#include <dm/platform_data/serial_pl01x.h>
+#include <asm/armv8/mmu.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const struct pl01x_serial_platdata serial_platdata = {
+ .base = UART0_BASE,
+ .type = TYPE_PL011,
+ .clock = CONFIG_PL011_CLOCK,
+};
+
+U_BOOT_DEVICE(total_compute_serials) = {
+ .name = "serial_pl01x",
+ .platdata = &serial_platdata,
+};
+
+static struct mm_region total_compute_mem_map[] = {
+ {
+ .virt = 0x0UL,
+ .phys = 0x0UL,
+ .size = 0x80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ .virt = 0x80000000UL,
+ .phys = 0x80000000UL,
+ .size = 0xff80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = total_compute_mem_map;
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->ram_size = PHYS_SDRAM_1_SIZE;
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+ return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+}
+
diff --git a/configs/total_compute_defconfig b/configs/total_compute_defconfig
new file mode 100644
index 00000000000..31d97dddc21
--- /dev/null
+++ b/configs/total_compute_defconfig
@@ -0,0 +1,39 @@
+CONFIG_ARM=y
+CONFIG_TARGET_TOTAL_COMPUTE=y
+CONFIG_SYS_TEXT_BASE=0xe0000000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x10000
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTDELAY=1
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0 debug user_debug=31 earlycon=pl011,0x7ff80000 loglevel=9 androidboot.hardware=total_compute video=640x480-32@60 root=/dev/vda2 ip=dhcp androidboot.selinux=permissive"
+# CONFIG_USE_BOOTCOMMAND is not set
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="TOTAL_COMPUTE# "
+# CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EDITENV is not set
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xff000000
+CONFIG_CMD_ARMFLASH=y
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_CMD_CACHE=y
+# CONFIG_CMD_MISC is not set
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_DEVICE=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_PROTECTION=y
+CONFIG_SYS_FLASH_CFI=y
+CONFIG_OF_LIBFDT=y
diff --git a/include/configs/total_compute.h b/include/configs/total_compute.h
new file mode 100644
index 00000000000..54086205db6
--- /dev/null
+++ b/include/configs/total_compute.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration for Total Compute. Parts were derived from other ARM
+ * configurations.
+ * (C) Copyright 2020 ARM Limited
+ * Usama Arif <usama.arif@arm.com>
+ */
+
+#ifndef __TOTAL_COMPUTE_H
+#define __TOTAL_COMPUTE_H
+
+#define CONFIG_REMAKE_ELF
+
+/* Link Definitions */
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
+#define CONFIG_ENV_SIZE 0x10000
+
+
+#define CONFIG_SYS_BOOTM_LEN (64 << 20)
+
+#define UART0_BASE 0x7ff80000
+
+/* Generic Timer Definitions */
+#define COUNTER_FREQUENCY (0x1800000) /* 24MHz */
+
+/* Generic Interrupt Controller Definitions */
+
+#define GICD_BASE (0x2C010000)
+#define GICC_BASE (0x2C02f000)
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (8 << 20))
+
+/* PL011 Serial Configuration */
+#define CONFIG_PL011_CLOCK 7372800
+
+/* BOOTP options */
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LOAD_ADDR 0x90000000
+
+/* Physical Memory Map */
+#define PHYS_SDRAM_1 0x80000000
+/* Top 32MB reserved for secure world use */
+#define DRAM_SEC_SIZE 0x02000000
+#define PHYS_SDRAM_1_SIZE 0x80000000 - DRAM_SEC_SIZE
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+
+/* Enable memtest */
+#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE)
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "kernel_addr_r=0x80080000\0" \
+ "initrd_addr_r=0x88000000\0" \
+ "fdt_addr_r=0x83000000\0" \
+ "fdt_high=0xffffffffffffffff\0" \
+ "initrd_high=0xffffffffffffffff\0"
+
+#define CONFIG_BOOTCOMMAND "booti ${kernel_addr_r} ${initrd_addr_r} ${fdt_addr_r}"
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
+#define CONFIG_SYS_MAXARGS 64 /* max command args */
+
+#define CONFIG_SYS_FLASH_BASE 0x0C000000
+/* 256 x 256KiB sectors */
+#define CONFIG_SYS_MAX_FLASH_SECT 256
+
+#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_32BIT
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+
+#define CONFIG_SYS_FLASH_EMPTY_INFO /* flinfo indicates empty blocks */
+#define FLASH_MAX_SECTOR_SIZE 0x00040000
+
+#endif /* __TOTAL_COMPUTE_H */
--
2.17.1

Some files were not shown because too many files have changed in this diff Show More