mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v1] add socketcand package
@ 2019-08-30  9:06 Oleksij Rempel
  2019-09-02  8:36 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksij Rempel @ 2019-08-30  9:06 UTC (permalink / raw)
  To: ptxdist; +Cc: Oleksij Rempel

Socketcand is a daemon that provides access to CAN interfaces on a
machine via a network interface. The communication protocol uses a
TCP/IP connection and a specific protocol to transfer CAN frames and
control commands.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 .../socketcand-0.4.2-27-gec47073/autogen.sh   |  1 +
 projectroot/etc/socketcand.conf               | 19 +++++++
 .../usr/lib/systemd/system/socketcand.service |  7 +++
 rules/socketcand.in                           | 12 ++++
 rules/socketcand.make                         | 56 +++++++++++++++++++
 5 files changed, 95 insertions(+)
 create mode 120000 patches/socketcand-0.4.2-27-gec47073/autogen.sh
 create mode 100644 projectroot/etc/socketcand.conf
 create mode 100644 projectroot/usr/lib/systemd/system/socketcand.service
 create mode 100644 rules/socketcand.in
 create mode 100644 rules/socketcand.make

diff --git a/patches/socketcand-0.4.2-27-gec47073/autogen.sh b/patches/socketcand-0.4.2-27-gec47073/autogen.sh
new file mode 120000
index 000000000..9f8a4cb7d
--- /dev/null
+++ b/patches/socketcand-0.4.2-27-gec47073/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/projectroot/etc/socketcand.conf b/projectroot/etc/socketcand.conf
new file mode 100644
index 000000000..0fdc19d07
--- /dev/null
+++ b/projectroot/etc/socketcand.conf
@@ -0,0 +1,19 @@
+# The network interface the socketcand will bind to
+# listen = "eth0";
+
+# The port the socketcand is listening on
+# port = 29536;
+
+# List of busses the daemon shall provide access to
+# Multiple busses must be separated with ',' and whitespace
+# is not allowed. eg "vcan0,vcan1"
+busses = "can0";
+
+# Description of the service. This will show up in the discovery beacon
+# description = "socketcand";
+
+# AF_UNIX name. As alternative to bind to a TCP/IP socket the socketcand can
+# listen on an AF_UNIX socket.
+# When afuxname starts with a '/' a path for the AF_UNIX socket is created.
+# Alternatively an abstact AF_UNIX namespace is allocated with afuxname
+# afuxname = "socketcand";
diff --git a/projectroot/usr/lib/systemd/system/socketcand.service b/projectroot/usr/lib/systemd/system/socketcand.service
new file mode 100644
index 000000000..3c1030676
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/socketcand.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Server to access CAN sockets over ASCII protocol
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/socketcand
+Restart=always
diff --git a/rules/socketcand.in b/rules/socketcand.in
new file mode 100644
index 000000000..779721208
--- /dev/null
+++ b/rules/socketcand.in
@@ -0,0 +1,12 @@
+## SECTION=communication
+
+config SOCKETCAND
+	tristate
+	prompt "socketcand"
+	select LIBCONFIG
+	help
+	  Socketcand is a daemon that provides access to CAN interfaces on a
+	  machine via a network interface. The communication protocol uses a
+	  TCP/IP connection and a specific protocol to transfer CAN frames and
+	  control commands.
+
diff --git a/rules/socketcand.make b/rules/socketcand.make
new file mode 100644
index 000000000..ecff9e05b
--- /dev/null
+++ b/rules/socketcand.make
@@ -0,0 +1,56 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2019 by Oleksij Rempel <o.rempel@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_SOCKETCAND) += socketcand
+
+#
+# Paths and names
+#
+SOCKETCAND_VERSION	:= 0.4.2-27-gec47073
+SOCKETCAND_MD5		:= 2b32adf77d359af0f3cca27050e2c32d
+SOCKETCAND		:= socketcand-$(SOCKETCAND_VERSION)
+SOCKETCAND_SUFFIX	:= tar.gz
+SOCKETCAND_URL		:= https://github.com/linux-can/socketcand/archive/$(SOCKETCAND_VERSION).$(SOCKETCAND_SUFFIX)
+SOCKETCAND_SOURCE	:= $(SRCDIR)/$(SOCKETCAND).$(SOCKETCAND_SUFFIX)
+SOCKETCAND_DIR		:= $(BUILDDIR)/$(SOCKETCAND)
+SOCKETCAND_LICENSE	:= GPL-2.0
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+SOCKETCAND_CONF_TOOL	:= autoconf
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/socketcand.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, socketcand)
+	@$(call install_fixup, socketcand,PRIORITY,optional)
+	@$(call install_fixup, socketcand,SECTION,base)
+	@$(call install_fixup, socketcand,AUTHOR,"Oleksij Rempel <o.rempel@pengutronix.de>")
+	@$(call install_fixup, socketcand,DESCRIPTION,missing)
+
+        @$(call install_link, socketcand, ../socketcand.service, \
+                /usr/lib/systemd/system/multi-user.target.wants/socketcand.service)
+	@$(call install_alternative, socketcand, 0, 0, 0644, /usr/lib/systemd/system/socketcand.service)
+	@$(call install_alternative, socketcand, 0, 0, 0644, /etc/socketcand.conf)
+	@$(call install_copy, socketcand, 0, 0, 0755, -, /usr/bin/socketcand)
+	@$(call install_copy, socketcand, 0, 0, 0755, -, /usr/bin/socketcandcl)
+
+	@$(call install_finish, socketcand)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.23.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH v1] add socketcand package
  2019-08-30  9:06 [ptxdist] [PATCH v1] add socketcand package Oleksij Rempel
@ 2019-09-02  8:36 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2019-09-02  8:36 UTC (permalink / raw)
  To: ptxdist

On Fri, Aug 30, 2019 at 11:06:32AM +0200, Oleksij Rempel wrote:
> Socketcand is a daemon that provides access to CAN interfaces on a
> machine via a network interface. The communication protocol uses a
> TCP/IP connection and a specific protocol to transfer CAN frames and
> control commands.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  .../socketcand-0.4.2-27-gec47073/autogen.sh   |  1 +
>  projectroot/etc/socketcand.conf               | 19 +++++++
>  .../usr/lib/systemd/system/socketcand.service |  7 +++
>  rules/socketcand.in                           | 12 ++++
>  rules/socketcand.make                         | 56 +++++++++++++++++++
>  5 files changed, 95 insertions(+)
>  create mode 120000 patches/socketcand-0.4.2-27-gec47073/autogen.sh
>  create mode 100644 projectroot/etc/socketcand.conf
>  create mode 100644 projectroot/usr/lib/systemd/system/socketcand.service
>  create mode 100644 rules/socketcand.in
>  create mode 100644 rules/socketcand.make
> 
> diff --git a/patches/socketcand-0.4.2-27-gec47073/autogen.sh b/patches/socketcand-0.4.2-27-gec47073/autogen.sh
> new file mode 120000
> index 000000000..9f8a4cb7d
> --- /dev/null
> +++ b/patches/socketcand-0.4.2-27-gec47073/autogen.sh
> @@ -0,0 +1 @@
> +../autogen.sh
> \ No newline at end of file
> diff --git a/projectroot/etc/socketcand.conf b/projectroot/etc/socketcand.conf
> new file mode 100644
> index 000000000..0fdc19d07
> --- /dev/null
> +++ b/projectroot/etc/socketcand.conf
> @@ -0,0 +1,19 @@
> +# The network interface the socketcand will bind to
> +# listen = "eth0";
> +
> +# The port the socketcand is listening on
> +# port = 29536;
> +
> +# List of busses the daemon shall provide access to
> +# Multiple busses must be separated with ',' and whitespace
> +# is not allowed. eg "vcan0,vcan1"
> +busses = "can0";
> +
> +# Description of the service. This will show up in the discovery beacon
> +# description = "socketcand";
> +
> +# AF_UNIX name. As alternative to bind to a TCP/IP socket the socketcand can
> +# listen on an AF_UNIX socket.
> +# When afuxname starts with a '/' a path for the AF_UNIX socket is created.
> +# Alternatively an abstact AF_UNIX namespace is allocated with afuxname
> +# afuxname = "socketcand";
> diff --git a/projectroot/usr/lib/systemd/system/socketcand.service b/projectroot/usr/lib/systemd/system/socketcand.service
> new file mode 100644
> index 000000000..3c1030676
> --- /dev/null
> +++ b/projectroot/usr/lib/systemd/system/socketcand.service
> @@ -0,0 +1,7 @@
> +[Unit]
> +Description=Server to access CAN sockets over ASCII protocol
> +After=network.target
> +
> +[Service]
> +ExecStart=/usr/bin/socketcand
> +Restart=always
> diff --git a/rules/socketcand.in b/rules/socketcand.in
> new file mode 100644
> index 000000000..779721208
> --- /dev/null
> +++ b/rules/socketcand.in
> @@ -0,0 +1,12 @@
> +## SECTION=communication
> +
> +config SOCKETCAND
> +	tristate
> +	prompt "socketcand"
> +	select LIBCONFIG
> +	help
> +	  Socketcand is a daemon that provides access to CAN interfaces on a
> +	  machine via a network interface. The communication protocol uses a
> +	  TCP/IP connection and a specific protocol to transfer CAN frames and
> +	  control commands.
> +
> diff --git a/rules/socketcand.make b/rules/socketcand.make
> new file mode 100644
> index 000000000..ecff9e05b
> --- /dev/null
> +++ b/rules/socketcand.make
> @@ -0,0 +1,56 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2019 by Oleksij Rempel <o.rempel@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_SOCKETCAND) += socketcand
> +
> +#
> +# Paths and names
> +#
> +SOCKETCAND_VERSION	:= 0.4.2-27-gec47073
> +SOCKETCAND_MD5		:= 2b32adf77d359af0f3cca27050e2c32d
> +SOCKETCAND		:= socketcand-$(SOCKETCAND_VERSION)
> +SOCKETCAND_SUFFIX	:= tar.gz
> +SOCKETCAND_URL		:= https://github.com/linux-can/socketcand/archive/$(SOCKETCAND_VERSION).$(SOCKETCAND_SUFFIX)
> +SOCKETCAND_SOURCE	:= $(SRCDIR)/$(SOCKETCAND).$(SOCKETCAND_SUFFIX)
> +SOCKETCAND_DIR		:= $(BUILDDIR)/$(SOCKETCAND)
> +SOCKETCAND_LICENSE	:= GPL-2.0
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +SOCKETCAND_CONF_TOOL	:= autoconf
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/socketcand.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, socketcand)
> +	@$(call install_fixup, socketcand,PRIORITY,optional)
> +	@$(call install_fixup, socketcand,SECTION,base)
> +	@$(call install_fixup, socketcand,AUTHOR,"Oleksij Rempel <o.rempel@pengutronix.de>")
> +	@$(call install_fixup, socketcand,DESCRIPTION,missing)
> +
> +        @$(call install_link, socketcand, ../socketcand.service, \
> +                /usr/lib/systemd/system/multi-user.target.wants/socketcand.service)

Indent with tabs.

> +	@$(call install_alternative, socketcand, 0, 0, 0644, /usr/lib/systemd/system/socketcand.service)

There should be a SOCKETCAND_SYSTEMD_UNIT option for this.

Michael

> +	@$(call install_alternative, socketcand, 0, 0, 0644, /etc/socketcand.conf)
> +	@$(call install_copy, socketcand, 0, 0, 0755, -, /usr/bin/socketcand)
> +	@$(call install_copy, socketcand, 0, 0, 0755, -, /usr/bin/socketcandcl)
> +
> +	@$(call install_finish, socketcand)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.23.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-02  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-30  9:06 [ptxdist] [PATCH v1] add socketcand package Oleksij Rempel
2019-09-02  8:36 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox