Files
operating-system/buildroot/package/easyframes/0002-Fix-different-compiling-issues.patch
Stefan Agner a0871be6c0 Bump buildroot to 2020.11-rc1 (#985)
* 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
2020-11-13 18:25:44 +01:00

92 lines
3.2 KiB
Diff

From d3d179c3c39ec10ec636b325325ad8e18ae9542f Mon Sep 17 00:00:00 2001
From: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: Tue, 1 Sep 2020 13:03:47 +0200
Subject: [PATCH] Fix different compiling issues
[Retrieved from:
https://github.com/microchip-ung/easyframes/commit/d3d179c3c39ec10ec636b325325ad8e18ae9542f]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
src/ef-exec.c | 4 ++--
src/ef-parse-bytes.c | 8 ++++++--
src/ef.h | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/ef-exec.c b/src/ef-exec.c
index 3d184a0..824164e 100644
--- a/src/ef-exec.c
+++ b/src/ef-exec.c
@@ -108,7 +108,7 @@ int ring_wait_for_init(tpacket_ring *ring) {
int raw_socket(cmd_socket_t *cmd_socket) {
- int s, res, val, ifidx;
+ int s, res, val, ifidx, i;
struct sockaddr_ll sa = {};
struct packet_mreq mr = {};
@@ -194,7 +194,7 @@ int raw_socket(cmd_socket_t *cmd_socket) {
//
// TODO: This does not seem to be needed, if we uses a RX ring buffer
// instead (atleast that seems to work for libpcap)
- for (int i = 0; i < 10000; ++i) {
+ for (i = 0; i < 10000; ++i) {
struct msghdr msg = { 0 };
int res = recvmsg(s, &msg, MSG_DONTWAIT);
if (res < 0)
diff --git a/src/ef-parse-bytes.c b/src/ef-parse-bytes.c
index 1dd590f..1785f45 100644
--- a/src/ef-parse-bytes.c
+++ b/src/ef-parse-bytes.c
@@ -2,6 +2,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <endian.h>
#include <arpa/inet.h>
struct start_with {
@@ -212,7 +213,9 @@ buf_t *parse_bytes(const char *s, int bytes) {
for (s = data_begin; *s; ++s) {
int match_found = 0;
for (i = 0; i < sizeof(has_chars)/sizeof(has_chars[0]); ++i) {
- for (const char *set_i = has_chars[i].char_set; *set_i; ++set_i) {
+ const char *set_i;
+
+ for (set_i = has_chars[i].char_set; *set_i; ++set_i) {
if (*s == *set_i) {
has_mask |= has_chars[i].mask;
match_found = 1;
@@ -313,6 +316,7 @@ buf_t *parse_bytes(const char *s, int bytes) {
((has_mask & ~(HAS_HEX_COL)) == 0) && (has_mask & HAS_COLON)) {
// This will be treated as a mac-address
uint8_t m[6] = {};
+ const char *x;
// We want to be able to write something like this (like we RFC2373
// specifies for IPv6):
@@ -334,7 +338,7 @@ buf_t *parse_bytes(const char *s, int bytes) {
//po("line: %d data_begin: %s\n", __LINE__, data_begin);
- for (const char *x = data_begin; *x; ++x) {
+ for (x = data_begin; *x; ++x) {
int colon = 0;
int val = 0;
diff --git a/src/ef.h b/src/ef.h
index 8926c25..f4c1629 100644
--- a/src/ef.h
+++ b/src/ef.h
@@ -59,8 +59,8 @@ void bl_check(buf_list_t *b);
void bl_reset(buf_list_t *b);
void bset_value(buf_t *b, uint8_t v);
-inline void bl_init(buf_list_t *b) { bl_reset(b); }
-inline void bl_destroy(buf_list_t *b) { bl_reset(b); }
+static inline void bl_init(buf_list_t *b) { bl_reset(b); }
+static inline void bl_destroy(buf_list_t *b) { bl_reset(b); }
int bl_printf_append(buf_list_t *b, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));