Files
operating-system/buildroot/package/python-rpi-gpio/0001-fix-build-with-gcc-10.x.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

148 lines
5.3 KiB
Diff

Description: This patch fixes the "multiple definition of" errors with gcc10
Signed-off-by: Michael Fischer <mf@go-sys.de>
diff -purN python-rpi-gpio.org/source/common.c python-rpi-gpio/source/common.c
--- python-rpi-gpio.org/source/common.c 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/common.c 2020-08-07 09:31:33.948575964 +0200
@@ -28,6 +28,9 @@
const int pin_to_gpio_rev1[41] = {-1, -1, -1, 0, -1, 1, -1, 4, 14, -1, 15, 17, 18, 21, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
const int pin_to_gpio_rev2[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
const int pin_to_gpio_rev3[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, 5, -1, 6, 12, 13, -1, 19, 16, 26, 20, -1, 21 };
+const int (*pin_to_gpio)[41];
+int gpio_direction[54];
+rpi_info rpiinfo;
int setup_error = 0;
int module_setup = 0;
diff -purN python-rpi-gpio.org/source/common.h python-rpi-gpio/source/common.h
--- python-rpi-gpio.org/source/common.h 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/common.h 2020-08-07 09:31:33.948575964 +0200
@@ -30,14 +30,14 @@ SOFTWARE.
#define I2C 42
#define PWM 43
-int gpio_mode;
-const int pin_to_gpio_rev1[41];
-const int pin_to_gpio_rev2[41];
-const int pin_to_gpio_rev3[41];
-const int (*pin_to_gpio)[41];
-int gpio_direction[54];
-rpi_info rpiinfo;
-int setup_error;
-int module_setup;
+extern int gpio_mode;
+extern const int pin_to_gpio_rev1[41];
+extern const int pin_to_gpio_rev2[41];
+extern const int pin_to_gpio_rev3[41];
+extern const int (*pin_to_gpio)[41];
+extern int gpio_direction[54];
+extern rpi_info rpiinfo;
+extern int setup_error;
+extern int module_setup;
int check_gpio_priv(void);
int get_gpio_number(int channel, unsigned int *gpio);
diff -purN python-rpi-gpio.org/source/constants.c python-rpi-gpio/source/constants.c
--- python-rpi-gpio.org/source/constants.c 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/constants.c 2020-08-07 09:32:15.522196618 +0200
@@ -21,6 +21,7 @@
*/
#include "Python.h"
+#define CONSTANTS_C
#include "constants.h"
#include "common.h"
#include "c_gpio.h"
diff -purN python-rpi-gpio.org/source/constants.h python-rpi-gpio/source/constants.h
--- python-rpi-gpio.org/source/constants.h 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/constants.h 2020-08-07 09:32:15.522196618 +0200
@@ -23,22 +23,28 @@ SOFTWARE.
#define PY_PUD_CONST_OFFSET 20
#define PY_EVENT_CONST_OFFSET 30
-PyObject *high;
-PyObject *low;
-PyObject *input;
-PyObject *output;
-PyObject *pwm;
-PyObject *serial;
-PyObject *i2c;
-PyObject *spi;
-PyObject *unknown;
-PyObject *board;
-PyObject *bcm;
-PyObject *pud_off;
-PyObject *pud_up;
-PyObject *pud_down;
-PyObject *rising_edge;
-PyObject *falling_edge;
-PyObject *both_edge;
+#ifdef CONSTANTS_C
+#define MAYBE_EXTERN
+#else
+#define MAYBE_EXTERN extern
+#endif
+
+MAYBE_EXTERN PyObject *high;
+MAYBE_EXTERN PyObject *low;
+MAYBE_EXTERN PyObject *input;
+MAYBE_EXTERN PyObject *output;
+MAYBE_EXTERN PyObject *pwm;
+MAYBE_EXTERN PyObject *serial;
+MAYBE_EXTERN PyObject *i2c;
+MAYBE_EXTERN PyObject *spi;
+MAYBE_EXTERN PyObject *unknown;
+MAYBE_EXTERN PyObject *board;
+MAYBE_EXTERN PyObject *bcm;
+MAYBE_EXTERN PyObject *pud_off;
+MAYBE_EXTERN PyObject *pud_up;
+MAYBE_EXTERN PyObject *pud_down;
+MAYBE_EXTERN PyObject *rising_edge;
+MAYBE_EXTERN PyObject *falling_edge;
+MAYBE_EXTERN PyObject *both_edge;
void define_constants(PyObject *module);
diff -purN python-rpi-gpio.org/source/event_gpio.c python-rpi-gpio/source/event_gpio.c
--- python-rpi-gpio.org/source/event_gpio.c 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/event_gpio.c 2020-08-07 09:42:05.564483136 +0200
@@ -57,7 +57,7 @@ struct callback
};
struct callback *callbacks = NULL;
-pthread_t threads;
+static pthread_t threads;
int event_occurred[54] = { 0 };
int thread_running = 0;
int epfd_thread = -1;
diff -purN python-rpi-gpio.org/source/py_pwm.h python-rpi-gpio/source/py_pwm.h
--- python-rpi-gpio.org/source/py_pwm.h 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/py_pwm.h 2020-08-07 09:38:49.445646807 +0200
@@ -20,5 +20,5 @@ OUT OF OR IN CONNECTION WITH THE SOFTWAR
SOFTWARE.
*/
-PyTypeObject PWMType;
+extern PyTypeObject PWMType;
PyTypeObject *PWM_init_PWMType(void);
diff -purN python-rpi-gpio.org/source/soft_pwm.c python-rpi-gpio/source/soft_pwm.c
--- python-rpi-gpio.org/source/soft_pwm.c 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/soft_pwm.c 2020-08-07 09:42:40.753160437 +0200
@@ -25,7 +25,7 @@ SOFTWARE.
#include <time.h>
#include "c_gpio.h"
#include "soft_pwm.h"
-pthread_t threads;
+static pthread_t threads;
struct pwm
{
diff -purN python-rpi-gpio.org/source/soft_pwm.h python-rpi-gpio/source/soft_pwm.h
--- python-rpi-gpio.org/source/soft_pwm.h 2019-07-21 14:41:22.000000000 +0200
+++ python-rpi-gpio/source/soft_pwm.h 2020-08-07 09:39:25.916811352 +0200
@@ -26,4 +26,4 @@ void pwm_set_duty_cycle(unsigned int gpi
void pwm_set_frequency(unsigned int gpio, float freq);
void pwm_start(unsigned int gpio);
void pwm_stop(unsigned int gpio);
-int pwm_exists(unsigned int gpio);
+extern int pwm_exists(unsigned int gpio);