From c30f075ea7da2ecf9177efce18233abdc7b12b4c Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Aug 2014 11:52:46 +0200
Subject: [PATCH] Update OpenWrt packages repo to 14.07

The only packages we use from this repo are haveged and (now) fastd and its
dependencies, so we can make the switch safely without updating OpenWrt itself
to Barrier Breaker yet.
---
 modules                                       |   7 +-
 ...er-initial-setup-and-don-t-run-tests.patch |  27 +++
 ...-and-add-patch-to-fix-race-condition.patch | 187 ------------------
 ...-the-root-partition-has-been-mounted.patch |  17 --
 4 files changed, 31 insertions(+), 207 deletions(-)
 create mode 100644 patches/packages/openwrt/0001-haveged-start-directly-after-initial-setup-and-don-t-run-tests.patch
 delete mode 100644 patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch
 delete mode 100644 patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch

diff --git a/modules b/modules
index 7bc85d018..b5eb93a83 100644
--- a/modules
+++ b/modules
@@ -3,11 +3,12 @@ GLUON_FEEDS='openwrt gluon routing luci'
 OPENWRT_REPO=git://git.openwrt.org/12.09/openwrt.git
 OPENWRT_COMMIT=b0a05d4f7c194c7db43c3c5f1818449e4ecfe653
 
-PACKAGES_OPENWRT_REPO=git://git.openwrt.org/12.09/packages.git
-PACKAGES_OPENWRT_COMMIT=381bbea65989b63e30f43ab87e51b042325bbff3
+PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
+PACKAGES_OPENWRT_COMMIT=a5944176bc761a3fd233c59bad1af96165e5b60f
+PACKAGES_OPENWRT_BRANCH=for-14.07
 
 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
-PACKAGES_GLUON_COMMIT=e65cf26d5302ca6791f9da953d653fd5e0a9ccf3
+PACKAGES_GLUON_COMMIT=1628f219607339492b00fb921757ac8716d1358b
 
 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
 PACKAGES_ROUTING_COMMIT=0e4201a983df967e88e6ce5451f5f5f99bab2370
diff --git a/patches/packages/openwrt/0001-haveged-start-directly-after-initial-setup-and-don-t-run-tests.patch b/patches/packages/openwrt/0001-haveged-start-directly-after-initial-setup-and-don-t-run-tests.patch
new file mode 100644
index 000000000..ff3d871ea
--- /dev/null
+++ b/patches/packages/openwrt/0001-haveged-start-directly-after-initial-setup-and-don-t-run-tests.patch
@@ -0,0 +1,27 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Sat, 26 Jul 2014 18:06:07 +0200
+Subject: haveged: start directly after initial setup and don't run tests
+
+diff --git a/utils/haveged/files/haveged.init b/utils/haveged/files/haveged.init
+index ce28e61..aa8d3c7 100644
+--- a/utils/haveged/files/haveged.init
++++ b/utils/haveged/files/haveged.init
+@@ -1,14 +1,16 @@
+ #!/bin/sh /etc/rc.common
+ # Copyright (C) 2012 OpenWrt.org
+ 
+-START=98
++START=13
+ 
+ HAVEGED_THRESHOLD=1024
+ HAVEGED_DCACHE=32
+ HAVEGED_ICACHE=32
++HAVEGED_TESTS_TOT=
++HAVEGED_TESTS_CONT=
+ 
+ start() {
+-	service_start /usr/sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1
++	service_start /usr/sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1 -o t${HAVEGED_TESTS_TOT}c${HAVEGED_TESTS_CONT}
+ }
+ 
+ stop() {
diff --git a/patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch b/patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch
deleted file mode 100644
index 4974f75cf..000000000
--- a/patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sun, 12 Jan 2014 00:42:43 +0100
-Subject: radvd: update to 1.9.8 and add patch to fix race condition
-
-diff --git a/ipv6/radvd/Makefile b/ipv6/radvd/Makefile
-index 571d9de..b14c02b 100644
---- a/ipv6/radvd/Makefile
-+++ b/ipv6/radvd/Makefile
-@@ -8,13 +8,13 @@
- include $(TOPDIR)/rules.mk
- 
- PKG_NAME:=radvd
--PKG_VERSION:=1.9.1
--PKG_RELEASE:=2
-+PKG_VERSION:=1.9.8
-+PKG_RELEASE:=1
- 
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
- PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \
- 		http://download.sourcemage.org/mirror
--PKG_MD5SUM:=e807ad7e9a76d46b6133df391385cd31
-+PKG_MD5SUM:=7a96a38252c3964ee18bbc1fdeae25fa
- 
- PKG_INSTALL:=1
- 
-diff --git a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch
-index 049d654..313b8cb 100644
---- a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch
-+++ b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch
-@@ -1,26 +1,26 @@
- --- a/netlink.c
- +++ b/netlink.c
--@@ -67,7 +67,7 @@ void process_netlink_msg(int sock)
-- 		else {
-- 			dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index);
-- 		}
---		reload_config();
--+		reload_config(LOG_DEBUG);
-- 	}
-- }
-- 
-+@@ -75,7 +75,7 @@ void process_netlink_msg(int sock)
-+ 						dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index);
-+ 					}
-+ 					if (!reloaded) {
-+-						reload_config();
-++						reload_config(LOG_DEBUG);
-+ 						reloaded = 1;
-+ 					}
-+ 				}
- --- a/radvd.c
- +++ b/radvd.c
- @@ -443,7 +443,7 @@ void main_loop(void)
-- 		if (sighup_received)
-- 		{
-+ 
-+ 		if (sighup_received) {
-  			dlog(LOG_INFO, 3, "sig hup received.\n");
- -			reload_config();
- +			reload_config(LOG_INFO);
-  			sighup_received = 0;
-  		}
-  
--@@ -552,11 +552,11 @@ stop_adverts(void)
-+@@ -545,11 +545,11 @@ void stop_adverts(void)
-  	}
-  }
-  
-@@ -32,9 +32,9 @@
- -	flog(LOG_INFO, "attempting to reread config file");
- +	flog(loglevel, "attempting to reread config file");
-  
-- 	iface=IfaceList;
-- 	while(iface)
--@@ -626,7 +626,7 @@ void reload_config(void)
-+ 	iface = IfaceList;
-+ 	while (iface) {
-+@@ -614,7 +614,7 @@ void reload_config(void)
-  	config_interface();
-  	kickoff_adverts();
-  
-@@ -42,10 +42,10 @@
- +	flog(loglevel, "resuming normal operation");
-  }
-  
-- void
-+ void sighup_handler(int sig)
- --- a/radvd.h
- +++ b/radvd.h
--@@ -185,7 +185,7 @@ int yylex(void);
-+@@ -186,7 +186,7 @@ int yylex(void);
-  
-  /* radvd.c */
-  int check_ip6_forwarding(void);
-@@ -56,7 +56,7 @@
-  /* timer.c */
- --- a/send.c
- +++ b/send.c
--@@ -154,7 +154,7 @@ send_ra(struct Interface *iface, struct
-+@@ -143,7 +143,7 @@ int send_ra(struct Interface *iface, str
-  			 * reload_config() will kick off new timers anyway.  This avoids
-  			 * timer list corruption.
-  			 */
-diff --git a/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch b/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch
-new file mode 100644
-index 0000000..3f22f76
---- /dev/null
-+++ b/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch
-@@ -0,0 +1,78 @@
-+diff --git a/device-linux.c b/device-linux.c
-+index bbf508d..054937e 100644
-+--- a/device-linux.c
-++++ b/device-linux.c
-+@@ -141,7 +141,13 @@ int setup_linklocal_addr(struct Interface *iface)
-+ 		}
-+ 	}
-+ 
-+-	flog(LOG_ERR, "no linklocal address configured for %s", iface->Name);
-++	if (iface->IgnoreIfMissing)
-++		dlog(LOG_DEBUG, 4, "no linklocal address configured for %s", iface->Name);
-++	else
-++		flog(LOG_ERR, "no linklocal address configured for %s", iface->Name);
-++
-++	iface->if_index = 0;
-++
-+ 	fclose(fp);
-+ 	return (-1);
-+ }
-+diff --git a/gram.y b/gram.y
-+index 9b453a1..3239848 100644
-+--- a/gram.y
-++++ b/gram.y
-+@@ -176,19 +176,33 @@ ifacedef	: ifacehead '{' ifaceparams  '}' ';'
-+ 					flog(LOG_ERR, "interface %s does not exist", iface->Name);
-+ 					ABORT;
-+ 				}
-++
-++				iface->HasFailed = 1;
-+ 			}
-+-			if (update_device_info(iface) < 0)
-++			if (update_device_info(iface) < 0) {
-+ 				if (!iface->IgnoreIfMissing)
-+-				ABORT;
-+-			if (check_iface(iface) < 0)
-++					ABORT;
-++
-++				iface->HasFailed = 1;
-++			}
-++			if (check_iface(iface) < 0) {
-+ 				if (!iface->IgnoreIfMissing)
-+-				ABORT;
-+-			if (setup_linklocal_addr(iface) < 0)
-++					ABORT;
-++
-++				iface->HasFailed = 1;
-++			}
-++			if (setup_linklocal_addr(iface) < 0) {
-+ 				if (!iface->IgnoreIfMissing)
-+-				ABORT;
-+-			if (setup_allrouters_membership(iface) < 0)
-++					ABORT;
-++
-++				iface->HasFailed = 1;
-++			}
-++			if (setup_allrouters_membership(iface) < 0) {
-+ 				if (!iface->IgnoreIfMissing)
-+-				ABORT;
-++					ABORT;
-++
-++				iface->HasFailed = 1;
-++			}
-+ 
-+ 			dlog(LOG_DEBUG, 4, "interface definition for %s is ok", iface->Name);
-+ 
-+diff --git a/send.c b/send.c
-+index 0d7ed5b..d6a3da2 100644
-+--- a/send.c
-++++ b/send.c
-+@@ -124,7 +124,7 @@ int send_ra(struct Interface *iface, struct in6_addr *dest)
-+ 	update_device_info(iface);
-+ 
-+ 	/* First we need to check that the interface hasn't been removed or deactivated */
-+-	if (check_device(iface) < 0) {
-++	if (check_device(iface) < 0 || (iface->if_index == 0 && setup_linklocal_addr(iface) < 0)) {
-+ 		if (iface->IgnoreIfMissing)	/* a bit more quiet warning message.. */
-+ 			dlog(LOG_DEBUG, 4, "interface %s does not exist, ignoring the interface", iface->Name);
-+ 		else {
diff --git a/patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch b/patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch
deleted file mode 100644
index dd6fd5a52..000000000
--- a/patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sun, 12 Jan 2014 00:44:29 +0100
-Subject: haveged: start directly after the root partition has been mounted
-
-diff --git a/utils/haveged/files/haveged.init b/utils/haveged/files/haveged.init
-index 129d951..2c5be1d 100644
---- a/utils/haveged/files/haveged.init
-+++ b/utils/haveged/files/haveged.init
-@@ -1,7 +1,7 @@
- #!/bin/sh /etc/rc.common
- # Copyright (C) 2012 OpenWrt.org
- 
--START=98
-+START=11
- 
- HAVEGED_THRESHOLD=1024
- HAVEGED_DCACHE=32
-- 
GitLab