* Update buildroot-patches for 2020.11-rc1 buildroot * Update buildroot to 2020.11-rc1 Signed-off-by: Stefan Agner <stefan@agner.ch> * Don't rely on sfdisk --list-free output The --list-free (-F) argument does not allow machine readable mode. And it seems that the output format changes over time (different spacing, using size postfixes instead of raw blocks). Use sfdisk json output and calculate free partition space ourselfs. This works for 2.35 and 2.36 and is more robust since we rely on output which is meant for scripts to parse. * Migrate defconfigs for Buildroot 2020.11-rc1 In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE). * Rebase/remove systemd patches for systemd 246 * Drop apparmor/libapparmor from buildroot-external * hassos-persists: use /run as directory for lockfiles The U-Boot tools use /var/lock by default which is not created any more by systemd by default (it is under tmpfiles legacy.conf, which we no longer install). * Disable systemd-update-done.service The service is not suited for pure read-only systems. In particular the service needs to be able to write a file in /etc and /var. Remove the service. Note: This is a static service and cannot be removed using systemd-preset. * Disable apparmor.service for now The service loads all default profiles. Some might actually cause problems. E.g. the profile for ping seems not to match our setup for /etc/resolv.conf: [85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
148 lines
5.2 KiB
Diff
148 lines
5.2 KiB
Diff
From 267a57022699453e8d8f517519df25ac6bf6ac4e Mon Sep 17 00:00:00 2001
|
|
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
Date: Sun, 16 Dec 2018 11:52:18 +0100
|
|
Subject: [PATCH] Only prefix with the sysroot a subset of variables
|
|
|
|
The standard logic of pkg-config is to prefix all absolute paths by
|
|
the sysroot defined in PKG_CONFIG_SYSROOT_DIR. However, while some
|
|
paths (like includedir, libdir, and paths used in -L and -I options)
|
|
indeed need to be prefixed by the sysroot, it is not necessarily the
|
|
case for paths that are used on the target. If they get prefixed by
|
|
the sysroot, the runtime path on the target is incorrect.
|
|
|
|
Unfortunately, pkg-config doesn't have a sense of which path needs to
|
|
be prefixed by the sysroot, and which path should not be prefixed by
|
|
the sysroot.
|
|
|
|
So, let's simply have a whitelist of paths that should be prefixed:
|
|
g_ir_scanner, g_ir_compiler, g_ir_generate, includedir, libdir, mapdir,
|
|
pkgdatadir and sdkdir. This list of variables was collected over years of
|
|
Buildroot development. All other paths are not prefixed by the sysroot.
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
[Updated to include gobject-introspection paths]
|
|
Signed-off-by: Adam Duskett <aduskett@gmail.com>
|
|
---
|
|
libpkgconf/tuple.c | 60 ++++++++++++++++++++++++++++++++--------------
|
|
1 file changed, 42 insertions(+), 18 deletions(-)
|
|
|
|
diff --git a/libpkgconf/tuple.c b/libpkgconf/tuple.c
|
|
index 8523709..7cd2fff 100644
|
|
--- a/libpkgconf/tuple.c
|
|
+++ b/libpkgconf/tuple.c
|
|
@@ -160,6 +160,21 @@ dequote(const char *value)
|
|
return buf;
|
|
}
|
|
|
|
+static char *
|
|
+pkgconf_tuple_parse_sysroot(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value, bool add_sysroot);
|
|
+
|
|
+const char *sysrooted_keys[] = {
|
|
+ "g_ir_scanner",
|
|
+ "g_ir_compiler",
|
|
+ "g_ir_generate",
|
|
+ "includedir",
|
|
+ "libdir",
|
|
+ "mapdir",
|
|
+ "pkgdatadir",
|
|
+ "sdkdir",
|
|
+ NULL,
|
|
+};
|
|
+
|
|
/*
|
|
* !doc
|
|
*
|
|
@@ -180,6 +192,8 @@ pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *list, const ch
|
|
{
|
|
char *dequote_value;
|
|
pkgconf_tuple_t *tuple = calloc(sizeof(pkgconf_tuple_t), 1);
|
|
+ bool add_sysroot = false;
|
|
+ int i;
|
|
|
|
pkgconf_tuple_find_delete(list, key);
|
|
|
|
@@ -187,9 +201,13 @@ pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *list, const ch
|
|
|
|
PKGCONF_TRACE(client, "adding tuple to @%p: %s => %s (parsed? %d)", list, key, dequote_value, parse);
|
|
|
|
+ for (i = 0; sysrooted_keys[i] != NULL; i++)
|
|
+ if (!strcmp(key, sysrooted_keys[i]))
|
|
+ add_sysroot = true;
|
|
+
|
|
tuple->key = strdup(key);
|
|
if (parse)
|
|
- tuple->value = pkgconf_tuple_parse(client, list, dequote_value);
|
|
+ tuple->value = pkgconf_tuple_parse_sysroot(client, list, dequote_value, add_sysroot);
|
|
else
|
|
tuple->value = strdup(dequote_value);
|
|
|
|
@@ -233,27 +251,14 @@ pkgconf_tuple_find(const pkgconf_client_t *client, pkgconf_list_t *list, const c
|
|
return NULL;
|
|
}
|
|
|
|
-/*
|
|
- * !doc
|
|
- *
|
|
- * .. c:function:: char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value)
|
|
- *
|
|
- * Parse an expression for variable substitution.
|
|
- *
|
|
- * :param pkgconf_client_t* client: The pkgconf client object to access.
|
|
- * :param pkgconf_list_t* list: The variable list to search for variables (along side the global variable list).
|
|
- * :param char* value: The ``key=value`` string to parse.
|
|
- * :return: the variable data with any variables substituted
|
|
- * :rtype: char *
|
|
- */
|
|
-char *
|
|
-pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value)
|
|
+static char *
|
|
+pkgconf_tuple_parse_sysroot(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value, bool add_sysroot)
|
|
{
|
|
char buf[PKGCONF_BUFSIZE];
|
|
const char *ptr;
|
|
char *bptr = buf;
|
|
|
|
- if (*value == '/' && client->sysroot_dir != NULL && strncmp(value, client->sysroot_dir, strlen(client->sysroot_dir)))
|
|
+ if (add_sysroot && *value == '/' && client->sysroot_dir != NULL && strncmp(value, client->sysroot_dir, strlen(client->sysroot_dir)))
|
|
bptr += pkgconf_strlcpy(buf, client->sysroot_dir, sizeof buf);
|
|
|
|
for (ptr = value; *ptr != '\0' && bptr - buf < PKGCONF_BUFSIZE; ptr++)
|
|
@@ -293,7 +298,7 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const
|
|
|
|
if (kv != NULL)
|
|
{
|
|
- parsekv = pkgconf_tuple_parse(client, vars, kv);
|
|
+ parsekv = pkgconf_tuple_parse_sysroot(client, vars, kv, add_sysroot);
|
|
|
|
strncpy(bptr, parsekv, PKGCONF_BUFSIZE - (bptr - buf));
|
|
bptr += strlen(parsekv);
|
|
@@ -338,6 +343,25 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const
|
|
return strdup(buf);
|
|
}
|
|
|
|
+/*
|
|
+ * !doc
|
|
+ *
|
|
+ * .. c:function:: char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value)
|
|
+ *
|
|
+ * Parse an expression for variable substitution.
|
|
+ *
|
|
+ * :param pkgconf_client_t* client: The pkgconf client object to access.
|
|
+ * :param pkgconf_list_t* list: The variable list to search for variables (along side the global variable list).
|
|
+ * :param char* value: The ``key=value`` string to parse.
|
|
+ * :return: the variable data with any variables substituted
|
|
+ * :rtype: char *
|
|
+ */
|
|
+char *
|
|
+pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value)
|
|
+{
|
|
+ return pkgconf_tuple_parse_sysroot(client, vars, value, true);
|
|
+}
|
|
+
|
|
/*
|
|
* !doc
|
|
*
|
|
--
|
|
2.19.2
|
|
|