Files
operating-system/buildroot/package/socketcand/0001-Fix-GCC10-build-failure.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

114 lines
2.7 KiB
Diff

From ae0af080058a576d62c72ffc011d644d0b4dcb98 Mon Sep 17 00:00:00 2001
From: Yegor Yefremov <yegorslists@googlemail.com>
Date: Tue, 7 Jul 2020 19:39:41 +0200
Subject: [PATCH] Fix GCC10 build failure (#17)
GCC10 breaks on multiple definitions:
ld: /tmp/ccFiGYO7.o:(.bss+0x114): multiple definition of `tv'; /tmp/cc7f6J5h.o:(.bss+0x80): first defined here
Change the scope of the related variables.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
[Retrieved from:
https://github.com/linux-can/socketcand/commit/ae0af080058a576d62c72ffc011d644d0b4dcb98]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
socketcand.c | 3 ++-
state_bcm.c | 4 ++--
state_isotp.c | 2 +-
state_raw.c | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/socketcand.c b/socketcand.c
index 8d84754..6125be9 100644
--- a/socketcand.c
+++ b/socketcand.c
@@ -102,7 +102,6 @@ socklen_t unaddrlen;
struct sockaddr_un remote_unaddr;
socklen_t remote_unaddrlen;
char* interface_string;
-struct ifreq ifr, ifr_brd;
int state_changed(char *buf, int current_state)
{
@@ -666,6 +665,8 @@ int receive_command(int socket, char *buffer) {
}
void determine_adress() {
+ struct ifreq ifr, ifr_brd;
+
int probe_socket = socket(AF_INET, SOCK_DGRAM, 0);
if(probe_socket < 0) {
diff --git a/state_bcm.c b/state_bcm.c
index cfaa8ed..05a5f7c 100644
--- a/state_bcm.c
+++ b/state_bcm.c
@@ -28,8 +28,6 @@
#define RXLEN 128
int sc = -1;
-fd_set readfds;
-struct timeval tv;
void state_bcm() {
int i, j, ret;
@@ -38,6 +36,7 @@ void state_bcm() {
struct ifreq ifr;
char rxmsg[RXLEN];
char buf[MAXLEN];
+ fd_set readfds;
struct {
struct bcm_msg_head msg_head;
@@ -91,6 +90,7 @@ void state_bcm() {
}
if (FD_ISSET(sc, &readfds)) {
+ struct timeval tv;
ret = recvfrom(sc, &msg, sizeof(msg), 0,
(struct sockaddr*)&caddr, &caddrlen);
diff --git a/state_isotp.c b/state_isotp.c
index 5c671f9..e1b944b 100644
--- a/state_isotp.c
+++ b/state_isotp.c
@@ -25,7 +25,6 @@
#include <linux/sockios.h>
int si = -1;
-fd_set readfds;
void state_isotp() {
int i, items, ret;
@@ -39,6 +38,7 @@ void state_isotp() {
char buf[MAXLEN]; /* inet commands to can */
unsigned char isobuf[ISOTPLEN+1]; /* binary buffer for isotp socket */
unsigned char tmp;
+ fd_set readfds;
while(previous_state != STATE_ISOTP) {
diff --git a/state_raw.c b/state_raw.c
index e83e6ec..2c49975 100644
--- a/state_raw.c
+++ b/state_raw.c
@@ -25,7 +25,6 @@
int raw_socket;
struct ifreq ifr;
struct sockaddr_can addr;
-fd_set readfds;
struct msghdr msg;
struct can_frame frame;
struct iovec iov;
@@ -36,6 +35,7 @@ struct cmsghdr *cmsg;
void state_raw() {
char buf[MAXLEN];
int i, ret, items;
+ fd_set readfds;
if(previous_state != STATE_RAW) {