Re: [OpenWrt-Devel] for ramips/mt7620a, emailrelay-nossl fails to build

2014-09-07 Thread Etienne Champetier
Hi
Le 7 sept. 2014 23:40, "Robert P. J. Day"  a écrit :
>
>
>   still reviewing so i don't think i have the background to debug this
> one:
>
> $ make V=s
> ... big snip ...
> Package emailrelay-nossl is missing dependencies for the following
libraries:
> libcrypto.so.1.0.0
> libssl.so.1.0.0
> Makefile:118: recipe for target
'/home/rpjday/openwrt/git/bin/ramips/packages/emailrelay-nossl_1.9-1_ramips_24kec.ipk'
failed
> make[3]: ***
[/home/rpjday/openwrt/git/bin/ramips/packages/emailrelay-nossl_1.9-1_ramips_24kec.ipk]
> Error 1
>
>   i'm using the default config.ramips_mt7620a config file. thoughts?
>
> rday
>
> --
>

Please open an issue on github
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] bcm53xx: image: rework Makefile and merge some functions

2014-09-07 Thread Rafał Miłecki
With this patch we build vendor specific firmwares in one function
avoiding code duplication and more complex maintenance.
It also merges two similar (Netgear specific) "Chk" functions.

Signed-off-by: Rafał Miłecki 
---
 target/linux/bcm53xx/image/Makefile | 28 +++-
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/target/linux/bcm53xx/image/Makefile 
b/target/linux/bcm53xx/image/Makefile
index 61bc39c..2acf107 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -13,16 +13,7 @@ define Image/Prepare
$(call prepare_generic_squashfs,$(KDIR)/fs_mark)
 endef
 
-define Image/Build/Initramfs
-   $(call 
Image/Build/Initramfs/Chk,bcm4708-netgear-r6250,U12H245T00_NETGEAR,2,initramfs)
-endef
-
-define Image/Build/Initramfs/Chk
-   $(call Image/Build/Initramfs/DTB,$(1))
-   $(STAGING_DIR_HOST)/bin/mkchkimg -o $(BIN_DIR)/openwrt-$(1)-$(4).chk -k 
$(KDIR)/$(IMG_PREFIX)-$(4)-$(1).trx -b $(2) -r $(3)
-endef
-
-define Image/Build/Initramfs/DTB
+define Image/Build/initramfs/DTB
$(call Image/Build/DTB,zImage-initramfs,$(1))
$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/$(IMG_PREFIX)-initramfs-$(1).trx 
\
-f $(KDIR)/zImage-initramfs-$(1).lzma
@@ -35,11 +26,6 @@ define Image/Build/squashfs/DTB
-a 1024 -f $(KDIR)/root.squashfs -a 0x1 -A $(KDIR)/fs_mark
 endef
 
-define Image/Build/squashfs/Chk
-   $(call Image/Build/squashfs/DTB,$(1))
-   $(STAGING_DIR_HOST)/bin/mkchkimg -o $(BIN_DIR)/openwrt-$(1)-$(4).chk -k 
$(KDIR)/$(IMG_PREFIX)-$(4)-$(1).trx -b $(2) -r $(3)
-endef
-
 define Image/Build/DTB
rm -f $(KDIR)/$(1)-$(2).lzma
rm -f $(KDIR)/$(1)-$(2).dts
@@ -47,10 +33,18 @@ define Image/Build/DTB
$(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/$(1)-$(2).dts 
$(KDIR)/$(1)-$(2).lzma -d16
 endef
 
+define Image/Build/Chk
+   $(call Image/Build/$(1)/DTB,$(2))
+   $(STAGING_DIR_HOST)/bin/mkchkimg -o $(BIN_DIR)/openwrt-$(2)-$(1).chk -k 
$(KDIR)/$(IMG_PREFIX)-$(1)-$(2).trx -b $(3) -r $(4)
+endef
+
+# $(1): filesystem type (e.g. squashfs, initramfs).
 define Image/Build
-   $(call Image/Build/$(1),$(1))
-   $(call 
Image/Build/squashfs/Chk,bcm4708-netgear-r6250,U12H245T00_NETGEAR,2,squashfs)
+   $(call Image/Build/Chk,$(1),bcm4708-netgear-r6250,U12H245T00_NETGEAR,2)
 endef
 
+define Image/Build/Initramfs
+   $(call Image/Build,initramfs)
+endef
 
 $(eval $(call BuildImage))
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] babeld: use procd to start, stop, and respawn

2014-09-07 Thread Tristan Plumb
Changes the babeld init script to utilize procd and adds a hotplug.d file
to restart babeld when interfaces go up or down.

Additionally adds a patch to the babeld source is to prevent the
attempted recreation of a pidfile when babeld restarts uncleanly. This is
also possible to do by passing -I '' on the command line, however procd
interprets an empty argument terminating the list, and thus cannot supply
empty arguments to programs it manages.

Signed-off-by: Tristan Plumb 
---
diff --git a/babeld/Makefile b/babeld/Makefile
index e939310..70fcd64 100644
--- a/babeld/Makefile
+++ b/babeld/Makefile
@@ -54,6 +54,8 @@ define Package/babeld/install
$(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld
+   $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+   $(INSTALL_DATA) ./files/babeld.hotplug 
$(1)/etc/hotplug.d/iface/25-babeld
 endef
 
 $(eval $(call BuildPackage,babeld))
diff --git a/babeld/files/babeld.hotplug b/babeld/files/babeld.hotplug
new file mode 100644
index 000..3fe674a
--- /dev/null
+++ b/babeld/files/babeld.hotplug
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+[ "$ACTION" = ifup ] || exit 0
+
+/etc/init.d/babeld enabled && /etc/init.d/babeld restart
+
diff --git a/babeld/files/babeld.init b/babeld/files/babeld.init
index 180fc7e..de8d73b 100755
--- a/babeld/files/babeld.init
+++ b/babeld/files/babeld.init
@@ -2,9 +2,9 @@
 
 . /lib/functions/network.sh
 
+USE_PROCD=1
 START=70
 
-pidfile='/var/run/babeld.pid'
 CONFIGFILE='/var/etc/babeld.conf'
 OTHERCONFIGFILE="/etc/babeld.conf"
 EXTRA_COMMANDS="status"
@@ -197,7 +197,7 @@ babel_config_cb() {
esac
 }
 
-start() {
+start_service() {
mkdir -p /var/lib
# Start by emptying the generated config file
>"$CONFIGFILE"
@@ -213,26 +213,17 @@ start() {
config_foreach parse_old_global_options general
# Parse filters separately, since we know which options we expect
config_foreach babel_filter filter
+   procd_open_instance
# Using multiple config files is supported since babeld 1.5.1
-   /usr/sbin/babeld -D -I "$pidfile" -c "$OTHERCONFIGFILE" -c "$CONFIGFILE"
-   # Wait for the pidfile to appear
-   for i in 1 2
-   do
-   [ -f "$pidfile" ] || sleep 1
-   done
-   [ -f "$pidfile" ] || (echo "Failed to start babeld"; exit 42)
+   procd_set_param command /usr/sbin/babeld -c "$OTHERCONFIGFILE" -c 
"$CONFIGFILE"
+   procd_set_param respawn
+   procd_close_instance
 }
 
-stop() {
-   [ -f "$pidfile" ] && kill $(cat $pidfile)
-  # avoid race-condition on restart: wait for
-  # babeld to die for real.
-  [ -f "$pidfile" ] && sleep 1
-  [ -f "$pidfile" ] && sleep 1
-  [ -f "$pidfile" ] && sleep 1
-  [ -f "$pidfile" ] && exit 42
+service_triggers() {
+   procd_add_reload_trigger babeld
 }
 
 status() {
-   [ -f "$pidfile" ] && kill -USR1 $(cat $pidfile)
+   kill -USR1 $(pidof babeld)
 }
diff --git a/babeld/patches/001-no-default-pidfile.patch 
b/babeld/patches/001-no-default-pidfile.patch
new file mode 100644
index 000..74ac6b4
--- /dev/null
+++ b/babeld/patches/001-no-default-pidfile.patch
@@ -0,0 +1,21 @@
+diff --git a/babeld.c b/babeld.c
+index 656c9da..88e4aec 100644
+--- a/babeld.c
 b/babeld.c
+@@ -66,7 +66,7 @@ int resend_delay = -1;
+ int random_id = 0;
+ int do_daemonise = 0;
+ const char *logfile = NULL,
+-*pidfile = "/var/run/babeld.pid",
++*pidfile = NULL,
+ *state_file = "/var/lib/babel-state";
+ 
+ unsigned char *receive_buffer = NULL;
+@@ -251,6 +251,7 @@ main(int argc, char **argv)
+ break;
+ case 'D':
+ do_daemonise = 1;
++pidfile = "/var/run/babeld.pid";
+ break;
+ case 'L':
+ logfile = optarg;

-- 
All original matter is hereby placed immediately under the public domain.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] for ramips/mt7620a, emailrelay-nossl fails to build

2014-09-07 Thread Robert P. J. Day

  still reviewing so i don't think i have the background to debug this
one:

$ make V=s
... big snip ...
Package emailrelay-nossl is missing dependencies for the following libraries:
libcrypto.so.1.0.0
libssl.so.1.0.0
Makefile:118: recipe for target 
'/home/rpjday/openwrt/git/bin/ramips/packages/emailrelay-nossl_1.9-1_ramips_24kec.ipk'
 failed
make[3]: *** 
[/home/rpjday/openwrt/git/bin/ramips/packages/emailrelay-nossl_1.9-1_ramips_24kec.ipk]
Error 1

  i'm using the default config.ramips_mt7620a config file. thoughts?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday

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


Re: [OpenWrt-Devel] [PATCH] bcm53xx: image: document arguments of some functions

2014-09-07 Thread Rafał Miłecki
On 7 September 2014 18:34, Rafał Miłecki  wrote:
> Signed-off-by: Rafał Miłecki 

Please drop it, I'll do better.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] bcm53xx: image: document arguments of some functions

2014-09-07 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki 
---
 target/linux/bcm53xx/image/Makefile | 8 
 1 file changed, 8 insertions(+)

diff --git a/target/linux/bcm53xx/image/Makefile 
b/target/linux/bcm53xx/image/Makefile
index 61bc39c..60b4d51 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -17,17 +17,23 @@ define Image/Build/Initramfs
$(call 
Image/Build/Initramfs/Chk,bcm4708-netgear-r6250,U12H245T00_NETGEAR,2,initramfs)
 endef
 
+# $(1): board and device model (used for output file).
+# $(2): board_id (device specific magic).
+# $(3): region.
+# $(4): filesystem type.
 define Image/Build/Initramfs/Chk
$(call Image/Build/Initramfs/DTB,$(1))
$(STAGING_DIR_HOST)/bin/mkchkimg -o $(BIN_DIR)/openwrt-$(1)-$(4).chk -k 
$(KDIR)/$(IMG_PREFIX)-$(4)-$(1).trx -b $(2) -r $(3)
 endef
 
+# $(1): board and device model (used for output file).
 define Image/Build/Initramfs/DTB
$(call Image/Build/DTB,zImage-initramfs,$(1))
$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/$(IMG_PREFIX)-initramfs-$(1).trx 
\
-f $(KDIR)/zImage-initramfs-$(1).lzma
 endef
 
+# $(1): board and device model (used for output file).
 define Image/Build/squashfs/DTB
$(call Image/Build/DTB,zImage,$(1))
$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/$(IMG_PREFIX)-squashfs-$(1).trx \
@@ -40,6 +46,7 @@ define Image/Build/squashfs/Chk
$(STAGING_DIR_HOST)/bin/mkchkimg -o $(BIN_DIR)/openwrt-$(1)-$(4).chk -k 
$(KDIR)/$(IMG_PREFIX)-$(4)-$(1).trx -b $(2) -r $(3)
 endef
 
+# $(2): board and device model (used for output file).
 define Image/Build/DTB
rm -f $(KDIR)/$(1)-$(2).lzma
rm -f $(KDIR)/$(1)-$(2).dts
@@ -47,6 +54,7 @@ define Image/Build/DTB
$(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/$(1)-$(2).dts 
$(KDIR)/$(1)-$(2).lzma -d16
 endef
 
+# $(1): filesystem type.
 define Image/Build
$(call Image/Build/$(1),$(1))
$(call 
Image/Build/squashfs/Chk,bcm4708-netgear-r6250,U12H245T00_NETGEAR,2,squashfs)
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: dev-eth: Don't advertise 1gbit in link code word on ar9331

2014-09-07 Thread Felix Fietkau
On 2014-09-07 06:10, Harald Welte wrote:
> While the AR9331 has a gigabit MAC towards the internal switch, the
> integrated PHYs however are only 100-base-tx capable.  The existing code
> however advertieses gigabit capability in the link status word.  If you
> attach such a PHY to a gigabit capable switch on the remote end, with
> some probability it attempts to negotiate gigabit and fails, falling
> baco to the AR9331 assuming a 10mbit half-duplex link.  This has been
> observed quite frequently with the Carambola2 and gigabit capable
> switches.
> 
> In ath79_register_eth(), "pdata->has_gbit = 1;" is set unconditionally
> for both AR9331 ethernet ports. This is most likely wrong. Despite the
> two MAC IP cores being gigabit MACs, the MAC for eth1 is connected to a
> 100base-T PHY via MII. The has_gbit attribute is used in the ethernet
> driver to determine the supported link modes.
> 
> So either pdata->has_gbit is not set to 1 anymore, or the ethernet
> driver needs to be modified to determine the advertised link code word
> on another criteria than pdata->has_gbit.  This patch implements the
> former solution.
> 
> Signed-off-by: Harald Welte 
Committed in r42432, thanks.

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