29e62dc0a2
Ubuntu bug link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1682368 original cover letter for the patches proposed upstream: Commit 1045ba77a ("net sched actions: Add support for user cookies") added code to net/sched/act_api.c's tcf_action_init_1 using the `tb` nlattr array unconditionally, while it was otherwise used as well as initialized only when `name == NULL`: if (name == NULL) { err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL); In the other case `nla` is instead passed over to ->init to be parsed there (using a different set of TCA_ enum values, iow. TCA_ACT_COOKIE then "clashes" with some other value). This lead to the following three example commands resulting in errors (sometimes followed by more traces and hangups some time later (although the hangups happened seconds or sometimes minutes later, sometimes not at all - results differed between different kernel versions (linux git-master vs ubuntu's mainline 4.11 rc6 vs. pve 4.10.5 (based off ubuntu's zesty kernel where the commit is cherry-picked)...))): # ip link add ve0 type veth peer name ve0b # tc qdisc add dev ve0 handle ffff: ingress # tc filter add dev ve0 parent ffff: prio 50 basic police rate 1000bps burst 1000b drop The 3rd command would sometimes succeed, sometimes error with: RTNETLINK answers: Invalid argument We have an error talking to the kernel and sometimes error with: RTNETLINK answers: Cannot allocate memory We have an error talking to the kernel In the latter case I assume `cklen` became negative, which passes the TC_COOKIE_MAX_SIZE check since it is signed but becomes unsigned later in kmemdup() (see the crash dump below) When the `tc filter add` command fails a backtrace shows up in dmesg, added below. I'm not sure why the TC_ACT_COOKIE code was added to tcf_action_init_1 where it is now. It makes me think that it's supposed to be available universally, but the `name == NULL` check for how nla is used or passed to ->init() shows that the there are various different TC_ACT_* enums in use at this point, hence the 'RFC' part of the patches, I'm not that familiar with the code yet. Backtrace when running `tc filter add`: Apr 12 11:31:38 testmachine kernel: ------------[ cut here ]------------ Apr 12 11:31:38 testmachine kernel: WARNING: CPU: 7 PID: 16596 at mm/page_alloc.c:3541 __alloc_pages_slowpath+0x9fe/0xba0 Apr 12 11:31:38 testmachine kernel: Modules linked in: act_police cls_basic sch_ingress veth nfsv3 nfs_acl nfs lockd grace ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables xt_mac ipt_REJECT nf_reject_ipv4 xt_physdev xt_comment nf_conntrack_ipv4 nf_defrag_ipv4 xt_tcpudp xt_mark xt_set xt_addrtype xt_multiport xt_conntrack nf_conntrack ip_set_hash_net ip_set arc4 md4 nls_utf8 cifs ccm fscache ipta Apr 12 11:31:38 testmachine kernel: snd_hda_codec_realtek snd_hda_codec_generic aesni_intel aes_x86_64 crypto_simd drm_kms_helper glue_helper cryptd drm snd_hda_intel intel_cstate snd_hda_codec i2c_algo_bit fb_sys_fops snd_hda_core joydev syscopyarea snd_hwdep sysfillrect input_leds sysimgblt intel_rapl_perf snd_pcm snd_timer snd pcspkr soundcore mei_me lpc_ich mei shpchp tpm_infineon mac_hid wmi acpi_pad video vhost_net vhost macv Apr 12 11:31:38 testmachine kernel: CPU: 7 PID: 16596 Comm: tc Tainted: P O 4.10.5-1-pve #1 Apr 12 11:31:38 testmachine kernel: Hardware name: ASUS All Series/Z97-A, BIOS 2801 11/11/2015 Apr 12 11:31:38 testmachine kernel: Call Trace: Apr 12 11:31:38 testmachine kernel: dump_stack+0x63/0x81 Apr 12 11:31:38 testmachine kernel: __warn+0xcb/0xf0 Apr 12 11:31:38 testmachine kernel: warn_slowpath_null+0x1d/0x20 Apr 12 11:31:38 testmachine kernel: __alloc_pages_slowpath+0x9fe/0xba0 Apr 12 11:31:38 testmachine kernel: ? get_page_from_freelist+0x46a/0xb20 Apr 12 11:31:38 testmachine kernel: ? schedule+0x36/0x80 Apr 12 11:31:38 testmachine kernel: ? schedule_timeout+0x22a/0x3f0 Apr 12 11:31:38 testmachine kernel: __alloc_pages_nodemask+0x209/0x260 Apr 12 11:31:38 testmachine kernel: alloc_pages_current+0x95/0x140 Apr 12 11:31:38 testmachine kernel: kmalloc_order+0x18/0x40 Apr 12 11:31:38 testmachine kernel: kmalloc_order_trace+0x24/0xa0 Apr 12 11:31:38 testmachine kernel: __kmalloc_track_caller+0x1e5/0x200 Apr 12 11:31:38 testmachine kernel: kmemdup+0x20/0x50 Apr 12 11:31:38 testmachine kernel: nla_memdup_cookie+0x55/0x90 Apr 12 11:31:38 testmachine kernel: tcf_action_init_1+0xcc/0x230 Apr 12 11:31:38 testmachine kernel: tcf_exts_validate+0x52/0x110 Apr 12 11:31:38 testmachine kernel: basic_change+0x194/0x4d2 [cls_basic] Apr 12 11:31:38 testmachine kernel: tc_ctl_tfilter+0x54d/0x9a0 Apr 12 11:31:38 testmachine kernel: rtnetlink_rcv_msg+0xe6/0x210 Apr 12 11:31:38 testmachine kernel: ? __kmalloc_node_track_caller+0x1f0/0x2a0 Apr 12 11:31:38 testmachine kernel: ? __alloc_skb+0x87/0x1e0 Apr 12 11:31:38 testmachine kernel: ? rtnl_newlink+0x860/0x860 Apr 12 11:31:38 testmachine kernel: netlink_rcv_skb+0xa4/0xc0 Apr 12 11:31:38 testmachine kernel: rtnetlink_rcv+0x28/0x30 Apr 12 11:31:38 testmachine kernel: netlink_unicast+0x18c/0x220 Apr 12 11:31:38 testmachine kernel: netlink_sendmsg+0x2f7/0x3b0 Apr 12 11:31:38 testmachine kernel: ? aa_sock_msg_perm+0x61/0x150 Apr 12 11:31:38 testmachine kernel: sock_sendmsg+0x38/0x50 Apr 12 11:31:38 testmachine kernel: ___sys_sendmsg+0x2c2/0x2d0 Apr 12 11:31:38 testmachine kernel: ? schedule+0x36/0x80 Apr 12 11:31:38 testmachine kernel: ? ptrace_stop+0x20a/0x2a0 Apr 12 11:31:38 testmachine kernel: ? ptrace_do_notify+0x98/0xc0 Apr 12 11:31:38 testmachine kernel: __sys_sendmsg+0x54/0x90 Apr 12 11:31:38 testmachine kernel: SyS_sendmsg+0x12/0x20 Apr 12 11:31:38 testmachine kernel: do_syscall_64+0x5b/0xc0 Apr 12 11:31:38 testmachine kernel: entry_SYSCALL64_slow_path+0x25/0x25 Apr 12 11:31:38 testmachine kernel: RIP: 0033:0x7f0aef7d0a77 Apr 12 11:31:38 testmachine kernel: RSP: 002b:00007ffe88627568 EFLAGS: 00000246 ORIG_RAX: 000000000000002e Apr 12 11:31:38 testmachine kernel: RAX: ffffffffffffffda RBX: 0000000058edf3fc RCX: 00007f0aef7d0a77 Apr 12 11:31:38 testmachine kernel: RDX: 0000000000000000 RSI: 00007ffe886275b0 RDI: 0000000000000003 Apr 12 11:31:38 testmachine kernel: RBP: 00007ffe886275b0 R08: 0000000000000001 R09: 0000000000000050 Apr 12 11:31:38 testmachine kernel: R10: 00000000000005e9 R11: 0000000000000246 R12: 00007ffe886275f0 Apr 12 11:31:38 testmachine kernel: R13: 00005619ea31ee00 R14: 00007ffe8862f690 R15: 0000000000000000 Apr 12 11:31:38 testmachine kernel: ---[ end trace be009b606808485e ]--- Which would later on be followed by different kinds of hangups, sometimes with more seemingly unrelated crash dumps such as: Apr 12 11:38:50 testmachine kernel: general protection fault: 0000 [#1] SMP Apr 12 11:38:50 testmachine kernel: Modules linked in: act_police cls_basic sch_ingress veth nfsv3 nfs_acl nfs lockd grace ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables xt_mac ipt_REJECT nf_reject_ipv4 xt_physdev xt_comment nf_conntrack_ipv4 nf_defrag_ipv4 xt_tcpudp xt_mark xt_set xt_addrtype xt_multiport xt_conntrack nf_conntrack ip_set_hash_net ip_set arc4 md4 nls_utf8 cifs ccm fscache ipta Apr 12 11:38:50 testmachine kernel: snd_hda_codec_realtek snd_hda_codec_generic aesni_intel aes_x86_64 crypto_simd drm_kms_helper glue_helper cryptd drm snd_hda_intel intel_cstate snd_hda_codec i2c_algo_bit fb_sys_fops snd_hda_core joydev syscopyarea snd_hwdep sysfillrect input_leds sysimgblt intel_rapl_perf snd_pcm snd_timer snd pcspkr soundcore mei_me lpc_ich mei shpchp tpm_infineon mac_hid wmi acpi_pad video vhost_net vhost macv Apr 12 11:38:50 testmachine kernel: CPU: 7 PID: 4829 Comm: chromium Tainted: P W O 4.10.5-1-pve #1 Apr 12 11:38:50 testmachine kernel: Hardware name: ASUS All Series/Z97-A, BIOS 2801 11/11/2015 Apr 12 11:38:50 testmachine kernel: task: ffff93679b132d00 task.stack: ffffa479a0e00000 Apr 12 11:38:50 testmachine kernel: RIP: 0010:kmem_cache_alloc_trace+0x7b/0x190 Apr 12 11:38:50 testmachine kernel: RSP: 0018:ffffa479a0e03ad0 EFLAGS: 00010202 Apr 12 11:38:50 testmachine kernel: RAX: 0000000000000000 RBX: 00000000014000c0 RCX: 0000000000005291 Apr 12 11:38:50 testmachine kernel: RDX: 0000000000005290 RSI: 00000000014000c0 RDI: 000000000001c5c0 Apr 12 11:38:50 testmachine kernel: RBP: ffffa479a0e03b00 R08: ffff9367bfbdc5c0 R09: ffff936724698580 Apr 12 11:38:50 testmachine kernel: R10: 0017ffffc0040038 R11: 0000000000000007 R12: 00000000014000c0 Apr 12 11:38:50 testmachine kernel: R13: ffff93679f003b80 R14: ffffffffc0b9090f R15: ffff93679f003b80 Apr 12 11:38:50 testmachine kernel: FS: 00007f5a069c4040(0000) GS:ffff9367bfbc0000(0000) knlGS:0000000000000000 Apr 12 11:38:50 testmachine kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Apr 12 11:38:50 testmachine kernel: CR2: 00007f5a068de000 CR3: 00000007ccb8b000 CR4: 00000000001426e0 Apr 12 11:38:50 testmachine kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Apr 12 11:38:50 testmachine kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Apr 12 11:38:50 testmachine kernel: Call Trace: Apr 12 11:38:50 testmachine kernel: i915_gem_object_get_pages_internal+0x6f/0x250 [i915] Apr 12 11:38:50 testmachine kernel: ? kmem_cache_alloc+0x185/0x1a0 Apr 12 11:38:50 testmachine kernel: ____i915_gem_object_get_pages+0x20/0x60 [i915] Apr 12 11:38:50 testmachine kernel: __i915_gem_object_get_pages+0x52/0x60 [i915] Apr 12 11:38:50 testmachine kernel: i915_gem_batch_pool_get+0x11d/0x180 [i915] Apr 12 11:38:50 testmachine kernel: i915_gem_do_execbuffer.isra.38+0x1027/0x1790 [i915] Apr 12 11:38:50 testmachine kernel: ? shmem_getpage_gfp+0xf9/0xc20 Apr 12 11:38:50 testmachine kernel: i915_gem_execbuffer2+0xc5/0x240 [i915] Apr 12 11:38:50 testmachine kernel: drm_ioctl+0x21b/0x4c0 [drm] Apr 12 11:38:50 testmachine kernel: ? i915_gem_execbuffer+0x310/0x310 [i915] Apr 12 11:38:50 testmachine kernel: ? __seccomp_filter+0x67/0x250 Apr 12 11:38:50 testmachine kernel: do_vfs_ioctl+0xa3/0x610 Apr 12 11:38:50 testmachine kernel: ? __secure_computing+0x3f/0xd0 Apr 12 11:38:50 testmachine kernel: ? syscall_trace_enter+0xcd/0x2e0 Apr 12 11:38:50 testmachine kernel: SyS_ioctl+0x79/0x90 Apr 12 11:38:50 testmachine kernel: do_syscall_64+0x5b/0xc0 Apr 12 11:38:50 testmachine kernel: entry_SYSCALL64_slow_path+0x25/0x25 Apr 12 11:38:50 testmachine kernel: RIP: 0033:0x7f59fba67ca7 Apr 12 11:38:50 testmachine kernel: RSP: 002b:00007ffd39778868 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 Apr 12 11:38:50 testmachine kernel: RAX: ffffffffffffffda RBX: 000024e398f52800 RCX: 00007f59fba67ca7 Apr 12 11:38:50 testmachine kernel: RDX: 00007ffd397788b0 RSI: 0000000040406469 RDI: 00000000000000a4 Apr 12 11:38:50 testmachine kernel: RBP: 00007ffd397788b0 R08: 0000000000000000 R09: 0000000000000000 Apr 12 11:38:50 testmachine kernel: R10: 0000000000000000 R11: 0000000000000246 R12: 0000000040406469 Apr 12 11:38:50 testmachine kernel: R13: 00000000000000a4 R14: 000024e399dd82c0 R15: 0000000000000070 Apr 12 11:38:50 testmachine kernel: Code: 08 65 4c 03 05 e7 de 9e 68 49 83 78 10 00 4d 8b 10 0f 84 e0 00 00 00 4d 85 d2 0f 84 d7 00 00 00 49 63 47 20 49 8b 3f 48 8d 4a 01 <49> 8b 1c 02 4c 89 d0 65 48 0f c7 0f 0f 94 c0 84 c0 74 bb 49 63 Apr 12 11:38:50 testmachine kernel: RIP: kmem_cache_alloc_trace+0x7b/0x190 RSP: ffffa479a0e03ad0 Apr 12 11:38:50 testmachine kernel: general protection fault: 0000 [#2] SMP Apr 12 11:38:50 testmachine kernel: general protection fault: 0000 [#3] SMP or: Apr 12 09:19:35 testmachine kernel: BUG: unable to handle kernel NULL pointer dereference at 000000000000019c Apr 12 09:19:35 testmachine kernel: IP: __free_pages+0x5/0x30 Apr 12 09:19:35 testmachine kernel: PGD 0 Apr 12 09:19:35 testmachine kernel: Apr 12 09:19:35 testmachine kernel: Oops: 0002 [#1] SMP Apr 12 09:19:35 testmachine kernel: Modules linked in: act_police cls_basic sch_ingress veth nfsv3 nfs_acl nfs lockd grace ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables xt_mac ipt_REJECT nf_reject_ipv4 xt_physdev xt_comment nf_conntrack_ipv4 nf_defrag_ipv4 xt_tcpudp xt_mark xt_set xt_addrtype xt_multiport xt_conntrack nf_conntrack ip_set_hash_net ip_set arc4 md4 nls_utf8 cifs ccm fscache ipta Apr 12 09:19:35 testmachine kernel: aes_x86_64 crypto_simd glue_helper cryptd intel_cstate snd_hda_codec_realtek snd_hda_codec_generic i915 intel_rapl_perf snd_hda_intel drm_kms_helper input_leds joydev snd_hda_codec drm snd_hda_core snd_hwdep i2c_algo_bit fb_sys_fops snd_pcm syscopyarea snd_timer sysfillrect sysimgblt snd soundcore mei_me shpchp lpc_ich mei pcspkr tpm_infineon wmi video mac_hid acpi_pad vhost_net vhost macvtap mac Apr 12 09:19:35 testmachine kernel: CPU: 2 PID: 69 Comm: kworker/2:1 Tainted: P W O 4.10.5-1-pve #1 Apr 12 09:19:35 testmachine kernel: Hardware name: ASUS All Series/Z97-A, BIOS 2801 11/11/2015 Apr 12 09:19:35 testmachine kernel: Workqueue: events __i915_gem_free_work [i915] Apr 12 09:19:35 testmachine kernel: task: ffff88885b134380 task.stack: ffffa7e243410000 Apr 12 09:19:35 testmachine kernel: RIP: 0010:__free_pages+0x5/0x30 Apr 12 09:19:35 testmachine kernel: RSP: 0018:ffffa7e243413d18 EFLAGS: 00010206 Apr 12 09:19:35 testmachine kernel: RAX: 00000000000ffff8 RBX: ffff888762473460 RCX: ffff888762473470 Apr 12 09:19:35 testmachine kernel: RDX: ffff888762473460 RSI: 0000000000000014 RDI: 0000000000000180 Apr 12 09:19:35 testmachine kernel: RBP: ffffa7e243413d38 R08: 0000000000000000 R09: 0000000000000000 Apr 12 09:19:35 testmachine kernel: R10: ffff8887dd8c1080 R11: 0000000000000000 R12: ffff8887624738f0 Apr 12 09:19:35 testmachine kernel: R13: 00000000ffffffff R14: ffff8887dd8c0440 R15: 0000000000000000 Apr 12 09:19:35 testmachine kernel: FS: 0000000000000000(0000) GS:ffff88887fa80000(0000) knlGS:0000000000000000 Apr 12 09:19:35 testmachine kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Apr 12 09:19:35 testmachine kernel: CR2: 000000000000019c CR3: 0000000476e09000 CR4: 00000000001426e0 Apr 12 09:19:35 testmachine kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Apr 12 09:19:35 testmachine kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Apr 12 09:19:35 testmachine kernel: Call Trace: Apr 12 09:19:35 testmachine kernel: ? internal_free_pages+0x40/0x80 [i915] Apr 12 09:19:35 testmachine kernel: i915_gem_object_put_pages_internal+0x1f/0x30 [i915] Apr 12 09:19:35 testmachine kernel: __i915_gem_object_put_pages.part.62+0x11d/0x180 [i915] Apr 12 09:19:35 testmachine kernel: ? dma_fence_context_alloc+0x20/0x20 Apr 12 09:19:35 testmachine kernel: __i915_gem_free_objects+0x161/0x330 [i915] Apr 12 09:19:35 testmachine kernel: __i915_gem_free_work+0x33/0x50 [i915] Apr 12 09:19:35 testmachine kernel: process_one_work+0x1fc/0x4b0 Apr 12 09:19:35 testmachine kernel: worker_thread+0x4b/0x500 Apr 12 09:19:35 testmachine kernel: kthread+0x101/0x140 Apr 12 09:19:35 testmachine kernel: ? process_one_work+0x4b0/0x4b0 Apr 12 09:19:35 testmachine kernel: ? kthread_create_on_node+0x60/0x60 Apr 12 09:19:35 testmachine kernel: ret_from_fork+0x2c/0x40 Apr 12 09:19:35 testmachine kernel: Code: ff 41 b8 05 00 00 00 31 c9 4c 89 ea 4c 89 fe e8 a2 e0 ff ff e9 1e ff ff ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 <f0> ff 4f 1c 75 0e 55 85 f6 48 89 e5 74 08 e8 48 e4 ff ff 5d f3 Apr 12 09:19:35 testmachine kernel: RIP: __free_pages+0x5/0x30 RSP: ffffa7e243413d18 Apr 12 09:19:35 testmachine kernel: CR2: 000000000000019c Apr 12 09:19:35 testmachine kernel: ---[ end trace 89cb022ec57f7bd1 ]--- Wolfgang Bumiller (2): net sched actions: fix access to uninitialized data net sched actions: decrement module refcount earlier net/sched/act_api.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
439 lines
18 KiB
Makefile
439 lines
18 KiB
Makefile
RELEASE=5.0
|
|
|
|
# also update proxmox-ve/changelog if you change KERNEL_VER or KREL
|
|
KERNEL_VER=4.10.5
|
|
PKGREL=5
|
|
# also include firmware of previous version into
|
|
# the fw package: fwlist-2.6.32-PREV-pve
|
|
KREL=1
|
|
|
|
KERNEL_SRC=ubuntu-zesty
|
|
KERNEL_SRC_SUBMODULE=submodules/ubuntu-zesty
|
|
|
|
EXTRAVERSION=-${KREL}-pve
|
|
KVNAME=${KERNEL_VER}${EXTRAVERSION}
|
|
PACKAGE=pve-kernel-${KVNAME}
|
|
HDRPACKAGE=pve-headers-${KVNAME}
|
|
|
|
ARCH=amd64
|
|
GITVERSION:=$(shell cat .git/refs/heads/master)
|
|
CHANGELOG_DATE:=$(shell dpkg-parsechangelog -SDate -lchangelog.Debian)
|
|
|
|
SKIPABI=0
|
|
|
|
TOP=$(shell pwd)
|
|
|
|
KERNEL_CFG_ORG=config-${KERNEL_VER}.org
|
|
|
|
E1000EDIR=e1000e-3.3.5.3
|
|
E1000ESRC=${E1000EDIR}.tar.gz
|
|
|
|
IGBDIR=igb-5.3.5.4
|
|
IGBSRC=${IGBDIR}.tar.gz
|
|
|
|
IXGBEDIR=ixgbe-5.0.4
|
|
IXGBESRC=${IXGBEDIR}.tar.gz
|
|
|
|
# does not compile with kernel 3.19.8
|
|
#I40EDIR=i40e-1.2.38
|
|
#I40ESRC=${I40EDIR}.tar.gz
|
|
|
|
# looks up to date with kernel 3.19.8
|
|
#BNX2DIR=netxtreme2-7.11.05
|
|
#BNX2SRC=${BNX2DIR}.tar.gz
|
|
|
|
# does not compile with kernel 3.19.8
|
|
#AACRAIDVER=1.2.1-40700
|
|
#AACRAIDDIR=aacraid-${AACRAIDVER}.src
|
|
#AACRAIDSRC=aacraid-linux-src-${AACRAIDVER}.tgz
|
|
|
|
# does not compile with kernel 3.19.8
|
|
HPSAVER=3.4.8
|
|
HPSADIR=hpsa-${HPSAVER}
|
|
HPSASRC=${HPSADIR}-140.tar.bz2
|
|
|
|
# driver does not compile
|
|
#MEGARAID_DIR=megaraid_sas-06.703.11.00
|
|
#MEGARAID_SRC=${MEGARAID_DIR}-src.tar.gz
|
|
|
|
#ARECADIR=arcmsr-1.30.0X.19-140509
|
|
#ARECASRC=${ARECADIR}.zip
|
|
|
|
# this one does not compile with newer 3.10 kernels!
|
|
#RR272XSRC=RR272x_1x-Linux-Src-v1.5-130325-0732.tar.gz
|
|
#RR272XDIR=rr272x_1x-linux-src-v1.5
|
|
|
|
SPLDIR=pkg-spl
|
|
SPLSRC=submodules/zfs/pkg-spl.tar.gz
|
|
ZFSDIR=pkg-zfs
|
|
ZFSSRC=submodules/zfs/pkg-zfs.tar.gz
|
|
ZFS_MODULES=zfs.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko zpios.ko
|
|
SPL_MODULES=spl.ko splat.ko
|
|
|
|
# DRBD9
|
|
#DRBDVER=9.0.6-1
|
|
#DRBDDIR=drbd-${DRBDVER}
|
|
#DRBDSRC=${DRBDDIR}.tar.gz
|
|
#DRBD_MODULES=drbd.ko drbd_transport_tcp.ko
|
|
|
|
DST_DEB=${PACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
|
|
HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
|
|
PVEPKG=proxmox-ve
|
|
PVE_DEB=${PVEPKG}_${RELEASE}-${PKGREL}_all.deb
|
|
VIRTUALHDRPACKAGE=pve-headers
|
|
VIRTUAL_HDR_DEB=${VIRTUALHDRPACKAGE}_${RELEASE}-${PKGREL}_all.deb
|
|
|
|
LINUX_TOOLS_PKG=linux-tools-4.10
|
|
LINUX_TOOLS_DEB=${LINUX_TOOLS_PKG}_${KERNEL_VER}-${PKGREL}_amd64.deb
|
|
|
|
DEBS=${DST_DEB} ${HDR_DEB} ${PVE_DEB} ${VIRTUAL_HDR_DEB} ${LINUX_TOOLS_DEB}
|
|
|
|
all: check_gcc ${DEBS}
|
|
|
|
${PVE_DEB} pve: proxmox-ve/control proxmox-ve/postinst ${PVE_RELEASE_KEYS}
|
|
rm -rf proxmox-ve/data
|
|
mkdir -p proxmox-ve/data/DEBIAN
|
|
mkdir -p proxmox-ve/data/usr/share/doc/${PVEPKG}/
|
|
mkdir -p proxmox-ve/data/etc/apt/trusted.gpg.d
|
|
install -m 0644 proxmox-ve/proxmox-release-5.x.pubkey proxmox-ve/data/etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg
|
|
sed -e 's/@KVNAME@/${KVNAME}/' -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@RELEASE@/${RELEASE}/' -e 's/@PKGREL@/${PKGREL}/' <proxmox-ve/control >proxmox-ve/data/DEBIAN/control
|
|
sed -e 's/@KVNAME@/${KVNAME}/' <proxmox-ve/postinst >proxmox-ve/data/DEBIAN/postinst
|
|
chmod 0755 proxmox-ve/data/DEBIAN/postinst
|
|
install -m 0755 proxmox-ve/postrm proxmox-ve/data/DEBIAN/postrm
|
|
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${PVEPKG}/SOURCE
|
|
install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${PVEPKG}
|
|
install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${PVEPKG}
|
|
gzip -n --best proxmox-ve/data/usr/share/doc/${PVEPKG}/changelog.Debian
|
|
dpkg-deb --build proxmox-ve/data ${PVE_DEB}
|
|
|
|
${VIRTUAL_HDR_DEB} pve-headers: proxmox-ve/pve-headers.control
|
|
rm -rf proxmox-ve/data
|
|
mkdir -p proxmox-ve/data/DEBIAN
|
|
mkdir -p proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/
|
|
sed -e 's/@KVNAME@/${KVNAME}/' -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@RELEASE@/${RELEASE}/' -e 's/@PKGREL@/${PKGREL}/' <proxmox-ve/pve-headers.control >proxmox-ve/data/DEBIAN/control
|
|
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/SOURCE
|
|
install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}
|
|
install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}
|
|
gzip -n --best proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/changelog.Debian
|
|
dpkg-deb --build proxmox-ve/data ${VIRTUAL_HDR_DEB}
|
|
|
|
check_gcc:
|
|
ifeq ($(CC), cc)
|
|
gcc --version|grep "6\.3" || false
|
|
else
|
|
$(CC) --version|grep "6\.3" || false
|
|
endif
|
|
|
|
${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian | fwcheck abicheck
|
|
mkdir -p data/DEBIAN
|
|
sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <control.in >data/DEBIAN/control
|
|
sed -e 's/@@KVNAME@@/${KVNAME}/g' <prerm.in >data/DEBIAN/prerm
|
|
chmod 0755 data/DEBIAN/prerm
|
|
sed -e 's/@@KVNAME@@/${KVNAME}/g' <postinst.in >data/DEBIAN/postinst
|
|
chmod 0755 data/DEBIAN/postinst
|
|
sed -e 's/@@KVNAME@@/${KVNAME}/g' <postrm.in >data/DEBIAN/postrm
|
|
chmod 0755 data/DEBIAN/postrm
|
|
install -D -m 644 copyright data/usr/share/doc/${PACKAGE}/copyright
|
|
install -D -m 644 changelog.Debian data/usr/share/doc/${PACKAGE}/changelog.Debian
|
|
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > data/usr/share/doc/${PACKAGE}/SOURCE
|
|
gzip -n -f --best data/usr/share/doc/${PACKAGE}/changelog.Debian
|
|
rm -f data/lib/modules/${KVNAME}/source
|
|
rm -f data/lib/modules/${KVNAME}/build
|
|
dpkg-deb --build data ${DST_DEB}
|
|
lintian ${DST_DEB}
|
|
|
|
LINUX_TOOLS_DH_LIST=strip installchangelogs installdocs compress shlibdeps gencontrol md5sums builddeb
|
|
|
|
${LINUX_TOOLS_DEB}: .compile_mark control.tools changelog.Debian copyright
|
|
rm -rf linux-tools ${LINUX_TOOLS_DEB}
|
|
mkdir -p linux-tools/debian
|
|
cp control.tools linux-tools/debian/control
|
|
echo 9 > linux-tools/debian/compat
|
|
cp changelog.Debian linux-tools/debian/changelog
|
|
cp copyright linux-tools/debian
|
|
mkdir -p linux-tools/debian/linux-tools-4.10/usr/bin
|
|
install -m 0755 ${KERNEL_SRC}/tools/perf/perf linux-tools/debian/linux-tools-4.10/usr/bin/perf_4.10
|
|
cd linux-tools; for i in ${LINUX_TOOLS_DH_LIST}; do dh_$$i; done
|
|
lintian ${LINUX_TOOLS_DEB}
|
|
|
|
fwlist-${KVNAME}: data
|
|
./find-firmware.pl data/lib/modules/${KVNAME} >fwlist.tmp
|
|
mv fwlist.tmp $@
|
|
|
|
.PHONY: fwcheck
|
|
fwcheck: fwlist-${KVNAME} fwlist-previous
|
|
@echo "checking fwlist for changes since last built firmware package.."
|
|
@echo "if this check fails, add fwlist-${KVNAME} to the pve-firmware repository and upload a new firmware package together with the ${KVNAME} kernel"
|
|
bash -c "diff -up -N <(sort fwlist-previous | uniq) <(sort fwlist-${KVNAME} | uniq) > fwlist.diff"
|
|
rm fwlist.diff
|
|
@echo "done, no need to rebuild pve-firmware"
|
|
|
|
|
|
abi-${KVNAME}: .compile_mark
|
|
sed -e 's/^\(.\+\)[[:space:]]\+\(.\+\)[[:space:]]\(.\+\)$$/\3 \2 \1/' ${KERNEL_SRC}/Module.symvers | sort > abi-${KVNAME}
|
|
|
|
.PHONY: abicheck
|
|
abicheck: abi-${KVNAME} abi-previous abi-blacklist
|
|
./abi-check abi-${KVNAME} abi-previous ${SKIPABI}
|
|
|
|
data: .compile_mark igb.ko ixgbe.ko e1000e.ko ${SPL_MODULES} ${ZFS_MODULES}
|
|
rm -rf data tmp; mkdir -p tmp/lib/modules/${KVNAME}
|
|
mkdir tmp/boot
|
|
install -m 644 ${KERNEL_SRC}/.config tmp/boot/config-${KVNAME}
|
|
install -m 644 ${KERNEL_SRC}/System.map tmp/boot/System.map-${KVNAME}
|
|
install -m 644 ${KERNEL_SRC}/arch/x86_64/boot/bzImage tmp/boot/vmlinuz-${KVNAME}
|
|
cd ${KERNEL_SRC}; make INSTALL_MOD_PATH=../tmp/ modules_install
|
|
## install latest ibg driver
|
|
install -m 644 igb.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/igb/
|
|
# install latest ixgbe driver
|
|
install -m 644 ixgbe.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/ixgbe/
|
|
# install latest e1000e driver
|
|
install -m 644 e1000e.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/e1000e/
|
|
## install hpsa driver
|
|
#install -m 644 hpsa.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/
|
|
# install zfs drivers
|
|
install -d -m 0755 tmp/lib/modules/${KVNAME}/zfs
|
|
install -m 644 ${SPL_MODULES} ${ZFS_MODULES} tmp/lib/modules/${KVNAME}/zfs
|
|
# install drbd9
|
|
#install -m 644 ${DRBD_MODULES} tmp/lib/modules/${KVNAME}/kernel/drivers/block/drbd
|
|
# remove firmware
|
|
rm -rf tmp/lib/firmware
|
|
# strip debug info
|
|
find tmp/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
|
|
# finalize
|
|
/sbin/depmod -b tmp/ ${KVNAME}
|
|
# Autogenerate blacklist for watchdog devices (see README)
|
|
install -m 0755 -d tmp/lib/modprobe.d
|
|
ls tmp/lib/modules/${KVNAME}/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
|
|
echo ipmi_watchdog.ko >> watchdog-blacklist.tmp
|
|
cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$$//'|sort -u > tmp/lib/modprobe.d/blacklist_${PACKAGE}.conf
|
|
mv tmp data
|
|
|
|
PVE_CONFIG_OPTS= \
|
|
-m INTEL_MEI_WDT \
|
|
-d CONFIG_SND_PCM_OSS \
|
|
-e CONFIG_TRANSPARENT_HUGEPAGE_MADVISE \
|
|
-d CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS \
|
|
-m CONFIG_CEPH_FS \
|
|
-m CONFIG_BLK_DEV_NBD \
|
|
-m CONFIG_BLK_DEV_RBD \
|
|
-m CONFIG_BCACHE \
|
|
-m CONFIG_JFS_FS \
|
|
-m CONFIG_HFS_FS \
|
|
-m CONFIG_HFSPLUS_FS \
|
|
-e CONFIG_BRIDGE \
|
|
-e CONFIG_BRIDGE_NETFILTER \
|
|
-e CONFIG_BLK_DEV_SD \
|
|
-e CONFIG_BLK_DEV_SR \
|
|
-e CONFIG_BLK_DEV_DM \
|
|
-e CONFIG_BLK_DEV_NVME \
|
|
-d CONFIG_INPUT_EVBUG \
|
|
-d CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND \
|
|
-e CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
|
|
-d CONFIG_MODULE_SIG \
|
|
-d CONFIG_MEMCG_DISABLED \
|
|
-e CONFIG_MEMCG_SWAP_ENABLED \
|
|
-e CONFIG_MEMCG_KMEM \
|
|
-d CONFIG_DEFAULT_CFQ \
|
|
-e CONFIG_DEFAULT_DEADLINE \
|
|
-e CONFIG_MODVERSIONS \
|
|
-d CONFIG_DEFAULT_SECURITY_DAC \
|
|
-e CONFIG_DEFAULT_SECURITY_APPARMOR \
|
|
--set-str CONFIG_DEFAULT_SECURITY apparmor
|
|
|
|
.compile_mark: ${KERNEL_SRC}/README ${KERNEL_CFG_ORG}
|
|
cp ${KERNEL_CFG_ORG} ${KERNEL_SRC}/.config
|
|
cd ${KERNEL_SRC}; ./scripts/config ${PVE_CONFIG_OPTS}
|
|
cd ${KERNEL_SRC}; make oldconfig
|
|
cd ${KERNEL_SRC}; make KBUILD_BUILD_VERSION_TIMESTAMP="PVE ${KERNEL_VER}-${PKGREL} ($(CHANGELOG_DATE))" -j 8
|
|
make -C ${KERNEL_SRC}/tools/perf prefix=/usr HAVE_CPLUS_DEMANGLE=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python2.7
|
|
make -C ${KERNEL_SRC}/tools/perf man
|
|
touch $@
|
|
|
|
${KERNEL_SRC}/README ${KERNEL_CFG_ORG}: ${KERNEL_SRC_SUBMODULE} | submodules
|
|
rm -rf ${KERNEL_SRC}
|
|
cp -a ${KERNEL_SRC_SUBMODULE} ${KERNEL_SRC}
|
|
cat ${KERNEL_SRC}/debian.master/config/config.common.ubuntu ${KERNEL_SRC}/debian.master/config/amd64/config.common.amd64 ${KERNEL_SRC}/debian.master/config/amd64/config.flavour.generic > ${KERNEL_CFG_ORG}
|
|
cd ${KERNEL_SRC}; patch -p1 < ../uname-version-timestamp.patch
|
|
cd ${KERNEL_SRC}; patch -p1 <../bridge-patch.diff
|
|
#cd ${KERNEL_SRC}; patch -p1 <../bridge-forward-ipv6-neighbor-solicitation.patch
|
|
#cd ${KERNEL_SRC}; patch -p1 <../add-empty-ndo_poll_controller-to-veth.patch
|
|
cd ${KERNEL_SRC}; patch -p1 <../override_for_missing_acs_capabilities.patch
|
|
#cd ${KERNEL_SRC}; patch -p1 <../vhost-net-extend-device-allocation-to-vmalloc.patch
|
|
cd ${KERNEL_SRC}; patch -p1 < ../kvm-dynamic-halt-polling-disable-default.patch
|
|
cd ${KERNEL_SRC}; patch -p1 < ../cgroup-cpuset-add-cpuset.remap_cpus.patch
|
|
cd ${KERNEL_SRC}; patch -p1 < ../CVE-2017-2596-kvm-page-reference-leakage-in-handle_vmon.patch
|
|
cd ${KERNEL_SRC}; patch -p1 < ../openvswitch-Set-internal-device-max-mtu-to-ETH_MAX_M.patch
|
|
cd ${KERNEL_SRC}; patch -p1 < ../0001-net-sched-actions-fix-access-to-uninitialized-data.patch
|
|
cd ${KERNEL_SRC}; patch -p1 < ../0002-net-sched-actions-decrement-module-refcount-earlier.patch
|
|
sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
|
|
touch $@
|
|
|
|
aacraid.ko: .compile_mark ${AACRAIDSRC}
|
|
rm -rf ${AACRAIDDIR}
|
|
mkdir ${AACRAIDDIR}
|
|
cd ${AACRAIDDIR};tar xzf ../${AACRAIDSRC}
|
|
cd ${AACRAIDDIR};rpm2cpio aacraid-${AACRAIDVER}.src.rpm|cpio -i
|
|
cd ${AACRAIDDIR};tar xf aacraid_source.tgz
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${AACRAIDDIR} KSRC=${TOP}/${KERNEL_SRC} modules
|
|
cp ${AACRAIDDIR}/aacraid.ko .
|
|
|
|
hpsa.ko hpsa: .compile_mark ${HPSASRC}
|
|
rm -rf ${HPSADIR}
|
|
tar xf ${HPSASRC}
|
|
# sed -i ${HPSADIR}/drivers/scsi/hpsa_kernel_compat.h -e 's/^\/\* #define RHEL7.*/#define RHEL7/'
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${HPSADIR}/drivers/scsi KSRC=${TOP}/${KERNEL_SRC} modules
|
|
cp ${HPSADIR}/drivers/scsi/hpsa.ko hpsa.ko
|
|
|
|
e1000e.ko e1000e: .compile_mark ${E1000ESRC}
|
|
rm -rf ${E1000EDIR}
|
|
tar xf ${E1000ESRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
cd ${E1000EDIR}; patch -p1 < ../intel-module-gcc6-compat.patch
|
|
cd ${E1000EDIR}; patch -p1 < ../e1000e_4.10_compat.patch
|
|
cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
|
|
cp ${E1000EDIR}/src/e1000e.ko e1000e.ko
|
|
|
|
igb.ko igb: .compile_mark ${IGBSRC}
|
|
rm -rf ${IGBDIR}
|
|
tar xf ${IGBSRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
cd ${IGBDIR}; patch -p1 < ../intel-module-gcc6-compat.patch
|
|
cd ${IGBDIR}; patch -p1 < ../igb_4.9_compat.patch
|
|
cd ${IGBDIR}; patch -p1 < ../igb_4.10_compat.patch
|
|
cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
|
|
cp ${IGBDIR}/src/igb.ko igb.ko
|
|
|
|
ixgbe.ko ixgbe: .compile_mark ${IXGBESRC}
|
|
rm -rf ${IXGBEDIR}
|
|
tar xf ${IXGBESRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
cd ${IXGBEDIR}; patch -p1 < ../ixgbe_4.10_compat.patch
|
|
cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO" BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
|
|
cp ${IXGBEDIR}/src/ixgbe.ko ixgbe.ko
|
|
|
|
i40e.ko i40e: .compile_mark ${I40ESRC}
|
|
rm -rf ${I40EDIR}
|
|
tar xf ${I40ESRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
cd ${I40EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
|
|
cp ${I40EDIR}/src/i40e.ko i40e.ko
|
|
|
|
bnx2.ko cnic.ko bnx2x.ko: ${BNX2SRC}
|
|
rm -rf ${BNX2DIR}
|
|
tar xf ${BNX2SRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
cd ${BNX2DIR}; make -C bnx2/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
|
|
cd ${BNX2DIR}; make -C bnx2x/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
|
|
cp `find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
|
|
|
|
arcmsr.ko: .compile_mark ${ARECASRC}
|
|
rm -rf ${ARECADIR}
|
|
mkdir ${ARECADIR}; cd ${ARECADIR}; unzip ../${ARECASRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} SUBDIRS=${TOP}/${ARECADIR} KSRC=${TOP}/${KERNEL_SRC} modules
|
|
cp ${ARECADIR}/arcmsr.ko arcmsr.ko
|
|
|
|
${SPL_MODULES}: .compile_mark ${SPLSRC}
|
|
rm -rf ${SPLDIR}
|
|
tar xf ${SPLSRC}
|
|
cd ${SPLDIR}; ./autogen.sh
|
|
cd ${SPLDIR}; ./configure --with-config=kernel --with-linux=${TOP}/${KERNEL_SRC} --with-linux-obj=${TOP}/${KERNEL_SRC}
|
|
cd ${SPLDIR}; make
|
|
cp ${SPLDIR}/module/spl/spl.ko spl.ko
|
|
cp ${SPLDIR}/module/splat/splat.ko splat.ko
|
|
|
|
${ZFS_MODULES}: .compile_mark ${ZFSSRC}
|
|
rm -rf ${ZFSDIR}
|
|
tar xf ${ZFSSRC}
|
|
cd ${ZFSDIR}; ./autogen.sh
|
|
cd ${ZFSDIR}; ./configure --with-spl=${TOP}/${SPLDIR} --with-spl-obj=${TOP}/${SPLDIR} --with-config=kernel --with-linux=${TOP}/${KERNEL_SRC} --with-linux-obj=${TOP}/${KERNEL_SRC}
|
|
cd ${ZFSDIR}; make
|
|
cp ${ZFSDIR}/module/zfs/zfs.ko zfs.ko
|
|
cp ${ZFSDIR}/module/avl/zavl.ko zavl.ko
|
|
cp ${ZFSDIR}/module/nvpair/znvpair.ko znvpair.ko
|
|
cp ${ZFSDIR}/module/unicode/zunicode.ko zunicode.ko
|
|
cp ${ZFSDIR}/module/zcommon/zcommon.ko zcommon.ko
|
|
cp ${ZFSDIR}/module/zpios/zpios.ko zpios.ko
|
|
|
|
#.PHONY: update-drbd
|
|
#update-drbd:
|
|
# rm -rf ${DRBDDIR} ${DRBDSRC} drbd-9.0
|
|
# git clone --recursive git://git.drbd.org/drbd-9.0
|
|
# cd drbd-9.0; make tarball
|
|
# mv drbd-9.0/${DRBDSRC} ${DRBDSRC}
|
|
#
|
|
#.PHONY: drbd
|
|
#drbd ${DRBD_MODULES}: .compile_mark ${DRBDSRC}
|
|
# rm -rf ${DRBDDIR}
|
|
# tar xzf ${DRBDSRC}
|
|
# [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
|
|
# cd ${DRBDDIR}; make KVER=${KVNAME} KDIR=${TOP}/${KERNEL_SRC}
|
|
# mv ${DRBDDIR}/drbd/drbd.ko drbd.ko
|
|
# mv ${DRBDDIR}/drbd/drbd_transport_tcp.ko drbd_transport_tcp.ko
|
|
|
|
#iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC}
|
|
# rm -rf ${ISCSITARGETDIR}
|
|
# tar xf ${ISCSITARGETSRC}
|
|
# cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC}
|
|
# cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko
|
|
|
|
headers_tmp := $(CURDIR)/tmp-headers
|
|
headers_dir := $(headers_tmp)/usr/src/linux-headers-${KVNAME}
|
|
|
|
${HDR_DEB} hdr: .compile_mark headers-control.in headers-postinst.in
|
|
rm -rf $(headers_tmp)
|
|
install -d $(headers_tmp)/DEBIAN $(headers_dir)/include/
|
|
sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <headers-control.in >$(headers_tmp)/DEBIAN/control
|
|
sed -e 's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in >$(headers_tmp)/DEBIAN/postinst
|
|
chmod 0755 $(headers_tmp)/DEBIAN/postinst
|
|
install -D -m 644 copyright $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/copyright
|
|
install -D -m 644 changelog.Debian $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian
|
|
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/SOURCE
|
|
gzip -n -f --best $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian
|
|
install -m 0644 ${KERNEL_SRC}/.config $(headers_dir)
|
|
install -m 0644 ${KERNEL_SRC}/Module.symvers $(headers_dir)
|
|
cd ${KERNEL_SRC}; find . -path './debian/*' -prune -o -path './include/*' -prune -o -path './Documentation' -prune \
|
|
-o -path './scripts' -prune -o -type f \
|
|
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
|
|
-name '*.sh' -o -name '*.pl' \) \
|
|
-print | cpio -pd --preserve-modification-time $(headers_dir)
|
|
cd ${KERNEL_SRC}; cp -a include scripts $(headers_dir)
|
|
cd ${KERNEL_SRC}; (find arch/x86 -name include -type d -print | \
|
|
xargs -n1 -i: find : -type f) | \
|
|
cpio -pd --preserve-modification-time $(headers_dir)
|
|
mkdir -p ${headers_tmp}/lib/modules/${KVNAME}
|
|
ln -sf /usr/src/linux-headers-${KVNAME} ${headers_tmp}/lib/modules/${KVNAME}/build
|
|
dpkg-deb --build $(headers_tmp) ${HDR_DEB}
|
|
#lintian ${HDR_DEB}
|
|
|
|
.PHONY: upload
|
|
upload: ${DEBS}
|
|
tar cf - ${DEBS}|ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
rm -rf linux-firmware.git dvb-firmware.git ${KERNEL_SRC}.org
|
|
|
|
# upgrade to current master
|
|
.PHONY: update_modules
|
|
update_modules: submodules
|
|
git submodule foreach 'git pull --ff-only origin master'
|
|
|
|
# make sure submodules were initialized
|
|
.PHONY: submodules
|
|
submodules ${SPLSRC} ${ZFSSRC}:
|
|
test -f "${KERNEL_SRC_SUBMODULE}/README" || git submodule update --init
|
|
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf *~ .compile_mark watchdog-blacklist.tmp ${KERNEL_CFG_ORG} ${KERNEL_SRC} ${KERNEL_SRC}.tmp ${KERNEL_CFG_ORG} ${KERNEL_SRC}.org orig tmp data proxmox-ve/data *.deb ${headers_tmp} fwdata fwlist.tmp *.ko abi-${KVNAME} fwlist-${KVNAME} ${ZFSDIR} ${SPLDIR} ${SPL_MODULES} ${ZFS_MODULES} hpsa.ko ${HPSADIR} ${DRBDDIR} drbd-9.0 ${IGBDIR} igb.ko ${IXGBEDIR} ixgbe.ko ${E1000EDIR} e1000e.ko linux-tools ${LINUX_TOOLS_DEB}
|
|
|
|
|
|
|
|
|
|
|