Intel NUC support (#288)

* Add hassos configuration for intel-nuc:

 * Cloned from ova config
 * Use default amd64 kernel config
 * Add support for Intel IGB type nics
 * Add rng-tools for better random

* Build with iwlwifi module & firmware (only newer modules with iwlmvm firmware)

* Include firmware for 915, which should improve power efficiency.
Build display and audio as a module to make it all work.

* Add intel_nuc to build script.

* Change directory structure as proposed by @pvizeli

*  * Fix paths
 * Remove unused patch directory

* Unduplicate barebox config.
This commit is contained in:
Jasper van der Neut - Stulen
2018-12-28 11:09:24 +01:00
committed by Pascal Vizeli
parent 42c2f88588
commit 9bc61e6318
13 changed files with 153 additions and 5 deletions

View File

@@ -0,0 +1,123 @@
From 405590bdb7ae434798010458e810c415e4e99db4 Mon Sep 17 00:00:00 2001
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Date: Fri, 30 Jun 2017 16:53:34 +0200
Subject: barebox-state: get devicetree from file
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
diff --git a/src/barebox-state.c b/src/barebox-state.c
index e68b8cb..3622e76 100644
--- a/src/barebox-state.c
+++ b/src/barebox-state.c
@@ -308,7 +308,7 @@ static int state_set_var(struct state *state, const char *var, const char *val)
}
-struct state *state_get(const char *name, bool readonly, bool auth)
+struct state *state_get(const char *name, const char *filename, bool readonly, bool auth)
{
struct device_node *root, *node, *partition_node;
char *path;
@@ -320,11 +320,19 @@ struct state *state_get(const char *name, bool readonly, bool auth)
off_t offset;
size_t size;
- root = of_read_proc_devicetree();
- if (IS_ERR(root)) {
- pr_err("Unable to read devicetree. %s\n",
- strerror(-PTR_ERR(root)));
- return ERR_CAST(root);
+ if (filename) {
+ void *fdt;
+
+ fdt = read_file(filename, NULL);
+ if (fdt)
+ root = of_unflatten_dtb(fdt);
+ } else {
+ root = of_read_proc_devicetree();
+ if (IS_ERR(root)) {
+ pr_err("Unable to read devicetree. %s\n",
+ strerror(-PTR_ERR(root)));
+ return ERR_CAST(root);
+ }
}
of_set_root_node(root);
@@ -387,6 +395,7 @@ static struct option long_options[] = {
{"get", required_argument, 0, 'g' },
{"set", required_argument, 0, 's' },
{"name", required_argument, 0, 'n' },
+ {"input", required_argument, 0, 'i' },
{"dump", no_argument, 0, 'd' },
{"dump-shell", no_argument, 0, OPT_DUMP_SHELL },
{"verbose", no_argument, 0, 'v' },
@@ -402,6 +411,7 @@ static void usage(char *name)
"-g, --get <variable> get the value of a variable\n"
"-s, --set <variable>=<value> set the value of a variable\n"
"-n, --name <name> specify the state to use (default=\"state\"). Multiple states are allowed.\n"
+"-i, --input <name> load the devicetree from a file instead of using the system devicetree.\n"
"-d, --dump dump the state\n"
"--dump-shell dump the state suitable for shell sourcing\n"
"-v, --verbose increase verbosity\n"
@@ -439,12 +449,13 @@ int main(int argc, char *argv[])
bool readonly = true;
int pr_level = 5;
int auth = 1;
+ const char *dtb = NULL;
INIT_LIST_HEAD(&sg_list);
INIT_LIST_HEAD(&state_list.list);
while (1) {
- c = getopt_long(argc, argv, "hg:s:dvn:qf", long_options, &option_index);
+ c = getopt_long(argc, argv, "hg:s:i:dvn:qf", long_options, &option_index);
if (c < 0)
break;
switch (c) {
@@ -490,6 +501,9 @@ int main(int argc, char *argv[])
++nr_states;
break;
}
+ case 'i':
+ dtb = strdup(optarg);
+ break;
case ':':
case '?':
default:
@@ -530,7 +544,7 @@ int main(int argc, char *argv[])
}
list_for_each_entry(state, &state_list.list, list) {
- state->state = state_get(state->name, readonly, auth);
+ state->state = state_get(state->name, dtb, readonly, auth);
if (!IS_ERR(state->state) && !state->name)
state->name = state->state->name;
if (IS_ERR(state->state)) {
diff --git a/src/barebox-state.h b/src/barebox-state.h
index bd89cf4..a0f49a5 100644
--- a/src/barebox-state.h
+++ b/src/barebox-state.h
@@ -1,7 +1,7 @@
#ifndef __BAREBOX_STATE__
#define __BAREBOX_STATE__
-struct state *state_get(const char *name, bool readonly, bool auth);
+struct state *state_get(const char *name, const char *file, bool readonly, bool auth);
char *state_get_var(struct state *state, const char *var);
#endif /* __BAREBOX_STATE__ */
diff --git a/src/keystore-blob.c b/src/keystore-blob.c
index 028dd8b..4572431 100644
--- a/src/keystore-blob.c
+++ b/src/keystore-blob.c
@@ -30,7 +30,7 @@ int keystore_get_secret(const char *name, const unsigned char **key, int *key_le
if (!state) {
struct state *tmp;
- tmp = state_get(keystore_state_name, true, false);
+ tmp = state_get(keystore_state_name, NULL, true, false);
if (IS_ERR(tmp))
return PTR_ERR(tmp);
state = tmp;
--
cgit v0.10.2

View File

@@ -0,0 +1,33 @@
From 26148417fab419a0c7f301fb8f2be015324d5374 Mon Sep 17 00:00:00 2001
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Date: Fri, 30 Jun 2017 16:53:17 +0200
Subject: libdt: support finding devices by partuuid
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
diff --git a/src/libdt.c b/src/libdt.c
index 3adeed2..2bc6cc1 100644
--- a/src/libdt.c
+++ b/src/libdt.c
@@ -2393,6 +2393,18 @@ int of_get_devicepath(struct device_node *partition_node, char **devpath, off_t
*/
node = partition_node->parent;
+ if (of_device_is_compatible(node, "fixed-partitions")) {
+ const char *uuid;
+
+ /* when partuuid is specified short-circuit the search for the cdev */
+ ret = of_property_read_string(partition_node, "partuuid", &uuid);
+ if (!ret) {
+ *devpath = basprintf("/dev/disk/by-partuuid/%s", uuid);
+
+ return 0;
+ }
+ }
+
/*
* Respect flash "partitions" subnode. Use parent of parent in this
* case.
--
cgit v0.10.2

View File

@@ -0,0 +1,36 @@
From c9d56ea8fccf72e1c5d1f224f965e1a8e84d1b7f Mon Sep 17 00:00:00 2001
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Wed, 9 May 2018 21:54:58 +0200
Subject: [PATCH 1/1] add -i argument to barebox-state call
---
src/bootchooser.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/bootchooser.c b/src/bootchooser.c
index d5efc0c..c57c2f7 100644
--- a/src/bootchooser.c
+++ b/src/bootchooser.c
@@ -77,6 +77,9 @@ static gboolean barebox_state_get(const gchar* bootname, BareboxSlotState *bb_st
g_ptr_array_add(args, g_strdup_printf(BOOTSTATE_PREFIX ".%s.priority", bootname));
g_ptr_array_add(args, g_strdup("-g"));
g_ptr_array_add(args, g_strdup_printf(BOOTSTATE_PREFIX ".%s.remaining_attempts", bootname));
+
+ g_ptr_array_add(args, g_strdup("-i"));
+ g_ptr_array_add(args, g_strdup("/etc/barebox-state.dtb"));
g_ptr_array_add(args, NULL);
sub = g_subprocess_newv((const gchar * const *)args->pdata,
@@ -170,6 +173,9 @@ static gboolean barebox_state_set(GPtrArray *pairs, GError **error)
g_ptr_array_add(args, g_strdup("-s"));
g_ptr_array_add(args, g_strdup(pairs->pdata[i]));
}
+
+ g_ptr_array_add(args, g_strdup("-i"));
+ g_ptr_array_add(args, g_strdup("/etc/barebox-state.dtb"));
g_ptr_array_add(args, NULL);
sub = g_subprocess_newv((const gchar * const *)args->pdata,
--
2.7.4