mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH v1] add socketcand package
Date: Mon, 2 Sep 2019 10:36:19 +0200	[thread overview]
Message-ID: <20190902083619.GB13226@pengutronix.de> (raw)
In-Reply-To: <20190830090632.7636-1-o.rempel@pengutronix.de>

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

      reply	other threads:[~2019-09-02  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30  9:06 Oleksij Rempel
2019-09-02  8:36 ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902083619.GB13226@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox