[ptxdist] [PATCH] templates: meson: wizard.sh: use neat parameter expansion and prevent word splitting
Signed-off-by: Ulrich Ölmann --- rules/templates/src-meson-prog/wizard.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/templates/src-meson-prog/wizard.sh b/rules/templates/src-meson-prog/wizard.sh index 3753d8d0e67d..d98a72585594 100644 --- a/rules/templates/src-meson-prog/wizard.sh +++ b/rules/templates/src-meson-prog/wizard.sh @@ -1,13 +1,13 @@ #!/bin/bash NAME="${1}" -if [ -z "$NAME" ]; then +if [ -z "${NAME}" ]; then echo -n "project name: " read NAME fi VERSION="${3}" -if [ -z "$VERSION" ]; then +if [ -z "${VERSION}" ]; then echo -n "project version: " read VERSION fi @@ -16,7 +16,7 @@ mv "@name@.c" "${NAME}.c" for i in \ meson.build \ - ${NAME}.c \ + "${NAME}.c" \ ; do sed -i -e "s/\@name\@/${NAME}/g" \ -e "s/\@version\@/${VERSION}/g" $i -- 2.20.1 ___ ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH] inetd services: don't use busybox's find in postinst
Hello Roland, On Mon, Jun 17, 2019 at 04:06:46PM +0200, Roland Hieber wrote: > busybox's find doesn't understand '-empty', so when running these > postinst scripts on a system without GNU coreutils, they will display a > nice help text instead. In deed. > diff --git a/rules/busybox.postinst b/rules/busybox.postinst > index 6f564791d0c8..aa56d329fd72 100644 > --- a/rules/busybox.postinst > +++ b/rules/busybox.postinst > @@ -1,8 +1,7 @@ > #!/bin/sh > > # generate inetd.conf > -if [ -d $DESTDIR/etc/inetd.conf.d ] && > - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then > +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" > ]; then > cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf > fi The use of backticks is discouraged by shellcheck: https://github.com/koalaman/shellcheck/wiki/SC2006 Grüße Alex -- /"\ ASCII RIBBON | »With the first link, the chain is forged. The first \ / CAMPAIGN | speech censured, the first thought forbidden, the X AGAINST | first freedom denied, chains us all irrevocably.« / \ HTML MAIL| (Jean-Luc Picard, quoting Judge Aaron Satie) signature.asc Description: PGP signature ___ ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH v2] host-openocd: add initial support
On Mon, Jun 17, 2019 at 03:23:12PM +0200, Michael Grzeschik wrote: > Signed-off-by: Michael Grzeschik > --- > v1 -> v2: - fixed indentation > - removed buildflags > > patches/openocd-af952850/autogen.sh | 3 + > rules/host-openocd.in | 12 > rules/host-openocd.make | 87 + > 3 files changed, 102 insertions(+) > create mode 100755 patches/openocd-af952850/autogen.sh > create mode 100644 rules/host-openocd.in > create mode 100644 rules/host-openocd.make > > diff --git a/patches/openocd-af952850/autogen.sh > b/patches/openocd-af952850/autogen.sh > new file mode 100755 > index 0..7d344d32f > --- /dev/null > +++ b/patches/openocd-af952850/autogen.sh > @@ -0,0 +1,3 @@ > +#!/bin/bash > + > +exec ./bootstrap > diff --git a/rules/host-openocd.in b/rules/host-openocd.in > new file mode 100644 > index 0..8c863598e > --- /dev/null > +++ b/rules/host-openocd.in > @@ -0,0 +1,12 @@ > +## SECTION=hosttools > + > +menuconfig HOST_OPENOCD > + tristate > + prompt "openocd" > + select HOST_LIBUSB > + select HOST_JIMTCL > + select HOST_LIBFTDI1 > + help > + The "Open On-Chip Debugger" provides JTAG/SWD access from GDB > + (or directly with TCL scripts) to processors with ARM and MIPS > + based cores. > diff --git a/rules/host-openocd.make b/rules/host-openocd.make > new file mode 100644 > index 0..10ac4d12b > --- /dev/null > +++ b/rules/host-openocd.make > @@ -0,0 +1,87 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2013 by Michael Grzeschik > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +HOST_PACKAGES-$(PTXCONF_HOST_OPENOCD) += host-openocd > + > +# > +# Paths and names > +# > +HOST_OPENOCD_VERSION := af952850 > +HOST_OPENOCD_MD5 := fa6841d4e4e76d1626406a99d5b1851d > +HOST_OPENOCD := openocd-$(HOST_OPENOCD_VERSION) > +HOST_OPENOCD_SUFFIX := tar.bz2 > +HOST_OPENOCD_URL := > git://git.code.sf.net/p/openocd/code;tag=$(HOST_OPENOCD_VERSION) When trying to build this package, SF.net seems horribly slow to me. Care to use repo.or.cz instead? It is about 4 times faster, and openocd recommends it as a mirror in their README. Also it would be nice to have a more descriptive version, so I suggest: HOST_OPENOCD_VERSION := 0.10.0-870-gaf952850b549 HOST_OPENOCD_URL := git://repo.or.cz/openocd;tag=v$(HOST_OPENOCD_VERSION) and to move the patches to the appropriate location too. - Roland > +HOST_OPENOCD_SOURCE := $(SRCDIR)/$(HOST_OPENOCD).$(HOST_OPENOCD_SUFFIX) > +HOST_OPENOCD_DIR := $(HOST_BUILDDIR)/$(HOST_OPENOCD) > + > +# > > +# Prepare > +# > > + > +# > +# autoconf > +# > +HOST_OPENOCD_CONF_TOOL := autoconf > +HOST_OPENOCD_CONF_ENV:= \ > + CCACHE=none > +HOST_OPENOCD_CONF_OPT:= \ > + $(HOST_AUTOCONF) \ > + --enable-shared \ > + --disable-static \ > + --disable-werror \ > + --disable-internal-jimtcl \ > + --disable-internal-libjaylink \ > + --enable-dummy \ > + --enable-ftdi \ > + --enable-stlink \ > + --disable-ti-icdi \ > + --disable-ulink \ > + --disable-usb-blaster-2 \ > + --disable-ft232r \ > + --disable-vsllink \ > + --disable-xds110 \ > + --disable-osbdm \ > + --disable-opendous \ > + --disable-aice \ > + --disable-usbprog \ > + --disable-rlink \ > + --disable-armjtagew \ > + --disable-cmsis-dap \ > + --disable-kitprog \ > + --disable-usb_blaster \ > + --disable-presto\ > + --disable-openjtag \ > + --disable-jlink \ > + --disable-parport \ > + --disable-parport-ppdev \ > + --disable-parport-giveio \ > + --disable-jtag_vpi \ > + --disable-amtjtagaccel \ > + --disable-zy1000 \ > + --disable-zy1000-master \ > + --disable-ioutil \ > + --disable-ep93xx \ > + --disable-at91rm9200 \ > + --disable-bcm2835gpio \ > + --disable-imx_gpio \ > + --disable-gw16012 \ > + --disable-oocd_trace \ > + --disable-buspirate \ > + --disable-sysfsgpio \ > + --disable-minidriver-dummy \ > + --disable-target-64 \ > + --disable-remote-bitbang \ > + --disable-doxygen-pdf \ > + --disable-doxygen-html > + > +# vim: syntax=make > -- > 2.20.1 > > > ___ > ptxdist mailing list > ptxdist@pengutronix.de -- Roland Hieber | r.hie...@pengutronix.de | Pengutronix e.K. | https://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- |
[ptxdist] [PATCH] inetd services: don't use busybox's find in postinst
busybox's find doesn't understand '-empty', so when running these postinst scripts on a system without GNU coreutils, they will display a nice help text instead. Replace the find call with a test that tries to expand the same pattern that is used afterwards, so cat doesn't run with a non-matching pattern. Signed-off-by: Roland Hieber --- rules/busybox.postinst | 3 +-- rules/dnsmasq.postinst | 3 +-- rules/inetutils.postinst | 3 +-- rules/portmap.postinst | 3 +-- rules/pureftpd.postinst | 3 +-- rules/rsync.postinst | 3 +-- rules/urshd.postinst | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/rules/busybox.postinst b/rules/busybox.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/busybox.postinst +++ b/rules/busybox.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi diff --git a/rules/dnsmasq.postinst b/rules/dnsmasq.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/dnsmasq.postinst +++ b/rules/dnsmasq.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi diff --git a/rules/inetutils.postinst b/rules/inetutils.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/inetutils.postinst +++ b/rules/inetutils.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi diff --git a/rules/portmap.postinst b/rules/portmap.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/portmap.postinst +++ b/rules/portmap.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi diff --git a/rules/pureftpd.postinst b/rules/pureftpd.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/pureftpd.postinst +++ b/rules/pureftpd.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi diff --git a/rules/rsync.postinst b/rules/rsync.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/rsync.postinst +++ b/rules/rsync.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi diff --git a/rules/urshd.postinst b/rules/urshd.postinst index 6f564791d0c8..aa56d329fd72 100644 --- a/rules/urshd.postinst +++ b/rules/urshd.postinst @@ -1,8 +1,7 @@ #!/bin/sh # generate inetd.conf -if [ -d $DESTDIR/etc/inetd.conf.d ] && - [ -z "`find $DESTDIR/etc/inetd.conf.d -type d -empty`" ]; then +if [ "`echo $DESTDIR/etc/inetd.conf.d/*`" != "$DESTDIR/etc/inetd.conf.d/*" ]; then cat $DESTDIR/etc/inetd.conf.d/* > $DESTDIR/etc/inetd.conf fi -- 2.20.1 ___ ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] [PATCH v2] host-openocd: add initial support
Signed-off-by: Michael Grzeschik --- v1 -> v2: - fixed indentation - removed buildflags patches/openocd-af952850/autogen.sh | 3 + rules/host-openocd.in | 12 rules/host-openocd.make | 87 + 3 files changed, 102 insertions(+) create mode 100755 patches/openocd-af952850/autogen.sh create mode 100644 rules/host-openocd.in create mode 100644 rules/host-openocd.make diff --git a/patches/openocd-af952850/autogen.sh b/patches/openocd-af952850/autogen.sh new file mode 100755 index 0..7d344d32f --- /dev/null +++ b/patches/openocd-af952850/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec ./bootstrap diff --git a/rules/host-openocd.in b/rules/host-openocd.in new file mode 100644 index 0..8c863598e --- /dev/null +++ b/rules/host-openocd.in @@ -0,0 +1,12 @@ +## SECTION=hosttools + +menuconfig HOST_OPENOCD + tristate + prompt "openocd" + select HOST_LIBUSB + select HOST_JIMTCL + select HOST_LIBFTDI1 + help + The "Open On-Chip Debugger" provides JTAG/SWD access from GDB + (or directly with TCL scripts) to processors with ARM and MIPS + based cores. diff --git a/rules/host-openocd.make b/rules/host-openocd.make new file mode 100644 index 0..10ac4d12b --- /dev/null +++ b/rules/host-openocd.make @@ -0,0 +1,87 @@ +# -*-makefile-*- +# +# Copyright (C) 2013 by Michael Grzeschik +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +HOST_PACKAGES-$(PTXCONF_HOST_OPENOCD) += host-openocd + +# +# Paths and names +# +HOST_OPENOCD_VERSION := af952850 +HOST_OPENOCD_MD5 := fa6841d4e4e76d1626406a99d5b1851d +HOST_OPENOCD := openocd-$(HOST_OPENOCD_VERSION) +HOST_OPENOCD_SUFFIX:= tar.bz2 +HOST_OPENOCD_URL := git://git.code.sf.net/p/openocd/code;tag=$(HOST_OPENOCD_VERSION) +HOST_OPENOCD_SOURCE:= $(SRCDIR)/$(HOST_OPENOCD).$(HOST_OPENOCD_SUFFIX) +HOST_OPENOCD_DIR := $(HOST_BUILDDIR)/$(HOST_OPENOCD) + +# +# Prepare +# + +# +# autoconf +# +HOST_OPENOCD_CONF_TOOL := autoconf +HOST_OPENOCD_CONF_ENV := \ + CCACHE=none +HOST_OPENOCD_CONF_OPT := \ + $(HOST_AUTOCONF) \ + --enable-shared \ + --disable-static \ + --disable-werror \ + --disable-internal-jimtcl \ + --disable-internal-libjaylink \ + --enable-dummy \ + --enable-ftdi \ + --enable-stlink \ + --disable-ti-icdi \ + --disable-ulink \ + --disable-usb-blaster-2 \ + --disable-ft232r \ + --disable-vsllink \ + --disable-xds110 \ + --disable-osbdm \ + --disable-opendous \ + --disable-aice \ + --disable-usbprog \ + --disable-rlink \ + --disable-armjtagew \ + --disable-cmsis-dap \ + --disable-kitprog \ + --disable-usb_blaster \ + --disable-presto\ + --disable-openjtag \ + --disable-jlink \ + --disable-parport \ + --disable-parport-ppdev \ + --disable-parport-giveio \ + --disable-jtag_vpi \ + --disable-amtjtagaccel \ + --disable-zy1000 \ + --disable-zy1000-master \ + --disable-ioutil \ + --disable-ep93xx \ + --disable-at91rm9200 \ + --disable-bcm2835gpio \ + --disable-imx_gpio \ + --disable-gw16012 \ + --disable-oocd_trace \ + --disable-buspirate \ + --disable-sysfsgpio \ + --disable-minidriver-dummy \ + --disable-target-64 \ + --disable-remote-bitbang \ + --disable-doxygen-pdf \ + --disable-doxygen-html + +# vim: syntax=make -- 2.20.1 ___ ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH 2/2] host-openocd: add initial support
On Fri, Jun 14, 2019 at 11:41:34AM +0200, Michael Olbrich wrote: > On Fri, Jun 14, 2019 at 11:15:28AM +0200, Michael Grzeschik wrote: > > On Fri, Jun 14, 2019 at 09:18:23AM +0200, Michael Olbrich wrote: > > > On Fri, Jun 07, 2019 at 12:19:49AM +0200, Michael Grzeschik wrote: > > > > Signed-off-by: Michael Grzeschik > > > > --- > > > > patches/openocd-af952850/autogen.sh | 3 + > > > > rules/host-openocd.in | 12 > > > > rules/host-openocd.make | 89 + > > > > 3 files changed, 104 insertions(+) > > > > create mode 100755 patches/openocd-af952850/autogen.sh > > > > create mode 100644 rules/host-openocd.in > > > > create mode 100644 rules/host-openocd.make > > > > > > > > diff --git a/patches/openocd-af952850/autogen.sh > > > > b/patches/openocd-af952850/autogen.sh > > > > new file mode 100755 > > > > index 0..7d344d32f > > > > --- /dev/null > > > > +++ b/patches/openocd-af952850/autogen.sh > > > > @@ -0,0 +1,3 @@ > > > > +#!/bin/bash > > > > + > > > > +exec ./bootstrap > > > > diff --git a/rules/host-openocd.in b/rules/host-openocd.in > > > > new file mode 100644 > > > > index 0..8c863598e > > > > --- /dev/null > > > > +++ b/rules/host-openocd.in > > > > @@ -0,0 +1,12 @@ > > > > +## SECTION=hosttools > > > > + > > > > +menuconfig HOST_OPENOCD > > > > + tristate > > > > + prompt "openocd" > > > > + select HOST_LIBUSB > > > > + select HOST_JIMTCL > > > > + select HOST_LIBFTDI1 > > > > + help > > > > + The "Open On-Chip Debugger" provides JTAG/SWD access from GDB > > > > + (or directly with TCL scripts) to processors with ARM and MIPS > > > > + based cores. > > > > diff --git a/rules/host-openocd.make b/rules/host-openocd.make > > > > new file mode 100644 > > > > index 0..8a741856e > > > > --- /dev/null > > > > +++ b/rules/host-openocd.make > > > > @@ -0,0 +1,89 @@ > > > > +# -*-makefile-*- > > > > +# > > > > +# Copyright (C) 2013 by Michael Grzeschik > > > > +# > > > > +# See CREDITS for details about who has contributed to this project. > > > > +# > > > > +# For further information about the PTXdist project and license > > > > conditions > > > > +# see the README file. > > > > +# > > > > + > > > > +# > > > > +# We provide this package > > > > +# > > > > +HOST_PACKAGES-$(PTXCONF_HOST_OPENOCD) += host-openocd > > > > + > > > > +# > > > > +# Paths and names > > > > +# > > > > +HOST_OPENOCD_VERSION := af952850 > > > > +HOST_OPENOCD_MD5 := fa6841d4e4e76d1626406a99d5b1851d > > > > +HOST_OPENOCD := openocd-$(HOST_OPENOCD_VERSION) > > > > +HOST_OPENOCD_SUFFIX:= tar.bz2 > > > > +HOST_OPENOCD_URL := > > > > git://git.code.sf.net/p/openocd/code;tag=$(HOST_OPENOCD_VERSION) > > > > +HOST_OPENOCD_SOURCE:= > > > > $(SRCDIR)/$(HOST_OPENOCD).$(HOST_OPENOCD_SUFFIX) > > > > +HOST_OPENOCD_DIR := $(HOST_BUILDDIR)/$(HOST_OPENOCD) > > > > + > > > > +# > > > > > > > > +# Prepare > > > > +# > > > > > > > > + > > > > +# > > > > +# autoconf > > > > +# > > > > +HOST_OPENOCD_CONF_TOOL := autoconf > > > > +HOST_OPENOCD_CONF_ENV := \ > > > > + CCACHE=none \ > > > > > > Indent with on tab. > > > > Right, will fix. > > > > > > > + LDFLAGS="-L$(PTXDIST_SYSROOT_HOST)/usr/lib" \ > > > > + CFLAGS="-I$(PTXDIST_SYSROOT_HOST)/usr/include" > > > > > > The flags should be added via HOST_OPENOCD_LDFLAGS / > > > HOST_OPENOCD_CPPFLAGS. > > > However, why do you need sysroot-host/usr/...? These directories should be > > > empty. > > > > Why should they be empty? Aren't there all host packages installed? This > > is needed because otherwise openocd won't find libjim and headers to > > compile and link against. I did not see any other way, then setting > > these variables. > > It should be (PTXDIST_SYSROOT_HOST)/lib (without /usr). I think host-jimtcl > needs to be fixed. I'm not sure why the prefix is /usr there. I'll run a > build-test to see if it works without /. I've done this in master. I've not seen any issues with it. So the flags can be removed now. Michael > > > > > > > +HOST_OPENOCD_CONF_OPT := \ > > > > + $(HOST_AUTOCONF) \ > > > > > > One tab. > > > > will fix > > > > > Michael > > > > > > > + --enable-shared \ > > > > + --disable-static \ > > > > + --disable-werror \ > > > > + --disable-internal-jimtcl \ > > > > + --disable-internal-libjaylink \ > > > > + --enable-dummy \ > > > > + --enable-ftdi \ > > > > + --enable-stlink \ > > > > + --disable-ti-icdi \ > > > > + --disable-ulink \ > > > > + --disable-usb-blaster-2 \ > > > > + --disable-ft232r \ > > > > +