Skip to contentSkip to conversation

package/brickd: new package

PATCH New David Lechner 2 participants 4 messages Feb 23, 2019 – Mar 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/brickd: new package

This adds a new package for brickd. Brickd is system management daemon for the LEGO MINDSTORMS EV3 programmable brick.

---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/brickd/Config.in   | 17 +++++++++++++++++
 package/brickd/S70brickd   | 37 +++++++++++++++++++++++++++++++++++++
 package/brickd/brickd.hash |  5 +++++
 package/brickd/brickd.mk   | 22 ++++++++++++++++++++++
 6 files changed, 83 insertions(+)
 create mode 100644 package/brickd/Config.in
 create mode 100644 package/brickd/S70brickd
 create mode 100644 package/brickd/brickd.hash
 create mode 100644 package/brickd/brickd.mk
DEVELOPERS +1 -0
index 7dd996decc..5c7dbb060e 100644
@@ -602,6 +602,7 @@ N:	David Lechner <[email protected]>
 F:	board/lego/ev3/
 F:	configs/lego_ev3_defconfig
 F:	linux/linux-ext-ev3dev-linux-drivers.mk
+F:	package/brickd/
 F:	package/ev3dev-linux-drivers/
 
 N:	Davide Viti <[email protected]>
package/Config.in +1 -0
index cc232b9fba..8961ed3500 100644
@@ -398,6 +398,7 @@ endmenu
 	source "package/avrdude/Config.in"
 	source "package/bcache-tools/Config.in"
 	source "package/biosdevname/Config.in"
+	source "package/brickd/Config.in"
 	source "package/brltty/Config.in"
 	source "package/cbootimage/Config.in"
 	source "package/cc-tool/Config.in"
package/brickd/Config.in new file +17 -0
new file mode 100644
index 0000000000..bd62e15122
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_BRICKD
+	bool "brickd"
+	depends on BR2_PACKAGE_HAS_UDEV # gudev
+	depends on BR2_TOOLCHAIN_HAS_THREADS # glib2
+	depends on BR2_USE_WCHAR # glib2
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBGUDEV
+	help
+	  Brick daemon for LEGO MINDSTORMS EV3 (and other LEGO-
+	  compatible devices). This performs tasks like battery
+	  management and controls device-specific hardware.
+
+	  https://github.com/ev3dev/brickd
+
+comment "brickd needs udev /dev management, a toolchain w/ threads, wchar"
+	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_USE_WCHAR
package/brickd/S70brickd new file +37 -0
new file mode 100644
index 0000000000..063ad875ad
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+NAME=brickd
+PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/sbin/$NAME
+
+start() {
+	printf "Starting $NAME: "
+	start-stop-daemon -S -q -m -b -p $PIDFILE --exec $DAEMON
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+stop() {
+	printf "Stopping $NAME: "
+	start-stop-daemon -K -q -p $PIDFILE
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+esac
+
+exit $?
package/brickd/brickd.hash new file +5 -0
new file mode 100644
index 0000000000..8de57a9b82
@@ -0,0 +1,5 @@
+# Locally computed hash
+sha256 0b79f1ccd6fa644d7ecb2e17b19f9ffbf6374702ae9ac536b2c4a0b8b2cfe160 brickd-ev3dev-stretch_1.2.1.tar.gz
+
+# Hashes for license files:
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE.txt
package/brickd/brickd.mk new file +22 -0
new file mode 100644
index 0000000000..7fe28daf78
@@ -0,0 +1,22 @@
+################################################################################
+#
+# brickd
+#
+################################################################################
+
+BRICKD_VERSION = ev3dev-stretch/1.2.1
+BRICKD_SITE = https://github.com/ev3dev/brickd
+BRICKD_SITE_METHOD = git
+BRICKD_GIT_SUBMODULES = YES
+
+BRICKD_LICENSE = GPL-2.0
+BRICKD_LICENSE_FILES = LICENSE.txt
+
+BRICKD_INSTALL_STAGING = YES
+BRICKD_DEPENDENCIES = host-pkgconf host-vala libglib2 libgudev
+
+define BRICKD_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/brickd/S70brickd $(TARGET_DIR)/etc/init.d/S70brickd
+endef
+
+$(eval $(cmake-package))
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 configs/lego_ev3_defconfig: enable brickd by default

This enables the brickd package by default on LEGO MINDSTORM EV3. This program is important because it shuts down the system on low battery. Without this, rechargeable batteries could be damaged.

---
 configs/lego_ev3_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/lego_ev3_defconfig +2 -0
index cf2809059e..b4a1000036 100644
@@ -8,6 +8,7 @@ BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 # system
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS1"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/lego/ev3/post-image.sh"
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
@@ -27,6 +28,7 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="da850-lego-ev3"
 BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/lego/ev3/busybox.fragment"
 BR2_PACKAGE_BLUEZ5_UTILS=y
 BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
+BR2_PACKAGE_BRICKD=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_TI_CC2560=y
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 configs/lego_ev3_defconfig: enable brickd by default

Quoted 8 lines · On Fri, 22 Feb 2019 19:04:54 -0600 David Lechner <[email protected]> wrote:

This enables the brickd package by default on LEGO MINDSTORM EV3. This program is important because it shuts down the system on low battery. Without this, rechargeable batteries could be damaged.

---
 configs/lego_ev3_defconfig | 2 ++
 1 file changed, 2 insertions(+)

Applied to master, thanks.

Thomas

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

PATCH 1/2 package/brickd: new package

In reply to David Lechner
Quoted 4 lines · On Fri, 22 Feb 2019 19:04:53 -0600 David Lechner <[email protected]> wrote:

This adds a new package for brickd. Brickd is system management daemon for the LEGO MINDSTORMS EV3 programmable brick.

I've applied, after fixing one dependency issue, see below.

package/brickd/Config.in line 7

Quoted 13 lines
package/brickd/Config.in new file +7 -0
new file mode 100644
index 0000000000..bd62e15122
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_BRICKD
+	bool "brickd"
+	depends on BR2_PACKAGE_HAS_UDEV # gudev
+	depends on BR2_TOOLCHAIN_HAS_THREADS # glib2
+	depends on BR2_USE_WCHAR # glib2
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBGUDEV

Both libglib2 and libgudev have a depends on BR2_USE_MMU, so it should have been replicated here.

package/brickd/Config.in line 17

Quoted 10 lines
package/brickd/Config.in new file +10 -0
+	help
+	  Brick daemon for LEGO MINDSTORMS EV3 (and other LEGO-
+	  compatible devices). This performs tasks like battery
+	  management and controls device-specific hardware.
+
+	  https://github.com/ev3dev/brickd
+
+comment "brickd needs udev /dev management, a toolchain w/ threads, wchar"
+	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_USE_WCHAR

And here.

I said, I fixed that up when applying.

Thanks!

Thomas

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