[OpenWrt-Devel] rc.local, inittab, rc.d not editable

2016-06-01 Thread Baptiste Clenet
Hi,

Why all those files in /etc are not editable:
rc.local, inittab, rc.d?
How can I make them editable?

Cheers,

-- 
Baptiste
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] package/devel/gdb: Add support of ARC gdb

2016-06-01 Thread Alexey Brodkin
As of today gdb port for ARC is not yet in upstream even though
we're working hard on that.

Still to allow ARC users to debug user-space apps on top of
Linux kernel we're adding here support for building GDB from
sources hosted on our GitHub here:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2016.03-gdb

Likewise for host GDB sources that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of binutils in gdb:
-->8--
--disable-binutils
--disable-ld
--disable-gas
-->8--

Also we disable sim because if the following breakage while
building with it:
>8
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
-mono -fast -pbb -switch sem5-switch.c \
-cpu a5f -infile ./mloop5.in \
-outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
>8

Signed-off-by: Alexey Brodkin 
Cc: John Crispin 
Cc: Felix Fietkau 
---
 package/devel/gdb/Makefile | 23 ++--
 .../001-gdb-pr14523-mips-signal-number.patch   |  0
 .../gdb/patches/{ => 7.11}/100-musl_fix.patch  |  0
 .../patches/arc-2016.03/100-no_extern_inline.patch | 32 ++
 .../gdb/patches/arc-2016.03/110-no_testsuite.patch | 21 ++
 .../120-fix-compile-flag-mismatch.patch| 11 
 .../arc-2016.03/200-arc-fix-target-mask.patch  | 13 +
 7 files changed, 98 insertions(+), 2 deletions(-)
 rename package/devel/gdb/patches/{ => 
7.11}/001-gdb-pr14523-mips-signal-number.patch (100%)
 rename package/devel/gdb/patches/{ => 7.11}/100-musl_fix.patch (100%)
 create mode 100644 
package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch
 create mode 100644 package/devel/gdb/patches/arc-2016.03/110-no_testsuite.patch
 create mode 100644 
package/devel/gdb/patches/arc-2016.03/120-fix-compile-flag-mismatch.patch
 create mode 100644 
package/devel/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch

diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile
index f6d5fec..2e6b332 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb/Makefile
@@ -8,12 +8,27 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb
+
+ifeq ($(CONFIG_arc),y)
+PKG_VERSION:=arc-2016.03-gdb
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION)
+PKG_MD5SUM:=775caaf6385c16f20b6f53c0a2b95f79
+GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
+else
 PKG_VERSION:=7.11
-PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gdb
 PKG_MD5SUM:=b5c784685e1cde65ba135feea86b6d75
+GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
+endif
+
+PKG_RELEASE:=1
+
+PATCH_DIR:=./patches/$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(GDB_DIR)
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -55,7 +70,11 @@ CONFIGURE_ARGS+= \
--with-system-readline \
--without-expat \
--without-lzma \
-   --disable-werror
+   --disable-werror \
+   --disable-binutils \
+   --disable-ld \
+   --disable-gas \
+   --disable-sim
 
 CONFIGURE_VARS+= \
ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
diff --git a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch 
b/package/devel/gdb/patches/7.11/001-gdb-pr14523-mips-signal-number.patch
similarity index 100%
rename from package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch
rename to 
package/devel/gdb/patches/7.11/001-gdb-pr14523-mips-signal-number.patch
diff --git a/package/devel/gdb/patches/100-musl_fix.patch 
b/package/devel/gdb/patches/7.11/100-musl_fix.patch
similarity index 100%
rename from package/devel/gdb/patches/100-musl_fix.patch
rename to package/devel/gdb/patches/7.11/100-musl_fix.patch
diff --git a/package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch 
b/package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch
new file mode 100644
index 000..8c18c6e
--- /dev/null
+++ b/package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch
@@ -0,0 +1,32 @@
+--- a/sim/common/sim-arange.c
 b/sim/common/sim-arange.c
+@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a
+   build_search_tree (ar);
+ }
+ 
+-#endif /* DEFINE_NON_INLINE_P */
+-
+-#if DEFINE_INLINE_P
+-
+-SIM_ARANGE_INLINE int
++int
+ sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr)
+ {
+   ADDR_RANGE_TREE *t = ar->range_tree;
+@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad
+   return 0;
+ }
+ 
+-#endif /* DEFINE_INLINE_P */
++#endif /* DEFINE_NON_INLINE_P */
+--- a/sim/common/sim-arange.h
 b/sim/common/sim-arange.h
+@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_
+ 
+ /* Return non-zero if ADDR is in range AR, traversing the entire tree.
+If no range is specified, that is defined to m

Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] _GNU_SOURCE should be defined for building vs uClibc

2016-06-01 Thread Karl Palsson

John Crispin  wrote:
> 
> 
> On 23/05/2016 20:12, Waldemar Brodkorb wrote:
> > Hi John,
> > John Crispin wrote,
> > 
> >> Hi,
> >> is it really a gnu extension or is uclibc b0rked for these symbols ?
> > 
> > I think it isn't b0rked.
> > It was added for ARM GNU libc here under #ifdef __USE_GNU:
> > https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps/unix/sysv/linux/arm/bits/fcntl.h;h=aa2d36ca80f0ca4c5793b28b3852ce60b5fe57ef;hp=6a5f89ad1f8bdf8a825fc1e55a84679a86349a6c;hb=adb252daea96e7e160553703d477b76ff6a7781e;hpb=01b5049d107460f5eca797eda983958d1a410ffd
> > 
> > And later moved to generic fcntl.h file. So we are correct here or
> > at least compatible to GNU libc.
> > 
> > best regards
> >  Waldemar
> >  
> 
> ok, i'll merge it later today or in the morning
> 

This still doesn't work on the uclibc in openwrt-CC branch. The
O_PATH definitions are in asm-generic/fcntl.h, which can be
included via linux/fcntl.h, _GNU_SOURCE doesn't get this pulled
in though.

I attempted to add includes for linux/fcntl, but it just gives me
redeclaration errors for struct flock.

Cheers,
Karl P

signature.asc
Description: OpenPGP Digital Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] package/devel/gdb: Add support of ARC gdb

2016-06-01 Thread Dirk Neukirchen
On 01.06.2016 17:32, Alexey Brodkin wrote:
> Also we disable sim because if the following breakage while
> building with it:
> >8
> /usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
> -mono -fast -pbb -switch sem5-switch.c \
> -cpu a5f -infile ./mloop5.in \
> -outfile-suffix 5
> unknown option: bash
> Makefile:699: recipe for target 'stamp-5mloop' failed
> make[7]: *** [stamp-5mloop] Error 1
> >8

rules.mk with its SHELL:=/usr/bin/env bash is the culprit

I had some issues when I set CONFIG_SHELL in the same  way
- using SHELL:=/bin/bash probably fixes this but might have
other side effects or breakage (globally/for other packages)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] package/devel/gdb: Add support of ARC gdb

2016-06-01 Thread Alexey Brodkin
Hi Dirk,

On Wed, 2016-06-01 at 18:21 +0200, Dirk Neukirchen wrote:
> On 01.06.2016 17:32, Alexey Brodkin wrote:
> > 
> > Also we disable sim because if the following breakage while
> > building with it:
> > >8
> > /usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
> > -mono -fast -pbb -switch sem5-switch.c \
> > -cpu a5f -infile ./mloop5.in \
> > -outfile-suffix 5
> > unknown option: bash
> > Makefile:699: recipe for target 'stamp-5mloop' failed
> > make[7]: *** [stamp-5mloop] Error 1
> > >8
> rules.mk with its SHELL:=/usr/bin/env bash is the culprit

I think so.

> I had some issues when I set CONFIG_SHELL in the same  way
> - using SHELL:=/bin/bash probably fixes this but might have
> other side effects or breakage (globally/for other packages)

Indeed.

But anyways we don't need GDB's simulator to be built here,
so change itself is pretty sane.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PROPOSAL] move OpenWrt codebase to Git and GitHub

2016-06-01 Thread Saverio Proto
Hello,

I am very happy about moving to Github.

Saverio

2016-05-24 16:06 GMT+02:00 Luka Perkov :
> Dear OpenWrt mailing list readers,
>
> as the subject says I'd like to make proposal to move the OpenWrt
> codebase to Git. This was already discussed before [1] and now when
> there are no blockers [2] for this change I'd like that we as a
> community move forward with this switch.
>
> Also, I'd like to propose that we move the project to GitHub and here
> are the reasons why I see this as a good decision:
>
> * GitHub will allow people to contribute more easily
>
> The bigger amount of contributions has already happened and can be seen
> on the packages feed which is already hosted on GitHub. With this I'm
> also hoping to avoid comments regarding invalid patches on the mailing
> list.
>
> For now I am proposing that the current development workflow is also
> accepted - aka. patches that are sent to the mailing list are also
> accepted.
>
> * GitHub and similar services will allow us to integrate more easily
> with other projects
>
> Here specifically I mean integration with modern CI. Here is an example
> of integration with drone.io [3][4]. At the moment this is only in the
> POC stage but what I'd like to do down the line is to:
>
>  - build OpenWrt images for all architectures for every pull request
>
>  - build OpenWrt package binary for every package pull request for all
> architectures and make it available for download
>
>  - build and host OpenWrt qemu and/or Docker image for every pull request
>
> This will allow easy review of the work since flags will be shown in the
> pull request if the build was sucessful or not. Also, this will allow
> people to test changes without building the image and thus lowering the
> time that needs to be spent on maintenance work.
>
> If this proposal gets accepted I'll be sending out an email to get
> access to more build servers so this new build infrastructure can
> properly support the project in a timely fashion.
>
> Please share your thoughts regarding this proposal.
>
> Regards,
> Luka
>
> [1] https://lists.openwrt.org/pipermail/openwrt-devel/2015-October/036390.html
> [2] https://lists.openwrt.org/pipermail/openwrt-devel/2016-May/041329.html
> [3] https://github.com/makkrnic/openwrt-qemu-x86
> [4] http://sartura-drone.makkrnic.com/makkrnic/openwrt-qemu-x86/5
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH libubox] blobmsg_json: add new functions blobmsg_format_json_value*

2016-06-01 Thread Matthias Schiffer
The current blobmsg_format_json* functions will return invalid JSON when
the "list" argument is given as false (blobmsg_format_element() will
output the name of the blob_attr as if the value is printed as part of a
JSON object).

To avoid breaking software relying on this behaviour, introduce new
functions which will never print the blob_attr name and thus always
produce valid JSON.

Signed-off-by: Matthias Schiffer 
---
 blobmsg_json.c | 49 -
 blobmsg_json.h | 14 ++
 2 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/blobmsg_json.c b/blobmsg_json.c
index 5713948..538c816 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -207,7 +207,7 @@ static void blobmsg_format_string(struct strbuf *s, const 
char *str)
 
 static void blobmsg_format_json_list(struct strbuf *s, struct blob_attr *attr, 
int len, bool array);
 
-static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, 
bool array, bool head)
+static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, 
bool without_name, bool head)
 {
const char *data_str;
char buf[32];
@@ -217,7 +217,7 @@ static void blobmsg_format_element(struct strbuf *s, struct 
blob_attr *attr, boo
if (!blobmsg_check_attr(attr, false))
return;
 
-   if (!array && blobmsg_name(attr)[0]) {
+   if (!without_name && blobmsg_name(attr)[0]) {
blobmsg_format_string(s, blobmsg_name(attr));
blobmsg_puts(s, ": ", s->indent ? 2 : 1);
}
@@ -286,22 +286,26 @@ static void blobmsg_format_json_list(struct strbuf *s, 
struct blob_attr *attr, i
blobmsg_puts(s, (array ? "]" : "}"), 1);
 }
 
+static void setup_strbuf(struct strbuf *s, struct blob_attr *attr, 
blobmsg_json_format_t cb, void *priv, int indent) {
+   s->len = blob_len(attr);
+   s->buf = malloc(s->len);
+   s->pos = 0;
+   s->custom_format = cb;
+   s->priv = priv;
+   s->indent = false;
+
+   if (indent >= 0) {
+   s->indent = true;
+   s->indent_level = indent;
+   }
+}
+
 char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, 
blobmsg_json_format_t cb, void *priv, int indent)
 {
struct strbuf s;
bool array;
 
-   s.len = blob_len(attr);
-   s.buf = malloc(s.len);
-   s.pos = 0;
-   s.custom_format = cb;
-   s.priv = priv;
-   s.indent = false;
-
-   if (indent >= 0) {
-   s.indent = true;
-   s.indent_level = indent;
-   }
+   setup_strbuf(&s, attr, cb, priv, indent);
 
array = blob_is_extended(attr) &&
blobmsg_type(attr) == BLOBMSG_TYPE_ARRAY;
@@ -321,3 +325,22 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, 
bool list, blobmsg_jso
 
return s.buf;
 }
+
+char *blobmsg_format_json_value_with_cb(struct blob_attr *attr, 
blobmsg_json_format_t cb, void *priv, int indent)
+{
+   struct strbuf s;
+
+   setup_strbuf(&s, attr, cb, priv, indent);
+
+   blobmsg_format_element(&s, attr, true, false);
+
+   if (!s.len) {
+   free(s.buf);
+   return NULL;
+   }
+
+   s.buf = realloc(s.buf, s.pos + 1);
+   s.buf[s.pos] = 0;
+
+   return s.buf;
+}
diff --git a/blobmsg_json.h b/blobmsg_json.h
index cd9ed33..9dfc02d 100644
--- a/blobmsg_json.h
+++ b/blobmsg_json.h
@@ -42,4 +42,18 @@ static inline char *blobmsg_format_json_indent(struct 
blob_attr *attr, bool list
return blobmsg_format_json_with_cb(attr, list, NULL, NULL, indent);
 }
 
+char *blobmsg_format_json_value_with_cb(struct blob_attr *attr,
+   blobmsg_json_format_t cb, void *priv,
+   int indent);
+
+static inline char *blobmsg_format_json_value(struct blob_attr *attr)
+{
+   return blobmsg_format_json_value_with_cb(attr, NULL, NULL, -1);
+}
+
+static inline char *blobmsg_format_json_value_indent(struct blob_attr *attr, 
int indent)
+{
+   return blobmsg_format_json_value_with_cb(attr, NULL, NULL, indent);
+}
+
 #endif
-- 
2.8.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel