Skip to contentSkip to conversation

package/bcm2835: bump version to 1.65

PATCH New Peter Seiderer 2 participants 2 messages Jun 2, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/bcm2835: bump version to 1.65

- disable doxygen documentation gneration using ac_cv_prog_DOXYGEN
- add optional libcap dependency and enable BCM2835_HAVE_LIBCAP feature

Changes since 1.63:
- 1.64 2020-04-11 Fixed error in definitions of BCM2835_AUX_SPI_STAT_TX_LVL and BCM2835_AUX_SPI_STAT_RX_LVL
- 1.65, 1.66 2020-04-16 Added support for use of capability cap_sys_rawio to determine if access to /dev/mem is available for non-root users

---
 package/bcm2835/bcm2835.hash |  2 +-
 package/bcm2835/bcm2835.mk   | 10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
package/bcm2835/bcm2835.hash +1 -1
index c722a97456..8317e10256 100644
@@ -1,3 +1,3 @@
 # Locally computed:
-sha256  aec4b33ed9ecda4a1c4c12b8ed2abdd13cf87f352f0d27a24be726d11f1fbf54  bcm2835-1.63.tar.gz
+sha256  62955cc8506cc6506d729da3138442beb9763f1ffd536e925aeb0dc223492874  bcm2835-1.65.tar.gz
 sha256  8b1ba204bb69a0ade2bfcf65ef294a920f6bb361b317dba43c7ef29d96332b9b  COPYING
package/bcm2835/bcm2835.mk +9 -1
index d43dd7e574..c3c684f6e4 100644
@@ -4,10 +4,18 @@
 #
 ################################################################################
 
-BCM2835_VERSION = 1.63
+BCM2835_VERSION = 1.65
 BCM2835_SITE = http://www.airspayce.com/mikem/bcm2835
 BCM2835_LICENSE = GPL-3.0
 BCM2835_LICENSE_FILES = COPYING
 BCM2835_INSTALL_STAGING = YES
 
+# disable doxygen doc generation
+BCM2835_CONF_ENV = ac_cv_prog_DOXYGEN=/bin/true
+
+ifeq ($(BR2_PACKAGE_LIBCAP),y)
+BCM2835_DEPENDENCIES = libcap
+BCM2835_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DBCM2835_HAVE_LIBCAP"
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 package/bcm2835: bump version to 1.65

Hello Peter,

Quoted 1 line · On Tue, 2 Jun 2020 22:49:41 +0200 Peter Seiderer <[email protected]> wrote:

- disable doxygen documentation gneration using ac_cv_prog_DOXYGEN

Is this related to the version bump? Or would the existing 1.63 version be potentially affected by a doxygen build issue? If that's the case, we want a separate patch which fixes this, so that we can backport.

package/bcm2835/bcm2835.mk line 18

Quoted 3 lines
package/bcm2835/bcm2835.mk +3 -0
+ifeq ($(BR2_PACKAGE_LIBCAP),y)
+BCM2835_DEPENDENCIES = libcap
+BCM2835_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DBCM2835_HAVE_LIBCAP"

So, this again illustrates how wonderful the RPi ecosystem is.

(1) They don't use configure.ac to check for libcap, even though they already have all the autotools machinery in place to do that.

(2) They ask to define BCM2835_HAVE_LIBCAP manually, but then look at the code:

#ifdef BCM2835_HAVE_LIBCAP
#include <sys/capability.h>
static int bcm2835_has_capability(cap_value_t capability)

{
    int ok = 0;
    cap_t cap = cap_get_proc();
    if (cap)
    {
        cap_flag_value_t value;
        if (cap_get_flag(cap,capability,CAP_EFFECTIVE,&value) == 0 && value == CAP_SET)
            ok = 1;
       cap_free(cap);
    }
    return ok;
}

#endif

So far, so good: if BCM2835_HAVE_LIBCAP is defined, a new function bcm2835_has_capability() is implemented.

Then, let's continue to the only place where this function is used:

#ifdef BCM2835_HAVE_LIBCAP2
        || bcm2835_has_capability(CAP_SYS_RAWIO)

#endif

It is under a different BCM2835_HAVE_LIBCAP2 define. I don't even see how this can work. Has someone really tested this?

I'm sorry, but this new libcap dependency feels like a joke :-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com