From ff363a45695e5828f26fd547018f7e00deb5e334 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 17 Dec 2014 19:19:17 +0100 Subject: convert dietnet patch to addon. should only be used with care --- target/linux/config/Config.in.addons | 7 +- target/linux/config/Config.in.network | 15 +- target/linux/patches/3.10.53/patch-dietnet | 254 ++++++++++++++++++++++++ target/linux/patches/3.10.53/tcp-fastopen.patch | 254 ------------------------ target/linux/patches/3.12.33/patch-dietnet | 254 ++++++++++++++++++++++++ target/linux/patches/3.12.33/tcp-fastopen.patch | 254 ------------------------ target/linux/patches/3.14.26/patch-dietnet | 253 +++++++++++++++++++++++ target/linux/patches/3.14.26/tcp-fastopen.patch | 253 ----------------------- 8 files changed, 775 insertions(+), 769 deletions(-) create mode 100644 target/linux/patches/3.10.53/patch-dietnet delete mode 100644 target/linux/patches/3.10.53/tcp-fastopen.patch create mode 100644 target/linux/patches/3.12.33/patch-dietnet delete mode 100644 target/linux/patches/3.12.33/tcp-fastopen.patch create mode 100644 target/linux/patches/3.14.26/patch-dietnet delete mode 100644 target/linux/patches/3.14.26/tcp-fastopen.patch (limited to 'target') diff --git a/target/linux/config/Config.in.addons b/target/linux/config/Config.in.addons index bdc2f4e78..1ea6b7315 100644 --- a/target/linux/config/Config.in.addons +++ b/target/linux/config/Config.in.addons @@ -15,5 +15,10 @@ config ADK_KERNEL_ADDON_MPTCP config ADK_KERNEL_ADDON_FBLOGO boolean - depends on ADK_KERNEL_VERSION_3_15 depends on ADK_KERNEL_VERSION_3_14 + +config ADK_KERNEL_ADDON_DIETNET + boolean + depends on ADK_KERNEL_VERSION_3_14 + depends on ADK_KERNEL_VERSION_3_12 + depends on ADK_KERNEL_VERSION_3_10 diff --git a/target/linux/config/Config.in.network b/target/linux/config/Config.in.network index 761fce117..6e20a190e 100644 --- a/target/linux/config/Config.in.network +++ b/target/linux/config/Config.in.network @@ -4,8 +4,15 @@ config ADK_KERNEL_IP_FIB_HASH boolean default y +config ADK_DISABLE_TCP_FASTOPEN + prompt "Disable TCP Fastopen" + boolean + select ADK_KERNEL_ADDON_DIETNET + default n + config ADK_KERNEL_SYN_COOKIES - boolean "IP: TCP syncookie support" + prompt "IP: TCP syncookie support" + boolean default n config ADK_KERNEL_IP_PNP_BOOTP @@ -40,12 +47,6 @@ config ADK_KERNEL_LLC tristate default n -config ADK_KERNEL_TCP_FASTOPEN - prompt "Enable TCP Fastopen" - select ADK_KERNEL_CRYPTO - select ADK_KERNEL_CRYPTO_AES - boolean - default n config ADK_KERNEL_IP_MULTICAST prompt "Enable IP Multicasting" diff --git a/target/linux/patches/3.10.53/patch-dietnet b/target/linux/patches/3.10.53/patch-dietnet new file mode 100644 index 000000000..c0bddbc4f --- /dev/null +++ b/target/linux/patches/3.10.53/patch-dietnet @@ -0,0 +1,254 @@ +https://lkml.org/lkml/2014/5/5/674 +Andi Kleen + +diff -Nur linux-3.10.40.orig/include/linux/tcp.h linux-3.10.40/include/linux/tcp.h +--- linux-3.10.40.orig/include/linux/tcp.h 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/include/linux/tcp.h 2014-05-30 15:41:44.000000000 +0200 +@@ -357,6 +357,9 @@ + return (struct tcp_timewait_sock *)sk; + } + ++extern void tcp_sock_destruct(struct sock *sk); ++ ++#ifdef CONFIG_TCP_FASTOPEN + static inline bool tcp_passive_fastopen(const struct sock *sk) + { + return (sk->sk_state == TCP_SYN_RECV && +@@ -368,8 +371,6 @@ + return foc->len != -1; + } + +-extern void tcp_sock_destruct(struct sock *sk); +- + static inline int fastopen_init_queue(struct sock *sk, int backlog) + { + struct request_sock_queue *queue = +@@ -389,4 +390,13 @@ + return 0; + } + ++#else ++static inline bool tcp_passive_fastopen(const struct sock *sk) ++{ return false; } ++static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) ++{ return false; } ++static inline int fastopen_init_queue(struct sock *sk, int backlog) ++{ return 0; } ++#endif ++ + #endif /* _LINUX_TCP_H */ +diff -Nur linux-3.10.40.orig/include/net/request_sock.h linux-3.10.40/include/net/request_sock.h +--- linux-3.10.40.orig/include/net/request_sock.h 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/include/net/request_sock.h 2014-05-30 15:41:44.000000000 +0200 +@@ -167,8 +167,14 @@ + + extern void __reqsk_queue_destroy(struct request_sock_queue *queue); + extern void reqsk_queue_destroy(struct request_sock_queue *queue); ++#ifdef CONFIG_TCP_FASTOPEN + extern void reqsk_fastopen_remove(struct sock *sk, + struct request_sock *req, bool reset); ++#else ++static inline void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, ++ bool reset) {} ++#endif ++ + + static inline struct request_sock * + reqsk_queue_yank_acceptq(struct request_sock_queue *queue) +diff -Nur linux-3.10.40.orig/include/net/tcp.h linux-3.10.40/include/net/tcp.h +--- linux-3.10.40.orig/include/net/tcp.h 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/include/net/tcp.h 2014-05-30 15:41:44.000000000 +0200 +@@ -257,7 +257,11 @@ + extern int sysctl_tcp_retries2; + extern int sysctl_tcp_orphan_retries; + extern int sysctl_tcp_syncookies; ++#ifdef CONFIG_TCP_FASTOPEN + extern int sysctl_tcp_fastopen; ++#else ++#define sysctl_tcp_fastopen 0 ++#endif + extern int sysctl_tcp_retrans_collapse; + extern int sysctl_tcp_stdurg; + extern int sysctl_tcp_rfc1337; +@@ -1311,7 +1315,12 @@ + size_t size; + int copied; /* queued in tcp_connect() */ + }; ++ ++#ifdef CONFIG_TCP_FASTOPEN + void tcp_free_fastopen_req(struct tcp_sock *tp); ++#else ++static inline void tcp_free_fastopen_req(struct tcp_sock *tp) {} ++#endif + + extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; + int tcp_fastopen_reset_cipher(void *key, unsigned int len); +diff -Nur linux-3.10.40.orig/net/Kconfig linux-3.10.40/net/Kconfig +--- linux-3.10.40.orig/net/Kconfig 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/Kconfig 2014-05-30 15:41:44.000000000 +0200 +@@ -52,8 +52,8 @@ + + config INET + bool "TCP/IP networking" +- select CRYPTO +- select CRYPTO_AES ++ select CRYPTO if TCP_FASTOPEN ++ select CRYPTO_AES if TCP_FASTOPEN + ---help--- + These are the protocols used on the Internet and on most local + Ethernets. It is highly recommended to say Y here (this will enlarge +diff -Nur linux-3.10.40.orig/net/core/request_sock.c linux-3.10.40/net/core/request_sock.c +--- linux-3.10.40.orig/net/core/request_sock.c 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/core/request_sock.c 2014-05-30 15:41:44.000000000 +0200 +@@ -131,6 +131,7 @@ + kfree(lopt); + } + ++#ifdef CONFIG_TCP_FASTOPEN + /* + * This function is called to set a Fast Open socket's "fastopen_rsk" field + * to NULL when a TFO socket no longer needs to access the request_sock. +@@ -223,3 +224,4 @@ + sock_put(lsk); + return; + } ++#endif +diff -Nur linux-3.10.40.orig/net/ipv4/Kconfig linux-3.10.40/net/ipv4/Kconfig +--- linux-3.10.40.orig/net/ipv4/Kconfig 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/ipv4/Kconfig 2014-05-30 15:41:44.000000000 +0200 +@@ -328,6 +328,10 @@ + the notion of a secure tunnel for IPSEC and then use routing protocol + on top. + ++config TCP_FASTOPEN ++ bool "Enable TCP fastopen" ++ default n ++ + config INET_AH + tristate "IP: AH transformation" + select XFRM_ALGO +diff -Nur linux-3.10.40.orig/net/ipv4/Makefile linux-3.10.40/net/ipv4/Makefile +--- linux-3.10.40.orig/net/ipv4/Makefile 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/ipv4/Makefile 2014-05-30 16:58:49.000000000 +0200 +@@ -7,7 +7,7 @@ + ip_output.o ip_sockglue.o inet_hashtables.o \ + inet_timewait_sock.o inet_connection_sock.o \ + tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ +- tcp_minisocks.o tcp_cong.o tcp_metrics.o tcp_fastopen.o \ ++ tcp_minisocks.o tcp_cong.o tcp_metrics.o \ + datagram.o raw.o udp.o udplite.o \ + arp.o icmp.o devinet.o af_inet.o igmp.o \ + fib_frontend.o fib_semantics.o fib_trie.o \ +@@ -50,6 +50,7 @@ + obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o + obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o + obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o ++obj-$(CONFIG_TCP_FASTOPEN) += tcp_fastopen.o + obj-$(CONFIG_MEMCG_KMEM) += tcp_memcontrol.o + obj-$(CONFIG_NETLABEL) += cipso_ipv4.o + +diff -Nur linux-3.10.40.orig/net/ipv4/sysctl_net_ipv4.c linux-3.10.40/net/ipv4/sysctl_net_ipv4.c +--- linux-3.10.40.orig/net/ipv4/sysctl_net_ipv4.c 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/ipv4/sysctl_net_ipv4.c 2014-05-30 17:00:16.000000000 +0200 +@@ -236,6 +236,7 @@ + return 0; + } + ++#ifdef CONFIG_TCP_FASTOPEN + static int proc_tcp_fastopen_key(ctl_table *ctl, int write, void __user *buffer, + size_t *lenp, loff_t *ppos) + { +@@ -276,6 +277,7 @@ + kfree(tbl.data); + return ret; + } ++#endif + + static struct ctl_table ipv4_table[] = { + { +@@ -425,6 +427,7 @@ + .proc_handler = proc_dointvec + }, + #endif ++#ifdef CONFIG_TCP_FASTOPEN + { + .procname = "tcp_fastopen", + .data = &sysctl_tcp_fastopen, +@@ -438,6 +441,7 @@ + .maxlen = ((TCP_FASTOPEN_KEY_LENGTH * 2) + 10), + .proc_handler = proc_tcp_fastopen_key, + }, ++#endif + { + .procname = "tcp_tw_recycle", + .data = &tcp_death_row.sysctl_tw_recycle, +diff -Nur linux-3.10.40.orig/net/ipv4/tcp.c linux-3.10.40/net/ipv4/tcp.c +--- linux-3.10.40.orig/net/ipv4/tcp.c 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/ipv4/tcp.c 2014-05-30 15:41:44.000000000 +0200 +@@ -993,6 +993,7 @@ + return tmp; + } + ++#ifdef CONFIG_TCP_FASTOPEN + void tcp_free_fastopen_req(struct tcp_sock *tp) + { + if (tp->fastopen_req != NULL) { +@@ -1026,6 +1027,7 @@ + tcp_free_fastopen_req(tp); + return err; + } ++#endif + + int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, + size_t size) +@@ -1041,6 +1043,7 @@ + lock_sock(sk); + + flags = msg->msg_flags; ++#ifdef CONFIG_TCP_FASTOPEN + if (flags & MSG_FASTOPEN) { + err = tcp_sendmsg_fastopen(sk, msg, &copied_syn, size); + if (err == -EINPROGRESS && copied_syn > 0) +@@ -1049,6 +1052,7 @@ + goto out_err; + offset = copied_syn; + } ++#endif + + timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); + +diff -Nur linux-3.10.40.orig/net/ipv4/tcp_ipv4.c linux-3.10.40/net/ipv4/tcp_ipv4.c +--- linux-3.10.40.orig/net/ipv4/tcp_ipv4.c 2014-05-13 14:00:04.000000000 +0200 ++++ linux-3.10.40/net/ipv4/tcp_ipv4.c 2014-05-30 15:41:44.000000000 +0200 +@@ -1285,6 +1285,7 @@ + }; + #endif + ++#ifdef CONFIG_TCP_FASTOPEN + static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, + struct request_sock *req, + struct tcp_fastopen_cookie *foc, +@@ -1461,6 +1462,23 @@ + WARN_ON(req->sk == NULL); + return 0; + } ++#else ++static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, ++ struct request_sock *req, ++ struct tcp_fastopen_cookie *foc, ++ struct tcp_fastopen_cookie *valid_foc) ++{ ++ return false; ++} ++ ++static int tcp_v4_conn_req_fastopen(struct sock *sk, ++ struct sk_buff *skb, ++ struct sk_buff *skb_synack, ++ struct request_sock *req) ++{ ++ return 0; ++} ++#endif + + int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) + { diff --git a/target/linux/patches/3.10.53/tcp-fastopen.patch b/target/linux/patches/3.10.53/tcp-fastopen.patch deleted file mode 100644 index c0bddbc4f..000000000 --- a/target/linux/patches/3.10.53/tcp-fastopen.patch +++ /dev/null @@ -1,254 +0,0 @@ -https://lkml.org/lkml/2014/5/5/674 -Andi Kleen - -diff -Nur linux-3.10.40.orig/include/linux/tcp.h linux-3.10.40/include/linux/tcp.h ---- linux-3.10.40.orig/include/linux/tcp.h 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/include/linux/tcp.h 2014-05-30 15:41:44.000000000 +0200 -@@ -357,6 +357,9 @@ - return (struct tcp_timewait_sock *)sk; - } - -+extern void tcp_sock_destruct(struct sock *sk); -+ -+#ifdef CONFIG_TCP_FASTOPEN - static inline bool tcp_passive_fastopen(const struct sock *sk) - { - return (sk->sk_state == TCP_SYN_RECV && -@@ -368,8 +371,6 @@ - return foc->len != -1; - } - --extern void tcp_sock_destruct(struct sock *sk); -- - static inline int fastopen_init_queue(struct sock *sk, int backlog) - { - struct request_sock_queue *queue = -@@ -389,4 +390,13 @@ - return 0; - } - -+#else -+static inline bool tcp_passive_fastopen(const struct sock *sk) -+{ return false; } -+static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) -+{ return false; } -+static inline int fastopen_init_queue(struct sock *sk, int backlog) -+{ return 0; } -+#endif -+ - #endif /* _LINUX_TCP_H */ -diff -Nur linux-3.10.40.orig/include/net/request_sock.h linux-3.10.40/include/net/request_sock.h ---- linux-3.10.40.orig/include/net/request_sock.h 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/include/net/request_sock.h 2014-05-30 15:41:44.000000000 +0200 -@@ -167,8 +167,14 @@ - - extern void __reqsk_queue_destroy(struct request_sock_queue *queue); - extern void reqsk_queue_destroy(struct request_sock_queue *queue); -+#ifdef CONFIG_TCP_FASTOPEN - extern void reqsk_fastopen_remove(struct sock *sk, - struct request_sock *req, bool reset); -+#else -+static inline void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, -+ bool reset) {} -+#endif -+ - - static inline struct request_sock * - reqsk_queue_yank_acceptq(struct request_sock_queue *queue) -diff -Nur linux-3.10.40.orig/include/net/tcp.h linux-3.10.40/include/net/tcp.h ---- linux-3.10.40.orig/include/net/tcp.h 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/include/net/tcp.h 2014-05-30 15:41:44.000000000 +0200 -@@ -257,7 +257,11 @@ - extern int sysctl_tcp_retries2; - extern int sysctl_tcp_orphan_retries; - extern int sysctl_tcp_syncookies; -+#ifdef CONFIG_TCP_FASTOPEN - extern int sysctl_tcp_fastopen; -+#else -+#define sysctl_tcp_fastopen 0 -+#endif - extern int sysctl_tcp_retrans_collapse; - extern int sysctl_tcp_stdurg; - extern int sysctl_tcp_rfc1337; -@@ -1311,7 +1315,12 @@ - size_t size; - int copied; /* queued in tcp_connect() */ - }; -+ -+#ifdef CONFIG_TCP_FASTOPEN - void tcp_free_fastopen_req(struct tcp_sock *tp); -+#else -+static inline void tcp_free_fastopen_req(struct tcp_sock *tp) {} -+#endif - - extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; - int tcp_fastopen_reset_cipher(void *key, unsigned int len); -diff -Nur linux-3.10.40.orig/net/Kconfig linux-3.10.40/net/Kconfig ---- linux-3.10.40.orig/net/Kconfig 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/Kconfig 2014-05-30 15:41:44.000000000 +0200 -@@ -52,8 +52,8 @@ - - config INET - bool "TCP/IP networking" -- select CRYPTO -- select CRYPTO_AES -+ select CRYPTO if TCP_FASTOPEN -+ select CRYPTO_AES if TCP_FASTOPEN - ---help--- - These are the protocols used on the Internet and on most local - Ethernets. It is highly recommended to say Y here (this will enlarge -diff -Nur linux-3.10.40.orig/net/core/request_sock.c linux-3.10.40/net/core/request_sock.c ---- linux-3.10.40.orig/net/core/request_sock.c 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/core/request_sock.c 2014-05-30 15:41:44.000000000 +0200 -@@ -131,6 +131,7 @@ - kfree(lopt); - } - -+#ifdef CONFIG_TCP_FASTOPEN - /* - * This function is called to set a Fast Open socket's "fastopen_rsk" field - * to NULL when a TFO socket no longer needs to access the request_sock. -@@ -223,3 +224,4 @@ - sock_put(lsk); - return; - } -+#endif -diff -Nur linux-3.10.40.orig/net/ipv4/Kconfig linux-3.10.40/net/ipv4/Kconfig ---- linux-3.10.40.orig/net/ipv4/Kconfig 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/ipv4/Kconfig 2014-05-30 15:41:44.000000000 +0200 -@@ -328,6 +328,10 @@ - the notion of a secure tunnel for IPSEC and then use routing protocol - on top. - -+config TCP_FASTOPEN -+ bool "Enable TCP fastopen" -+ default n -+ - config INET_AH - tristate "IP: AH transformation" - select XFRM_ALGO -diff -Nur linux-3.10.40.orig/net/ipv4/Makefile linux-3.10.40/net/ipv4/Makefile ---- linux-3.10.40.orig/net/ipv4/Makefile 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/ipv4/Makefile 2014-05-30 16:58:49.000000000 +0200 -@@ -7,7 +7,7 @@ - ip_output.o ip_sockglue.o inet_hashtables.o \ - inet_timewait_sock.o inet_connection_sock.o \ - tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ -- tcp_minisocks.o tcp_cong.o tcp_metrics.o tcp_fastopen.o \ -+ tcp_minisocks.o tcp_cong.o tcp_metrics.o \ - datagram.o raw.o udp.o udplite.o \ - arp.o icmp.o devinet.o af_inet.o igmp.o \ - fib_frontend.o fib_semantics.o fib_trie.o \ -@@ -50,6 +50,7 @@ - obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o - obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o - obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o -+obj-$(CONFIG_TCP_FASTOPEN) += tcp_fastopen.o - obj-$(CONFIG_MEMCG_KMEM) += tcp_memcontrol.o - obj-$(CONFIG_NETLABEL) += cipso_ipv4.o - -diff -Nur linux-3.10.40.orig/net/ipv4/sysctl_net_ipv4.c linux-3.10.40/net/ipv4/sysctl_net_ipv4.c ---- linux-3.10.40.orig/net/ipv4/sysctl_net_ipv4.c 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/ipv4/sysctl_net_ipv4.c 2014-05-30 17:00:16.000000000 +0200 -@@ -236,6 +236,7 @@ - return 0; - } - -+#ifdef CONFIG_TCP_FASTOPEN - static int proc_tcp_fastopen_key(ctl_table *ctl, int write, void __user *buffer, - size_t *lenp, loff_t *ppos) - { -@@ -276,6 +277,7 @@ - kfree(tbl.data); - return ret; - } -+#endif - - static struct ctl_table ipv4_table[] = { - { -@@ -425,6 +427,7 @@ - .proc_handler = proc_dointvec - }, - #endif -+#ifdef CONFIG_TCP_FASTOPEN - { - .procname = "tcp_fastopen", - .data = &sysctl_tcp_fastopen, -@@ -438,6 +441,7 @@ - .maxlen = ((TCP_FASTOPEN_KEY_LENGTH * 2) + 10), - .proc_handler = proc_tcp_fastopen_key, - }, -+#endif - { - .procname = "tcp_tw_recycle", - .data = &tcp_death_row.sysctl_tw_recycle, -diff -Nur linux-3.10.40.orig/net/ipv4/tcp.c linux-3.10.40/net/ipv4/tcp.c ---- linux-3.10.40.orig/net/ipv4/tcp.c 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/ipv4/tcp.c 2014-05-30 15:41:44.000000000 +0200 -@@ -993,6 +993,7 @@ - return tmp; - } - -+#ifdef CONFIG_TCP_FASTOPEN - void tcp_free_fastopen_req(struct tcp_sock *tp) - { - if (tp->fastopen_req != NULL) { -@@ -1026,6 +1027,7 @@ - tcp_free_fastopen_req(tp); - return err; - } -+#endif - - int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, - size_t size) -@@ -1041,6 +1043,7 @@ - lock_sock(sk); - - flags = msg->msg_flags; -+#ifdef CONFIG_TCP_FASTOPEN - if (flags & MSG_FASTOPEN) { - err = tcp_sendmsg_fastopen(sk, msg, &copied_syn, size); - if (err == -EINPROGRESS && copied_syn > 0) -@@ -1049,6 +1052,7 @@ - goto out_err; - offset = copied_syn; - } -+#endif - - timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); - -diff -Nur linux-3.10.40.orig/net/ipv4/tcp_ipv4.c linux-3.10.40/net/ipv4/tcp_ipv4.c ---- linux-3.10.40.orig/net/ipv4/tcp_ipv4.c 2014-05-13 14:00:04.000000000 +0200 -+++ linux-3.10.40/net/ipv4/tcp_ipv4.c 2014-05-30 15:41:44.000000000 +0200 -@@ -1285,6 +1285,7 @@ - }; - #endif - -+#ifdef CONFIG_TCP_FASTOPEN - static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, - struct request_sock *req, - struct tcp_fastopen_cookie *foc, -@@ -1461,6 +1462,23 @@ - WARN_ON(req->sk == NULL); - return 0; - } -+#else -+static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, -+ struct request_sock *req, -+ struct tcp_fastopen_cookie *foc, -+ struct tcp_fastopen_cookie *valid_foc) -+{ -+ return false; -+} -+ -+static int tcp_v4_conn_req_fastopen(struct sock *sk, -+ struct sk_buff *skb, -+ struct sk_buff *skb_synack, -+ struct request_sock *req) -+{ -+ return 0; -+} -+#endif - - int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) - { diff --git a/target/linux/patches/3.12.33/patch-dietnet b/target/linux/patches/3.12.33/patch-dietnet new file mode 100644 index 000000000..c1ff7209c --- /dev/null +++ b/target/linux/patches/3.12.33/patch-dietnet @@ -0,0 +1,254 @@ +https://lkml.org/lkml/2014/5/5/674 +Andi Kleen + +diff -Nur linux-3.12.20.orig/include/linux/tcp.h linux-3.12.20/include/linux/tcp.h +--- linux-3.12.20.orig/include/linux/tcp.h 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/include/linux/tcp.h 2014-05-30 14:41:11.000000000 +0200 +@@ -356,6 +356,9 @@ + return (struct tcp_timewait_sock *)sk; + } + ++extern void tcp_sock_destruct(struct sock *sk); ++ ++#ifdef CONFIG_TCP_FASTOPEN + static inline bool tcp_passive_fastopen(const struct sock *sk) + { + return (sk->sk_state == TCP_SYN_RECV && +@@ -367,8 +370,6 @@ + return foc->len != -1; + } + +-extern void tcp_sock_destruct(struct sock *sk); +- + static inline int fastopen_init_queue(struct sock *sk, int backlog) + { + struct request_sock_queue *queue = +@@ -388,4 +389,13 @@ + return 0; + } + ++#else ++static inline bool tcp_passive_fastopen(const struct sock *sk) ++{ return false; } ++static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) ++{ return false; } ++static inline int fastopen_init_queue(struct sock *sk, int backlog) ++{ return 0; } ++#endif ++ + #endif /* _LINUX_TCP_H */ +diff -Nur linux-3.12.20.orig/include/net/request_sock.h linux-3.12.20/include/net/request_sock.h +--- linux-3.12.20.orig/include/net/request_sock.h 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/include/net/request_sock.h 2014-05-30 14:42:55.000000000 +0200 +@@ -167,8 +167,14 @@ + + extern void __reqsk_queue_destroy(struct request_sock_queue *queue); + extern void reqsk_queue_destroy(struct request_sock_queue *queue); ++#ifdef CONFIG_TCP_FASTOPEN + extern void reqsk_fastopen_remove(struct sock *sk, + struct request_sock *req, bool reset); ++#else ++static inline void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, ++ bool reset) {} ++#endif ++ + + static inline struct request_sock * + reqsk_queue_yank_acceptq(struct request_sock_queue *queue) +diff -Nur linux-3.12.20.orig/include/net/tcp.h linux-3.12.20/include/net/tcp.h +--- linux-3.12.20.orig/include/net/tcp.h 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/include/net/tcp.h 2014-05-30 14:41:11.000000000 +0200 +@@ -250,7 +250,11 @@ + extern int sysctl_tcp_retries2; + extern int sysctl_tcp_orphan_retries; + extern int sysctl_tcp_syncookies; ++#ifdef CONFIG_TCP_FASTOPEN + extern int sysctl_tcp_fastopen; ++#else ++#define sysctl_tcp_fastopen 0 ++#endif + extern int sysctl_tcp_retrans_collapse; + extern int sysctl_tcp_stdurg; + extern int sysctl_tcp_rfc1337; +@@ -1325,7 +1329,12 @@ + size_t size; + int copied; /* queued in tcp_connect() */ + }; ++ ++#ifdef CONFIG_TCP_FASTOPEN + void tcp_free_fastopen_req(struct tcp_sock *tp); ++#else ++static inline void tcp_free_fastopen_req(struct tcp_sock *tp) {} ++#endif + + extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; + int tcp_fastopen_reset_cipher(void *key, unsigned int len); +diff -Nur linux-3.12.20.orig/net/Kconfig linux-3.12.20/net/Kconfig +--- linux-3.12.20.orig/net/Kconfig 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/Kconfig 2014-05-30 14:41:11.000000000 +0200 +@@ -53,8 +53,8 @@ + + config INET + bool "TCP/IP networking" +- select CRYPTO +- select CRYPTO_AES ++ select CRYPTO if TCP_FASTOPEN ++ select CRYPTO_AES if TCP_FASTOPEN + ---help--- + These are the protocols used on the Internet and on most local + Ethernets. It is highly recommended to say Y here (this will enlarge +diff -Nur linux-3.12.20.orig/net/core/request_sock.c linux-3.12.20/net/core/request_sock.c +--- linux-3.12.20.orig/net/core/request_sock.c 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/core/request_sock.c 2014-05-30 14:41:11.000000000 +0200 +@@ -131,6 +131,7 @@ + kfree(lopt); + } + ++#ifdef CONFIG_TCP_FASTOPEN + /* + * This function is called to set a Fast Open socket's "fastopen_rsk" field + * to NULL when a TFO socket no longer needs to access the request_sock. +@@ -223,3 +224,4 @@ + sock_put(lsk); + return; + } ++#endif +diff -Nur linux-3.12.20.orig/net/ipv4/Kconfig linux-3.12.20/net/ipv4/Kconfig +--- linux-3.12.20.orig/net/ipv4/Kconfig 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/ipv4/Kconfig 2014-05-30 14:41:11.000000000 +0200 +@@ -307,6 +307,10 @@ + the notion of a secure tunnel for IPSEC and then use routing protocol + on top. + ++config TCP_FASTOPEN ++ bool "Enable TCP fastopen" ++ default n ++ + config INET_AH + tristate "IP: AH transformation" + select XFRM_ALGO +diff -Nur linux-3.12.20.orig/net/ipv4/Makefile linux-3.12.20/net/ipv4/Makefile +--- linux-3.12.20.orig/net/ipv4/Makefile 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/ipv4/Makefile 2014-05-30 14:41:11.000000000 +0200 +@@ -7,7 +7,7 @@ + ip_output.o ip_sockglue.o inet_hashtables.o \ + inet_timewait_sock.o inet_connection_sock.o \ + tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ +- tcp_minisocks.o tcp_cong.o tcp_metrics.o tcp_fastopen.o \ ++ tcp_minisocks.o tcp_cong.o tcp_metrics.o \ + tcp_offload.o datagram.o raw.o udp.o udplite.o \ + udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \ + fib_frontend.o fib_semantics.o fib_trie.o \ +@@ -51,6 +51,7 @@ + obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o + obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o + obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o ++obj-$(CONFIG_TCP_FASTOPEN) += tcp_fastopen.o + obj-$(CONFIG_MEMCG_KMEM) += tcp_memcontrol.o + obj-$(CONFIG_NETLABEL) += cipso_ipv4.o + +diff -Nur linux-3.12.20.orig/net/ipv4/sysctl_net_ipv4.c linux-3.12.20/net/ipv4/sysctl_net_ipv4.c +--- linux-3.12.20.orig/net/ipv4/sysctl_net_ipv4.c 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/ipv4/sysctl_net_ipv4.c 2014-05-30 14:41:11.000000000 +0200 +@@ -236,6 +236,7 @@ + return 0; + } + ++#ifdef CONFIG_TCP_FASTOPEN + static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write, + void __user *buffer, size_t *lenp, + loff_t *ppos) +@@ -277,6 +278,7 @@ + kfree(tbl.data); + return ret; + } ++#endif + + static struct ctl_table ipv4_table[] = { + { +@@ -426,6 +428,7 @@ + .proc_handler = proc_dointvec + }, + #endif ++#ifdef CONFIG_TCP_FASTOPEN + { + .procname = "tcp_fastopen", + .data = &sysctl_tcp_fastopen, +@@ -439,6 +442,7 @@ + .maxlen = ((TCP_FASTOPEN_KEY_LENGTH * 2) + 10), + .proc_handler = proc_tcp_fastopen_key, + }, ++#endif + { + .procname = "tcp_tw_recycle", + .data = &tcp_death_row.sysctl_tw_recycle, +diff -Nur linux-3.12.20.orig/net/ipv4/tcp.c linux-3.12.20/net/ipv4/tcp.c +--- linux-3.12.20.orig/net/ipv4/tcp.c 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/ipv4/tcp.c 2014-05-30 14:41:11.000000000 +0200 +@@ -992,6 +992,7 @@ + return tmp; + } + ++#ifdef CONFIG_TCP_FASTOPEN + void tcp_free_fastopen_req(struct tcp_sock *tp) + { + if (tp->fastopen_req != NULL) { +@@ -1025,6 +1026,7 @@ + tcp_free_fastopen_req(tp); + return err; + } ++#endif + + int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, + size_t size) +@@ -1040,6 +1042,7 @@ + lock_sock(sk); + + flags = msg->msg_flags; ++#ifdef CONFIG_TCP_FASTOPEN + if (flags & MSG_FASTOPEN) { + err = tcp_sendmsg_fastopen(sk, msg, &copied_syn, size); + if (err == -EINPROGRESS && copied_syn > 0) +@@ -1048,6 +1051,7 @@ + goto out_err; + offset = copied_syn; + } ++#endif + + timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); + +diff -Nur linux-3.12.20.orig/net/ipv4/tcp_ipv4.c linux-3.12.20/net/ipv4/tcp_ipv4.c +--- linux-3.12.20.orig/net/ipv4/tcp_ipv4.c 2014-05-15 09:56:19.000000000 +0200 ++++ linux-3.12.20/net/ipv4/tcp_ipv4.c 2014-05-30 14:41:11.000000000 +0200 +@@ -1259,6 +1259,7 @@ + }; + #endif + ++#ifdef CONFIG_TCP_FASTOPEN + static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, + struct request_sock *req, + struct tcp_fastopen_cookie *foc, +@@ -1439,6 +1440,23 @@ + WARN_ON(req->sk == NULL); + return 0; + } ++#else ++static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, ++ struct request_sock *req, ++ struct tcp_fastopen_cookie *foc, ++ struct tcp_fastopen_cookie *valid_foc) ++{ ++ return false; ++} ++ ++static int tcp_v4_conn_req_fastopen(struct sock *sk, ++ struct sk_buff *skb, ++ struct sk_buff *skb_synack, ++ struct request_sock *req) ++{ ++ return 0; ++} ++#endif + + int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) + { diff --git a/target/linux/patches/3.12.33/tcp-fastopen.patch b/target/linux/patches/3.12.33/tcp-fastopen.patch deleted file mode 100644 index c1ff7209c..000000000 --- a/target/linux/patches/3.12.33/tcp-fastopen.patch +++ /dev/null @@ -1,254 +0,0 @@ -https://lkml.org/lkml/2014/5/5/674 -Andi Kleen - -diff -Nur linux-3.12.20.orig/include/linux/tcp.h linux-3.12.20/include/linux/tcp.h ---- linux-3.12.20.orig/include/linux/tcp.h 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/include/linux/tcp.h 2014-05-30 14:41:11.000000000 +0200 -@@ -356,6 +356,9 @@ - return (struct tcp_timewait_sock *)sk; - } - -+extern void tcp_sock_destruct(struct sock *sk); -+ -+#ifdef CONFIG_TCP_FASTOPEN - static inline bool tcp_passive_fastopen(const struct sock *sk) - { - return (sk->sk_state == TCP_SYN_RECV && -@@ -367,8 +370,6 @@ - return foc->len != -1; - } - --extern void tcp_sock_destruct(struct sock *sk); -- - static inline int fastopen_init_queue(struct sock *sk, int backlog) - { - struct request_sock_queue *queue = -@@ -388,4 +389,13 @@ - return 0; - } - -+#else -+static inline bool tcp_passive_fastopen(const struct sock *sk) -+{ return false; } -+static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) -+{ return false; } -+static inline int fastopen_init_queue(struct sock *sk, int backlog) -+{ return 0; } -+#endif -+ - #endif /* _LINUX_TCP_H */ -diff -Nur linux-3.12.20.orig/include/net/request_sock.h linux-3.12.20/include/net/request_sock.h ---- linux-3.12.20.orig/include/net/request_sock.h 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/include/net/request_sock.h 2014-05-30 14:42:55.000000000 +0200 -@@ -167,8 +167,14 @@ - - extern void __reqsk_queue_destroy(struct request_sock_queue *queue); - extern void reqsk_queue_destroy(struct request_sock_queue *queue); -+#ifdef CONFIG_TCP_FASTOPEN - extern void reqsk_fastopen_remove(struct sock *sk, - struct request_sock *req, bool reset); -+#else -+static inline void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, -+ bool reset) {} -+#endif -+ - - static inline struct request_sock * - reqsk_queue_yank_acceptq(struct request_sock_queue *queue) -diff -Nur linux-3.12.20.orig/include/net/tcp.h linux-3.12.20/include/net/tcp.h ---- linux-3.12.20.orig/include/net/tcp.h 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/include/net/tcp.h 2014-05-30 14:41:11.000000000 +0200 -@@ -250,7 +250,11 @@ - extern int sysctl_tcp_retries2; - extern int sysctl_tcp_orphan_retries; - extern int sysctl_tcp_syncookies; -+#ifdef CONFIG_TCP_FASTOPEN - extern int sysctl_tcp_fastopen; -+#else -+#define sysctl_tcp_fastopen 0 -+#endif - extern int sysctl_tcp_retrans_collapse; - extern int sysctl_tcp_stdurg; - extern int sysctl_tcp_rfc1337; -@@ -1325,7 +1329,12 @@ - size_t size; - int copied; /* queued in tcp_connect() */ - }; -+ -+#ifdef CONFIG_TCP_FASTOPEN - void tcp_free_fastopen_req(struct tcp_sock *tp); -+#else -+static inline void tcp_free_fastopen_req(struct tcp_sock *tp) {} -+#endif - - extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; - int tcp_fastopen_reset_cipher(void *key, unsigned int len); -diff -Nur linux-3.12.20.orig/net/Kconfig linux-3.12.20/net/Kconfig ---- linux-3.12.20.orig/net/Kconfig 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/Kconfig 2014-05-30 14:41:11.000000000 +0200 -@@ -53,8 +53,8 @@ - - config INET - bool "TCP/IP networking" -- select CRYPTO -- select CRYPTO_AES -+ select CRYPTO if TCP_FASTOPEN -+ select CRYPTO_AES if TCP_FASTOPEN - ---help--- - These are the protocols used on the Internet and on most local - Ethernets. It is highly recommended to say Y here (this will enlarge -diff -Nur linux-3.12.20.orig/net/core/request_sock.c linux-3.12.20/net/core/request_sock.c ---- linux-3.12.20.orig/net/core/request_sock.c 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/core/request_sock.c 2014-05-30 14:41:11.000000000 +0200 -@@ -131,6 +131,7 @@ - kfree(lopt); - } - -+#ifdef CONFIG_TCP_FASTOPEN - /* - * This function is called to set a Fast Open socket's "fastopen_rsk" field - * to NULL when a TFO socket no longer needs to access the request_sock. -@@ -223,3 +224,4 @@ - sock_put(lsk); - return; - } -+#endif -diff -Nur linux-3.12.20.orig/net/ipv4/Kconfig linux-3.12.20/net/ipv4/Kconfig ---- linux-3.12.20.orig/net/ipv4/Kconfig 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/ipv4/Kconfig 2014-05-30 14:41:11.000000000 +0200 -@@ -307,6 +307,10 @@ - the notion of a secure tunnel for IPSEC and then use routing protocol - on top. - -+config TCP_FASTOPEN -+ bool "Enable TCP fastopen" -+ default n -+ - config INET_AH - tristate "IP: AH transformation" - select XFRM_ALGO -diff -Nur linux-3.12.20.orig/net/ipv4/Makefile linux-3.12.20/net/ipv4/Makefile ---- linux-3.12.20.orig/net/ipv4/Makefile 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/ipv4/Makefile 2014-05-30 14:41:11.000000000 +0200 -@@ -7,7 +7,7 @@ - ip_output.o ip_sockglue.o inet_hashtables.o \ - inet_timewait_sock.o inet_connection_sock.o \ - tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ -- tcp_minisocks.o tcp_cong.o tcp_metrics.o tcp_fastopen.o \ -+ tcp_minisocks.o tcp_cong.o tcp_metrics.o \ - tcp_offload.o datagram.o raw.o udp.o udplite.o \ - udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \ - fib_frontend.o fib_semantics.o fib_trie.o \ -@@ -51,6 +51,7 @@ - obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o - obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o - obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o -+obj-$(CONFIG_TCP_FASTOPEN) += tcp_fastopen.o - obj-$(CONFIG_MEMCG_KMEM) += tcp_memcontrol.o - obj-$(CONFIG_NETLABEL) += cipso_ipv4.o - -diff -Nur linux-3.12.20.orig/net/ipv4/sysctl_net_ipv4.c linux-3.12.20/net/ipv4/sysctl_net_ipv4.c ---- linux-3.12.20.orig/net/ipv4/sysctl_net_ipv4.c 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/ipv4/sysctl_net_ipv4.c 2014-05-30 14:41:11.000000000 +0200 -@@ -236,6 +236,7 @@ - return 0; - } - -+#ifdef CONFIG_TCP_FASTOPEN - static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, - loff_t *ppos) -@@ -277,6 +278,7 @@ - kfree(tbl.data); - return ret; - } -+#endif - - static struct ctl_table ipv4_table[] = { - { -@@ -426,6 +428,7 @@ - .proc_handler = proc_dointvec - }, - #endif -+#ifdef CONFIG_TCP_FASTOPEN - { - .procname = "tcp_fastopen", - .data = &sysctl_tcp_fastopen, -@@ -439,6 +442,7 @@ - .maxlen = ((TCP_FASTOPEN_KEY_LENGTH * 2) + 10), - .proc_handler = proc_tcp_fastopen_key, - }, -+#endif - { - .procname = "tcp_tw_recycle", - .data = &tcp_death_row.sysctl_tw_recycle, -diff -Nur linux-3.12.20.orig/net/ipv4/tcp.c linux-3.12.20/net/ipv4/tcp.c ---- linux-3.12.20.orig/net/ipv4/tcp.c 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/ipv4/tcp.c 2014-05-30 14:41:11.000000000 +0200 -@@ -992,6 +992,7 @@ - return tmp; - } - -+#ifdef CONFIG_TCP_FASTOPEN - void tcp_free_fastopen_req(struct tcp_sock *tp) - { - if (tp->fastopen_req != NULL) { -@@ -1025,6 +1026,7 @@ - tcp_free_fastopen_req(tp); - return err; - } -+#endif - - int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, - size_t size) -@@ -1040,6 +1042,7 @@ - lock_sock(sk); - - flags = msg->msg_flags; -+#ifdef CONFIG_TCP_FASTOPEN - if (flags & MSG_FASTOPEN) { - err = tcp_sendmsg_fastopen(sk, msg, &copied_syn, size); - if (err == -EINPROGRESS && copied_syn > 0) -@@ -1048,6 +1051,7 @@ - goto out_err; - offset = copied_syn; - } -+#endif - - timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); - -diff -Nur linux-3.12.20.orig/net/ipv4/tcp_ipv4.c linux-3.12.20/net/ipv4/tcp_ipv4.c ---- linux-3.12.20.orig/net/ipv4/tcp_ipv4.c 2014-05-15 09:56:19.000000000 +0200 -+++ linux-3.12.20/net/ipv4/tcp_ipv4.c 2014-05-30 14:41:11.000000000 +0200 -@@ -1259,6 +1259,7 @@ - }; - #endif - -+#ifdef CONFIG_TCP_FASTOPEN - static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, - struct request_sock *req, - struct tcp_fastopen_cookie *foc, -@@ -1439,6 +1440,23 @@ - WARN_ON(req->sk == NULL); - return 0; - } -+#else -+static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, -+ struct request_sock *req, -+ struct tcp_fastopen_cookie *foc, -+ struct tcp_fastopen_cookie *valid_foc) -+{ -+ return false; -+} -+ -+static int tcp_v4_conn_req_fastopen(struct sock *sk, -+ struct sk_buff *skb, -+ struct sk_buff *skb_synack, -+ struct request_sock *req) -+{ -+ return 0; -+} -+#endif - - int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) - { diff --git a/target/linux/patches/3.14.26/patch-dietnet b/target/linux/patches/3.14.26/patch-dietnet new file mode 100644 index 000000000..43e685972 --- /dev/null +++ b/target/linux/patches/3.14.26/patch-dietnet @@ -0,0 +1,253 @@ +https://lkml.org/lkml/2014/5/5/674 +Andi Kleen + +diff -Nur linux-3.14.4.orig/include/linux/tcp.h linux-3.14.4/include/linux/tcp.h +--- linux-3.14.4.orig/include/linux/tcp.h 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/include/linux/tcp.h 2014-05-29 21:30:07.000000000 +0200 +@@ -359,6 +359,9 @@ + return (struct tcp_timewait_sock *)sk; + } + ++extern void tcp_sock_destruct(struct sock *sk); ++ ++#ifdef CONFIG_TCP_FASTOPEN + static inline bool tcp_passive_fastopen(const struct sock *sk) + { + return (sk->sk_state == TCP_SYN_RECV && +@@ -370,8 +373,6 @@ + return foc->len != -1; + } + +-extern void tcp_sock_destruct(struct sock *sk); +- + static inline int fastopen_init_queue(struct sock *sk, int backlog) + { + struct request_sock_queue *queue = +@@ -391,4 +392,13 @@ + return 0; + } + ++#else ++static inline bool tcp_passive_fastopen(const struct sock *sk) ++{ return false; } ++static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) ++{ return false; } ++static inline int fastopen_init_queue(struct sock *sk, int backlog) ++{ return 0; } ++#endif ++ + #endif /* _LINUX_TCP_H */ +diff -Nur linux-3.14.4.orig/include/net/request_sock.h linux-3.14.4/include/net/request_sock.h +--- linux-3.14.4.orig/include/net/request_sock.h 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/include/net/request_sock.h 2014-05-29 21:30:07.000000000 +0200 +@@ -168,8 +168,13 @@ + + void __reqsk_queue_destroy(struct request_sock_queue *queue); + void reqsk_queue_destroy(struct request_sock_queue *queue); ++#ifdef CONFIG_TCP_FASTOPEN + void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, + bool reset); ++#else ++static inline void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, ++ bool reset) {} ++#endif + + static inline struct request_sock * + reqsk_queue_yank_acceptq(struct request_sock_queue *queue) +diff -Nur linux-3.14.4.orig/include/net/tcp.h linux-3.14.4/include/net/tcp.h +--- linux-3.14.4.orig/include/net/tcp.h 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/include/net/tcp.h 2014-05-29 21:30:07.000000000 +0200 +@@ -250,7 +250,11 @@ + extern int sysctl_tcp_retries2; + extern int sysctl_tcp_orphan_retries; + extern int sysctl_tcp_syncookies; ++#ifdef CONFIG_TCP_FASTOPEN + extern int sysctl_tcp_fastopen; ++#else ++#define sysctl_tcp_fastopen 0 ++#endif + extern int sysctl_tcp_retrans_collapse; + extern int sysctl_tcp_stdurg; + extern int sysctl_tcp_rfc1337; +@@ -1307,7 +1311,12 @@ + size_t size; + int copied; /* queued in tcp_connect() */ + }; ++ ++#ifdef CONFIG_TCP_FASTOPEN + void tcp_free_fastopen_req(struct tcp_sock *tp); ++#else ++static inline void tcp_free_fastopen_req(struct tcp_sock *tp) {} ++#endif + + extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; + int tcp_fastopen_reset_cipher(void *key, unsigned int len); +diff -Nur linux-3.14.4.orig/net/Kconfig linux-3.14.4/net/Kconfig +--- linux-3.14.4.orig/net/Kconfig 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/Kconfig 2014-05-29 21:30:07.000000000 +0200 +@@ -53,8 +53,8 @@ + + config INET + bool "TCP/IP networking" +- select CRYPTO +- select CRYPTO_AES ++ select CRYPTO if TCP_FASTOPEN ++ select CRYPTO_AES if TCP_FASTOPEN + ---help--- + These are the protocols used on the Internet and on most local + Ethernets. It is highly recommended to say Y here (this will enlarge +diff -Nur linux-3.14.4.orig/net/core/request_sock.c linux-3.14.4/net/core/request_sock.c +--- linux-3.14.4.orig/net/core/request_sock.c 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/core/request_sock.c 2014-05-29 21:30:07.000000000 +0200 +@@ -131,6 +131,7 @@ + kfree(lopt); + } + ++#ifdef CONFIG_TCP_FASTOPEN + /* + * This function is called to set a Fast Open socket's "fastopen_rsk" field + * to NULL when a TFO socket no longer needs to access the request_sock. +@@ -223,3 +224,4 @@ + sock_put(lsk); + return; + } ++#endif +diff -Nur linux-3.14.4.orig/net/ipv4/Kconfig linux-3.14.4/net/ipv4/Kconfig +--- linux-3.14.4.orig/net/ipv4/Kconfig 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/ipv4/Kconfig 2014-05-29 21:30:07.000000000 +0200 +@@ -307,6 +307,10 @@ + the notion of a secure tunnel for IPSEC and then use routing protocol + on top. + ++config TCP_FASTOPEN ++ bool "Enable TCP fastopen" ++ default n ++ + config INET_AH + tristate "IP: AH transformation" + select XFRM_ALGO +diff -Nur linux-3.14.4.orig/net/ipv4/Makefile linux-3.14.4/net/ipv4/Makefile +--- linux-3.14.4.orig/net/ipv4/Makefile 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/ipv4/Makefile 2014-05-29 21:30:51.000000000 +0200 +@@ -7,7 +7,7 @@ + ip_output.o ip_sockglue.o inet_hashtables.o \ + inet_timewait_sock.o inet_connection_sock.o \ + tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ +- tcp_minisocks.o tcp_cong.o tcp_metrics.o tcp_fastopen.o \ ++ tcp_minisocks.o tcp_cong.o tcp_metrics.o \ + tcp_offload.o datagram.o raw.o udp.o udplite.o \ + udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \ + fib_frontend.o fib_semantics.o fib_trie.o \ +@@ -51,6 +51,7 @@ + obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o + obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o + obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o ++obj-$(CONFIG_TCP_FASTOPEN) += tcp_fastopen.o + obj-$(CONFIG_MEMCG_KMEM) += tcp_memcontrol.o + obj-$(CONFIG_NETLABEL) += cipso_ipv4.o + +diff -Nur linux-3.14.4.orig/net/ipv4/sysctl_net_ipv4.c linux-3.14.4/net/ipv4/sysctl_net_ipv4.c +--- linux-3.14.4.orig/net/ipv4/sysctl_net_ipv4.c 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/ipv4/sysctl_net_ipv4.c 2014-05-29 21:30:07.000000000 +0200 +@@ -200,6 +200,7 @@ + return ret; + } + ++#ifdef CONFIG_TCP_FASTOPEN + static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write, + void __user *buffer, size_t *lenp, + loff_t *ppos) +@@ -246,6 +247,7 @@ + kfree(tbl.data); + return ret; + } ++#endif + + static struct ctl_table ipv4_table[] = { + { +@@ -388,6 +390,7 @@ + .proc_handler = proc_dointvec + }, + #endif ++#ifdef CONFIG_TCP_FASTOPEN + { + .procname = "tcp_fastopen", + .data = &sysctl_tcp_fastopen, +@@ -401,6 +404,7 @@ + .maxlen = ((TCP_FASTOPEN_KEY_LENGTH * 2) + 10), + .proc_handler = proc_tcp_fastopen_key, + }, ++#endif + { + .procname = "tcp_tw_recycle", + .data = &tcp_death_row.sysctl_tw_recycle, +diff -Nur linux-3.14.4.orig/net/ipv4/tcp.c linux-3.14.4/net/ipv4/tcp.c +--- linux-3.14.4.orig/net/ipv4/tcp.c 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/ipv4/tcp.c 2014-05-29 21:30:07.000000000 +0200 +@@ -1036,6 +1036,7 @@ + return tmp; + } + ++#ifdef CONFIG_TCP_FASTOPEN + void tcp_free_fastopen_req(struct tcp_sock *tp) + { + if (tp->fastopen_req != NULL) { +@@ -1069,6 +1070,7 @@ + tcp_free_fastopen_req(tp); + return err; + } ++#endif + + int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, + size_t size) +@@ -1084,6 +1086,7 @@ + lock_sock(sk); + + flags = msg->msg_flags; ++#ifdef CONFIG_TCP_FASTOPEN + if (flags & MSG_FASTOPEN) { + err = tcp_sendmsg_fastopen(sk, msg, &copied_syn, size); + if (err == -EINPROGRESS && copied_syn > 0) +@@ -1092,6 +1095,7 @@ + goto out_err; + offset = copied_syn; + } ++#endif + + timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); + +diff -Nur linux-3.14.4.orig/net/ipv4/tcp_ipv4.c linux-3.14.4/net/ipv4/tcp_ipv4.c +--- linux-3.14.4.orig/net/ipv4/tcp_ipv4.c 2014-05-13 13:33:14.000000000 +0200 ++++ linux-3.14.4/net/ipv4/tcp_ipv4.c 2014-05-29 21:30:07.000000000 +0200 +@@ -1260,6 +1260,7 @@ + }; + #endif + ++#ifdef CONFIG_TCP_FASTOPEN + static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, + struct request_sock *req, + struct tcp_fastopen_cookie *foc, +@@ -1440,6 +1441,23 @@ + WARN_ON(req->sk == NULL); + return 0; + } ++#else ++static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, ++ struct request_sock *req, ++ struct tcp_fastopen_cookie *foc, ++ struct tcp_fastopen_cookie *valid_foc) ++{ ++ return false; ++} ++ ++static int tcp_v4_conn_req_fastopen(struct sock *sk, ++ struct sk_buff *skb, ++ struct sk_buff *skb_synack, ++ struct request_sock *req) ++{ ++ return 0; ++} ++#endif + + int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) + { diff --git a/target/linux/patches/3.14.26/tcp-fastopen.patch b/target/linux/patches/3.14.26/tcp-fastopen.patch deleted file mode 100644 index 43e685972..000000000 --- a/target/linux/patches/3.14.26/tcp-fastopen.patch +++ /dev/null @@ -1,253 +0,0 @@ -https://lkml.org/lkml/2014/5/5/674 -Andi Kleen - -diff -Nur linux-3.14.4.orig/include/linux/tcp.h linux-3.14.4/include/linux/tcp.h ---- linux-3.14.4.orig/include/linux/tcp.h 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/include/linux/tcp.h 2014-05-29 21:30:07.000000000 +0200 -@@ -359,6 +359,9 @@ - return (struct tcp_timewait_sock *)sk; - } - -+extern void tcp_sock_destruct(struct sock *sk); -+ -+#ifdef CONFIG_TCP_FASTOPEN - static inline bool tcp_passive_fastopen(const struct sock *sk) - { - return (sk->sk_state == TCP_SYN_RECV && -@@ -370,8 +373,6 @@ - return foc->len != -1; - } - --extern void tcp_sock_destruct(struct sock *sk); -- - static inline int fastopen_init_queue(struct sock *sk, int backlog) - { - struct request_sock_queue *queue = -@@ -391,4 +392,13 @@ - return 0; - } - -+#else -+static inline bool tcp_passive_fastopen(const struct sock *sk) -+{ return false; } -+static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) -+{ return false; } -+static inline int fastopen_init_queue(struct sock *sk, int backlog) -+{ return 0; } -+#endif -+ - #endif /* _LINUX_TCP_H */ -diff -Nur linux-3.14.4.orig/include/net/request_sock.h linux-3.14.4/include/net/request_sock.h ---- linux-3.14.4.orig/include/net/request_sock.h 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/include/net/request_sock.h 2014-05-29 21:30:07.000000000 +0200 -@@ -168,8 +168,13 @@ - - void __reqsk_queue_destroy(struct request_sock_queue *queue); - void reqsk_queue_destroy(struct request_sock_queue *queue); -+#ifdef CONFIG_TCP_FASTOPEN - void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, - bool reset); -+#else -+static inline void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, -+ bool reset) {} -+#endif - - static inline struct request_sock * - reqsk_queue_yank_acceptq(struct request_sock_queue *queue) -diff -Nur linux-3.14.4.orig/include/net/tcp.h linux-3.14.4/include/net/tcp.h ---- linux-3.14.4.orig/include/net/tcp.h 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/include/net/tcp.h 2014-05-29 21:30:07.000000000 +0200 -@@ -250,7 +250,11 @@ - extern int sysctl_tcp_retries2; - extern int sysctl_tcp_orphan_retries; - extern int sysctl_tcp_syncookies; -+#ifdef CONFIG_TCP_FASTOPEN - extern int sysctl_tcp_fastopen; -+#else -+#define sysctl_tcp_fastopen 0 -+#endif - extern int sysctl_tcp_retrans_collapse; - extern int sysctl_tcp_stdurg; - extern int sysctl_tcp_rfc1337; -@@ -1307,7 +1311,12 @@ - size_t size; - int copied; /* queued in tcp_connect() */ - }; -+ -+#ifdef CONFIG_TCP_FASTOPEN - void tcp_free_fastopen_req(struct tcp_sock *tp); -+#else -+static inline void tcp_free_fastopen_req(struct tcp_sock *tp) {} -+#endif - - extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; - int tcp_fastopen_reset_cipher(void *key, unsigned int len); -diff -Nur linux-3.14.4.orig/net/Kconfig linux-3.14.4/net/Kconfig ---- linux-3.14.4.orig/net/Kconfig 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/Kconfig 2014-05-29 21:30:07.000000000 +0200 -@@ -53,8 +53,8 @@ - - config INET - bool "TCP/IP networking" -- select CRYPTO -- select CRYPTO_AES -+ select CRYPTO if TCP_FASTOPEN -+ select CRYPTO_AES if TCP_FASTOPEN - ---help--- - These are the protocols used on the Internet and on most local - Ethernets. It is highly recommended to say Y here (this will enlarge -diff -Nur linux-3.14.4.orig/net/core/request_sock.c linux-3.14.4/net/core/request_sock.c ---- linux-3.14.4.orig/net/core/request_sock.c 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/core/request_sock.c 2014-05-29 21:30:07.000000000 +0200 -@@ -131,6 +131,7 @@ - kfree(lopt); - } - -+#ifdef CONFIG_TCP_FASTOPEN - /* - * This function is called to set a Fast Open socket's "fastopen_rsk" field - * to NULL when a TFO socket no longer needs to access the request_sock. -@@ -223,3 +224,4 @@ - sock_put(lsk); - return; - } -+#endif -diff -Nur linux-3.14.4.orig/net/ipv4/Kconfig linux-3.14.4/net/ipv4/Kconfig ---- linux-3.14.4.orig/net/ipv4/Kconfig 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/ipv4/Kconfig 2014-05-29 21:30:07.000000000 +0200 -@@ -307,6 +307,10 @@ - the notion of a secure tunnel for IPSEC and then use routing protocol - on top. - -+config TCP_FASTOPEN -+ bool "Enable TCP fastopen" -+ default n -+ - config INET_AH - tristate "IP: AH transformation" - select XFRM_ALGO -diff -Nur linux-3.14.4.orig/net/ipv4/Makefile linux-3.14.4/net/ipv4/Makefile ---- linux-3.14.4.orig/net/ipv4/Makefile 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/ipv4/Makefile 2014-05-29 21:30:51.000000000 +0200 -@@ -7,7 +7,7 @@ - ip_output.o ip_sockglue.o inet_hashtables.o \ - inet_timewait_sock.o inet_connection_sock.o \ - tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ -- tcp_minisocks.o tcp_cong.o tcp_metrics.o tcp_fastopen.o \ -+ tcp_minisocks.o tcp_cong.o tcp_metrics.o \ - tcp_offload.o datagram.o raw.o udp.o udplite.o \ - udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \ - fib_frontend.o fib_semantics.o fib_trie.o \ -@@ -51,6 +51,7 @@ - obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o - obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o - obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o -+obj-$(CONFIG_TCP_FASTOPEN) += tcp_fastopen.o - obj-$(CONFIG_MEMCG_KMEM) += tcp_memcontrol.o - obj-$(CONFIG_NETLABEL) += cipso_ipv4.o - -diff -Nur linux-3.14.4.orig/net/ipv4/sysctl_net_ipv4.c linux-3.14.4/net/ipv4/sysctl_net_ipv4.c ---- linux-3.14.4.orig/net/ipv4/sysctl_net_ipv4.c 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/ipv4/sysctl_net_ipv4.c 2014-05-29 21:30:07.000000000 +0200 -@@ -200,6 +200,7 @@ - return ret; - } - -+#ifdef CONFIG_TCP_FASTOPEN - static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, - loff_t *ppos) -@@ -246,6 +247,7 @@ - kfree(tbl.data); - return ret; - } -+#endif - - static struct ctl_table ipv4_table[] = { - { -@@ -388,6 +390,7 @@ - .proc_handler = proc_dointvec - }, - #endif -+#ifdef CONFIG_TCP_FASTOPEN - { - .procname = "tcp_fastopen", - .data = &sysctl_tcp_fastopen, -@@ -401,6 +404,7 @@ - .maxlen = ((TCP_FASTOPEN_KEY_LENGTH * 2) + 10), - .proc_handler = proc_tcp_fastopen_key, - }, -+#endif - { - .procname = "tcp_tw_recycle", - .data = &tcp_death_row.sysctl_tw_recycle, -diff -Nur linux-3.14.4.orig/net/ipv4/tcp.c linux-3.14.4/net/ipv4/tcp.c ---- linux-3.14.4.orig/net/ipv4/tcp.c 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/ipv4/tcp.c 2014-05-29 21:30:07.000000000 +0200 -@@ -1036,6 +1036,7 @@ - return tmp; - } - -+#ifdef CONFIG_TCP_FASTOPEN - void tcp_free_fastopen_req(struct tcp_sock *tp) - { - if (tp->fastopen_req != NULL) { -@@ -1069,6 +1070,7 @@ - tcp_free_fastopen_req(tp); - return err; - } -+#endif - - int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, - size_t size) -@@ -1084,6 +1086,7 @@ - lock_sock(sk); - - flags = msg->msg_flags; -+#ifdef CONFIG_TCP_FASTOPEN - if (flags & MSG_FASTOPEN) { - err = tcp_sendmsg_fastopen(sk, msg, &copied_syn, size); - if (err == -EINPROGRESS && copied_syn > 0) -@@ -1092,6 +1095,7 @@ - goto out_err; - offset = copied_syn; - } -+#endif - - timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); - -diff -Nur linux-3.14.4.orig/net/ipv4/tcp_ipv4.c linux-3.14.4/net/ipv4/tcp_ipv4.c ---- linux-3.14.4.orig/net/ipv4/tcp_ipv4.c 2014-05-13 13:33:14.000000000 +0200 -+++ linux-3.14.4/net/ipv4/tcp_ipv4.c 2014-05-29 21:30:07.000000000 +0200 -@@ -1260,6 +1260,7 @@ - }; - #endif - -+#ifdef CONFIG_TCP_FASTOPEN - static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, - struct request_sock *req, - struct tcp_fastopen_cookie *foc, -@@ -1440,6 +1441,23 @@ - WARN_ON(req->sk == NULL); - return 0; - } -+#else -+static bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb, -+ struct request_sock *req, -+ struct tcp_fastopen_cookie *foc, -+ struct tcp_fastopen_cookie *valid_foc) -+{ -+ return false; -+} -+ -+static int tcp_v4_conn_req_fastopen(struct sock *sk, -+ struct sk_buff *skb, -+ struct sk_buff *skb_synack, -+ struct request_sock *req) -+{ -+ return 0; -+} -+#endif - - int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) - { -- cgit v1.2.3 From c311fd0e8809b625b424616f490e506c54f2b863 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 18 Dec 2014 23:46:27 +0100 Subject: style cleanup --- target/Makefile | 75 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 34 deletions(-) (limited to 'target') diff --git a/target/Makefile b/target/Makefile index 98c830329..e14f02398 100644 --- a/target/Makefile +++ b/target/Makefile @@ -14,7 +14,7 @@ all: install # .kernelconfig.kernel # 2) get the global and device-specific static kernel config and place it into # .kernelconfig.board -# 3) append ${FS_CMDLINE} to the kernel commandline inside .kernelconfig.board +# 3) append $(FS_CMDLINE) to the kernel commandline inside .kernelconfig.board # 4) merge both together into .kernelconfig.tmp # 5) check if .kernelconfig.tmp differs from the current one # (.kernelconfig) at all, overwriting the current one @@ -25,65 +25,65 @@ ADK_PACKAGE_CRYPTINIT_ROOT:=$(strip $(subst ",, $(ADK_PACKAGE_CRYPTINIT_ROOT))) ADK_PACKAGE_CRYPTINIT_SWAP:=$(strip $(subst ",, $(ADK_PACKAGE_CRYPTINIT_SWAP))) ADK_PACKAGE_CMDLINE:=root=$(ADK_PACKAGE_CRYPTINIT_ROOT) swap=$(ADK_PACKAGE_CRYPTINIT_SWAP) resume=/dev/mapper/swapcrypt -ifeq (${ADK_TARGET_KERNEL_CUSTOMISING},y) +ifeq ($(ADK_TARGET_KERNEL_CUSTOMISING),y) config-prepare: $(ADK_TOPDIR)/.config - @PATH='$(HOST_PATH)' sed -n '/^ADK_KERNEL/s//CONFIG/p' ${ADK_TOPDIR}/.config \ - >${BUILD_DIR}/.kernelconfig.kernel - @if [ -f ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} ];then \ - cat ${ADK_TOPDIR}/target/linux/kernel.config \ - ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} > ${BUILD_DIR}/.kernelconfig.board; \ + @PATH='$(HOST_PATH)' sed -n '/^ADK_KERNEL/s//CONFIG/p' $(ADK_TOPDIR)/.config \ + >$(BUILD_DIR)/.kernelconfig.kernel + @if [ -f $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) ];then \ + cat $(ADK_TOPDIR)/target/linux/kernel.config \ + $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) > $(BUILD_DIR)/.kernelconfig.board; \ else \ echo "no miniconfig found for target system"; \ exit 1; \ fi ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K),y) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*BOOTPARAM_STRING="\)\(.*\)"#\1\2 ro ${FS_CMDLINE}"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*BOOTPARAM_STRING="\)\(.*\)"#\1\2 ro $(FS_CMDLINE)"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifeq ($(ADK_TARGET_ROOTFS_NFSROOT),) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ro"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ro"#' \ + $(BUILD_DIR)/.kernelconfig.board endif - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${FS_CMDLINE}"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 $(FS_CMDLINE)"#' \ + $(BUILD_DIR)/.kernelconfig.board ifneq ($(ADK_TARGET_CMDLINE),) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${ADK_TARGET_CMDLINE}"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 $(ADK_TARGET_CMDLINE)"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifeq ($(ADK_TARGET_QEMU_WITH_GRAPHIC),y) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=tty0"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=tty0"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifneq ($(ADK_PACKAGE_CRYPTINIT_ROOT),) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${ADK_PACKAGE_CMDLINE}"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 $(ADK_PACKAGE_CMDLINE)"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifeq ($(ADK_RUNTIME_QUIET_INIT),y) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 rcquiet=1"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 rcquiet=1"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifeq ($(ADK_QUIET_KERNEL),y) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 quiet loglevel=2 vt.global_cursor_default=0"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 quiet loglevel=2 vt.global_cursor_default=0"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifeq ($(ADK_KERNEL_DEBUG_WITH_KGDB),y) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 kgdbwait kgdboc=ttyS0,115200"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 kgdbwait kgdboc=ttyS0,115200"#' \ + $(BUILD_DIR)/.kernelconfig.board endif ifeq ($(ADK_KERNEL_NETCONSOLE),y) - @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 netconsole=@$(ADK_PARAMETER_NETCONSOLE_SRC_IP)/,@$(ADK_PARAMETER_NETCONSOLE_DST_IP)/"#' \ - ${BUILD_DIR}/.kernelconfig.board + @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 netconsole=@$(ADK_PARAMETER_NETCONSOLE_SRC_IP)/,@$(ADK_PARAMETER_NETCONSOLE_DST_IP)/"#' \ + $(BUILD_DIR)/.kernelconfig.board endif - @cd ${BUILD_DIR} && cat .kernelconfig.board .kernelconfig.kernel \ + @cd $(BUILD_DIR) && cat .kernelconfig.board .kernelconfig.kernel \ >.kernelconfig.tmp - @cd ${BUILD_DIR} && cmp -s .kernelconfig.tmp .kernelconfig || \ + @cd $(BUILD_DIR) && cmp -s .kernelconfig.tmp .kernelconfig || \ cp .kernelconfig.tmp .kernelconfig - @-rm -f ${BUILD_DIR}/.kernelconfig.tmp + @-rm -f $(BUILD_DIR)/.kernelconfig.tmp else config-prepare: $(ADK_TOPDIR)/.config - @if [ -f ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} ];then \ - cat ${ADK_TOPDIR}/target/linux/kernel.config \ - ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} > ${BUILD_DIR}/.kernelconfig.board; \ + @if [ -f $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) ];then \ + cat $(ADK_TOPDIR)/target/linux/kernel.config \ + $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) > $(BUILD_DIR)/.kernelconfig.board; \ else \ echo "no miniconfig found for target system"; \ exit 1; \ @@ -100,24 +100,31 @@ clean: $(ADK_TARGET_ARCH)-clean $(ADK_TARGET_ARCH)-imageclean %-clean: $(TRACE) target/$(patsubst %-clean,%,$@)-clean $(MAKE) -C $(patsubst %-clean,%,$@) clean + %-imageclean: $(TRACE) target/$(patsubst %-imageclean,%,$@)-imageclean $(MAKE) -C $(patsubst %-imageclean,%,$@) imageclean + %-prepare: $(TRACE) target/$(patsubst %-prepare,%,$@)-prepare $(MAKE) -C $(patsubst %-prepare,%,$@) prepare + %-imageprepare: $(TRACE) target/$(patsubst %-imageprepare,%,$@)-imageprepare $(MAKE) -C $(patsubst %-imageprepare,%,$@) imageprepare + %-compile: %-prepare $(TRACE) target/$(patsubst %-compile,%,$@)-compile $(MAKE) -C $(patsubst %-compile,%,$@) compile + %-install: %-compile $(TRACE) target/$(patsubst %-install,%,$@)-install $(MAKE) -C $(patsubst %-install,%,$@) install + %-targethelp: $(MAKE) -C $(patsubst %-targethelp,%,$@) targethelp + %-imageinstall: %-imageprepare $(TRACE) target/$(patsubst %-imageinstall,%,$@)-imageinstall $(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall - @echo 'Login as user root with password ${ADK_RUNTIME_PASSWORD} via ssh or console.' + @echo 'Login as user root with password $(ADK_RUNTIME_PASSWORD) via ssh or console.' -- cgit v1.2.3 From 949d8663f2f12c986ef2983b7b307f5ecddf060e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 19 Dec 2014 01:42:49 -0600 Subject: use the new concept of appliances - Sync with Kernel upstream Kconfig - use new feature visible - add a patch for select on choices https://lkml.org/lkml/2011/2/17/379 - rename ADK_LINUX -> ADK_TARGET_ARCH - remove package collection feature - add appliance feature to define a appliance more complete --- target/appliances/000default | 6 ++ target/appliances/kodi | 34 +++++++++++ target/appliances/mpd | 61 ++++++++++++++++++++ target/config/Config.in.abi.choice | 15 ++--- target/config/Config.in.abi.default | 10 ++-- target/config/Config.in.adk | 1 + target/config/Config.in.arm.choice | 2 +- target/config/Config.in.cpu | 38 ++++++------- target/config/Config.in.cris.choice | 2 +- target/config/Config.in.endian.choice | 7 +-- target/config/Config.in.kernelversion.choice | 2 +- target/config/Config.in.libc.choice | 56 +++++++++--------- target/config/Config.in.libc.default | 8 +-- target/config/Config.in.target | 49 ++++++++-------- target/config/Config.in.toolchain | 85 ++++++++++++++-------------- target/config/Config.in.x86.choice | 2 +- target/linux/config/Config.in.debug | 2 +- target/linux/config/Config.in.kernel | 8 +-- target/linux/config/Config.in.kvm | 2 +- target/linux/config/Config.in.leds | 1 - target/xtensa/Config.in | 9 --- 21 files changed, 242 insertions(+), 158 deletions(-) create mode 100644 target/appliances/000default create mode 100644 target/appliances/kodi create mode 100644 target/appliances/mpd delete mode 100644 target/xtensa/Config.in (limited to 'target') diff --git a/target/appliances/000default b/target/appliances/000default new file mode 100644 index 000000000..9c8aac7d0 --- /dev/null +++ b/target/appliances/000default @@ -0,0 +1,6 @@ +config ADK_APPLIANCE_NEW + prompt "create a new appliance" + boolean + help + Create a new appliance from scratch. + diff --git a/target/appliances/kodi b/target/appliances/kodi new file mode 100644 index 000000000..7b1c61c53 --- /dev/null +++ b/target/appliances/kodi @@ -0,0 +1,34 @@ +config ADK_APPLIANCE_KODI + prompt "kodi multimedia appliance" + boolean + select ADK_TARGET_ARCH_ARM + select ADK_TARGET_SYSTEM_RASPBERRY_PI + select ADK_TARGET_LIB_GLIBC + select ADK_PACKAGE_GLIBC + select ADK_PACKAGE_GLIBC_GCONV + select ADK_PACKAGE_KODI + select ADK_PACKAGE_KODI_WITH_SMB + select ADK_PACKAGE_KODI_WITH_NFS + select ADK_PACKAGE_KODI_WITH_SSH + select ADK_PACKAGE_KODI_WITH_CEC + select ADK_PACKAGE_KODI_WITH_RTMP + select ADK_PACKAGE_KODI_WITH_BLURAY + select ADK_PACKAGE_HTOP + select ADK_PACKAGE_DROPBEAR + select ADK_PACKAGE_DROPBEAR_WITH_UTMP + select ADK_PACKAGE_SCREEN + select ADK_PACKAGE_VIM + select ADK_PACKAGE_E2FSCK + select ADK_PACKAGE_ALSA_UTILS + select ADK_PACKAGE_ALSA_UTILS_WITH_ALSAMIXER + select BUSYBOX_NTPD + select ADK_QUIET_KERNEL + select ADK_RUNTIME_QUIET_INIT + select ADK_RUNTIME_START_SERVICES + select ADK_RUNTIME_START_DROPBEAR +