[OpenWrt-Devel] [PATCH] ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2
There are a few NETGEAR devices which don't terminate the model name in the ART with a NUL byte, at least some NETGEAR WNDR3700v2. The current awk expression doesn't match 0xFF bytes, so AR71XX_MODEL contains lots of trailing 0xFF garbage in this case. Fix this by matching for the first non-printable character and explicitly setting LC_CTYPE=C (probably not strictly necessary on OpenWrt, but will definitely work like this, even when awk supports locales and LANG is set). Signed-off-by: Matthias Schiffer --- target/linux/ar71xx/base-files/lib/ar71xx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Hi, this is another little fix that should also be applied to CC. Matthias diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 9edd0cd..e1c47ee 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -38,7 +38,7 @@ wndr3700_board_detect() { ;; "33373031") # Use awk to remove everything after the first zero byte - model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | awk 'BEGIN{FS="[[:cntrl:]]"} {print $1; exit}')" + model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" case $model in $'\xff'*) if [ "${model:24:1}" = 'N' ]; then -- 2.4.6 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH]v3: CC : ar71xx: Backport Support for the Bitmain Antminer S3
Backport of r46236 to CC : add support for the Bitmain Antminer S3 Signed-off-by: L. D. Pinney --- V3 adds the *support.patch missing in V2 target/linux/ar71xx/base-files/etc/diag.sh | 3 +- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 6 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 ++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 2 ++ target/linux/ar71xx/config-3.18 | 1 + target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c | 98 + target/linux/ar71xx/generic/profiles/antminer.mk | 11 +++ target/linux/ar71xx/image/Makefile | 10 ++- target/linux/ar71xx/patches-3.18/905-MIPS-ath79-bitmain-antminer-s3-support.patch | 45 tools/firmware-utils/src/mktplinkfw.c | 1 + 11 files changed, 179 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 4bdb53d..843e709 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -12,7 +12,8 @@ get_status_led() { all0305) status_led="eap7660d:green:ds4" ;; - antminer-s1) + antminer-s1|\ + antminer-s3) status_led="bitmain:green:system" ;; ap132) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds index 19814f4..5126497 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -36,6 +36,12 @@ antminer-s1) ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt" ;; +antminer-s3) + ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt" + ucidef_set_led_default "sys" "SYS" "bitmain:green:sys" "0" + ucidef_set_led_default "lan" "LAN" "bitmain:yellow:lan" "0" + ;; + ap113) ucidef_set_led_usbdev "usb" "USB" "ap113:green:usb" "1-1" ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network index 4fe951e..ea5ba91 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -344,6 +344,7 @@ wp543) ;; antminer-s1 |\ +antminer-s3 |\ dir-505-a1) ucidef_set_interface_lan "eth1" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 8f4bb40..1aa90fe 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -110,6 +110,9 @@ tplink_board_detect() { "04440001"*) model="BITMAIN ANTMINER S1" ;; + "04440003"*) + model="BITMAIN ANTMINER S3" + ;; "12"*) model="MERCURY MAC1200R" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index ade47fb..da4c9fa 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -299,6 +299,8 @@ platform_check_image() { return 1 ;; + antminer-s1 | \ + antminer-s3 | \ archer-c5 | \ archer-c7 | \ el-m150 | \ diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 index 05c98eb..b051c90 100644 --- a/target/linux/ar71xx/config-3.18 +++ b/target/linux/ar71xx/config-3.18 @@ -41,6 +41,7 @@ CONFIG_ATH79_MACH_AP96=y CONFIG_ATH79_MACH_ARCHER_C7=y CONFIG_ATH79_MACH_AW_NR580=y CONFIG_ATH79_MACH_ANTMINER_S1=y +CONFIG_ATH79_MACH_ANTMINER_S3=y CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y CONFIG_ATH79_MACH_CAP4200AG=y CONFIG_ATH79_MACH_CARAMBOLA2=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c new file mode 100644 index 000..010c461 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c @@ -0,0 +1,98 @@ +/* + * Bitmain Antminer S3 board support + * + * Copyright (C) 2015 L. D. Pinney + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include
[OpenWrt-Devel] Fwd: Wanted: OpenWRT talk at NLUUG conference
Hi Hackers NLUUG would like a talk at this years conference. Anyone interested in doing this? Forwarded Message Subject: Wanted: OpenWRT talk at NLUUG conference Date: Tue, 21 Jul 2015 19:37:50 +0200 From: Jos Vos To: Gregers Petersen Hello Gregers, On behalf of the program committee of the NLUUG I am looking for someone that would like to give a talk about OpenWRT at the NLUUG autumn conference on 19 November 2015 at a conference hotel near Utrecht, the Netherlands. The talk (45 minutes incl. Q&A) should be technical and targeted at experienced UNIX/Linux system administrators and developers. The talk should at least give an overview of OpenWRT, platforms, use cases, etc., but may also address a specific technical topic, like the build system, configuration management, porting to other platforms, or something else. The NLUUG is the Dutch counterpart of what the DKUUG is in Denmark and the GUUG in Germany. We normally have two one-day conferences per year, with at least 3 technical tracks in parallel. I found your name and email address at the OpenWRT developers page, being the main contactperson. Feel free to forward this mail to other OpenWRT developers. The NLUUG can take care of travel and hotel costs (but travel arrangements have to be made in cooperation with the organizers), but we only have a limited budget, so we can't afford too "expensive" speakers, like those from Australia. Hope to hear from you, or some other OpenWRT developer, soon. Best regards, Jos Vos Program Committee Member NLUUG Autumn Conference 2015 -- --Jos Vos --X/OS Experts in Open Systems BV | Phone: +31 20 6938364 --Amsterdam, The Netherlands| Fax: +31 20 6948204 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] openwrt.org down due to expired certificate
I'm sure it's been noticed already, but the ssl cert for openwrt.org seems to have expired, and due to hsts being enabled, the site is impossible to access. --Jonathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Adding device driver to OpenWRT (RBP)
Hi, I am trying to integrate https://github.com/ivan19871002/nxp-pn5xx driver as a kernel module to OpenWRT for RaspberyPi. What I did: -Put nxp-pn5xx sources to drivers/misc of build_dir -Added "obj-y += nxp-pn5xx/ " to drivers/misc/Makefile -Added "source "drivers/misc/nxp-pn5xx/Kconfig"" to drivers/misc/Kconfig After that can see <> NXP PN5XX based driver in (Device Drivers -> Misc devices) I checked it. Also tried to add structs showed below to bcm2807.c file : struct pn544_i2c_platform_data pn544_platform_data = { .irq_gpio = 23, .ven_gpio = 24 }; // Use the actual device name rather than generic driver name static struct i2c_board_info __initdata pn544_i2c_devices[] = { { I2C_BOARD_INFO("pn544", 0x28), .platform_data = &pn544_platform_data }, }; i2c_register_board_info_dt(1, pn544_i2c_devices, ARRAY_SIZE(pn544_i2c_devices)); But after successful builded image, cannot see any module on OpenWRT. In use 14.07 branch (Barrier Breaker) of OpenWRT. Maybe someone know what I did wrong? With Best Regards Jernej smime.p7s Description: S/MIME cryptographic signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Change Uboot default values
>W dniu 22.07.2015 o 13:37, Baptiste Clenet pisze: > > I would like to change the default values of Uboot when I choose 2 in the > menu. > In the below example, I would like to change <1>, <2> and <3> by > defaults values that I would have set earlier. > > 2: System Load Linux Kernel then write to Flash via TFTP. > Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) > Please Input new ones /or Ctrl-C to discard > Input device IP (10.10.10.123) ==: <1> > Input server IP (10.10.10.3) ==: <2> > Input Linux Kernel filename () ==:<3> >It is usually stored on separate partition on flash. Read about UBoot >environment variables >athttp://www.denx.de/wiki/view/DULG/UBootEnvVariables - >in particular |**||*ipaddr, *||*|*serverip*|, >*||*bootfile and commands >setenv, saveenv.*| Thanks, works perfectly! 2015-07-22 14:18 GMT+02:00 Baptiste Clenet : > 2015-07-22 13:54 GMT+02:00 Yousong Zhou : >> On 22 July 2015 at 19:37, Baptiste Clenet wrote: >>> Hi, >>> >>> I would like to change the default values of Uboot when I choose 2 in the >>> menu. >>> In the below example, I would like to change <1>, <2> and <3> by >>> defaults values that I would have set earlier. >>> >> >> Looks like it's most likely hardcoded [1]. >> >> [1] >> https://github.com/8devices/u-boot/blob/a4ac3be49389f0801cae4c37454e59679d56f036/lib_mips/board.c#L1502 >> > > Yeah, but how to change the value then, I don't mind to hardcode them, > it's to flash quicker (not enter each time the values). > I changed it on one board but I don't remember how I have done that. > >> >> yousong >> >>> Example: >>> >>> Please choose the operation: >>>1: Load system code to SDRAM via TFTP. >>>2: Load system code then write to Flash via TFTP. >>>3: Boot system code via Flash (default). >>>4: Entr boot command line interface. >>>7: Load Boot Loader code then write to Flash via Serial. >>>9: Load Boot Loader code then write to Flash via TFTP. >>> >>> You choosed 2 >>> >>> 2: System Load Linux Kernel then write to Flash via TFTP. >>> Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) >>> Please Input new ones /or Ctrl-C to discard >>> Input device IP (10.10.10.123) ==: <1> >>> Input server IP (10.10.10.3) ==: <2> >>> Input Linux Kernel filename () ==:<3> >>> >>> Cheers, >>> >>> -- >>> Baptiste >>> ___ >>> openwrt-devel mailing list >>> openwrt-devel@lists.openwrt.org >>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > > > > -- > Baptiste -- Baptiste ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH]v2: CC : ar71xx: Backport Support for the Bitmain Antminer S3
Backport of r46236 to CC : add support for the Bitmain Antminer S3 Signed-off-by: L. D. Pinney --- V1 is missing mach-antminer-s3.c V2 includes this file. target/linux/ar71xx/base-files/etc/diag.sh | 3 ++- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 6 + target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 2 ++ target/linux/ar71xx/config-3.18 | 1 + target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c | 98 ++ target/linux/ar71xx/generic/profiles/antminer.mk | 11 ++ target/linux/ar71xx/image/Makefile | 10 - tools/firmware-utils/src/mktplinkfw.c| 1 + diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 4bdb53d..843e709 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -12,7 +12,8 @@ get_status_led() { all0305) status_led="eap7660d:green:ds4" ;; - antminer-s1) + antminer-s1|\ + antminer-s3) status_led="bitmain:green:system" ;; ap132) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds index 19814f4..5126497 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -36,6 +36,12 @@ antminer-s1) ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt" ;; +antminer-s3) + ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt" + ucidef_set_led_default "sys" "SYS" "bitmain:green:sys" "0" + ucidef_set_led_default "lan" "LAN" "bitmain:yellow:lan" "0" + ;; + ap113) ucidef_set_led_usbdev "usb" "USB" "ap113:green:usb" "1-1" ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network index 4fe951e..ea5ba91 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -344,6 +344,7 @@ wp543) ;; antminer-s1 |\ +antminer-s3 |\ dir-505-a1) ucidef_set_interface_lan "eth1" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 8f4bb40..1aa90fe 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -110,6 +110,9 @@ tplink_board_detect() { "04440001"*) model="BITMAIN ANTMINER S1" ;; + "04440003"*) + model="BITMAIN ANTMINER S3" + ;; "12"*) model="MERCURY MAC1200R" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index ade47fb..da4c9fa 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -299,6 +299,8 @@ platform_check_image() { return 1 ;; + antminer-s1 | \ + antminer-s3 | \ archer-c5 | \ archer-c7 | \ el-m150 | \ diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 index 05c98eb..b051c90 100644 --- a/target/linux/ar71xx/config-3.18 +++ b/target/linux/ar71xx/config-3.18 @@ -41,6 +41,7 @@ CONFIG_ATH79_MACH_AP96=y CONFIG_ATH79_MACH_ARCHER_C7=y CONFIG_ATH79_MACH_AW_NR580=y CONFIG_ATH79_MACH_ANTMINER_S1=y +CONFIG_ATH79_MACH_ANTMINER_S3=y CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y CONFIG_ATH79_MACH_CAP4200AG=y CONFIG_ATH79_MACH_CARAMBOLA2=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c new file mode 100644 index 000..010c461 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c @@ -0,0 +1,98 @@ +/* + * Bitmain Antminer S3 board support + * + * Copyright (C) 2015 L. D. Pinney + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "dev-usb.h" + +#define ANTMINER_S3_GPIO_LED_WLAN 0 +#define ANTMINER_S3_GPIO_LED_SYSTEM17 +#define ANTMINER_S3_
Re: [OpenWrt-Devel] Change Uboot default values
2015-07-22 13:54 GMT+02:00 Yousong Zhou : > On 22 July 2015 at 19:37, Baptiste Clenet wrote: >> Hi, >> >> I would like to change the default values of Uboot when I choose 2 in the >> menu. >> In the below example, I would like to change <1>, <2> and <3> by >> defaults values that I would have set earlier. >> > > Looks like it's most likely hardcoded [1]. > > [1] > https://github.com/8devices/u-boot/blob/a4ac3be49389f0801cae4c37454e59679d56f036/lib_mips/board.c#L1502 > Yeah, but how to change the value then, I don't mind to hardcode them, it's to flash quicker (not enter each time the values). I changed it on one board but I don't remember how I have done that. > > yousong > >> Example: >> >> Please choose the operation: >>1: Load system code to SDRAM via TFTP. >>2: Load system code then write to Flash via TFTP. >>3: Boot system code via Flash (default). >>4: Entr boot command line interface. >>7: Load Boot Loader code then write to Flash via Serial. >>9: Load Boot Loader code then write to Flash via TFTP. >> >> You choosed 2 >> >> 2: System Load Linux Kernel then write to Flash via TFTP. >> Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) >> Please Input new ones /or Ctrl-C to discard >> Input device IP (10.10.10.123) ==: <1> >> Input server IP (10.10.10.3) ==: <2> >> Input Linux Kernel filename () ==:<3> >> >> Cheers, >> >> -- >> Baptiste >> ___ >> openwrt-devel mailing list >> openwrt-devel@lists.openwrt.org >> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel -- Baptiste ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Can't link to ubus / ubox from C++ package
Thanks! that worked... On Wed, Jul 22, 2015 at 2:40 PM, Yousong Zhou wrote: > On 22 July 2015 at 19:34, Tomer Eliyahu wrote: >> Hi, >> >> Sorry if I am repeating this question (I posted it in the developers >> forum and stackoverflow), but I am out of luck for 3 days now and come >> to think it might be an openwrt bug, forgive me if i'm mistaken.. >> >> I am writing a GUI for openwrt which uses UBUS to get indications for >> system status. >> >> For some reason, I can't get it to compile with ubus / ubox - I keep >> getting the same error: >> >> [color=#FF]/local/store/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_uClibc-0.9.33.2_eabi/ilixi_mgui-source/src/UBusThread.cpp:11: >> undefined reference to `uloop_init()'[/color] >> > > As a temporary workaround, you can try surrounding libubox and libubus > headers with "extern "C" {}". > > yousong ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Change Uboot default values
On 22 July 2015 at 19:37, Baptiste Clenet wrote: > Hi, > > I would like to change the default values of Uboot when I choose 2 in the > menu. > In the below example, I would like to change <1>, <2> and <3> by > defaults values that I would have set earlier. > Looks like it's most likely hardcoded [1]. [1] https://github.com/8devices/u-boot/blob/a4ac3be49389f0801cae4c37454e59679d56f036/lib_mips/board.c#L1502 yousong > Example: > > Please choose the operation: >1: Load system code to SDRAM via TFTP. >2: Load system code then write to Flash via TFTP. >3: Boot system code via Flash (default). >4: Entr boot command line interface. >7: Load Boot Loader code then write to Flash via Serial. >9: Load Boot Loader code then write to Flash via TFTP. > > You choosed 2 > > 2: System Load Linux Kernel then write to Flash via TFTP. > Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) > Please Input new ones /or Ctrl-C to discard > Input device IP (10.10.10.123) ==: <1> > Input server IP (10.10.10.3) ==: <2> > Input Linux Kernel filename () ==:<3> > > Cheers, > > -- > Baptiste > ___ > 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
Re: [OpenWrt-Devel] Can't link to ubus / ubox from C++ package
On 22 July 2015 at 19:34, Tomer Eliyahu wrote: > Hi, > > Sorry if I am repeating this question (I posted it in the developers > forum and stackoverflow), but I am out of luck for 3 days now and come > to think it might be an openwrt bug, forgive me if i'm mistaken.. > > I am writing a GUI for openwrt which uses UBUS to get indications for > system status. > > For some reason, I can't get it to compile with ubus / ubox - I keep > getting the same error: > > [color=#FF]/local/store/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_uClibc-0.9.33.2_eabi/ilixi_mgui-source/src/UBusThread.cpp:11: > undefined reference to `uloop_init()'[/color] > As a temporary workaround, you can try surrounding libubox and libubus headers with "extern "C" {}". yousong ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH]v2: CC: ar71xx: add support for Onion Omega
This patch adds support for the Onion Omega. https://onion.io/omega Signed-off-by: L. D. Pinney Acked-by: Boken Lin Tested-by: Jacky Huang --- Patch v1 had ath79/mach-onion-omega.c and profiles/onion.mk ommitted in error. v2 includes these files. target/linux/ar71xx/base-files/etc/diag.sh | 3 +++ target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 4 target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 1 + target/linux/ar71xx/config-3.18| 1 + target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c | 84 target/linux/ar71xx/generic/profiles/onion.mk | 16 ++ target/linux/ar71xx/image/Makefile | 9 target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch | 48 + tools/firmware-utils/src/mktplinkfw.c | 6 ++ 10 files changed, 161 insertions(+), 14 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 4bdb53d..6b885b2 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -159,6 +159,9 @@ get_status_led() { om5p-an) status_led="om5p:blue:power" ;; + onion-omega) + status_led="onion:amber:system" + ;; pb44) status_led="pb44:amber:jump1" ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network index 4fe951e..2a43c2c 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -274,6 +274,10 @@ mynet-n750) [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac" ;; +onion-omega) + ucidef_set_interface_lan "wlan0" + ;; + dhp-1565-a1 |\ dir-835-a1 |\ wndr3700v4 | \ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 8f4bb40..1315859 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -538,6 +538,9 @@ ar71xx_board_detect() { *"OM5P AN") name="om5p-an" ;; + *"Onion Omega") + name="onion-omega" + ;; *PB42) name="pb42" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index ade47fb..f5f4adb 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -305,6 +305,7 @@ platform_check_image() { el-mini | \ gl-inet | \ mc-mac1200r | \ + onion-omega | \ oolite | \ smart-300 | \ tl-mr10u | \ diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 index 05c98eb..8167134 100644 --- a/target/linux/ar71xx/config-3.18 +++ b/target/linux/ar71xx/config-3.18 @@ -82,6 +82,7 @@ CONFIG_ATH79_MACH_NBG460N=y CONFIG_ATH79_MACH_NBG6716=y CONFIG_ATH79_MACH_OM2P=y CONFIG_ATH79_MACH_OM5P=y +CONFIG_ATH79_MACH_ONION_OMEGA=y CONFIG_ATH79_MACH_PB42=y CONFIG_ATH79_MACH_PB44=y CONFIG_ATH79_MACH_PB92=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c new file mode 100644 index 000..c739840 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c @@ -0,0 +1,84 @@ +/* + * Onion Omega board support + * + * Copyright (C) 2015 Boken Lin + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include + +#include + +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define OMEGA_GPIO_LED_SYSTEM 27 +#define OMEGA_GPIO_BTN_RESET 11 + +#define OMEGA_GPIO_USB_POWER 8 + +#define OMEGA_KEYS_POLL_INTERVAL 20 /* msecs */ +#define OMEGA_KEYS_DEBOUNCE_INTERVAL (3 * OMEGA_KEYS_POLL_INTERVAL) + +static const char *omega_part_probes[] = { + "tp-link", + NULL, +}; + +static struct flash_platform_data omega_flash_data = { + .part_probes= omega_part_probes, +}; + +static struct gpio_led omega_leds_gpio[] __initdata = { + { + .name = "onion:amber:system", + .gp
[OpenWrt-Devel] Change Uboot default values
Hi, I would like to change the default values of Uboot when I choose 2 in the menu. In the below example, I would like to change <1>, <2> and <3> by defaults values that I would have set earlier. Example: Please choose the operation: 1: Load system code to SDRAM via TFTP. 2: Load system code then write to Flash via TFTP. 3: Boot system code via Flash (default). 4: Entr boot command line interface. 7: Load Boot Loader code then write to Flash via Serial. 9: Load Boot Loader code then write to Flash via TFTP. You choosed 2 2: System Load Linux Kernel then write to Flash via TFTP. Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) Please Input new ones /or Ctrl-C to discard Input device IP (10.10.10.123) ==: <1> Input server IP (10.10.10.3) ==: <2> Input Linux Kernel filename () ==:<3> Cheers, -- Baptiste ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Can't link to ubus / ubox from C++ package
Hi, Sorry if I am repeating this question (I posted it in the developers forum and stackoverflow), but I am out of luck for 3 days now and come to think it might be an openwrt bug, forgive me if i'm mistaken.. I am writing a GUI for openwrt which uses UBUS to get indications for system status. For some reason, I can't get it to compile with ubus / ubox - I keep getting the same error: [color=#FF]/local/store/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_uClibc-0.9.33.2_eabi/ilixi_mgui-source/src/UBusThread.cpp:11: undefined reference to `uloop_init()'[/color] It is the same for other ubus API. I'm quite new to CPP, but linking to other C libraries works perfectly, for examlpe blobmsg_get_u32(). BTW - I used both CMAKE and Autotools (configure), both tools produced the same error when trying to call ubus/ubox functions. Any thoughts? [b]UBusThread.h:[/b] [code] #ifndef SRC_UBUSTHREAD_H_ #define SRC_UBUSTHREAD_H_ #include #include #include #include "StatusBar.h" namespace MGUI { class UBusThread : public ilixi::Thread { public: UBusThread(StatusBar* target); virtual ~UBusThread(); virtual int run(); private: StatusBar* _bar; ubus_context* _ubus; }; } /* namespace MGUI */ #endif /* SRC_UBUSTHREAD_H_ */ [/code] [b]UBusThread.cpp:[/b] [code] #include "UBusThread.h" namespace MGUI { UBusThread::UBusThread(StatusBar* bar) : Thread(), _bar(bar) { char buf[10]; uloop_init(); } UBusThread::~UBusThread() { } } /* namespace MGUI */ [/code] [b]mgui/CMakeLists.txt:[/b] [code] # # mgui (marvell gui) project cmake ### cmake_minimum_required(VERSION 2.6) PROJECT(MGUI) ADD_DEFINITIONS(-Os -ggdb -Wall -Werror -Wmissing-declarations -DMARVELL_EXTENDED) # define resource files target install SET(MGUI_DATADIR ${CMAKE_INSTALL_PREFIX}/share/ilixi-1.0.0) ADD_DEFINITIONS(-DDATADIR="${MGUI_DATADIR}") SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "Makefile;ipkg-install;ipkg-pxa1826;Makefile;CMakeCache.txt;CMakeFiles;cmake_install.cmake;install_manifest.txt;") # find necessary libraries INCLUDE(CheckLibraryExists) find_library(json NAMES json-c json) LIST(APPEND LIBS ubox ubus uci ${json} blobmsg_json) find_library(librt NAMES rt librt) LIST(APPEND LIBS ${librt}) # find ilixi-1.0.0 INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(ILIXI REQUIRED ilixi>=1.0.0) ADD_DEFINITIONS(${ILIXI_CFLAGS}) LIST(APPEND LIBS ${ILIXI_LIBRARIES}) CONFIGURE_FILE(config.h.in config.h @ONLY) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(data) [/code] [b]src/CMakeLists.txt[/b] [code] # define sources and linked libraries SET(SOURCES main.cpp MGuiPlatform.h BatteryIcon.cpp BatteryIcon.h BottomBar.cpp BottomBar.h BTIcon.cpp BTIcon.h CellularIcon.cpp CellularIcon.h GPSIcon.cpp GPSIcon.h MGuiApplication.cpp MGuiApplication.h SDCardIcon.cpp SDCardIcon.h SimIcon.cpp SimIcon.h SimpleIcon.cpp SimpleIcon.h StatusBar.cpp StatusBar.h UBusThread.cpp UBusThread.h WiFiIcon.cpp WiFiIcon.h ) # create and install executable ADD_EXECUTABLE(mgui ${SOURCES}) TARGET_LINK_LIBRARIES(mgui ${LIBS}) INSTALL(TARGETS mgui RUNTIME DESTINATION bin) [/code] ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] jail patches -> CC & trunk
Hi guys Just forgot to says that my 3 patches fixing jails are also for CC https://patchwork.ozlabs.org/patch/497899/ https://patchwork.ozlabs.org/patch/497900/ https://patchwork.ozlabs.org/patch/497901/ Regards Etienne ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] fix for ticket #20087
Hello folks, has anyone find a quick solution for the ticket #20087 ? https://dev.openwrt.org/ticket/20087 I'm still experiencing this issue when building a system with uClibc. In my case, the broken package is *glib2* as also reported in the tickets itself. I could use also a simple patch to fix my building issue. Regards, Arturo ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [CC 15.05-rc3] vsftpd: Security update (CVE-2015-1419)
The vsftpd package has been rebuilt and was uploaded to the Chaos Calmer 15.05 Release Candicate 3 repository due to a reported security issue. VERSION 3.0.2-4 => 3.0.2-4.1 CHANGELOG [Wed, 22 Jul 2015 09:47:48 +0200 bcedf17] Vsftpd: CVE-2015-1419 Unspecified vulnerability in vsftp 3.0.2 and earlier allows remote attackers to bypass access restrictions via unknown vectors, related to deny_file parsing. CHANGES net/vsftpd/Makefile|4 +- net/vsftpd/patches/007-CVE-2015-1419.patch | 98 2 files changed, 100 insertions(+), 2 deletions(-) REFERENCES * https://github.com/openwrt/packages/commit/bcedf17632e6944edb999853de6beba8fa56624b ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during kernel_menuconfig on a cleaned env
Hi, this was originally done to fix quilt in the SDK. Did you test it there after your change? ~ Jow 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] Request for advice about SysUpgrade
Hi, Thank you Claudio for you answer. Le 22/07/2015 01:52, Claudio Leite a écrit : >> What is the most simple implementation of sysupgrade ? >> I cannot get it to work with ubifs, the root is blocking my ubidetach try. >> If I get all unmount with /etc/init/umount stop, then my /mnt and images are >> no more available. > > I'm sitting on some patches that implement the aforementioned > squashfs+ubifs format on Kirkwood, rather than the straight UBIFS image it > is now. I'll try to clean them up in the next few days and submit. Great, I'll wait for this submit. > I don't remember the details, but even before switching to squashfs it > was mostly a matter of creating a platform_check_image() block in > /lib/upgrade/platform.sh, and calling "nand_do_platform_check" for the > board. It "just worked" after that. May be I get more unwanted side back effects because I am testing from console instead of using webui ? G+ ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel