diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-09-12 23:09:09 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-09-12 23:09:09 +0200 |
commit | c9eaf71fe0e4da8ffa9487832d60743a43586b56 (patch) | |
tree | a1734afd1ce53ad9e69eb1a2d344df2210daf65b /packages/linux-kernel/patches | |
parent | 0b69d007405cacb680fc8a6130f2e4f9765ca977 (diff) | |
download | vyos-build-c9eaf71fe0e4da8ffa9487832d60743a43586b56.tar.gz vyos-build-c9eaf71fe0e4da8ffa9487832d60743a43586b56.zip |
Revert "Kernel: T2843: upgrade Kernel to v5.8.5"
This reverts commit 78c43c2078e292ac9b53d2d6a41a47466d283914.
Unfortunately we must revert the Kernel upgrade as there are two problematic
issues. One which is the break of ABI functionality with parted [1] and second
the internal cryptop API [2] which removed required literals for the build of
Intel QAT acceleration.
In the two weeks running 5.8 we still learned a lot - we experienced a
performance improvement of ~30% when doing NAT @ > 10GBit/s and also utilizing
the build in updated drivers for Intel NICs and WireGuard.
We are looking forward to the release of this years LTS kernel and we hope to
ship this in the final 1.3 release.
1: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.8.y&id=692d062655
2: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.5.y&id=d63007eb95
Diffstat (limited to 'packages/linux-kernel/patches')
5 files changed, 195 insertions, 217 deletions
diff --git a/packages/linux-kernel/patches/intel-qat/0001-API-adjustments.patch b/packages/linux-kernel/patches/intel-qat/0001-API-adjustments.patch deleted file mode 100644 index 3bd600c5..00000000 --- a/packages/linux-kernel/patches/intel-qat/0001-API-adjustments.patch +++ /dev/null @@ -1,105 +0,0 @@ -From eaede51c4cff21f5d52982838d86c0c5918caa30 Mon Sep 17 00:00:00 2001 -From: Christian Poessinger <christian@poessinger.com> -Date: Sun, 30 Aug 2020 15:29:26 +0000 -Subject: [PATCH] API: adjust to Linux Kernel 5.8 API - -Change source code to be compatible with the latest Linux 5.8 Kernel API. -The change is not backwards compatible with the old API. - -Conditional checks like - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -should be added - ---- - .../drivers/crypto/qat/qat_common/adf_aer.c | 2 +- - .../drivers/crypto/qat/qat_common/adf_clock.c | 18 +++++++++--------- - .../linux/kernel_space/OsalCryptoInterface.c | 1 - - 3 files changed, 10 insertions(+), 11 deletions(-) - -diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c -index 080f6de..e06667d 100644 ---- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c -+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c -@@ -303,7 +303,7 @@ static pci_ers_result_t adf_slot_reset(struct pci_dev *pdev) - pr_err("QAT: Can't find acceleration device\n"); - return PCI_ERS_RESULT_DISCONNECT; - } -- pci_cleanup_aer_uncorrect_error_status(pdev); -+ pci_aer_clear_nonfatal_status(pdev); - if (adf_dev_aer_schedule_reset(accel_dev, ADF_DEV_RESET_SYNC)) - return PCI_ERS_RESULT_DISCONNECT; - -diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c -index 8785f67..be3d9b8 100644 ---- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c -+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c -@@ -113,7 +113,7 @@ int adf_clock_debugfs_add(struct adf_accel_dev *accel_dev) - #endif - EXPORT_SYMBOL_GPL(adf_clock_debugfs_add); - --static inline s64 timespec_to_us(const struct timespec *ts) -+static inline s64 timespec_to_us(const struct timespec64 *ts) - { - return ((s64)ts->tv_sec * USEC_PER_SEC + - (ts->tv_nsec + NSEC_PER_USEC / 2) / NSEC_PER_USEC); -@@ -129,10 +129,10 @@ static inline s64 timespec_to_us(const struct timespec *ts) - static int measure_clock(struct adf_accel_dev *accel_dev, - u32 *frequency) - { -- struct timespec ts1; -- struct timespec ts2; -- struct timespec ts3; -- struct timespec ts4; -+ struct timespec64 ts1; -+ struct timespec64 ts2; -+ struct timespec64 ts3; -+ struct timespec64 ts4; - u64 delta_us = 0; - u64 timestamp1 = 0; - u64 timestamp2 = 0; -@@ -143,13 +143,13 @@ static int measure_clock(struct adf_accel_dev *accel_dev, - return -EIO; - - do { -- getnstimeofday(&ts1); -+ ktime_get_real_ts64(&ts1); - if (adf_get_fw_timestamp(accel_dev, ×tamp1)) { - dev_err(&GET_DEV(accel_dev), - "Failed to get fw timestamp\n"); - return -EIO; - } -- getnstimeofday(&ts2); -+ ktime_get_real_ts64(&ts2); - delta_us = timespec_to_us(&ts2) - timespec_to_us(&ts1); - } while (delta_us > MEASURE_CLOCK_DELTA_THRESHOLD && - ++tries < MEASURE_CLOCK_RETRIES); -@@ -162,13 +162,13 @@ static int measure_clock(struct adf_accel_dev *accel_dev, - - tries = 0; - do { -- getnstimeofday(&ts3); -+ ktime_get_real_ts64(&ts3); - if (adf_get_fw_timestamp(accel_dev, ×tamp2)) { - dev_err(&GET_DEV(accel_dev), - "Failed to get fw timestamp\n"); - return -EIO; - } -- getnstimeofday(&ts4); -+ ktime_get_real_ts64(&ts4); - delta_us = timespec_to_us(&ts4) - timespec_to_us(&ts3); - } while (delta_us > MEASURE_CLOCK_DELTA_THRESHOLD && - ++tries < MEASURE_CLOCK_RETRIES); -diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c -index 96d75cc..1f05e90 100644 ---- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c -+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c -@@ -66,7 +66,6 @@ - - #include "Osal.h" - #include <linux/crypto.h> --#include <linux/cryptohash.h> - #include <linux/version.h> - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - #include <crypto/internal/hash.h> --- -2.20.1 diff --git a/packages/linux-kernel/patches/kernel/0001-VyOS-Add-linkstate-IP-device-attribute.patch b/packages/linux-kernel/patches/kernel/0001-VyOS-Add-linkstate-IP-device-attribute.patch index bfe63008..c70a9f13 100644 --- a/packages/linux-kernel/patches/kernel/0001-VyOS-Add-linkstate-IP-device-attribute.patch +++ b/packages/linux-kernel/patches/kernel/0001-VyOS-Add-linkstate-IP-device-attribute.patch @@ -8,151 +8,157 @@ Backport of earlier Vyatta patch. (cherry picked from commit 7c5a851086686be14ae937c80d6cee34814dbefc) --- - Documentation/networking/ip-sysctl.rst | 11 +++++++++++ + Documentation/networking/ip-sysctl.txt | 13 +++++++++++++ include/linux/inetdevice.h | 1 + include/linux/ipv6.h | 1 + include/uapi/linux/ip.h | 1 + include/uapi/linux/ipv6.h | 1 + - net/ipv4/devinet.c | 1 + - net/ipv6/addrconf.c | 8 ++++++++ - net/ipv6/route.c | 10 ++++++++++ - 8 files changed, 34 insertions(+) + net/ipv4/devinet.c | 2 ++ + net/ipv6/addrconf.c | 9 +++++++++ + net/ipv6/route.c | 12 ++++++++++++ + 8 files changed, 40 insertions(+) -diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst -index 837d51f9e1fa..49610520d858 100644 ---- a/Documentation/networking/ip-sysctl.rst -+++ b/Documentation/networking/ip-sysctl.rst -@@ -1423,6 +1423,17 @@ rp_filter - INTEGER +diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt +index 7eb9366422f5..b99d54a313a0 100644 +--- a/Documentation/networking/ip-sysctl.txt ++++ b/Documentation/networking/ip-sysctl.txt +@@ -1177,6 +1177,19 @@ rp_filter - INTEGER Default value is 0. Note that some distributions enable it in startup scripts. +link_filter - INTEGER -+ 0 - Allow packets to be received for the address on this interface -+ even if interface is disabled or no carrier. ++ 0 - Allow packets to be received for the address on this interface ++ even if interface is disabled or no carrier. ++ + 1 - Ignore packets received if interface associated with the incoming -+ address is down. ++ address is down. ++ + 2 - Ignore packets received if interface associated with the incoming -+ address is down or has no carrier. ++ address is down or has no carrier. + + Default value is 0. Note that some distributions enable it + in startup scripts. + arp_filter - BOOLEAN - - 1 - Allows you to have multiple network interfaces on the same - subnet, and have the ARPs for each interface be answered + 1 - Allows you to have multiple network interfaces on the same + subnet, and have the ARPs for each interface be answered diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h -index 3515ca64e638..bfb49b5913e7 100644 +index a64f21a97369..4014dd852bae 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -133,6 +133,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) #define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE) #define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) #define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) -+#define IN_DEV_LINKFILTER(in_dev) IN_DEV_MAXCONF((in_dev), LINKFILTER) ++#define IN_DEV_LINKFILTER(in_dev) IN_DEV_MAXCONF((in_dev), LINKFILTER) struct in_ifaddr { struct hlist_node hash; diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h -index 2cb445a8fc9e..b80c4652fc55 100644 +index 8415bf1a9776..80a0ada19c9a 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h -@@ -77,6 +77,7 @@ struct ipv6_devconf { - __s32 rpl_seg_enabled; +@@ -76,6 +76,7 @@ struct ipv6_devconf { + __s32 ndisc_tclass; struct ctl_table_header *sysctl_header; -+ __s32 link_filter; ++ __s32 link_filter; /* VyOS */ }; struct ipv6_params { diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h -index e42d13b55cf3..8f5291976f04 100644 +index e42d13b55cf3..baf8e77c201b 100644 --- a/include/uapi/linux/ip.h +++ b/include/uapi/linux/ip.h @@ -169,6 +169,7 @@ enum IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST, IPV4_DEVCONF_DROP_GRATUITOUS_ARP, IPV4_DEVCONF_BC_FORWARDING, -+ IPV4_DEVCONF_LINKFILTER, ++ IPV4_DEVCONF_LINKFILTER, /* VyOS only */ __IPV4_DEVCONF_MAX }; diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h -index 13e8751bf24a..2ea26a70bda2 100644 +index 9c0f4a92bcff..619edd130cfd 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h -@@ -189,6 +189,7 @@ enum { +@@ -187,6 +187,7 @@ enum { + DEVCONF_DISABLE_POLICY, DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN, DEVCONF_NDISC_TCLASS, - DEVCONF_RPL_SEG_ENABLED, + DEVCONF_LINK_FILTER, DEVCONF_MAX }; diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c -index 123a6d39438f..1deb400805b0 100644 +index a08d682ba676..17949eb57a5b 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c -@@ -2547,6 +2547,7 @@ static struct devinet_sysctl_table { +@@ -2318,6 +2318,8 @@ static struct devinet_sysctl_table { "route_localnet"), DEVINET_SYSCTL_FLUSHING_ENTRY(DROP_UNICAST_IN_L2_MULTICAST, "drop_unicast_in_l2_multicast"), ++ /* VyOS */ + DEVINET_SYSCTL_RW_ENTRY(LINKFILTER, "link_filter"), }, }; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index 840bfdb3d7bd..262b5fe31f65 100644 +index 627cd24b7c0d..8c49eac27fd0 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c -@@ -5487,6 +5487,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, +@@ -5240,6 +5240,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, + array[DEVCONF_ADDR_GEN_MODE] = cnf->addr_gen_mode; array[DEVCONF_DISABLE_POLICY] = cnf->disable_policy; array[DEVCONF_NDISC_TCLASS] = cnf->ndisc_tclass; - array[DEVCONF_RPL_SEG_ENABLED] = cnf->rpl_seg_enabled; + array[DEVCONF_LINK_FILTER] = cnf->link_filter; } static inline size_t inet6_ifla6_size(void) -@@ -6867,6 +6868,13 @@ static const struct ctl_table addrconf_sysctl[] = { - .mode = 0644, - .proc_handler = proc_dointvec, +@@ -6561,6 +6562,14 @@ static const struct ctl_table addrconf_sysctl[] = { + .mode = 0644, + .proc_handler = addrconf_sysctl_disable_policy, }, ++ /* VyOS */ + { + .procname = "link_filter", + .data = &ipv6_devconf.link_filter, + .maxlen = sizeof(int), + .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, ++ .proc_handler = proc_dointvec ++ }, { - /* sentinel */ - } + .procname = "ndisc_tclass", + .data = &ipv6_devconf.ndisc_tclass, diff --git a/net/ipv6/route.c b/net/ipv6/route.c -index 4c36bd0c7930..ece562db0d34 100644 +index dad35cd48807..1a2439c6a257 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c -@@ -686,6 +686,14 @@ static inline void rt6_probe(struct fib6_nh *fib6_nh) +@@ -595,6 +595,15 @@ static inline int rt6_check_dev(struct fib6_info *rt, int oif) + return 0; } - #endif -+static inline int rt6_link_filter(const struct fib6_nh *nh) ++static inline int rt6_link_filter(struct fib6_info *rt) +{ -+ const struct net_device *dev = nh->fib_nh_dev; ++ const struct net_device *dev = rt->fib6_nh.nh_dev; + int linkf = __in6_dev_get(dev)->cnf.link_filter; ++ + return (linkf && !netif_running(dev)) + || (linkf > 1 && !netif_carrier_ok(dev)); +} + - /* - * Default Router Selection (RFC 2461 6.3.6) - */ -@@ -727,6 +735,8 @@ static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif, - + static inline enum rt6_nud_state rt6_check_neigh(struct fib6_info *rt) + { + enum rt6_nud_state ret = RT6_NUD_FAIL_HARD; +@@ -634,6 +643,9 @@ static int rt6_score_route(struct fib6_info *rt, int oif, int strict) + m = rt6_check_dev(rt, oif); if (!m && (strict & RT6_LOOKUP_F_IFACE)) return RT6_NUD_FAIL_HARD; -+ if (rt6_link_filter(nh)) ++ if (rt6_link_filter(rt)) + return -1; ++ #ifdef CONFIG_IPV6_ROUTER_PREF - m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(fib6_flags)) << 2; + m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->fib6_flags)) << 2; #endif -- 2.20.1 diff --git a/packages/linux-kernel/patches/kernel/0002-VyOS-add-inotify-support-for-stackable-filesystems-o.patch b/packages/linux-kernel/patches/kernel/0002-VyOS-add-inotify-support-for-stackable-filesystems-o.patch index cb9bb735..bf28f313 100644 --- a/packages/linux-kernel/patches/kernel/0002-VyOS-add-inotify-support-for-stackable-filesystems-o.patch +++ b/packages/linux-kernel/patches/kernel/0002-VyOS-add-inotify-support-for-stackable-filesystems-o.patch @@ -22,20 +22,20 @@ Bug #425 http://bugzilla.vyos.net/show_bug.cgi?id=425 --- fs/notify/inotify/Kconfig | 9 +++ - fs/notify/inotify/inotify_user.c | 113 ++++++++++++++++++++++++++++++- - fs/overlayfs/super.c | 27 ++++++-- + fs/notify/inotify/inotify_user.c | 112 ++++++++++++++++++++++++++++++- + fs/overlayfs/super.c | 24 ++++++- include/linux/inotify.h | 28 ++++++++ - 4 files changed, 172 insertions(+), 5 deletions(-) + 4 files changed, 170 insertions(+), 3 deletions(-) diff --git a/fs/notify/inotify/Kconfig b/fs/notify/inotify/Kconfig -index 1cc8be25df7e..2994e5f7fadb 100644 +index b981fc0c8379..b0b208bd584b 100644 --- a/fs/notify/inotify/Kconfig +++ b/fs/notify/inotify/Kconfig @@ -15,3 +15,12 @@ config INOTIFY_USER - For more information, see <file:Documentation/filesystems/inotify.rst> + For more information, see <file:Documentation/filesystems/inotify.txt> If unsure, say Y. -+ ++ +config INOTIFY_STACKFS + bool "Inotify support for stackable filesystem" + select INOTIFY_USER @@ -45,10 +45,10 @@ index 1cc8be25df7e..2994e5f7fadb 100644 + + If unsure, say N. diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c -index f88bbcc9efeb..cf57910c715f 100644 +index 97a51690338e..0595de27e1b5 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c -@@ -15,6 +15,7 @@ +@@ -24,6 +24,7 @@ #include <linux/file.h> #include <linux/fs.h> /* struct inode */ @@ -56,7 +56,7 @@ index f88bbcc9efeb..cf57910c715f 100644 #include <linux/fsnotify_backend.h> #include <linux/idr.h> #include <linux/init.h> /* fs_initcall */ -@@ -75,6 +76,94 @@ struct ctl_table inotify_table[] = { +@@ -85,6 +86,94 @@ struct ctl_table inotify_table[] = { }; #endif /* CONFIG_SYSCTL */ @@ -151,27 +151,26 @@ index f88bbcc9efeb..cf57910c715f 100644 static inline __u32 inotify_arg_to_mask(u32 arg) { __u32 mask; -@@ -332,7 +421,7 @@ static const struct file_operations inotify_fops = { +@@ -342,7 +431,7 @@ static const struct file_operations inotify_fops = { /* * find_inode - resolve a user-given path to a specific inode */ --static int inotify_find_inode(const char __user *dirname, struct path *path, -+static inline int __inotify_find_inode(const char __user *dirname, struct path *path, - unsigned int flags, __u64 mask) +-static int inotify_find_inode(const char __user *dirname, struct path *path, unsigned flags) ++static inline int __inotify_find_inode(const char __user *dirname, struct path *path, unsigned flags) { int error; -@@ -354,6 +443,28 @@ static int inotify_find_inode(const char __user *dirname, struct path *path, + +@@ -356,6 +445,27 @@ static int inotify_find_inode(const char __user *dirname, struct path *path, uns return error; } -+static int inotify_find_inode(const char __user *dirname, struct path *path, -+ unsigned int flags, __u64 mask) ++static int inotify_find_inode(const char __user *dirname, struct path *path, unsigned flags) +{ + int ret; + struct path tpath; + struct inotify_stackfs *fse; + -+ ret = __inotify_find_inode(dirname, &tpath, flags, mask); ++ ret = __inotify_find_inode(dirname, &tpath, flags); + if (ret) + return ret; + fse = inotify_get_stackfs(&tpath); @@ -190,10 +189,10 @@ index f88bbcc9efeb..cf57910c715f 100644 struct inotify_inode_mark *i_mark) { diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c -index 4b38141c2985..2cee303b3d1d 100644 +index 127df4a85c8a..d6d41a328f9d 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c -@@ -15,6 +15,7 @@ +@@ -18,6 +18,7 @@ #include <linux/seq_file.h> #include <linux/posix_acl_xattr.h> #include <linux/exportfs.h> @@ -201,7 +200,7 @@ index 4b38141c2985..2cee303b3d1d 100644 #include "overlayfs.h" MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>"); -@@ -1959,6 +1960,18 @@ static void ovl_inode_init_once(void *foo) +@@ -1703,6 +1704,18 @@ static void ovl_inode_init_once(void *foo) inode_init_once(&oi->vfs_inode); } @@ -220,26 +219,20 @@ index 4b38141c2985..2cee303b3d1d 100644 static int __init ovl_init(void) { int err; -@@ -1974,18 +1987,24 @@ static int __init ovl_init(void) - err = ovl_aio_request_cache_init(); - if (!err) { - err = register_filesystem(&ovl_fs_type); -- if (!err) -- return 0; -+ if (err) -+ goto err; -+ err = inotify_register_stackfs(&ovl_inotify); -+ if (err) -+ goto err; -+ return 0; +@@ -1717,13 +1730,21 @@ static int __init ovl_init(void) + + err = register_filesystem(&ovl_fs_type); + if (err) +- kmem_cache_destroy(ovl_inode_cachep); ++ goto err; ++ err = inotify_register_stackfs(&ovl_inotify); ++ if (err) ++ goto err; ++ return err; -- ovl_aio_request_cache_destroy(); - } +err: - kmem_cache_destroy(ovl_inode_cachep); -- ++ kmem_cache_destroy(ovl_inode_cachep); + unregister_filesystem(&ovl_fs_type); -+ ovl_aio_request_cache_destroy(); return err; } @@ -249,6 +242,14 @@ index 4b38141c2985..2cee303b3d1d 100644 unregister_filesystem(&ovl_fs_type); /* +@@ -1732,7 +1753,6 @@ static void __exit ovl_exit(void) + */ + rcu_barrier(); + kmem_cache_destroy(ovl_inode_cachep); +- + } + + module_init(ovl_init); diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 6a24905f6e1e..248b1441ba83 100644 --- a/include/linux/inotify.h diff --git a/packages/linux-kernel/patches/kernel/0003-RFC-builddeb-add-linux-tools-package-with-perf.patch b/packages/linux-kernel/patches/kernel/0003-RFC-builddeb-add-linux-tools-package-with-perf.patch index f7fbc90b..38d5b980 100644 --- a/packages/linux-kernel/patches/kernel/0003-RFC-builddeb-add-linux-tools-package-with-perf.patch +++ b/packages/linux-kernel/patches/kernel/0003-RFC-builddeb-add-linux-tools-package-with-perf.patch @@ -31,46 +31,48 @@ Signed-off-by: Riku Voipio <riku.voipio@linaro.org> 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb -index 6df3c9f8b2da..a38cfc984134 100755 +index 0b31f4f1f92c..629144b4226b 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb -@@ -102,8 +102,10 @@ deploy_libc_headers () { - version=$KERNELRELEASE - tmpdir=debian/linux-image - dbg_dir=debian/linux-image-dbg +@@ -39,10 +39,12 @@ tmpdir="$objtree/debian/tmp" + kernel_headers_dir="$objtree/debian/hdrtmp" + libc_headers_dir="$objtree/debian/headertmp" + dbg_dir="$objtree/debian/dbgtmp" +tools_dir="$objtree/debian/toolstmp" packagename=linux-image-$version + kernel_headers_packagename=linux-headers-$version + libc_headers_packagename=linux-libc-dev dbg_packagename=$packagename-dbg +tools_packagename=linux-tools-$version if [ "$ARCH" = "um" ] ; then packagename=user-mode-linux-$version -@@ -126,7 +128,7 @@ esac - BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes) +@@ -65,7 +67,7 @@ esac + BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" # Setup the directory structure --rm -rf "$tmpdir" "$dbg_dir" debian/files -+rm -rf "$tmpdir" "$dbg_dir" "$tools_dir" debian/files +-rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files ++rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" "$tools_dir" $objtree/debian/files mkdir -m 755 -p "$tmpdir/DEBIAN" mkdir -p "$tmpdir/lib" "$tmpdir/boot" - -@@ -225,4 +227,31 @@ if [ -n "$BUILD_DEBUG" ] ; then + mkdir -p "$kernel_headers_dir/lib/modules/$version/" +@@ -194,4 +196,31 @@ if [ -n "$BUILD_DEBUG" ] ; then create_package "$dbg_packagename" "$dbg_dir" fi +if [ -n "$BUILD_TOOLS" ] +then -+ # HACK - change output dir from relative to absolute -+ mkdir -p $tools_dir -+ tools_dest=`readlink -f $tools_dir` -+ if [ -n "$O" ] -+ then -+ output=`readlink -f $objtree` -+ mkdir -p $output/tools/perf -+ output="O=$output/tools/perf" -+ fi -+ $MAKE -C $srctree/tools/perf $output LDFLAGS= srctree=$KBUILD_SRC prefix=$tools_dest/usr install -+ cat <<EOF >> debian/control ++ # HACK - change output dir from relative to absolute ++ mkdir -p $tools_dir ++ tools_dest=`readlink -f $tools_dir` ++ if [ -n "$O" ] ++ then ++ output=`readlink -f $objtree` ++ mkdir -p $output/tools/perf ++ output="O=$output/tools/perf" ++ fi ++ $MAKE -C $srctree/tools/perf $output LDFLAGS= srctree=$KBUILD_SRC prefix=$tools_dest/usr install ++ cat <<EOF >> debian/control + +Package: $tools_packagename +Architecture: any @@ -81,8 +83,8 @@ index 6df3c9f8b2da..a38cfc984134 100755 + kernel version $version . +EOF + -+ dpkg-shlibdeps $tools_dest/usr/bin/* $tools_dest/usr/lib*/traceevent/plugins/* -+ create_package "$tools_packagename" "$tools_dir" ++ dpkg-shlibdeps $tools_dest/usr/bin/* $tools_dest/usr/lib*/traceevent/plugins/* ++ create_package "$tools_packagename" "$tools_dir" +fi + exit 0 diff --git a/packages/linux-kernel/patches/wireguard-linux-compat/0001-Debian-build-wireguard-modules-package.patch b/packages/linux-kernel/patches/wireguard-linux-compat/0001-Debian-build-wireguard-modules-package.patch new file mode 100644 index 00000000..4b5e3b03 --- /dev/null +++ b/packages/linux-kernel/patches/wireguard-linux-compat/0001-Debian-build-wireguard-modules-package.patch @@ -0,0 +1,74 @@ +From e5fa65c772eac4f577642038031da360f11e925c Mon Sep 17 00:00:00 2001 +From: Christian Poessinger <christian@poessinger.com> +Date: Sun, 30 Aug 2020 09:26:59 +0200 +Subject: [PATCH] Debian: build wireguard-modules package + +VyOS requires a pre build binary of the WireGuard package over a DKMS build. +Change the build rules to produce the binary over the source package for DKMS. +--- + debian/control | 10 +++------- + debian/rules | 9 ++++----- + 2 files changed, 7 insertions(+), 12 deletions(-) + +diff --git a/debian/control b/debian/control +index d65b8b5..e7be383 100644 +--- a/debian/control ++++ b/debian/control +@@ -5,15 +5,14 @@ Maintainer: Daniel Kahn Gillmor <dkg@fifthhorseman.net> + Uploaders: + Unit 193 <unit193@debian.org>, + Build-Depends: +- debhelper-compat (= 13), +- dkms, ++ debhelper-compat (= 12) + Standards-Version: 4.5.0 + Homepage: https://www.wireguard.com + Vcs-Git: https://salsa.debian.org/debian/wireguard-linux-compat.git -b debian/buster-backports + Vcs-Browser: https://salsa.debian.org/debian/wireguard-linux-compat + Rules-Requires-Root: no + +-Package: wireguard-dkms ++Package: wireguard-modules + Architecture: all + Section: kernel + Depends: +@@ -22,7 +21,7 @@ Depends: + Recommends: + wireguard (>= 0.0.20191219), + wireguard-tools (>= 0.0.20191219), +-Description: fast, modern, secure kernel VPN tunnel (DKMS version) ++Description: fast, modern, secure kernel VPN tunnel (Kernel module) + WireGuard is a novel VPN that runs inside the Linux Kernel and uses + state-of-the-art cryptography (the "Noise" protocol). It aims to be + faster, simpler, leaner, and more useful than IPSec, while avoiding +@@ -30,6 +29,3 @@ Description: fast, modern, secure kernel VPN tunnel (DKMS version) + than OpenVPN. WireGuard is designed as a general purpose VPN for + running on embedded interfaces and super computers alike, fit for + many different circumstances. It runs over UDP. +- . +- This package uses DKMS to automatically build the wireguard kernel +- module. +diff --git a/debian/rules b/debian/rules +index 4fbedc6..4d93243 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -6,12 +6,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all + export DEB_VERSION_UPSTREAM + + WIREGUARD_ARGS = V=1 ++KERNEL_VERSION := $(shell cat "${KERNELDIR}"/include/config/kernel.release) + + %: +- dh $@ --with dkms ++ dh $@ + + override_dh_auto_install-indep: +- $(MAKE) -C src DESTDIR=../debian/wireguard-dkms DKMSDIR=/usr/src/wireguard-$(DEB_VERSION_UPSTREAM) dkms-install +- +-override_dh_dkms: +- dh_dkms -p wireguard-dkms -- src/dkms.conf ++ $(MAKE) -C src module ++ echo "src/wireguard.ko /lib/modules/$(KERNEL_VERSION)/extra" > debian/wireguard-modules.install +-- +2.20.1 + |