├── .gitignore ├── .gitmodules ├── README.md ├── autobuild.sh ├── debian ├── changelog ├── compat ├── config │ ├── amd64.kconfig │ ├── arm64.kconfig │ ├── common.kconfig │ └── loong64.kconfig ├── copyright ├── patches │ ├── pve │ │ └── 0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch │ ├── series.linux │ ├── series.zfs │ └── zfs │ │ ├── 0001-Check-for-META-and-DCH-consistency-in-autoconf.patch │ │ ├── 0002-always-load-ZFS-module-on-boot.patch │ │ ├── 0003-Fix-the-path-to-the-zed-binary-on-the-systemd-unit.patch │ │ ├── 0004-import-with-d-dev-disk-by-id-in-scan-service.patch │ │ ├── 0005-Enable-zed-emails.patch │ │ ├── 0006-dont-symlink-zed-scripts.patch │ │ ├── 0007-Add-systemd-unit-for-importing-specific-pools.patch │ │ ├── 0008-Patch-move-manpage-arcstat-1-to-arcstat-8.patch │ │ ├── 0009-arc-stat-summary-guard-access-to-freshly-introduced-.patch │ │ ├── 0010-Fix-nfs_truncate_shares-without-etc-exports.d.patch │ │ ├── 0011-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch │ │ └── 0099-CDDL-to-GPL.patch ├── rules ├── rules.d │ ├── arch │ │ ├── amd64.mk │ │ ├── arm64.mk │ │ ├── loong64.mk │ │ └── riscv64.mk │ └── common.mk ├── source │ └── format └── templates │ ├── control.in │ ├── pve-headers.postinst.in │ ├── pve-kernel.postinst.in │ ├── pve-kernel.postrm.in │ └── pve-kernel.prerm.in └── scripts ├── update.sh └── version.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Build artifacts 2 | build 3 | *.prepared 4 | config*.org 5 | *.deb 6 | *.ddeb 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zfs"] 2 | path = zfs 3 | url = https://github.com/openzfs/zfs.git 4 | [submodule "linux"] 5 | path = linux 6 | url = https://gitee.com/openeuler/kernel.git 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pve-port-kernel 2 | 3 | Because maintaining the kernel requires a significant amount of time, we directly use the OpenEuler 6.6 kernel as the default kernel for PVEPort. This kernel is adapted to a variety of ARM devices and LoongArch, supporting more hardware types than the upstream kernel. 4 | 5 | ## How to install 6 | ```bash 7 | apt update 8 | apt search pve-kernel|grep openeuler 9 | apt install pve-kernel-6.6.0-openeuler #meta package.You can get latest version. 10 | ``` 11 | ## How to build 12 | ```bash 13 | bash autobuild.sh 14 | ``` 15 | -------------------------------------------------------------------------------- /autobuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git submodule update --init --depth=1 3 | debian/rules debian/control 4 | apt install devscripts rsync -y 5 | yes |mk-build-deps --install --remove 6 | rm build -rf 7 | mkdir build && rsync -ra * .git build/ 8 | cd build 9 | dpkg-buildpackage -b -us -uc 10 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | pve-kernel (6.6.0-10) openeuler; urgency=medium 2 | 3 | * Update to openeuler 20250604 4 | 5 | * Enable eNFS support 6 | 7 | -- Lierfang Support Team Wed, 04 Jun 2025 17:33:21 +0800 8 | 9 | pve-kernel (6.6.0-9) openeuler; urgency=medium 10 | 11 | * Update to openeuler 20250511 12 | 13 | -- Lierfang Support Team Sun, 11 May 2025 11:05:50 +0000 14 | 15 | pve-kernel (6.6.0-8) openeuler; urgency=medium 16 | 17 | * Update to openeuler 20250404 18 | 19 | -- Jiangcuo Fri, 04 Apr 2025 17:45:37 +0800 20 | 21 | pve-kernel (6.6.0-7) openeuler; urgency=medium 22 | 23 | * Update to openeuler 20250218 24 | 25 | -- root Tue, 18 Feb 2025 18:44:08 +0800 26 | 27 | pve-kernel (6.6.0-6) openeuler; urgency=medium 28 | 29 | * Update to openeuler 20250122 30 | 31 | -- Jiangcuo Wed, 22 Jan 2025 15:47:53 +0800 32 | 33 | pve-kernel (6.6.0-5) openeuler; urgency=medium 34 | 35 | * Update to openeuler 20250102 36 | 37 | -- Jiangcuo Thu, 02 Jan 2025 16:34:15 +0800 38 | 39 | pve-kernel (6.6.0-4) openeuler; urgency=medium 40 | 41 | * rebuild 42 | 43 | -- Jiangcuo Wed, 11 Dec 2024 11:30:53 +0800 44 | 45 | pve-kernel (6.6.0-3) openeuler; urgency=medium 46 | 47 | * rebuild 48 | 49 | -- Jiangcuo Tue, 10 Dec 2024 13:31:14 +0800 50 | 51 | pve-kernel (6.6.0-2) openeuler; urgency=medium 52 | 53 | * Update Linux to 20241204 54 | 55 | -- Jiangcuo Wed, 04 Dec 2024 13:28:54 +0800 56 | 57 | pve-kernel (6.6-20241113) openeuler; urgency=medium 58 | 59 | * Update Linux to 20241113 60 | 61 | -- Jiangcuo Wed, 13 Nov 2024 16:15:21 +0800 62 | 63 | pve-kernel (6.6-20240914) openeuler; urgency=medium 64 | 65 | * Update Linux to 20240914 66 | 67 | * Add Zhaoxin Sata/i2c/crypto drivers 68 | 69 | -- Jiangcuo Sat, 14 Sep 2024 14:24:35 +0800 70 | 71 | pve-kernel (6.6-20240730) openeuler; urgency=medium 72 | 73 | * Update Linux to 20240730 74 | 75 | -- Jiangcuo Tue, 30 Jul 2024 14:47:15 +0000 76 | 77 | pve-kernel (6.6-20240619) openeuler; urgency=medium 78 | 79 | * Update Linux to 20240619 80 | 81 | * Update ZFS to 2.2.4 82 | 83 | -- Jiangcuo Wed, 19 Jun 2024 16:16:26 +0800 84 | 85 | pve-kernel (6.6-20240608.1) openeuler; urgency=medium 86 | 87 | * Add amdgpu virtio ast g200 drm driver support 88 | 89 | -- Jiangcuo Thu, 13 Jun 2024 17:47:10 +0800 90 | 91 | pve-kernel (6.6-20240608) openeuler; urgency=medium 92 | 93 | * Update to Linux 20240608 94 | 95 | * Add riscv64 loong64 arm64 kconfig 96 | 97 | -- Jiangcuo Sat, 08 Jun 2024 15:10:32 +0800 98 | 99 | pve-kernel (6.6-1) openeuler; urgency=medium 100 | 101 | * for openeuler 102 | 103 | -- Jiangcuo Fri, 17 May 2024 20:55:21 +0800 104 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /debian/config/amd64.kconfig: -------------------------------------------------------------------------------- 1 | CONFIG_KVM=m 2 | -------------------------------------------------------------------------------- /debian/config/arm64.kconfig: -------------------------------------------------------------------------------- 1 | # Platform selection 2 | CONFIG_ARCH_ACTIONS=y 3 | CONFIG_ARCH_SUNXI=y 4 | CONFIG_ARCH_APPLE=y 5 | CONFIG_ARCH_BCM=y 6 | CONFIG_ARCH_BCM2835=y 7 | CONFIG_ARCH_BCM_IPROC=y 8 | CONFIG_ARCH_BCMBCA=y 9 | CONFIG_ARCH_BRCMSTB=y 10 | 11 | # ARCH 12 | CONFIG_HISI_VIRTCCA_GUEST=n 13 | CONFIG_KVM_HISI_VIRT=n 14 | 15 | 16 | ### mailbox 17 | 18 | CONFIG_BCM_FLEXRM_MBOX=n 19 | 20 | ### iommu 21 | CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y 22 | 23 | ### Andriod 24 | CONFIG_ANDROID_BINDER_IPC=y 25 | CONFIG_ANDROID_BINDERFS=y 26 | 27 | 28 | ### watchdog 29 | CONFIG_SDEI_WATCHDOG=n 30 | CONFIG_ARM_SDE_INTERFACE=n 31 | 32 | 33 | ### phytium 34 | CONFIG_DRM_PHYTIUM=n 35 | -------------------------------------------------------------------------------- /debian/config/common.kconfig: -------------------------------------------------------------------------------- 1 | # Other 2 | CONFIG_UNICODE=m 3 | CONFIG_KVM=y 4 | 5 | # Virtio 6 | CONFIG_VIRTIO=y 7 | CONFIG_VIRTIO_RING=y 8 | CONFIG_VIRTIO_PCI=y 9 | CONFIG_VIRTIO_BLK=y 10 | CONFIG_VIRTIO_NET=y 11 | CONFIG_VIRTIO_CONSOLE=y 12 | CONFIG_SCSI_VIRTIO=y 13 | CONFIG_VIRT_DRIVERS=y 14 | CONFIG_VMGENID=m 15 | CONFIG_VIRTIO_BALLOON=m 16 | CONFIG_VIRTIO_MEM=m 17 | CONFIG_VIRTIO_INPUT=m 18 | CONFIG_VIRTIO_MMIO=m 19 | CONFIG_VIRTIO_IOMMU=m 20 | 21 | 22 | # Boot options 23 | CONFIG_CMDLINE="" 24 | 25 | # General 26 | CONFIG_KPROBES=y 27 | CONFIG_PREEMPT_NONE=y 28 | 29 | # BPF 30 | CONFIG_BPF_SYSCALL=y 31 | CONFIG_BPF_JIT=y 32 | CONFIG_BPF_UNPRIV_DEFAULT_OFF=y 33 | CONFIG_BPF_LSM=y 34 | CONFIG_BPF_STREAM_PARSER=y 35 | CONFIG_DEBUG_INFO_BTF=n 36 | CONFIG_DEBUG_INFO_BTF_MODULES=n 37 | CONFIG_BPF_SCHED=y 38 | CONFIG_BPF_PRELOAD=y 39 | CONFIG_CGROUP_BPF=y 40 | CONFIG_BPF_KPROBE_OVERRIDE=y 41 | CONFIG_IPV6_SEG6_BPF=y 42 | CONFIG_NETACC_BPF=y 43 | CONFIG_BPF_READAHEAD=y 44 | 45 | # Security 46 | CONFIG_SECURITY_LOCKDOWN_LSM=n 47 | CONFIG_LSM="yama,integrity,apparmor,bpf" 48 | CONFIG_EVM=n 49 | CONFIG_IMA=n 50 | 51 | # Kernel hacking 52 | 53 | 54 | # Enable loadable module support 55 | CONFIG_MODULE_SIG=n 56 | CONFIG_MODULE_SIG_KEY="" 57 | CONFIG_MODULE_SIG_ALL=n 58 | CONFIG_SYSTEM_TRUSTED_KEYS="" 59 | CONFIG_SYSTEM_REVOCATION_KEYS="" 60 | CONFIG_MODULE_SRCVERSION_ALL=n 61 | 62 | # Memory Management options 63 | CONFIG_MEMCG_SWAP_ENABLED=y 64 | CONFIG_MEMCG_V1=y 65 | 66 | # File systems 67 | CONFIG_EXT2_FS=m 68 | CONFIG_EXT4_FS=y 69 | CONFIG_BTRFS_FS=y 70 | CONFIG_FUSE_FS=y 71 | CONFIG_OVERLAY_FS=y 72 | CONFIG_ISO9660_FS=y 73 | CONFIG_VFAT_FS=y 74 | CONFIG_BCACHE=m 75 | CONFIG_JFS_FS=y 76 | CONFIG_HFS_FS=y 77 | CONFIG_HFSPLUS_FS=y 78 | CONFIG_NFS_FS=y 79 | CONFIG_NFS_V3=y 80 | CONFIG_NFS_V4=y 81 | CONFIG_NFS_V4_1_MIGRATION=y 82 | CONFIG_NFS_SWAP=y 83 | CONFIG_RPCSEC_GSS_KRB5=y 84 | CONFIG_ENFS=y 85 | CONFIG_SUNRPC_ENFS=y 86 | CONFIG_NFS_DISABLE_UDP_SUPPORT=y 87 | CONFIG_ROOT_NFS=y 88 | CONFIG_SMB_SERVER=m 89 | CONFIG_CIFS_SMB_DIRECT=y 90 | CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN=y 91 | CONFIG_SMB_SERVER_KERBEROS5=y 92 | CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y 93 | CONFIG_ZONEFS_FS=m 94 | CONFIG_F2FS_FS=m 95 | CONFIG_NILFS2_FS=m 96 | 97 | # Networking support 98 | 99 | CONFIG_IP_PNP=y 100 | CONFIG_IP_PNP_DHCP=y 101 | CONFIG_IP_PNP_BOOTP=y 102 | CONFIG_IP_PNP_RARP=y 103 | CONFIG_XFRM_INTERFACE=y 104 | 105 | CONFIG_BRIDGE=y 106 | CONFIG_BRIDGE_NETFILTER=y 107 | CONFIG_BRIDGE_MRP=y 108 | CONFIG_BRIDGE_CFM=y 109 | CONFIG_BPFILTER=y 110 | CONFIG_PHONET=m 111 | 112 | ## Netfilter 113 | CONFIG_NF_CONNTRACK_BRIDGE=m 114 | CONFIG_NF_CONNTRACK=y 115 | CONFIG_NF_NAT=y 116 | CONFIG_IP_NF_IPTABLES=y 117 | CONFIG_IP_NF_NAT=y 118 | CONFIG_IP_NF_TARGET_MASQUERADE=y 119 | CONFIG_IP_NF_TARGET_NETMAP=y 120 | CONFIG_IP_NF_TARGET_REDIRECT=y 121 | CONFIG_IP6_NF_IPTABLES=y 122 | CONFIG_IP6_NF_TARGET_MASQUERADE=y 123 | CONFIG_IP6_NF_TARGET_NPT=y 124 | 125 | ## Device Drivers 126 | 127 | CONFIG_ISCSI_IBFT=y 128 | 129 | CONFIG_BLK_DEV_NBD=m 130 | CONFIG_BLK_DEV_RBD=m 131 | CONFIG_BLK_DEV_UBLK=m 132 | CONFIG_BLK_DEV_NVME=y 133 | CONFIG_NVME_APPLE=y 134 | CONFIG_ISCSI_TCP=y 135 | CONFIG_SCSI_CXGB3_ISCSI=y 136 | CONFIG_MEGARAID_LEGACY=y 137 | CONFIG_SCSI_MPI3MR=m 138 | CONFIG_SCSI_SNIC=m 139 | 140 | CONFIG_BCACHE_ASYNC_REGISTRATION=y 141 | CONFIG_MD_CLUSTER=m 142 | CONFIG_FUSION=y 143 | CONFIG_FUSION_LAN=m 144 | CONFIG_FUSION_CTL=m 145 | CONFIG_FUSION_SAS=m 146 | CONFIG_FUSION_FC=m 147 | CONFIG_FUSION_SPI=m 148 | 149 | CONFIG_SCSI_BFA_FC=m 150 | CONFIG_SCSI_PM8001=m 151 | 152 | CONFIG_SCSI_PMCRAID=m 153 | CONFIG_SCSI_WD719X=m 154 | CONFIG_SCSI_AM53C974=m 155 | CONFIG_SCSI_DC395x=m 156 | CONFIG_SCSI_EFCT=m 157 | CONFIG_TCM_QLA2XXX=m 158 | CONFIG_SCSI_QLOGIC_1280=m 159 | CONFIG_SCSI_SYM53C8XX_2=m 160 | CONFIG_SCSI_STEX=m 161 | CONFIG_SCSI_INIA100=m 162 | CONFIG_SCSI_INITIO=m 163 | CONFIG_SCSI_IPS=m 164 | CONFIG_SCSI_FDOMAIN_PCI=m 165 | CONFIG_SCSI_DMX3191D=m 166 | CONFIG_SCSI_MYRB=m 167 | CONFIG_SCSI_MYRS=m 168 | CONFIG_SCSI_BUSLOGIC=m 169 | CONFIG_SCSI_FLASHPOINT=m 170 | CONFIG_SCSI_HPTIOP=m 171 | CONFIG_MEGARAID_LEGACY=m 172 | CONFIG_MEGARAID_NEWGEN=m 173 | CONFIG_MEGARAID_MM=m 174 | CONFIG_MEGARAID_MAILBOX=m 175 | 176 | CONFIG_SCSI_ESAS2R=m 177 | CONFIG_SCSI_ARCMSR=m 178 | CONFIG_SCSI_ADVANSYS=m 179 | CONFIG_SCSI_MVUMI=m 180 | CONFIG_SCSI_MVSAS=m 181 | 182 | CONFIG_BLK_DEV_3W_XXXX_RAID=m 183 | CONFIG_SCSI_3W_9XXX=m 184 | CONFIG_SCSI_3W_SAS=m 185 | CONFIG_SCSI_ACARD=m 186 | CONFIG_SCSI_AIC7XXX=m 187 | CONFIG_SCSI_AIC79XX=m 188 | CONFIG_SCSI_AIC94XX=m 189 | CONFIG_MLX5_VFIO_PCI=m 190 | 191 | CONFIG_PDS_VFIO_PCI=m 192 | 193 | CONFIG_NVME_TARGET_PASSTHRU=y 194 | CONFIG_NVME_TARGET_AUTH=y 195 | CONFIG_NVME_AUTH=y 196 | CONFIG_NVME_HWMON=y 197 | 198 | 199 | ### Network device support 200 | CONFIG_NET_VENDOR_3COM=y 201 | CONFIG_VORTEX=m 202 | CONFIG_TYPHOON=m 203 | CONFIG_OWL_EMAC=m 204 | CONFIG_NET_VENDOR_ADAPTEC=y 205 | CONFIG_ADAPTEC_STARFIRE=m 206 | CONFIG_NET_VENDOR_AGERE=y 207 | CONFIG_ET131X=m 208 | CONFIG_SLICOSS=m 209 | CONFIG_NET_VENDOR_ALTEON=y 210 | CONFIG_ACENIC=m 211 | CONFIG_ACENIC_OMIT_TIGON_I=y 212 | CONFIG_ALTERA_TSE=m 213 | CONFIG_PDS_CORE=m 214 | CONFIG_AQTION=m 215 | CONFIG_ATL2=m 216 | CONFIG_B44=m 217 | CONFIG_BCMGENET=m 218 | CONFIG_SYSTEMPORT=m 219 | CONFIG_BNXT_HWMON=y 220 | CONFIG_CHELSIO_T1=m 221 | CONFIG_CHELSIO_T1_1G=y 222 | CONFIG_CHELSIO_T4_DCB=y 223 | CONFIG_CHELSIO_T4_FCOE=y 224 | CONFIG_NET_VENDOR_CISCO=y 225 | CONFIG_ENIC=m 226 | CONFIG_NET_VENDOR_CORTINA=y 227 | CONFIG_GEMINI_ETHERNET=m 228 | CONFIG_NET_VENDOR_DLINK=y 229 | CONFIG_DL2K=m 230 | CONFIG_SUNDANCE=m 231 | CONFIG_NET_VENDOR_EMULEX=y 232 | CONFIG_BE2NET=m 233 | CONFIG_TSNEP=m 234 | CONFIG_FUN_ETH=m 235 | CONFIG_HIX5HD2_GMAC=m 236 | CONFIG_HISI_FEMAC=m 237 | CONFIG_HIP04_ETH=m 238 | CONFIG_NET_VENDOR_I825XX=y 239 | CONFIG_E100=m 240 | CONFIG_I40E_DCB=y 241 | CONFIG_IGC=m 242 | CONFIG_JME=m 243 | CONFIG_LITEX_LITEETH=m 244 | CONFIG_NET_VENDOR_MARVELL=y 245 | CONFIG_MVMDIO=m 246 | CONFIG_SKGE=m 247 | CONFIG_SKY2=m 248 | CONFIG_OCTEONTX2_AF=m 249 | CONFIG_OCTEONTX2_PF=m 250 | CONFIG_OCTEONTX2_VF=m 251 | CONFIG_OCTEON_EP=m 252 | CONFIG_PRESTERA=m 253 | CONFIG_MLX4_CORE_GEN2=y 254 | CONFIG_MLX5_MACSEC=y 255 | CONFIG_MLX5_EN_IPSEC=y 256 | CONFIG_MLX5_EN_TLS=y 257 | CONFIG_MLX5_SF=y 258 | CONFIG_MLXSW_SPECTRUM=m 259 | CONFIG_MLXBF_GIGE=m 260 | CONFIG_MYRI10GE=m 261 | CONFIG_NET_VENDOR_NETERION=y 262 | CONFIG_S2IO=y 263 | CONFIG_NET_VENDOR_NATSEMI=y 264 | CONFIG_NATSEMI=m 265 | CONFIG_NS83820=m 266 | CONFIG_NET_VENDOR_NI=y 267 | CONFIG_NI_XGE_MANAGEMENT_ENET=m 268 | CONFIG_NE2K_PCI=m 269 | CONFIG_NET_VENDOR_NVIDIA=y 270 | CONFIG_FORCEDETH=m 271 | CONFIG_QLCNIC=m 272 | CONFIG_NET_VENDOR_BROCADE=y 273 | CONFIG_BNA=m 274 | CONFIG_NET_VENDOR_SAMSUNG=y 275 | CONFIG_SXGBE_ETH=m 276 | CONFIG_SC92031=m 277 | CONFIG_NET_VENDOR_SIS=y 278 | CONFIG_SIS900=m 279 | CONFIG_SIS190=m 280 | CONFIG_SFC_FALCON=m 281 | CONFIG_SFC_SIENA=m 282 | CONFIG_SFC_SIENA_SRIOV=y 283 | CONFIG_THUNDER_NIC_PF=m 284 | CONFIG_THUNDER_NIC_VF=m 285 | CONFIG_MACB=m 286 | CONFIG_MACB_PCI=m 287 | CONFIG_NET_VENDOR_STMICRO=y 288 | CONFIG_STMMAC_ETH=m 289 | CONFIG_NET_VENDOR_SUN=y 290 | CONFIG_HAPPYMEAL=m 291 | CONFIG_SUNGEM=m 292 | CONFIG_CASSINI=m 293 | CONFIG_NIU=m 294 | CONFIG_NET_VENDOR_TEHUTI=y 295 | CONFIG_TEHUTI=m 296 | CONFIG_NET_VENDOR_CAVIUM=y 297 | CONFIG_LIQUIDIO=m 298 | CONFIG_LIQUIDIO_VF=m 299 | CONFIG_NET_VENDOR_AMD=y 300 | CONFIG_NET_VENDOR_ATHEROS=y 301 | CONFIG_ATL2=m 302 | CONFIG_ATL1=m 303 | CONFIG_ATL1E=m 304 | CONFIG_ATL1C=m 305 | CONFIG_ALX=m 306 | CONFIG_CRYPTO_DEV_CHELSIO_TLS=m 307 | CONFIG_CHELSIO_TLS_DEVICE=m 308 | CONFIG_MXGBE=y 309 | CONFIG_MXGBEVF=m 310 | CONFIG_MXGBEM=m 311 | CONFIG_MGBE=m 312 | CONFIG_MGBEVF=m 313 | CONFIG_NET_VENDOR_QLOGIC=y 314 | CONFIG_QLA3XXX=m 315 | CONFIG_QLCNIC=m 316 | CONFIG_NETXEN_NIC=m 317 | CONFIG_QED=m 318 | CONFIG_QEDE=m 319 | CONFIG_NET_VENDOR_SOLARFLARE=y 320 | CONFIG_SFC=m 321 | CONFIG_SFC_FALCON=m 322 | CONFIG_NET_VENDOR_BZWX=y 323 | CONFIG_NCE=m 324 | CONFIG_NE6X=m 325 | CONFIG_NE6XVF=m 326 | CONFIG_WIREGUARD=m 327 | CONFIG_EQUALIZER=m 328 | CONFIG_AMT=m 329 | CONFIG_BAREUDP=m 330 | CONFIG_GTP=m 331 | CONFIG_AMD8111_ETH=m 332 | CONFIG_PCNET32=m 333 | CONFIG_AMD_XGBE_DCB=m 334 | CONFIG_NET_VENDOR_CADENCE=m 335 | CONFIG_MACB=m 336 | CONFIG_MACB_PCI=m 337 | CONFIG_FEALNX=m 338 | CONFIG_IONIC=m 339 | CONFIG_NET_VENDOR_RENESAS=m 340 | CONFIG_NET_VENDOR_SILAN=m 341 | CONFIG_SC92031=m 342 | CONFIG_NET_VENDOR_SYNOPSYS=m 343 | CONFIG_DWC_XLGMAC=m 344 | CONFIG_DWC_XLGMAC_PCI=m 345 | CONFIG_NET_VENDOR_VIA=m 346 | CONFIG_VIA_RHINE=m 347 | CONFIG_VIA_VELOCITY=m 348 | 349 | 350 | ### Graphics support 351 | CONFIG_DRM=y 352 | CONFIG_DRM_VKMS=m 353 | CONFIG_DRM_VGEM=m 354 | CONFIG_DRM_SIMPLEDRM=y 355 | CONFIG_FB_UVESA=m 356 | CONFIG_SYSFB_SIMPLEFB=y 357 | CONFIG_FB_LS2K500=m 358 | 359 | 360 | ### iommu 361 | CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y 362 | CONFIG_QAT_VFIO_PCI=y 363 | 364 | ### serials 365 | CONFIG_USB_SERIAL_SIMPLE=m 366 | 367 | 368 | ### sound 369 | CONFIG_SND=m 370 | 371 | ### stage 372 | CONFIG_STAGING=y 373 | CONFIG_PRISM2_USB=m 374 | CONFIG_QLGE=m 375 | 376 | ### hyperv 377 | 378 | CONFIG_HYPERV=m 379 | CONFIG_HYPERV_UTILS=m 380 | CONFIG_HYPERV_BALLOON=m 381 | 382 | ### crypto 383 | 384 | 385 | CONFIG_CRYPTO_DEV_QAT_DH895xCC=m 386 | CONFIG_CRYPTO_DEV_QAT_C62X=m 387 | CONFIG_CRYPTO_DEV_QAT_C3XXX=m 388 | CONFIG_CRYPTO_DEV_QAT_420XX=m 389 | CONFIG_CRYPTO_DEV_QAT_4XXX=m 390 | 391 | CONFIG_CRYPTO_DEV_QAT_C62XVF=m 392 | CONFIG_CRYPTO_DEV_QAT_C3XXXVF=m 393 | CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=m 394 | 395 | CONFIG_CRYPTO_DEV_NITROX_CNN55XX=m 396 | 397 | 398 | ### serials 399 | CONFIG_SERIAL_8250_16550A_VARIANTS=y 400 | CONFIG_SERIAL_8250_FINTEK=y 401 | CONFIG_SERIAL_8250_MEN_MCB=m 402 | CONFIG_SERIAL_8250_PCI1XXXX=m 403 | CONFIG_SERIAL_8250_DFL=m 404 | CONFIG_SERIAL_8250_RT288X=y 405 | CONFIG_SERIAL_8250_FINTEK=y 406 | CONFIG_SERIAL_8250_16550A_VARIANTS=y 407 | CONFIG_SERIAL_8250_PCI1XXXX=y 408 | CONFIG_SERIAL_8250_RT288X=y 409 | CONFIG_SERIAL_MAX3100=y 410 | CONFIG_SERIAL_MAX310X=y 411 | 412 | ### other 413 | 414 | CONFIG_HISI_HIKEY_USB=m 415 | CONFIG_BLK_CGROUP_FC_APPID=m 416 | CONFIG_EFI_ZBOOT=y 417 | -------------------------------------------------------------------------------- /debian/config/loong64.kconfig: -------------------------------------------------------------------------------- 1 | CONFIG_LOONGARCH_IOMMU=m 2 | CONFIG_ARCH_IOREMAP=y 3 | CONFIG_CPU_HAS_LBT=y 4 | CONFIG_NR_CPUS=256 5 | CONFIG_LOONGSON3_ACPI_CPUFREQ=y 6 | CONFIG_CRYPTO_CRC32_LOONGARCH=y 7 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: Linux kernel 3 | Source: https://www.kernel.org/pub/linux/kernel/ 4 | Files-Excluded: linux/Documentation/netlabel/draft-ietf-cipso-ipsecurity-01.txt 5 | linux/arch/powerpc/platforms/8xx/micropatch.c 6 | linux/drivers/media/usb/dvb-usb/af9005-script.h 7 | linux/drivers/media/i2c/vs6624.c 8 | linux/drivers/net/appletalk/cops* 9 | linux/drivers/video/fbdev/nvidia 10 | linux/drivers/video/fbdev/riva 11 | Comment: 12 | The 'perf' tool is dynamically linked with the Python interpreter, 13 | which is itself dynamically linked with OpenSSL, which is not 14 | GPL-compatible. However, since perf itself does not link with or use 15 | OpenSSL, we believe that this indirect linking does not require 16 | additional permissions beyond the GPL. 17 | 18 | Files: linux/* 19 | Copyright: 1991-2012 Linus Torvalds and many others 20 | License: GPL-2 21 | 22 | Files: zfs/* 23 | Copyright: ZFS authors 24 | License: CDDL 25 | 26 | Files: debian/* 27 | Copyright: 2021 Fabian Mastenbroek 28 | License: GPL-2 29 | 30 | Files: linux/drivers/crypto/vmx/*.pl 31 | Copyright: 2006,2014 Andy Polyakov 32 | License: CRYPTOGAMS 33 | All rights reserved. 34 | . 35 | Redistribution and use in source and binary forms, with or without 36 | modification, are permitted provided that the following conditions 37 | are met: 38 | . 39 | * Redistributions of source code must retain copyright notices, this 40 | list of conditions and the following disclaimer. 41 | * Redistributions in binary form must reproduce the above copyright 42 | notice, this list of conditions and the following disclaimer in the 43 | documentation and/or other materials provided with the 44 | distribution. 45 | * Neither the name of the CRYPTOGAMS nor the names of its copyright 46 | holder and contributors may be used to endorse or promote products 47 | derived from this software without specific prior written 48 | permission. 49 | . 50 | ALTERNATIVELY, provided that this notice is retained in full, this 51 | product may be distributed under the terms of the GNU General Public 52 | License (GPL), in which case the provisions of the GPL apply INSTEAD 53 | OF those given above. 54 | . 55 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS 56 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 57 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 58 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 59 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 60 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 61 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 62 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 63 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 64 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 65 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 66 | 67 | Files: linux/fs/nls/mac-* 68 | Copyright: 1991-2012 Unicode, Inc. 69 | License: Unicode-data 70 | All rights reserved. Distributed under the Terms of Use in 71 | http://www.unicode.org/copyright.html. 72 | . 73 | Permission is hereby granted, free of charge, to any person obtaining a 74 | copy of the Unicode data files and any associated documentation (the "Data 75 | Files") or Unicode software and any associated documentation (the 76 | "Software") to deal in the Data Files or Software without restriction, 77 | including without limitation the rights to use, copy, modify, merge, 78 | publish, distribute, and/or sell copies of the Data Files or Software, and 79 | to permit persons to whom the Data Files or Software are furnished to do 80 | so, provided that (a) the above copyright notice(s) and this permission 81 | notice appear with all copies of the Data Files or Software, (b) both the 82 | above copyright notice(s) and this permission notice appear in associated 83 | documentation, and (c) there is clear notice in each modified Data File or 84 | in the Software as well as in the documentation associated with the Data 85 | File(s) or Software that the data or software has been modified. 86 | . 87 | THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 88 | KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 89 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 90 | THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 91 | INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 92 | OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 93 | USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 94 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 95 | PERFORMANCE OF THE DATA FILES OR SOFTWARE. 96 | . 97 | Except as contained in this notice, the name of a copyright holder shall 98 | not be used in advertising or otherwise to promote the sale, use or other 99 | dealings in these Data Files or Software without prior written 100 | authorization of the copyright holder. 101 | 102 | Files: linux/include/xen/interface/* 103 | Copyright: 2002-2006 Keir Fraser 104 | 2004 Tim Deegan 105 | 2004 Andrew Warfield 106 | 2005 Nguyen Anh Quynh 107 | 2005-2006 IBM Corporation 108 | 2005 Anthony Liguori 109 | 2005 Rusty Russell 110 | 2005-2006 XenSource Ltd. 111 | 2006 Ian Campbell 112 | 2006 Red Hat, Inc. 113 | 2010 Ryan Wilson 114 | License: Xen-interface 115 | Permission is hereby granted, free of charge, to any person obtaining a copy 116 | of this software and associated documentation files (the "Software"), to 117 | deal in the Software without restriction, including without limitation the 118 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 119 | sell copies of the Software, and to permit persons to whom the Software is 120 | furnished to do so, subject to the following conditions: 121 | . 122 | The above copyright notice and this permission notice shall be included in 123 | all copies or substantial portions of the Software. 124 | . 125 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 126 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 127 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 128 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 129 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 130 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 131 | DEALINGS IN THE SOFTWARE. 132 | 133 | Files: linux/scripts/extract-cert.c scripts/sign-file.c 134 | Copyright: 2014-2015 Red Hat, Inc. 135 | 2015 Intel Corporation 136 | License: LGPL-2.1 137 | 138 | Files: linux/tools/lib/bpf/* 139 | Copyright: 2015-2020 Linus Torvalds and many others 140 | License: LGPL-2.1 or BSD-2-clause 141 | 142 | Files: linux/tools/bpf/bpftool/* 143 | Copyright: 2017-2020 Linus Torvalds and many others 144 | License: GPL-2 or BSD-2-clause 145 | 146 | License: BSD-2-clause 147 | Redistribution and use in source and binary forms, with or without 148 | modification, are permitted provided that the following conditions are met: 149 | . 150 | 1. Redistributions of source code must retain the above copyright notice, 151 | this list of conditions and the following disclaimer. 152 | . 153 | 2. Redistributions in binary form must reproduce the above copyright 154 | notice, this list of conditions and the following disclaimer in the 155 | documentation and/or other materials provided with the distribution. 156 | . 157 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 158 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 159 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 160 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 161 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 162 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 163 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 164 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 165 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 166 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 167 | POSSIBILITY OF SUCH DAMAGE. 168 | 169 | License: GPL-2 170 | This package is free software; you can redistribute it and/or modify 171 | it under the terms of the GNU General Public License version 2 as 172 | published by the Free Software Foundation. 173 | . 174 | This package is distributed in the hope that it will be useful, 175 | but WITHOUT ANY WARRANTY; without even the implied warranty of 176 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 177 | GNU General Public License for more details. 178 | . 179 | You should have received a copy of the GNU General Public License 180 | along with this package; if not, write to the Free Software 181 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 182 | . 183 | On Debian systems, the complete text of the GNU General Public License version 184 | 2 can be found in `/usr/share/common-licenses/GPL-2'. 185 | 186 | License: LGPL-2.1 187 | This program is free software; you can redistribute it and/or modify it 188 | under the terms of the GNU Lesser General Public License as published by 189 | the Free Software Foundation; either version 2.1 of the License, or 190 | (at your option) any later version. 191 | . 192 | This program is distributed in the hope that it will be useful, but 193 | WITHOUT ANY WARRANTY; without even the implied warranty of 194 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 195 | Lesser General Public License for more details. 196 | . 197 | You should have received a copy of the GNU Lesser General Public License 198 | along with this program; If not, see . 199 | . 200 | On Debian systems, the complete text of the GNU Lesser General Public 201 | License version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. 202 | 203 | License: GPL-2+ or X11 204 | This file is dual-licensed: you can use it either under the terms 205 | of the GPL or the X11 license, at your option. Note that this dual 206 | licensing only applies to this file, and not this project as a 207 | whole. 208 | . 209 | a) This file is free software; you can redistribute it and/or 210 | modify it under the terms of the GNU General Public License as 211 | published by the Free Software Foundation; either version 2 of the 212 | License, or (at your option) any later version. 213 | . 214 | This file is distributed in the hope that it will be useful, 215 | but WITHOUT ANY WARRANTY; without even the implied warranty of 216 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 217 | GNU General Public License for more details. 218 | . 219 | Or, alternatively, 220 | . 221 | b) Permission is hereby granted, free of charge, to any person 222 | obtaining a copy of this software and associated documentation 223 | files (the "Software"), to deal in the Software without 224 | restriction, including without limitation the rights to use, 225 | copy, modify, merge, publish, distribute, sublicense, and/or 226 | sell copies of the Software, and to permit persons to whom the 227 | Software is furnished to do so, subject to the following 228 | conditions: 229 | . 230 | The above copyright notice and this permission notice shall be 231 | included in all copies or substantial portions of the Software. 232 | . 233 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 234 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 235 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 236 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 237 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 238 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 239 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 240 | OTHER DEALINGS IN THE SOFTWARE. 241 | 242 | License: CDDL 243 | The contents of this file are subject to the terms of the 244 | Common Development and Distribution License (the "License"). 245 | You may not use this file except in compliance with the License. 246 | 247 | You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 248 | or http://www.opensolaris.org/os/licensing. 249 | See the License for the specific language governing permissions 250 | and limitations under the License. 251 | 252 | When distributing Covered Code, include this CDDL HEADER in each 253 | file and include the License file at usr/src/OPENSOLARIS.LICENSE. 254 | If applicable, add the following below this CDDL HEADER, with the 255 | fields enclosed by brackets "[]" replaced with your own identifying 256 | information: Portions Copyright [yyyy] [name of copyright owner] 257 | -------------------------------------------------------------------------------- /debian/patches/pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Ben Hutchings 3 | Date: Tue, 12 May 2015 19:29:22 +0100 4 | Subject: [PATCH] Make mkcompile_h accept an alternate timestamp string 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | We want to include the Debian version in the utsname::version string 10 | instead of a full timestamp string. However, we still need to provide 11 | a standard timestamp string for gen_initramfs_list.sh to make the 12 | kernel image reproducible. 13 | 14 | Make mkcompile_h use $KBUILD_BUILD_VERSION_TIMESTAMP in preference to 15 | $KBUILD_BUILD_TIMESTAMP. 16 | 17 | Signed-off-by: Fabian Grünbichler 18 | Signed-off-by: Thomas Lamprecht 19 | --- 20 | init/Makefile | 2 +- 21 | 1 file changed, 1 insertion(+), 1 deletion(-) 22 | 23 | diff --git a/init/Makefile b/init/Makefile 24 | index 8316c23bead2..e99b8de4a93a 100644 25 | --- a/init/Makefile 26 | +++ b/init/Makefile 27 | @@ -29,7 +29,7 @@ preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC 28 | preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT 29 | 30 | build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto)) 31 | -build-timestamp = $(or $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto)) 32 | +build-timestamp = $(or $(KBUILD_BUILD_VERSION_TIMESTAMP), $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto)) 33 | 34 | # Maximum length of UTS_VERSION is 64 chars 35 | filechk_uts_version = \ 36 | -------------------------------------------------------------------------------- /debian/patches/series.linux: -------------------------------------------------------------------------------- 1 | pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch 2 | -------------------------------------------------------------------------------- /debian/patches/series.zfs: -------------------------------------------------------------------------------- 1 | zfs/0001-Check-for-META-and-DCH-consistency-in-autoconf.patch 2 | zfs/0002-always-load-ZFS-module-on-boot.patch 3 | zfs/0003-Fix-the-path-to-the-zed-binary-on-the-systemd-unit.patch 4 | zfs/0004-import-with-d-dev-disk-by-id-in-scan-service.patch 5 | zfs/0005-Enable-zed-emails.patch 6 | zfs/0006-dont-symlink-zed-scripts.patch 7 | zfs/0007-Add-systemd-unit-for-importing-specific-pools.patch 8 | zfs/0008-Patch-move-manpage-arcstat-1-to-arcstat-8.patch 9 | zfs/0009-arc-stat-summary-guard-access-to-freshly-introduced-.patch 10 | zfs/0010-Fix-nfs_truncate_shares-without-etc-exports.d.patch 11 | zfs/0011-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch 12 | zfs/0099-CDDL-to-GPL.patch 13 | -------------------------------------------------------------------------------- /debian/patches/zfs/0001-Check-for-META-and-DCH-consistency-in-autoconf.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Debian ZFS on Linux maintainers 3 | 4 | Date: Wed, 30 Jan 2019 15:12:04 +0100 5 | Subject: [PATCH] Check-for-META-and-DCH-consistency-in-autoconf 6 | 7 | Signed-off-by: Thomas Lamprecht 8 | --- 9 | config/zfs-meta.m4 | 34 +++++++++++++++++++++++++++++----- 10 | 1 file changed, 29 insertions(+), 5 deletions(-) 11 | 12 | diff --git a/config/zfs-meta.m4 b/config/zfs-meta.m4 13 | index 20064a0fb..4d5f545ad 100644 14 | --- a/config/zfs-meta.m4 15 | +++ b/config/zfs-meta.m4 16 | @@ -1,9 +1,10 @@ 17 | dnl # 18 | dnl # DESCRIPTION: 19 | -dnl # Read meta data from the META file. When building from a git repository 20 | -dnl # the ZFS_META_RELEASE field will be overwritten if there is an annotated 21 | -dnl # tag matching the form ZFS_META_NAME-ZFS_META_VERSION-*. This allows 22 | -dnl # for working builds to be uniquely identified using the git commit hash. 23 | +dnl # Read meta data from the META file or the debian/changelog file if it 24 | +dnl # exists. When building from a git repository the ZFS_META_RELEASE field 25 | +dnl # will be overwritten if there is an annotated tag matching the form 26 | +dnl # ZFS_META_NAME-ZFS_META_VERSION-*. This allows for working builds to be 27 | +dnl # uniquely identified using the git commit hash. 28 | dnl # 29 | dnl # The META file format is as follows: 30 | dnl # ^[ ]*KEY:[ \t]+VALUE$ 31 | @@ -49,6 +50,7 @@ AC_DEFUN([ZFS_AC_META], [ 32 | _zfs_ac_meta_type="none" 33 | if test -f "$META"; then 34 | _zfs_ac_meta_type="META file" 35 | + _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null) 36 | 37 | ZFS_META_NAME=_ZFS_AC_META_GETVAL([(Name|Project|Package)]); 38 | if test -n "$ZFS_META_NAME"; then 39 | @@ -69,8 +71,30 @@ AC_DEFUN([ZFS_AC_META], [ 40 | AC_SUBST([ZFS_META_VERSION]) 41 | fi 42 | 43 | + if test -n "${_dpkg_parsechangelog}"; then 44 | + _dpkg_version=$(echo "${_dpkg_parsechangelog}" \ 45 | + | $AWK '$[]1 == "Version:" { print $[]2; }' \ 46 | + | cut -d- -f1) 47 | + if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then 48 | + AC_MSG_ERROR([ 49 | + *** Version $ZFS_META_VERSION in the META file is different than 50 | + *** version $_dpkg_version in the debian/changelog file. DKMS and DEB 51 | + *** packaging require that these files have the same version. 52 | + ]) 53 | + fi 54 | + fi 55 | + 56 | ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]); 57 | - if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then 58 | + 59 | + if test -n "${_dpkg_parsechangelog}"; then 60 | + _dpkg_release=$(echo "${_dpkg_parsechangelog}" \ 61 | + | $AWK '$[]1 == "Version:" { print $[]2; }' \ 62 | + | cut -d- -f2-) 63 | + if test -n "${_dpkg_release}"; then 64 | + ZFS_META_RELEASE=${_dpkg_release} 65 | + _zfs_ac_meta_type="dpkg-parsechangelog" 66 | + fi 67 | + elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then 68 | _match="${ZFS_META_NAME}-${ZFS_META_VERSION}" 69 | _alias=$(git describe --match=${_match} 2>/dev/null) 70 | _release=$(echo ${_alias}|sed "s/${ZFS_META_NAME}//"|cut -f3- -d'-'|tr - _) 71 | -------------------------------------------------------------------------------- /debian/patches/zfs/0002-always-load-ZFS-module-on-boot.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= 3 | Date: Fri, 19 Jan 2018 12:13:46 +0100 4 | Subject: [PATCH] always load ZFS module on boot 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | since zfs-import-scan.service is disabled by default, and 10 | zfs-import-cache.service only gets started if a cache file exists, this 11 | is needed for zfs-mount, zfs-share and zfs-zed services in case ZFS is 12 | not actually used. 13 | 14 | Signed-off-by: Fabian Grünbichler 15 | Signed-off-by: Stoiko Ivanov 16 | Signed-off-by: Thomas Lamprecht 17 | --- 18 | etc/modules-load.d/zfs.conf | 2 +- 19 | 1 file changed, 1 insertion(+), 1 deletion(-) 20 | 21 | diff --git a/etc/modules-load.d/zfs.conf b/etc/modules-load.d/zfs.conf 22 | index 44e1bb3ed..7509b03cb 100644 23 | --- a/etc/modules-load.d/zfs.conf 24 | +++ b/etc/modules-load.d/zfs.conf 25 | @@ -1,3 +1,3 @@ 26 | # The default behavior is to allow udev to load the kernel modules on demand. 27 | # Uncomment the following line to unconditionally load them at boot. 28 | -#zfs 29 | +zfs 30 | -------------------------------------------------------------------------------- /debian/patches/zfs/0003-Fix-the-path-to-the-zed-binary-on-the-systemd-unit.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= 3 | Date: Mon, 6 Feb 2017 12:04:35 +0100 4 | Subject: [PATCH] Fix the path to the zed binary on the systemd unit. 5 | 6 | We install zed into /usr/sbin manually meanwhile the upstream default is 7 | installing it into /sbin. Ubuntu packages also install zed to /usr/sbin, but 8 | they ship their own zfs-zed unit. 9 | 10 | Signed-off-by: Thomas Lamprecht 11 | --- 12 | etc/systemd/system/zfs-zed.service.in | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/etc/systemd/system/zfs-zed.service.in b/etc/systemd/system/zfs-zed.service.in 16 | index be2fc6734..7606604ec 100644 17 | --- a/etc/systemd/system/zfs-zed.service.in 18 | +++ b/etc/systemd/system/zfs-zed.service.in 19 | @@ -5,7 +5,7 @@ ConditionPathIsDirectory=/sys/module/zfs 20 | 21 | [Service] 22 | EnvironmentFile=-@initconfdir@/zfs 23 | -ExecStart=@sbindir@/zed -F 24 | +ExecStart=/usr/sbin/zed -F 25 | Restart=always 26 | 27 | [Install] 28 | -------------------------------------------------------------------------------- /debian/patches/zfs/0004-import-with-d-dev-disk-by-id-in-scan-service.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= 3 | Date: Mon, 24 Oct 2016 13:47:06 +0200 4 | Subject: [PATCH] import with -d /dev/disk/by-id in scan service 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | Signed-off-by: Fabian Grünbichler 10 | Signed-off-by: Stoiko Ivanov 11 | Signed-off-by: Thomas Lamprecht 12 | --- 13 | etc/systemd/system/zfs-import-scan.service.in | 2 +- 14 | 1 file changed, 1 insertion(+), 1 deletion(-) 15 | 16 | diff --git a/etc/systemd/system/zfs-import-scan.service.in b/etc/systemd/system/zfs-import-scan.service.in 17 | index c5dd45d87..1c792edf0 100644 18 | --- a/etc/systemd/system/zfs-import-scan.service.in 19 | +++ b/etc/systemd/system/zfs-import-scan.service.in 20 | @@ -14,7 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs 21 | Type=oneshot 22 | RemainAfterExit=yes 23 | EnvironmentFile=-@initconfdir@/zfs 24 | -ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS 25 | +ExecStart=@sbindir@/zpool import -aN -d /dev/disk/by-id -o cachefile=none $ZPOOL_IMPORT_OPTS 26 | 27 | [Install] 28 | WantedBy=zfs-import.target 29 | -------------------------------------------------------------------------------- /debian/patches/zfs/0005-Enable-zed-emails.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Richard Laager 3 | Date: Wed, 30 Jan 2019 15:12:04 +0100 4 | Subject: [PATCH] Enable zed emails 5 | 6 | The OpenZFS event daemon monitors pools. This patch enables the email sending 7 | function by default (if zed is installed). This is consistent with the default 8 | behavior of mdadm. 9 | 10 | Signed-off-by: Thomas Lamprecht 11 | --- 12 | cmd/zed/zed.d/zed.rc | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/cmd/zed/zed.d/zed.rc b/cmd/zed/zed.d/zed.rc 16 | index 859c6f9cb..9d1ee1560 100644 17 | --- a/cmd/zed/zed.d/zed.rc 18 | +++ b/cmd/zed/zed.d/zed.rc 19 | @@ -41,7 +41,7 @@ ZED_EMAIL_ADDR="root" 20 | ## 21 | # Minimum number of seconds between notifications for a similar event. 22 | # 23 | -#ZED_NOTIFY_INTERVAL_SECS=3600 24 | +ZED_NOTIFY_INTERVAL_SECS=3600 25 | 26 | ## 27 | # Notification verbosity. 28 | -------------------------------------------------------------------------------- /debian/patches/zfs/0006-dont-symlink-zed-scripts.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Antonio Russo 3 | Date: Fri, 20 Mar 2020 17:28:43 +0100 4 | Subject: [PATCH] dont symlink zed scripts 5 | 6 | Of the zedlet scripts shipped by upstream, a subset are enabled by 7 | default, by creating symlinks in /etc/zfs/zed.d. These symlinks are 8 | shipped in the zfs-zed package. dpkg, however, does not support 9 | conffile handling of symlinks, and therefore any changes (removals) to 10 | the symlinks are not preserved on package upgrade. 11 | 12 | To address this policy violation, we: 13 | 14 | 1. During package build, create a list of enabled-by-default zedlets, 15 | instead of creating symlinks. 16 | 2. On package removal, identify all enabled-by-default zedlets whose 17 | symlinks do not exist (i.e., were removed by the user). This is done 18 | by creating "whiteout" links to /dev/null in their place). 19 | 3. On package installation, create links to enabled-by-default zedlets 20 | UNLESS there is already a file there (i.e., abort if there is a 21 | whiteout link). 22 | 4. We also clean up broken symlinks to removed zedlets at package 23 | postinst. 24 | 25 | Description: track default symlinks, instead of symlinking 26 | Forwarded: no need 27 | (cherry picked from https://salsa.debian.org/zfsonlinux-team/zfs/-/commit/5cee380324d7) 28 | Signed-off-by: Stoiko Ivanov 29 | Signed-off-by: Thomas Lamprecht 30 | --- 31 | cmd/zed/zed.d/Makefile.am | 2 +- 32 | 1 file changed, 1 insertion(+), 1 deletion(-) 33 | 34 | diff --git a/cmd/zed/zed.d/Makefile.am b/cmd/zed/zed.d/Makefile.am 35 | index 093a04c46..e5e735d00 100644 36 | --- a/cmd/zed/zed.d/Makefile.am 37 | +++ b/cmd/zed/zed.d/Makefile.am 38 | @@ -50,7 +50,7 @@ zed-install-data-hook: 39 | set -x; for f in $(zedconfdefaults); do \ 40 | [ -f "$(DESTDIR)$(zedconfdir)/$${f}" ] ||\ 41 | [ -L "$(DESTDIR)$(zedconfdir)/$${f}" ] || \ 42 | - $(LN_S) "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \ 43 | + echo "$${f}" >> "$(DESTDIR)$(zedexecdir)/DEFAULT-ENABLED" ; \ 44 | done 45 | 46 | SHELLCHECKSCRIPTS += $(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS) 47 | -------------------------------------------------------------------------------- /debian/patches/zfs/0007-Add-systemd-unit-for-importing-specific-pools.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Stoiko Ivanov 3 | Date: Tue, 15 Sep 2020 19:07:24 +0200 4 | Subject: [PATCH] Add systemd-unit for importing specific pools 5 | 6 | The unit can be instantiated with a specific poolname, which will get imported 7 | by scanning /dev/disk/by-id, irrespective of the existence and content of 8 | /etc/zfs/zpool.cache. 9 | 10 | the instance name is used unescaped (see systemd.unit(5)), since zpool names 11 | can contain characters which will be escaped by systemd. 12 | 13 | Its instances are ordered before the other two "big" import services to avoid 14 | races and spurious (cosmetic!) service failures. 15 | 16 | Signed-off-by: Stoiko Ivanov 17 | Signed-off-by: Thomas Lamprecht 18 | --- 19 | etc/Makefile.am | 1 + 20 | etc/systemd/system/50-zfs.preset | 1 + 21 | etc/systemd/system/zfs-import@.service.in | 18 ++++++++++++++++++ 22 | 3 files changed, 20 insertions(+) 23 | create mode 100644 etc/systemd/system/zfs-import@.service.in 24 | 25 | diff --git a/etc/Makefile.am b/etc/Makefile.am 26 | index 7187762d3..de131dc87 100644 27 | --- a/etc/Makefile.am 28 | +++ b/etc/Makefile.am 29 | @@ -54,6 +54,7 @@ dist_systemdpreset_DATA = \ 30 | systemdunit_DATA = \ 31 | %D%/systemd/system/zfs-import-cache.service \ 32 | %D%/systemd/system/zfs-import-scan.service \ 33 | + %D%/systemd/system/zfs-import@.service \ 34 | %D%/systemd/system/zfs-import.target \ 35 | %D%/systemd/system/zfs-mount.service \ 36 | %D%/systemd/system/zfs-scrub-monthly@.timer \ 37 | diff --git a/etc/systemd/system/50-zfs.preset b/etc/systemd/system/50-zfs.preset 38 | index e4056a92c..030611419 100644 39 | --- a/etc/systemd/system/50-zfs.preset 40 | +++ b/etc/systemd/system/50-zfs.preset 41 | @@ -1,6 +1,7 @@ 42 | # ZFS is enabled by default 43 | enable zfs-import-cache.service 44 | disable zfs-import-scan.service 45 | +enable zfs-import@.service 46 | enable zfs-import.target 47 | enable zfs-mount.service 48 | enable zfs-share.service 49 | diff --git a/etc/systemd/system/zfs-import@.service.in b/etc/systemd/system/zfs-import@.service.in 50 | new file mode 100644 51 | index 000000000..5bd19fb79 52 | --- /dev/null 53 | +++ b/etc/systemd/system/zfs-import@.service.in 54 | @@ -0,0 +1,18 @@ 55 | +[Unit] 56 | +Description=Import ZFS pool %i 57 | +Documentation=man:zpool(8) 58 | +DefaultDependencies=no 59 | +After=systemd-udev-settle.service 60 | +After=cryptsetup.target 61 | +After=multipathd.target 62 | +Before=zfs-import.target 63 | +Before=zfs-import-scan.service 64 | +Before=zfs-import-cache.service 65 | + 66 | +[Service] 67 | +Type=oneshot 68 | +RemainAfterExit=yes 69 | +ExecStart=@sbindir@/zpool import -N -d /dev/disk/by-id -o cachefile=none %I 70 | + 71 | +[Install] 72 | +WantedBy=zfs-import.target 73 | -------------------------------------------------------------------------------- /debian/patches/zfs/0008-Patch-move-manpage-arcstat-1-to-arcstat-8.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Stoiko Ivanov 3 | Date: Thu, 4 Feb 2021 19:01:12 +0100 4 | Subject: [PATCH] Patch: move manpage arcstat(1) to arcstat(8). 5 | 6 | Originally-By: Mo Zhou 7 | Originally-By: Antonio Russo 8 | 9 | Signed-off-by: Stoiko Ivanov 10 | Signed-off-by: Thomas Lamprecht 11 | --- 12 | man/Makefile.am | 2 +- 13 | man/{man1/arcstat.1 => man8/arcstat.8} | 2 +- 14 | 2 files changed, 2 insertions(+), 2 deletions(-) 15 | rename man/{man1/arcstat.1 => man8/arcstat.8} (99%) 16 | 17 | diff --git a/man/Makefile.am b/man/Makefile.am 18 | index 43bb014dd..a9293468a 100644 19 | --- a/man/Makefile.am 20 | +++ b/man/Makefile.am 21 | @@ -2,7 +2,6 @@ dist_noinst_man_MANS = \ 22 | %D%/man1/cstyle.1 23 | 24 | dist_man_MANS = \ 25 | - %D%/man1/arcstat.1 \ 26 | %D%/man1/raidz_test.1 \ 27 | %D%/man1/test-runner.1 \ 28 | %D%/man1/zhack.1 \ 29 | @@ -22,6 +21,7 @@ dist_man_MANS = \ 30 | %D%/man7/zpoolconcepts.7 \ 31 | %D%/man7/zpoolprops.7 \ 32 | \ 33 | + %D%/man8/arcstat.8 \ 34 | %D%/man8/fsck.zfs.8 \ 35 | %D%/man8/mount.zfs.8 \ 36 | %D%/man8/vdev_id.8 \ 37 | diff --git a/man/man1/arcstat.1 b/man/man8/arcstat.8 38 | similarity index 99% 39 | rename from man/man1/arcstat.1 40 | rename to man/man8/arcstat.8 41 | index 82358fa68..a8fb55498 100644 42 | --- a/man/man1/arcstat.1 43 | +++ b/man/man8/arcstat.8 44 | @@ -13,7 +13,7 @@ 45 | .\" Copyright (c) 2020 by AJ Jordan. All rights reserved. 46 | .\" 47 | .Dd December 23, 2022 48 | -.Dt ARCSTAT 1 49 | +.Dt ARCSTAT 8 50 | .Os 51 | . 52 | .Sh NAME 53 | -------------------------------------------------------------------------------- /debian/patches/zfs/0009-arc-stat-summary-guard-access-to-freshly-introduced-.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Thomas Lamprecht 3 | Date: Wed, 10 Nov 2021 09:29:47 +0100 4 | Subject: [PATCH] arc stat/summary: guard access to freshly introduced stats 5 | 6 | l2arc MFU/MRU and zfetch past future and stride stats were introduced 7 | in 2.1 and 2.2.4 respectively: 8 | 9 | commit 085321621e79a75bea41c2b6511da6ebfbf2ba0a added printing MFU 10 | and MRU stats for 2.1 user space tools, but those keys are not 11 | available in the 2.0 module. That means it may break the arcstat and 12 | arc_summary tools after upgrade to 2.1 (user space), before a reboot 13 | to the new 2.1 ZFS kernel-module happened, due to python raising a 14 | KeyError on the dict access then. 15 | 16 | Move those two keys to a .get accessor with `0` as fallback, as it 17 | should be better to show some possible wrong data for new stat-keys 18 | than throwing an exception. 19 | 20 | also move l2_mfu_asize l2_mru_asize l2_prefetch_asize 21 | l2_bufc_data_asize l2_bufc_metadata_asize to .get accessor 22 | (these are only present with a cache device in the pool) 23 | 24 | guard access to iohits and uncached state introduced in 25 | 792a6ee462efc15a7614f27e13f0f8aaa9414a08 26 | 27 | guard access to zfetch past future stride stats introduced in 28 | 026fe796465e3da7b27d06ef5338634ee6dd30d8 29 | 30 | These are present in the current kernel, but lead to an exception, if 31 | running the new user-space with an old kernel module. 32 | 33 | Signed-off-by: Stoiko Ivanov 34 | Signed-off-by: Thomas Lamprecht 35 | --- 36 | cmd/arc_summary | 132 ++++++++++++++++++++++++------------------------ 37 | cmd/arcstat.in | 48 +++++++++--------- 38 | 2 files changed, 90 insertions(+), 90 deletions(-) 39 | 40 | diff --git a/cmd/arc_summary b/cmd/arc_summary 41 | index 100fb1987..30f5d23e9 100755 42 | --- a/cmd/arc_summary 43 | +++ b/cmd/arc_summary 44 | @@ -551,21 +551,21 @@ def section_arc(kstats_dict): 45 | arc_target_size = arc_stats['c'] 46 | arc_max = arc_stats['c_max'] 47 | arc_min = arc_stats['c_min'] 48 | - meta = arc_stats['meta'] 49 | - pd = arc_stats['pd'] 50 | - pm = arc_stats['pm'] 51 | - anon_data = arc_stats['anon_data'] 52 | - anon_metadata = arc_stats['anon_metadata'] 53 | - mfu_data = arc_stats['mfu_data'] 54 | - mfu_metadata = arc_stats['mfu_metadata'] 55 | - mru_data = arc_stats['mru_data'] 56 | - mru_metadata = arc_stats['mru_metadata'] 57 | - mfug_data = arc_stats['mfu_ghost_data'] 58 | - mfug_metadata = arc_stats['mfu_ghost_metadata'] 59 | - mrug_data = arc_stats['mru_ghost_data'] 60 | - mrug_metadata = arc_stats['mru_ghost_metadata'] 61 | - unc_data = arc_stats['uncached_data'] 62 | - unc_metadata = arc_stats['uncached_metadata'] 63 | + meta = arc_stats.get('meta', 0) 64 | + pd = arc_stats.get('pd', 0) 65 | + pm = arc_stats.get('pm', 0) 66 | + anon_data = arc_stats.get('anon_data', 0) 67 | + anon_metadata = arc_stats.get('anon_metadata', 0) 68 | + mfu_data = arc_stats.get('mfu_data', 0) 69 | + mfu_metadata = arc_stats.get('mfu_metadata', 0) 70 | + mru_data = arc_stats.get('mru_data', 0) 71 | + mru_metadata = arc_stats.get('mru_metadata', 0) 72 | + mfug_data = arc_stats.get('mfu_ghost_data', 0) 73 | + mfug_metadata = arc_stats.get('mfu_ghost_metadata', 0) 74 | + mrug_data = arc_stats.get('mru_ghost_data', 0) 75 | + mrug_metadata = arc_stats.get('mru_ghost_metadata', 0) 76 | + unc_data = arc_stats.get('uncached_data', 0) 77 | + unc_metadata = arc_stats.get('uncached_metadata', 0) 78 | bonus_size = arc_stats['bonus_size'] 79 | dnode_limit = arc_stats['arc_dnode_limit'] 80 | dnode_size = arc_stats['dnode_size'] 81 | @@ -655,13 +655,13 @@ def section_arc(kstats_dict): 82 | prt_i1('L2 cached evictions:', f_bytes(arc_stats['evict_l2_cached'])) 83 | prt_i1('L2 eligible evictions:', f_bytes(arc_stats['evict_l2_eligible'])) 84 | prt_i2('L2 eligible MFU evictions:', 85 | - f_perc(arc_stats['evict_l2_eligible_mfu'], 86 | + f_perc(arc_stats.get('evict_l2_eligible_mfu', 0), # 2.0 module compat 87 | arc_stats['evict_l2_eligible']), 88 | - f_bytes(arc_stats['evict_l2_eligible_mfu'])) 89 | + f_bytes(arc_stats.get('evict_l2_eligible_mfu', 0))) 90 | prt_i2('L2 eligible MRU evictions:', 91 | - f_perc(arc_stats['evict_l2_eligible_mru'], 92 | + f_perc(arc_stats.get('evict_l2_eligible_mru', 0), # 2.0 module compat 93 | arc_stats['evict_l2_eligible']), 94 | - f_bytes(arc_stats['evict_l2_eligible_mru'])) 95 | + f_bytes(arc_stats.get('evict_l2_eligible_mru', 0))) 96 | prt_i1('L2 ineligible evictions:', 97 | f_bytes(arc_stats['evict_l2_ineligible'])) 98 | print() 99 | @@ -672,106 +672,106 @@ def section_archits(kstats_dict): 100 | """ 101 | 102 | arc_stats = isolate_section('arcstats', kstats_dict) 103 | - all_accesses = int(arc_stats['hits'])+int(arc_stats['iohits'])+\ 104 | + all_accesses = int(arc_stats['hits'])+int(arc_stats.get('iohits', 0))+\ 105 | int(arc_stats['misses']) 106 | 107 | prt_1('ARC total accesses:', f_hits(all_accesses)) 108 | ta_todo = (('Total hits:', arc_stats['hits']), 109 | - ('Total I/O hits:', arc_stats['iohits']), 110 | + ('Total I/O hits:', arc_stats.get('iohits', 0)), 111 | ('Total misses:', arc_stats['misses'])) 112 | for title, value in ta_todo: 113 | prt_i2(title, f_perc(value, all_accesses), f_hits(value)) 114 | print() 115 | 116 | dd_total = int(arc_stats['demand_data_hits']) +\ 117 | - int(arc_stats['demand_data_iohits']) +\ 118 | + int(arc_stats.get('demand_data_iohits', 0)) +\ 119 | int(arc_stats['demand_data_misses']) 120 | prt_2('ARC demand data accesses:', f_perc(dd_total, all_accesses), 121 | f_hits(dd_total)) 122 | dd_todo = (('Demand data hits:', arc_stats['demand_data_hits']), 123 | - ('Demand data I/O hits:', arc_stats['demand_data_iohits']), 124 | + ('Demand data I/O hits:', arc_stats.get('demand_data_iohits', 0)), 125 | ('Demand data misses:', arc_stats['demand_data_misses'])) 126 | for title, value in dd_todo: 127 | prt_i2(title, f_perc(value, dd_total), f_hits(value)) 128 | print() 129 | 130 | dm_total = int(arc_stats['demand_metadata_hits']) +\ 131 | - int(arc_stats['demand_metadata_iohits']) +\ 132 | + int(arc_stats.get('demand_metadata_iohits', 0)) +\ 133 | int(arc_stats['demand_metadata_misses']) 134 | prt_2('ARC demand metadata accesses:', f_perc(dm_total, all_accesses), 135 | f_hits(dm_total)) 136 | dm_todo = (('Demand metadata hits:', arc_stats['demand_metadata_hits']), 137 | ('Demand metadata I/O hits:', 138 | - arc_stats['demand_metadata_iohits']), 139 | + arc_stats.get('demand_metadata_iohits', 0)), 140 | ('Demand metadata misses:', arc_stats['demand_metadata_misses'])) 141 | for title, value in dm_todo: 142 | prt_i2(title, f_perc(value, dm_total), f_hits(value)) 143 | print() 144 | 145 | pd_total = int(arc_stats['prefetch_data_hits']) +\ 146 | - int(arc_stats['prefetch_data_iohits']) +\ 147 | + int(arc_stats.get('prefetch_data_iohits', 0)) +\ 148 | int(arc_stats['prefetch_data_misses']) 149 | prt_2('ARC prefetch data accesses:', f_perc(pd_total, all_accesses), 150 | f_hits(pd_total)) 151 | pd_todo = (('Prefetch data hits:', arc_stats['prefetch_data_hits']), 152 | - ('Prefetch data I/O hits:', arc_stats['prefetch_data_iohits']), 153 | + ('Prefetch data I/O hits:', arc_stats.get('prefetch_data_iohits', 0)), 154 | ('Prefetch data misses:', arc_stats['prefetch_data_misses'])) 155 | for title, value in pd_todo: 156 | prt_i2(title, f_perc(value, pd_total), f_hits(value)) 157 | print() 158 | 159 | pm_total = int(arc_stats['prefetch_metadata_hits']) +\ 160 | - int(arc_stats['prefetch_metadata_iohits']) +\ 161 | + int(arc_stats.get('prefetch_metadata_iohits', 0)) +\ 162 | int(arc_stats['prefetch_metadata_misses']) 163 | prt_2('ARC prefetch metadata accesses:', f_perc(pm_total, all_accesses), 164 | f_hits(pm_total)) 165 | pm_todo = (('Prefetch metadata hits:', 166 | arc_stats['prefetch_metadata_hits']), 167 | ('Prefetch metadata I/O hits:', 168 | - arc_stats['prefetch_metadata_iohits']), 169 | + arc_stats.get('prefetch_metadata_iohits', 0)), 170 | ('Prefetch metadata misses:', 171 | arc_stats['prefetch_metadata_misses'])) 172 | for title, value in pm_todo: 173 | prt_i2(title, f_perc(value, pm_total), f_hits(value)) 174 | print() 175 | 176 | - all_prefetches = int(arc_stats['predictive_prefetch'])+\ 177 | - int(arc_stats['prescient_prefetch']) 178 | + all_prefetches = int(arc_stats.get('predictive_prefetch', 0))+\ 179 | + int(arc_stats.get('prescient_prefetch', 0)) 180 | prt_2('ARC predictive prefetches:', 181 | - f_perc(arc_stats['predictive_prefetch'], all_prefetches), 182 | - f_hits(arc_stats['predictive_prefetch'])) 183 | + f_perc(arc_stats.get('predictive_prefetch', 0), all_prefetches), 184 | + f_hits(arc_stats.get('predictive_prefetch', 0))) 185 | prt_i2('Demand hits after predictive:', 186 | f_perc(arc_stats['demand_hit_predictive_prefetch'], 187 | - arc_stats['predictive_prefetch']), 188 | + arc_stats.get('predictive_prefetch', 0)), 189 | f_hits(arc_stats['demand_hit_predictive_prefetch'])) 190 | prt_i2('Demand I/O hits after predictive:', 191 | - f_perc(arc_stats['demand_iohit_predictive_prefetch'], 192 | - arc_stats['predictive_prefetch']), 193 | - f_hits(arc_stats['demand_iohit_predictive_prefetch'])) 194 | - never = int(arc_stats['predictive_prefetch']) -\ 195 | + f_perc(arc_stats.get('demand_iohit_predictive_prefetch', 0), 196 | + arc_stats.get('predictive_prefetch', 0)), 197 | + f_hits(arc_stats.get('demand_iohit_predictive_prefetch', 0))) 198 | + never = int(arc_stats.get('predictive_prefetch', 0)) -\ 199 | int(arc_stats['demand_hit_predictive_prefetch']) -\ 200 | - int(arc_stats['demand_iohit_predictive_prefetch']) 201 | + int(arc_stats.get('demand_iohit_predictive_prefetch', 0)) 202 | prt_i2('Never demanded after predictive:', 203 | - f_perc(never, arc_stats['predictive_prefetch']), 204 | + f_perc(never, arc_stats.get('predictive_prefetch', 0)), 205 | f_hits(never)) 206 | print() 207 | 208 | prt_2('ARC prescient prefetches:', 209 | - f_perc(arc_stats['prescient_prefetch'], all_prefetches), 210 | - f_hits(arc_stats['prescient_prefetch'])) 211 | + f_perc(arc_stats.get('prescient_prefetch', 0), all_prefetches), 212 | + f_hits(arc_stats.get('prescient_prefetch', 0))) 213 | prt_i2('Demand hits after prescient:', 214 | f_perc(arc_stats['demand_hit_prescient_prefetch'], 215 | - arc_stats['prescient_prefetch']), 216 | + arc_stats.get('prescient_prefetch', 0)), 217 | f_hits(arc_stats['demand_hit_prescient_prefetch'])) 218 | prt_i2('Demand I/O hits after prescient:', 219 | - f_perc(arc_stats['demand_iohit_prescient_prefetch'], 220 | - arc_stats['prescient_prefetch']), 221 | - f_hits(arc_stats['demand_iohit_prescient_prefetch'])) 222 | - never = int(arc_stats['prescient_prefetch'])-\ 223 | + f_perc(arc_stats.get('demand_iohit_prescient_prefetch', 0), 224 | + arc_stats.get('prescient_prefetch', 0)), 225 | + f_hits(arc_stats.get('demand_iohit_prescient_prefetch', 0))) 226 | + never = int(arc_stats.get('prescient_prefetch', 0))-\ 227 | int(arc_stats['demand_hit_prescient_prefetch'])-\ 228 | - int(arc_stats['demand_iohit_prescient_prefetch']) 229 | + int(arc_stats.get('demand_iohit_prescient_prefetch', 0)) 230 | prt_i2('Never demanded after prescient:', 231 | - f_perc(never, arc_stats['prescient_prefetch']), 232 | + f_perc(never, arc_stats.get('prescient_prefetch', 0)), 233 | f_hits(never)) 234 | print() 235 | 236 | @@ -782,7 +782,7 @@ def section_archits(kstats_dict): 237 | arc_stats['mfu_ghost_hits']), 238 | ('Most recently used (MRU) ghost:', 239 | arc_stats['mru_ghost_hits']), 240 | - ('Uncached:', arc_stats['uncached_hits'])) 241 | + ('Uncached:', arc_stats.get('uncached_hits', 0))) 242 | for title, value in cl_todo: 243 | prt_i2(title, f_perc(value, all_accesses), f_hits(value)) 244 | print() 245 | @@ -794,26 +794,26 @@ def section_dmu(kstats_dict): 246 | zfetch_stats = isolate_section('zfetchstats', kstats_dict) 247 | 248 | zfetch_access_total = int(zfetch_stats['hits']) +\ 249 | - int(zfetch_stats['future']) + int(zfetch_stats['stride']) +\ 250 | - int(zfetch_stats['past']) + int(zfetch_stats['misses']) 251 | + int(zfetch_stats.get('future', 0)) + int(zfetch_stats.get('stride', 0)) +\ 252 | + int(zfetch_stats.get('past', 0)) + int(zfetch_stats['misses']) 253 | 254 | prt_1('DMU predictive prefetcher calls:', f_hits(zfetch_access_total)) 255 | prt_i2('Stream hits:', 256 | f_perc(zfetch_stats['hits'], zfetch_access_total), 257 | f_hits(zfetch_stats['hits'])) 258 | - future = int(zfetch_stats['future']) + int(zfetch_stats['stride']) 259 | + future = int(zfetch_stats.get('future', 0)) + int(zfetch_stats.get('stride', 0)) 260 | prt_i2('Hits ahead of stream:', f_perc(future, zfetch_access_total), 261 | f_hits(future)) 262 | prt_i2('Hits behind stream:', 263 | - f_perc(zfetch_stats['past'], zfetch_access_total), 264 | - f_hits(zfetch_stats['past'])) 265 | + f_perc(zfetch_stats.get('past', 0), zfetch_access_total), 266 | + f_hits(zfetch_stats.get('past', 0))) 267 | prt_i2('Stream misses:', 268 | f_perc(zfetch_stats['misses'], zfetch_access_total), 269 | f_hits(zfetch_stats['misses'])) 270 | prt_i2('Streams limit reached:', 271 | f_perc(zfetch_stats['max_streams'], zfetch_stats['misses']), 272 | f_hits(zfetch_stats['max_streams'])) 273 | - prt_i1('Stream strides:', f_hits(zfetch_stats['stride'])) 274 | + prt_i1('Stream strides:', f_hits(zfetch_stats.get('stride', 0))) 275 | prt_i1('Prefetches issued', f_hits(zfetch_stats['io_issued'])) 276 | print() 277 | 278 | @@ -860,20 +860,20 @@ def section_l2arc(kstats_dict): 279 | f_perc(arc_stats['l2_hdr_size'], arc_stats['l2_size']), 280 | f_bytes(arc_stats['l2_hdr_size'])) 281 | prt_i2('MFU allocated size:', 282 | - f_perc(arc_stats['l2_mfu_asize'], arc_stats['l2_asize']), 283 | - f_bytes(arc_stats['l2_mfu_asize'])) 284 | + f_perc(arc_stats.get('l2_mfu_asize', 0), arc_stats['l2_asize']), 285 | + f_bytes(arc_stats.get('l2_mfu_asize', 0))) # 2.0 module compat 286 | prt_i2('MRU allocated size:', 287 | - f_perc(arc_stats['l2_mru_asize'], arc_stats['l2_asize']), 288 | - f_bytes(arc_stats['l2_mru_asize'])) 289 | + f_perc(arc_stats.get('l2_mru_asize', 0), arc_stats['l2_asize']), 290 | + f_bytes(arc_stats.get('l2_mru_asize', 0))) # 2.0 module compat 291 | prt_i2('Prefetch allocated size:', 292 | - f_perc(arc_stats['l2_prefetch_asize'], arc_stats['l2_asize']), 293 | - f_bytes(arc_stats['l2_prefetch_asize'])) 294 | + f_perc(arc_stats.get('l2_prefetch_asize', 0), arc_stats['l2_asize']), 295 | + f_bytes(arc_stats.get('l2_prefetch_asize',0))) # 2.0 module compat 296 | prt_i2('Data (buffer content) allocated size:', 297 | - f_perc(arc_stats['l2_bufc_data_asize'], arc_stats['l2_asize']), 298 | - f_bytes(arc_stats['l2_bufc_data_asize'])) 299 | + f_perc(arc_stats.get('l2_bufc_data_asize', 0), arc_stats['l2_asize']), 300 | + f_bytes(arc_stats.get('l2_bufc_data_asize', 0))) # 2.0 module compat 301 | prt_i2('Metadata (buffer content) allocated size:', 302 | - f_perc(arc_stats['l2_bufc_metadata_asize'], arc_stats['l2_asize']), 303 | - f_bytes(arc_stats['l2_bufc_metadata_asize'])) 304 | + f_perc(arc_stats.get('l2_bufc_metadata_asize', 0), arc_stats['l2_asize']), 305 | + f_bytes(arc_stats.get('l2_bufc_metadata_asize', 0))) # 2.0 module compat 306 | 307 | print() 308 | prt_1('L2ARC breakdown:', f_hits(l2_access_total)) 309 | diff --git a/cmd/arcstat.in b/cmd/arcstat.in 310 | index c4f10a1d6..bf47ec90e 100755 311 | --- a/cmd/arcstat.in 312 | +++ b/cmd/arcstat.in 313 | @@ -510,7 +510,7 @@ def calculate(): 314 | v = dict() 315 | v["time"] = time.strftime("%H:%M:%S", time.localtime()) 316 | v["hits"] = d["hits"] // sint 317 | - v["iohs"] = d["iohits"] // sint 318 | + v["iohs"] = d.get("iohits", 0) // sint 319 | v["miss"] = d["misses"] // sint 320 | v["read"] = v["hits"] + v["iohs"] + v["miss"] 321 | v["hit%"] = 100 * v["hits"] // v["read"] if v["read"] > 0 else 0 322 | @@ -518,7 +518,7 @@ def calculate(): 323 | v["miss%"] = 100 - v["hit%"] - v["ioh%"] if v["read"] > 0 else 0 324 | 325 | v["dhit"] = (d["demand_data_hits"] + d["demand_metadata_hits"]) // sint 326 | - v["dioh"] = (d["demand_data_iohits"] + d["demand_metadata_iohits"]) // sint 327 | + v["dioh"] = (d.get("demand_data_iohits", 0) + d.get("demand_metadata_iohits", 0)) // sint 328 | v["dmis"] = (d["demand_data_misses"] + d["demand_metadata_misses"]) // sint 329 | 330 | v["dread"] = v["dhit"] + v["dioh"] + v["dmis"] 331 | @@ -527,7 +527,7 @@ def calculate(): 332 | v["dm%"] = 100 - v["dh%"] - v["di%"] if v["dread"] > 0 else 0 333 | 334 | v["ddhit"] = d["demand_data_hits"] // sint 335 | - v["ddioh"] = d["demand_data_iohits"] // sint 336 | + v["ddioh"] = d.get("demand_data_iohits", 0) // sint 337 | v["ddmis"] = d["demand_data_misses"] // sint 338 | 339 | v["ddread"] = v["ddhit"] + v["ddioh"] + v["ddmis"] 340 | @@ -536,7 +536,7 @@ def calculate(): 341 | v["ddm%"] = 100 - v["ddh%"] - v["ddi%"] if v["ddread"] > 0 else 0 342 | 343 | v["dmhit"] = d["demand_metadata_hits"] // sint 344 | - v["dmioh"] = d["demand_metadata_iohits"] // sint 345 | + v["dmioh"] = d.get("demand_metadata_iohits", 0) // sint 346 | v["dmmis"] = d["demand_metadata_misses"] // sint 347 | 348 | v["dmread"] = v["dmhit"] + v["dmioh"] + v["dmmis"] 349 | @@ -545,8 +545,8 @@ def calculate(): 350 | v["dmm%"] = 100 - v["dmh%"] - v["dmi%"] if v["dmread"] > 0 else 0 351 | 352 | v["phit"] = (d["prefetch_data_hits"] + d["prefetch_metadata_hits"]) // sint 353 | - v["pioh"] = (d["prefetch_data_iohits"] + 354 | - d["prefetch_metadata_iohits"]) // sint 355 | + v["pioh"] = (d.get("prefetch_data_iohits", 0) + 356 | + d.get("prefetch_metadata_iohits", 0)) // sint 357 | v["pmis"] = (d["prefetch_data_misses"] + 358 | d["prefetch_metadata_misses"]) // sint 359 | 360 | @@ -556,7 +556,7 @@ def calculate(): 361 | v["pm%"] = 100 - v["ph%"] - v["pi%"] if v["pread"] > 0 else 0 362 | 363 | v["pdhit"] = d["prefetch_data_hits"] // sint 364 | - v["pdioh"] = d["prefetch_data_iohits"] // sint 365 | + v["pdioh"] = d.get("prefetch_data_iohits", 0) // sint 366 | v["pdmis"] = d["prefetch_data_misses"] // sint 367 | 368 | v["pdread"] = v["pdhit"] + v["pdioh"] + v["pdmis"] 369 | @@ -565,7 +565,7 @@ def calculate(): 370 | v["pdm%"] = 100 - v["pdh%"] - v["pdi%"] if v["pdread"] > 0 else 0 371 | 372 | v["pmhit"] = d["prefetch_metadata_hits"] // sint 373 | - v["pmioh"] = d["prefetch_metadata_iohits"] // sint 374 | + v["pmioh"] = d.get("prefetch_metadata_iohits", 0) // sint 375 | v["pmmis"] = d["prefetch_metadata_misses"] // sint 376 | 377 | v["pmread"] = v["pmhit"] + v["pmioh"] + v["pmmis"] 378 | @@ -575,8 +575,8 @@ def calculate(): 379 | 380 | v["mhit"] = (d["prefetch_metadata_hits"] + 381 | d["demand_metadata_hits"]) // sint 382 | - v["mioh"] = (d["prefetch_metadata_iohits"] + 383 | - d["demand_metadata_iohits"]) // sint 384 | + v["mioh"] = (d.get("prefetch_metadata_iohits", 0) + 385 | + d.get("demand_metadata_iohits", 0)) // sint 386 | v["mmis"] = (d["prefetch_metadata_misses"] + 387 | d["demand_metadata_misses"]) // sint 388 | 389 | @@ -592,24 +592,24 @@ def calculate(): 390 | v["mru"] = d["mru_hits"] // sint 391 | v["mrug"] = d["mru_ghost_hits"] // sint 392 | v["mfug"] = d["mfu_ghost_hits"] // sint 393 | - v["unc"] = d["uncached_hits"] // sint 394 | + v["unc"] = d.get("uncached_hits", 0) // sint 395 | v["eskip"] = d["evict_skip"] // sint 396 | v["el2skip"] = d["evict_l2_skip"] // sint 397 | v["el2cach"] = d["evict_l2_cached"] // sint 398 | v["el2el"] = d["evict_l2_eligible"] // sint 399 | - v["el2mfu"] = d["evict_l2_eligible_mfu"] // sint 400 | - v["el2mru"] = d["evict_l2_eligible_mru"] // sint 401 | + v["el2mfu"] = d.get("evict_l2_eligible_mfu", 0) // sint 402 | + v["el2mru"] = d.get("evict_l2_eligible_mru", 0) // sint 403 | v["el2inel"] = d["evict_l2_ineligible"] // sint 404 | v["mtxmis"] = d["mutex_miss"] // sint 405 | - v["ztotal"] = (d["zfetch_hits"] + d["zfetch_future"] + d["zfetch_stride"] + 406 | - d["zfetch_past"] + d["zfetch_misses"]) // sint 407 | + v["ztotal"] = (d["zfetch_hits"] + d.get("zfetch_future", 0) + d.get("zfetch_stride", 0) + 408 | + d.get("zfetch_past", 0) + d["zfetch_misses"]) // sint 409 | v["zhits"] = d["zfetch_hits"] // sint 410 | - v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) // sint 411 | - v["zpast"] = d["zfetch_past"] // sint 412 | + v["zahead"] = (d.get("zfetch_future", 0) + d.get("zfetch_stride", 0)) // sint 413 | + v["zpast"] = d.get("zfetch_past", 0) // sint 414 | v["zmisses"] = d["zfetch_misses"] // sint 415 | v["zmax"] = d["zfetch_max_streams"] // sint 416 | - v["zfuture"] = d["zfetch_future"] // sint 417 | - v["zstride"] = d["zfetch_stride"] // sint 418 | + v["zfuture"] = d.get("zfetch_future", 0) // sint 419 | + v["zstride"] = d.get("zfetch_stride", 0) // sint 420 | v["zissued"] = d["zfetch_io_issued"] // sint 421 | v["zactive"] = d["zfetch_io_active"] // sint 422 | 423 | @@ -624,11 +624,11 @@ def calculate(): 424 | v["l2size"] = cur["l2_size"] 425 | v["l2bytes"] = d["l2_read_bytes"] // sint 426 | 427 | - v["l2pref"] = cur["l2_prefetch_asize"] 428 | - v["l2mfu"] = cur["l2_mfu_asize"] 429 | - v["l2mru"] = cur["l2_mru_asize"] 430 | - v["l2data"] = cur["l2_bufc_data_asize"] 431 | - v["l2meta"] = cur["l2_bufc_metadata_asize"] 432 | + v["l2pref"] = cur.get("l2_prefetch_asize", 0) 433 | + v["l2mfu"] = cur.get("l2_mfu_asize", 0) 434 | + v["l2mru"] = cur.get("l2_mru_asize", 0) 435 | + v["l2data"] = cur.get("l2_bufc_data_asize", 0) 436 | + v["l2meta"] = cur.get("l2_bufc_metadata_asize", 0) 437 | v["l2pref%"] = 100 * v["l2pref"] // v["l2asize"] 438 | v["l2mfu%"] = 100 * v["l2mfu"] // v["l2asize"] 439 | v["l2mru%"] = 100 * v["l2mru"] // v["l2asize"] 440 | -------------------------------------------------------------------------------- /debian/patches/zfs/0010-Fix-nfs_truncate_shares-without-etc-exports.d.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: siv0 3 | Date: Tue, 31 Oct 2023 21:57:54 +0100 4 | Subject: [PATCH] Fix nfs_truncate_shares without /etc/exports.d 5 | 6 | Calling nfs_reset_shares on Linux prints a warning: 7 | `failed to lock /etc/exports.d/zfs.exports.lock: No such file or 8 | directory` 9 | when /etc/exports.d does not exist. The directory gets created, when a 10 | filesystem is actually exported through nfs_toggle_share and 11 | nfs_init_share. The truncation of /etc/exports.d/zfs.exports happens 12 | unconditionally when calling `zfs mount -a` (via zfs_do_mount and 13 | share_mount in `cmd/zfs/zfs_main.c`). 14 | 15 | Fixing the issue only in the Linux part, since the exports file on 16 | freebsd is in `/etc/zfs/`, which seems present on 2 FreeBSD systems I 17 | have access to (through `/etc/zfs/compatibility.d/`), while a Debian 18 | box does not have the directory even if `/usr/sbin/exportfs` is 19 | present through the `nfs-kernel-server` package. 20 | 21 | The code for exports_available is copied from nfs_available above. 22 | 23 | Fixes: ede037cda73675f42b1452187e8dd3438fafc220 24 | ("Make zfs-share service resilient to stale exports") 25 | 26 | Reviewed-by: Brian Atkinson 27 | Reviewed-by: Brian Behlendorf 28 | Signed-off-by: Stoiko Ivanov 29 | Closes #15369 30 | Closes #15468 31 | (cherry picked from commit 41e55b476bcfc90f1ad81c02c5375367fdace9e9) 32 | Signed-off-by: Stoiko Ivanov 33 | Signed-off-by: Thomas Lamprecht 34 | --- 35 | lib/libshare/os/linux/nfs.c | 18 ++++++++++++++++++ 36 | 1 file changed, 18 insertions(+) 37 | 38 | diff --git a/lib/libshare/os/linux/nfs.c b/lib/libshare/os/linux/nfs.c 39 | index 004946b0c..3dce81840 100644 40 | --- a/lib/libshare/os/linux/nfs.c 41 | +++ b/lib/libshare/os/linux/nfs.c 42 | @@ -47,6 +47,7 @@ 43 | 44 | 45 | static boolean_t nfs_available(void); 46 | +static boolean_t exports_available(void); 47 | 48 | typedef int (*nfs_shareopt_callback_t)(const char *opt, const char *value, 49 | void *cookie); 50 | @@ -539,6 +540,8 @@ nfs_commit_shares(void) 51 | static void 52 | nfs_truncate_shares(void) 53 | { 54 | + if (!exports_available()) 55 | + return; 56 | nfs_reset_shares(ZFS_EXPORTS_LOCK, ZFS_EXPORTS_FILE); 57 | } 58 | 59 | @@ -566,3 +569,18 @@ nfs_available(void) 60 | 61 | return (avail == 1); 62 | } 63 | + 64 | +static boolean_t 65 | +exports_available(void) 66 | +{ 67 | + static int avail; 68 | + 69 | + if (!avail) { 70 | + if (access(ZFS_EXPORTS_DIR, F_OK) != 0) 71 | + avail = -1; 72 | + else 73 | + avail = 1; 74 | + } 75 | + 76 | + return (avail == 1); 77 | +} 78 | -------------------------------------------------------------------------------- /debian/patches/zfs/0011-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Thomas Lamprecht 3 | Date: Sun, 12 Nov 2023 15:52:25 +0100 4 | Subject: [PATCH] zpool status: tighten bounds for noalloc stat availabillity 5 | 6 | When running zfs 2.2.0 userspace utilities with a kernel that still 7 | has 2.1.13 modules zpool status adds `(non-allocating)` next to the 8 | disk name of a single-disk pool. 9 | 10 | The reason for this seems to be that the patch adding the `vs_pspace` field was 11 | backported, but the one adding `vs_noalloc` was not. 12 | 13 | Itself that is not a problem, but in 2.2 `noalloc` was added before `psspace`, 14 | so the struct layout between 2.1.13 and 2.2.0 do NOT match anymore... 15 | 16 | I.e., the struct looks like the following at the end for ZFS 2.1.x: 17 | 18 | ``` 19 | typedef struct vdev_stat { 20 | hrtime_t vs_timestamp; /* time since vdev load */ 21 | // snip 22 | uint64_t vs_logical_ashift; /* vdev_logical_ashift */ 23 | uint64_t vs_physical_ashift; /* vdev_physical_ashift */ 24 | uint64_t vs_pspace; /* physical capacity */ 25 | } vdev_stat_t; 26 | ``` 27 | 28 | And like the following on ZFS 2.2.x: 29 | ``` 30 | typedef struct vdev_stat { 31 | hrtime_t vs_timestamp; /* time since vdev load */ 32 | // snip 33 | uint64_t vs_logical_ashift; /* vdev_logical_ashift */ 34 | uint64_t vs_physical_ashift; /* vdev_physical_ashift */ 35 | uint64_t vs_noalloc; /* allocations halted? */ 36 | uint64_t vs_pspace; /* physical capacity */ 37 | } vdev_stat_t; 38 | ``` 39 | 40 | Resulting in 2.2.x user-space tooling interpreting the `vs_pspace` field from 41 | the 2.1.x kernel module as `vs_noalloc` field. 42 | 43 | For now, work-around that discrepancy by coupling the availability of 44 | the vs_noalloc field with the one of the vs_pspace one, as when both 45 | are returned from the module we can be sure that our struct layout 46 | matches again. 47 | 48 | Signed-off-by: Thomas Lamprecht 49 | --- 50 | cmd/zpool/zpool_main.c | 3 ++- 51 | 1 file changed, 2 insertions(+), 1 deletion(-) 52 | 53 | diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c 54 | index ed0b8d7a1..f3acc49d0 100644 55 | --- a/cmd/zpool/zpool_main.c 56 | +++ b/cmd/zpool/zpool_main.c 57 | @@ -2663,7 +2663,8 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name, 58 | 59 | if (vs->vs_scan_removing != 0) { 60 | (void) printf(gettext(" (removing)")); 61 | - } else if (VDEV_STAT_VALID(vs_noalloc, vsc) && vs->vs_noalloc != 0) { 62 | + } else if (VDEV_STAT_VALID(vs_pspace, vsc) 63 | + && VDEV_STAT_VALID(vs_noalloc, vsc) && vs->vs_noalloc != 0) { 64 | (void) printf(gettext(" (non-allocating)")); 65 | } 66 | 67 | -------------------------------------------------------------------------------- /debian/patches/zfs/0099-CDDL-to-GPL.patch: -------------------------------------------------------------------------------- 1 | diff --git a/META b/META 2 | index 0e852d3..cb38752 100644 3 | --- a/META 4 | +++ b/META 5 | @@ -4,7 +4,7 @@ Branch: 1.0 6 | Version: 2.2.7 7 | Release: 1 8 | Release-Tags: relext 9 | -License: CDDL 10 | +License: GPL 11 | Author: OpenZFS 12 | Linux-Maximum: 6.12 13 | Linux-Minimum: 4.18 14 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | include /usr/share/dpkg/default.mk 4 | 5 | # Common variables for all architectures 6 | include debian/rules.d/common.mk 7 | 8 | # Pull in some arch specific stuff 9 | include debian/rules.d/arch/${DEB_BUILD_ARCH}.mk 10 | 11 | BUILD_DIR ?= ${CURDIR} 12 | KERNEL_SRC := linux 13 | ZFS_SRC := zfs 14 | 15 | ifeq ($(DEB_BUILD_ARCH),loong64) 16 | DEF_CONFIG := loongson3_defconfig 17 | else 18 | DEF_CONFIG := openeuler_defconfig 19 | endif 20 | 21 | %: 22 | dh $@ --with quilt 23 | 24 | ## Debian package metadata 25 | debian/control: debian/templates/control.in 26 | sed -e 's/@KVNAME@/${KVNAME}/g' -e 's/@KVMAJMIN@/${KERNEL_MAJMIN}/g' -e 's/edge/${DEB_DISTRIBUTION}/g' < debian/templates/control.in > debian/control 27 | 28 | debian/SOURCE: 29 | echo "git clone https://github.com/jiangcuo/pve-port-kernel.git \ 30 | git checkout ${PKG_GIT_VERSION} \ 31 | git submodule update --init --depth=1" > $@ 32 | 33 | ## Debhelper phases 34 | override_dh_quilt_patch: 35 | # Apply crack bundle 36 | # Apply patches 37 | cd ${KERNEL_SRC}; \ 38 | QUILT_PATCHES=../debian/patches \ 39 | QUILT_SERIES=series.linux \ 40 | quilt --quiltrc /dev/null --color=always push -a || test $$? = 2 41 | cd ${ZFS_SRC}; \ 42 | QUILT_PATCHES=../debian/patches \ 43 | QUILT_SERIES=series.zfs \ 44 | quilt --quiltrc /dev/null --color=always push -a || test $$? = 2 45 | 46 | override_dh_quilt_unpatch: 47 | cd ${KERNEL_SRC}; \ 48 | QUILT_PATCHES=../debian/patches \ 49 | QUILT_SERIES=series.linux \ 50 | quilt --quiltrc /dev/null pop -a || test $$? = 2 51 | cd ${ZFS_SRC}; \ 52 | QUILT_PATCHES=../debian/patches \ 53 | QUILT_SERIES=series.zfs \ 54 | quilt --quiltrc /dev/null pop -a || test $$? = 2 55 | rm -rf ${KERNEL_SRC}/.pc ${ZFS_SRC}/.pc 56 | 57 | override_dh_autoreconf: 58 | dh_autoreconf -D ${ZFS_SRC} 59 | 60 | override_dh_auto_configure: ${KERNEL_SRC}/.config 61 | 62 | override_dh_auto_build: 63 | # Kernel 64 | dh_auto_build -D ${KERNEL_SRC} -- \ 65 | CC="${PVE_KERNEL_CC}" \ 66 | KCFLAGS="${PVE_KERNEL_CFLAGS}" \ 67 | EXTRAVERSION="${EXTRAVERSION}" \ 68 | LOCALVERSION="${LOCALVERSION}" \ 69 | KBUILD_BUILD_VERSION_TIMESTAMP="${PKG_DISTRIBUTOR} ${DEB_VERSION} (${PKG_DATE_UTC_ISO})" 70 | # ZFS 71 | dh_auto_configure -D ${ZFS_SRC} -- CC="${PVE_ZFS_CC}" --with-config=kernel --with-linux=$(realpath ${KERNEL_SRC}) --with-linux-obj=$(realpath ${KERNEL_SRC}) 72 | dh_auto_build -D ${ZFS_SRC} 73 | 74 | override_dh_auto_install: debian/SOURCE .install_mark .tools_install_mark .headers_install_mark .usr_headers_install_mark 75 | dh_installdocs -A debian/copyright debian/SOURCE 76 | dh_installchangelogs 77 | dh_installman 78 | dh_strip_nondeterminism 79 | dh_compress 80 | dh_fixperms 81 | 82 | override_dh_auto_clean: debian/control 83 | dh_clean 84 | dh_auto_clean -D ${KERNEL_SRC} 85 | dh_auto_clean -D ${ZFS_SRC} 86 | rm -f ${PVE_KERNEL_TEMPLATES} ${PVE_HEADER_TEMPLATES} 87 | rm -f debian/SOURCE debian/*.tmp .*_mark 88 | 89 | ## Kernel 90 | PVE_KERNEL_TEMPLATES := $(patsubst debian/templates/pve-kernel.%.in, debian/${PVE_KERNEL_PKG}.%, $(wildcard debian/templates/pve-kernel.*.in)) 91 | 92 | ${KERNEL_SRC}/.config: 93 | ${MAKE} -C ${KERNEL_SRC} CC=${PVE_KERNEL_CC} ${DEF_CONFIG} 94 | cd ${KERNEL_SRC}; ./scripts/kconfig/merge_config.sh -m .config ../debian/config/common.kconfig 95 | cd ${KERNEL_SRC}; ./scripts/kconfig/merge_config.sh -m .config ../debian/config/${DEB_BUILD_ARCH}.kconfig 96 | 97 | debian/${PVE_KERNEL_PKG}.%: debian/templates/pve-kernel.%.in 98 | sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/templates/pve-kernel.$*.in > debian/${PVE_KERNEL_PKG}.$* 99 | chmod +x debian/${PVE_KERNEL_PKG}.$* 100 | 101 | .install_mark: ${PVE_KERNEL_TEMPLATES} 102 | rm -rf debian/${PVE_KERNEL_PKG} 103 | mkdir -p debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME} 104 | mkdir debian/${PVE_KERNEL_PKG}/boot 105 | install -m 644 ${KERNEL_SRC}/.config debian/${PVE_KERNEL_PKG}/boot/config-${KVNAME} 106 | install -m 644 ${KERNEL_SRC}/System.map debian/${PVE_KERNEL_PKG}/boot/System.map-${KVNAME} 107 | install -m 644 ${KERNEL_SRC}/${KERNEL_IMAGE_PATH} debian/${PVE_KERNEL_PKG}/boot/${KERNEL_INSTALL_FILE}-${KVNAME} 108 | ${MAKE} -C ${KERNEL_SRC} INSTALL_MOD_PATH=${BUILD_DIR}/debian/${PVE_KERNEL_PKG}/ modules_install 109 | 110 | # install zfs drivers 111 | install -d -m 0755 debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/zfs 112 | install -m 644 ${ZFS_SRC}/module/zfs.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/zfs 113 | install -m 644 ${ZFS_SRC}/module/spl.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/zfs 114 | # remove firmware 115 | rm -rf debian/${PVE_KERNEL_PKG}/lib/firmware 116 | # strip debug info 117 | find debian/${PVE_KERNEL_PKG}/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done 118 | # finalize 119 | /sbin/depmod -b debian/${PVE_KERNEL_PKG}/ ${KVNAME} 120 | # Autogenerate blacklist for watchdog devices (see README) 121 | install -m 0755 -d debian/${PVE_KERNEL_PKG}/lib/modprobe.d 122 | ls debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/watchdog/ > debian/watchdog-blacklist.tmp 123 | echo ipmi_watchdog.ko >> debian/watchdog-blacklist.tmp 124 | cat debian/watchdog-blacklist.tmp | sed -e 's/^/blacklist /' -e 's/.ko$$//' | sort -u > debian/${PVE_KERNEL_PKG}/lib/modprobe.d/blacklist_${PVE_KERNEL_PKG}.conf 125 | rm -f debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/source 126 | rm -f debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/build 127 | touch $@ 128 | 129 | ## Kernel tools 130 | .tools_compile_mark: 131 | dh_auto_build -D ${KERNEL_SRC}/tools/perf -- prefix=/usr \ 132 | HAVE_NO_LIBBFD=1 \ 133 | HAVE_CPLUS_DEMANGLE_SUPPORT=1 \ 134 | NO_LIBPYTHON=1 \ 135 | NO_LIBPERL=1 \ 136 | NO_LIBCRYPTO=1 \ 137 | PYTHON=python3 138 | echo "checking GPL-2 only perf binary for library linkage with incompatible licenses.." 139 | ! ldd ${KERNEL_SRC}/tools/perf/perf | grep -q -E '\blibbfd' 140 | ! ldd ${KERNEL_SRC}/tools/perf/perf | grep -q -E '\blibcrypto' 141 | ${MAKE} -C ${KERNEL_SRC}/tools/perf man 142 | touch $@ 143 | 144 | .tools_install_mark: .tools_compile_mark 145 | rm -rf debian/${LINUX_TOOLS_PKG} 146 | mkdir -p debian/${LINUX_TOOLS_PKG}/usr/bin 147 | mkdir -p debian/${LINUX_TOOLS_PKG}/usr/share/man/man1 148 | install -m 755 ${BUILD_DIR}/${KERNEL_SRC}/tools/perf/perf debian/${LINUX_TOOLS_PKG}/usr/bin/perf_$(KERNEL_MAJMIN) 149 | for i in ${BUILD_DIR}/${KERNEL_SRC}/tools/perf/Documentation/*.1; do \ 150 | fname="$${i##*/}"; manname="$${fname%.1}"; \ 151 | install -m644 "$$i" "debian/${LINUX_TOOLS_PKG}/usr/share/man/man1/$${manname}_$(KERNEL_MAJMIN).1"; \ 152 | done 153 | touch $@ 154 | 155 | ## Headers 156 | PVE_HEADER_TEMPLATES := $(patsubst debian/templates/pve-headers.%.in, debian/${PVE_HEADER_PKG}.%, $(wildcard debian/templates/pve-headers.*.in)) 157 | 158 | debian/${PVE_HEADER_PKG}.%: debian/templates/pve-headers.%.in 159 | sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/templates/pve-headers.$*.in > debian/${PVE_HEADER_PKG}.$* 160 | chmod +x debian/${PVE_HEADER_PKG}.$* 161 | 162 | .headers_install_mark: ${PVE_HEADER_TEMPLATES} 163 | rm -rf debian/${PVE_HEADER_PKG} 164 | mkdir -p debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} 165 | install -m 0644 ${KERNEL_SRC}/.config debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} 166 | ( \ 167 | cd ${KERNEL_SRC}; \ 168 | find . -path './debian/*' -prune \ 169 | -o -path './include/*' -prune \ 170 | -o -path './scripts' -prune \ 171 | -o -type f \ 172 | \( \ 173 | -name 'Makefile*' \ 174 | -o -name 'Kconfig*' \ 175 | -o -name 'Kbuild*' \ 176 | -o -name '*.sh' \ 177 | -o -name '*.pl' \ 178 | \) \ 179 | -print; \ 180 | find include scripts -type f -o -type l; \ 181 | find arch/${KERNEL_BUILD_ARCH} -maxdepth 1 -name Makefile\*; \ 182 | find arch/${KERNEL_BUILD_ARCH} -name module.lds -o -name Kbuild.platforms -o -name Platform; \ 183 | find $$(find arch/${KERNEL_BUILD_ARCH} -name include -o -name scripts -type d) -type f; \ 184 | find arch/${KERNEL_BUILD_ARCH}/include Module.symvers include scripts -type f; \ 185 | find tools/ -name 'objtool' -type f \ 186 | ) | rsync -avq --files-from=- ${KERNEL_SRC} debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} 187 | mkdir -p debian/${PVE_HEADER_PKG}/lib/modules/${KVNAME} 188 | ln -sf /usr/src/linux-headers-${KVNAME} debian/${PVE_HEADER_PKG}/lib/modules/${KVNAME}/build 189 | touch $@ 190 | 191 | ## User-space headers 192 | .usr_headers_install_mark: PKG_DIR = debian/${PVE_USR_HEADER_PKG} 193 | .usr_headers_install_mark: OUT_DIR = ${PKG_DIR}/usr 194 | .usr_headers_install_mark: 195 | rm -rf '${PKG_DIR}' 196 | mkdir -p '${PKG_DIR}' 197 | $(MAKE) -C ${KERNEL_SRC} headers_install ARCH=$(KERNEL_HEADER_ARCH) INSTALL_HDR_PATH='$(CURDIR)'/$(OUT_DIR) 198 | rm -rf $(OUT_DIR)/include/drm $(OUT_DIR)/include/scsi 199 | find $(OUT_DIR)/include \( -name .install -o -name ..install.cmd \) -execdir rm {} + 200 | # Move include/asm to arch-specific directory 201 | mkdir -p $(OUT_DIR)/include/$(DEB_HOST_MULTIARCH) 202 | mv $(OUT_DIR)/include/asm $(OUT_DIR)/include/$(DEB_HOST_MULTIARCH)/ 203 | test ! -d $(OUT_DIR)/include/arch || \ 204 | mv $(OUT_DIR)/include/arch $(OUT_DIR)/include/$(DEB_HOST_MULTIARCH)/ 205 | touch $@ 206 | -------------------------------------------------------------------------------- /debian/rules.d/arch/amd64.mk: -------------------------------------------------------------------------------- 1 | KERNEL_BUILD_ARCH = x86 2 | KERNEL_HEADER_ARCH = $(KERNEL_BUILD_ARCH) 3 | KERNEL_BUILD_IMAGE = bzImage 4 | KERNEL_IMAGE_PATH = arch/$(KERNEL_BUILD_ARCH)/boot/${KERNEL_BUILD_IMAGE} 5 | KERNEL_INSTALL_FILE = vmlinuz 6 | -------------------------------------------------------------------------------- /debian/rules.d/arch/arm64.mk: -------------------------------------------------------------------------------- 1 | KERNEL_BUILD_ARCH = arm64 2 | KERNEL_HEADER_ARCH = $(KERNEL_BUILD_ARCH) 3 | KERNEL_BUILD_IMAGE = Image 4 | KERNEL_IMAGE_PATH = arch/$(KERNEL_BUILD_ARCH)/boot/${KERNEL_BUILD_IMAGE} 5 | KERNEL_INSTALL_FILE = vmlinuz 6 | -------------------------------------------------------------------------------- /debian/rules.d/arch/loong64.mk: -------------------------------------------------------------------------------- 1 | KERNEL_BUILD_ARCH = loongarch 2 | KERNEL_HEADER_ARCH = $(KERNEL_BUILD_ARCH) 3 | KERNEL_BUILD_IMAGE = vmlinuz 4 | KERNEL_IMAGE_PATH = arch/$(KERNEL_BUILD_ARCH)/boot/${KERNEL_BUILD_IMAGE} 5 | KERNEL_INSTALL_FILE = vmlinuz 6 | -------------------------------------------------------------------------------- /debian/rules.d/arch/riscv64.mk: -------------------------------------------------------------------------------- 1 | KERNEL_BUILD_ARCH = riscv64 2 | KERNEL_HEADER_ARCH = $(KERNEL_BUILD_ARCH) 3 | KERNEL_BUILD_IMAGE = Image 4 | KERNEL_IMAGE_PATH = arch/$(KERNEL_BUILD_ARCH)/boot/${KERNEL_BUILD_IMAGE} 5 | KERNEL_INSTALL_FILE = vmlinuz 6 | -------------------------------------------------------------------------------- /debian/rules.d/common.mk: -------------------------------------------------------------------------------- 1 | ## Kernel information 2 | KERNEL_MAJMIN=$(shell ./scripts/version.sh -n) 3 | KERNEL_VER=$(shell ./scripts/version.sh) 4 | 5 | ## Debian package information 6 | PKG_DISTRIBUTOR ?= PVE Port 7 | PKG_RELEASE = $(shell ./scripts/version.sh -r) 8 | PKG_DATE := $(shell dpkg-parsechangelog -SDate) 9 | PKG_DATE_UTC_ISO := $(shell date -u -d '$(PKG_DATE)' +%Y-%m-%d) 10 | PKG_GIT_VERSION := $(shell git rev-parse HEAD) 11 | 12 | # Build settings 13 | PVE_KERNEL_CC ?= ${CC} 14 | PVE_ZFS_CC ?= ${CC} 15 | 16 | ### Debian package names 17 | EXTRAVERSION=-${PKG_RELEASE}-${DEB_DISTRIBUTION} 18 | KVNAME=${KERNEL_VER}-${DEB_DISTRIBUTION} 19 | 20 | PVE_KERNEL_PKG=pve-kernel-${KVNAME} 21 | PVE_HEADER_PKG=pve-headers-${KVNAME} 22 | PVE_USR_HEADER_PKG=pve-kernel-libc-dev 23 | LINUX_TOOLS_PKG=linux-tools-${KERNEL_MAJMIN} 24 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/templates/control.in: -------------------------------------------------------------------------------- 1 | Source: pve-kernel 2 | Section: devel 3 | Priority: optional 4 | Maintainer: Jiangcuo 5 | Build-Depends: asciidoc, 6 | automake, 7 | bc, 8 | bison, 9 | cpio, 10 | debhelper (>= 10~), 11 | dwarves (>= 1.16), 12 | flex, 13 | gcc (>= 8.3.0-6), 14 | git, 15 | kmod, 16 | libbabeltrace-dev, 17 | libcap-dev, 18 | libdw-dev, 19 | libelf-dev, 20 | libiberty-dev, 21 | libunwind-dev, 22 | libpfm4-dev, 23 | libtraceevent-dev, 24 | libnuma-dev, 25 | libslang2-dev, 26 | libssl-dev, 27 | libzstd-dev, 28 | lz4, 29 | pkg-config, 30 | python3-minimal, 31 | python3-dev, 32 | quilt, 33 | rsync, 34 | xmlto, 35 | systemtap-sdt-dev, 36 | zlib1g-dev, 37 | zstd 38 | Build-Conflicts: pve-headers-@KVNAME@, 39 | Vcs-Git: git://github.com/fabianishere/pve-edge-kernel.git 40 | Vcs-Browser: https://github.com/fabianishere/pve-edge-kernel 41 | 42 | Package: linux-tools-@KVMAJMIN@ 43 | Architecture: any 44 | Section: devel 45 | Priority: optional 46 | Depends: linux-base, 47 | ${misc:Depends}, 48 | ${shlibs:Depends}, 49 | Description: Linux kernel version specific tools for version @KVMAJMIN@ 50 | This package provides the architecture dependent parts for kernel 51 | version locked tools (such as perf and x86_energy_perf_policy) 52 | 53 | Package: pve-headers-@KVMAJMIN@-edge 54 | Architecture: all 55 | Section: admin 56 | Priority: optional 57 | Depends: pve-headers-@KVNAME@, 58 | Description: Latest Proxmox Edge Kernel Headers 59 | This is a metapackage which will install the kernel headers 60 | for the latest available Proxmox Edge kernel from the @KVMAJMIN@ 61 | series. 62 | 63 | Package: pve-kernel-@KVMAJMIN@-edge 64 | Architecture: all 65 | Section: admin 66 | Priority: optional 67 | Depends: pve-firmware, 68 | pve-kernel-@KVNAME@, 69 | Description: Latest Proxmox Edge Kernel Image 70 | This is a metapackage which will install the latest available 71 | Proxmox Edge kernel from the @KVMAJMIN@ series. 72 | 73 | Package: pve-headers-@KVNAME@ 74 | Section: devel 75 | Priority: optional 76 | Architecture: any 77 | Provides: linux-headers, 78 | linux-headers-2.6, 79 | Depends: 80 | Description: The Proxmox Edge Kernel Headers 81 | This package contains the Proxmox Edge Linux kernel headers 82 | 83 | Package: pve-kernel-@KVNAME@ 84 | Section: admin 85 | Priority: optional 86 | Architecture: any 87 | Provides: linux-image, 88 | linux-image-2.6, 89 | Suggests: pve-firmware, 90 | Depends: busybox, 91 | initramfs-tools, 92 | Recommends: grub-pc | grub-efi-amd64 | grub-efi-ia32 | grub-efi-arm64, 93 | Description: The Proxmox PVE Kernel Image 94 | This package contains the Linux kernel and initial ramdisk used for booting 95 | 96 | Package: pve-kernel-libc-dev 97 | Section: devel 98 | Priority: optional 99 | Architecture: any 100 | Provides: linux-libc-dev, 101 | Conflicts: linux-libc-dev, 102 | Replaces: linux-libc-dev, 103 | Depends: ${misc:Depends} 104 | Description: Linux support headers for userspace development 105 | This package provides userspaces headers from the Linux kernel. These headers 106 | are used by the installed headers for GNU libc and other system libraries. 107 | -------------------------------------------------------------------------------- /debian/templates/pve-headers.postinst.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Abort if any command returns an error value 4 | set -e 5 | 6 | case "$1" in 7 | configure) 8 | 9 | # There are three sub-cases: 10 | if test "${2+set}" != set; then 11 | # We're being installed by an ancient dpkg which doesn't remember 12 | # which version was most recently configured, or even whether 13 | # there is a most recently configured version. 14 | : 15 | 16 | elif test -z "$2" -o "$2" = ""; then 17 | # The package has not ever been configured on this system, or was 18 | # purged since it was last configured. 19 | : 20 | 21 | else 22 | # Version $2 is the most recently configured version of this 23 | # package. 24 | : 25 | 26 | fi ;; 27 | abort-upgrade) 28 | # Back out of an attempt to upgrade this package FROM THIS VERSION 29 | # to version $2. Undo the effects of "prerm upgrade $2". 30 | : 31 | 32 | ;; 33 | abort-remove) 34 | if test "$2" != in-favour; then 35 | echo "$0: undocumented call to \`postinst $*'" 1>&2 36 | exit 0 37 | fi 38 | # Back out of an attempt to remove this package, which was due to 39 | # a conflict with package $3 (version $4). Undo the effects of 40 | # "prerm remove in-favour $3 $4". 41 | : 42 | 43 | ;; 44 | abort-deconfigure) 45 | if test "$2" != in-favour -o "$5" != removing; then 46 | echo "$0: undocumented call to \`postinst $*'" 1>&2 47 | exit 0 48 | fi 49 | # Back out of an attempt to deconfigure this package, which was 50 | # due to package $6 (version $7) which we depend on being removed 51 | # to make way for package $3 (version $4). Undo the effects of 52 | # "prerm deconfigure in-favour $3 $4 removing $6 $7". 53 | : 54 | 55 | ;; 56 | *) echo "$0: didn't understand being called with \`$1'" 1>&2 57 | exit 0;; 58 | esac 59 | 60 | exit 0 61 | -------------------------------------------------------------------------------- /debian/templates/pve-kernel.postinst.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | # Ignore all invocations except when called on to configure. 6 | exit 0 unless $ARGV[0] =~ /configure/; 7 | 8 | # do nothing if run from proxmox installer 9 | exit 0 if -e "/proxmox_install_mode"; 10 | 11 | my $imagedir = "/boot"; 12 | 13 | my $version = "@@KVNAME@@"; 14 | 15 | system("depmod $version"); 16 | 17 | if (-d "/etc/kernel/postinst.d") { 18 | print STDERR "Examining /etc/kernel/postinst.d.\n"; 19 | system ("run-parts --verbose --exit-on-error --arg=$version " . 20 | "--arg=$imagedir/vmlinuz-$version " . 21 | "/etc/kernel/postinst.d") && 22 | die "Failed to process /etc/kernel/postinst.d"; 23 | } 24 | 25 | exit 0 26 | -------------------------------------------------------------------------------- /debian/templates/pve-kernel.postrm.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | # Ignore all 'upgrade' invocations . 6 | exit 0 if $ARGV[0] =~ /upgrade/; 7 | 8 | my $imagedir = "/boot"; 9 | 10 | my $version = "@@KVNAME@@"; 11 | 12 | if (-d "/etc/kernel/postrm.d") { 13 | print STDERR "Examining /etc/kernel/postrm.d.\n"; 14 | system ("run-parts --verbose --exit-on-error --arg=$version " . 15 | "--arg=$imagedir/vmlinuz-$version " . 16 | "/etc/kernel/postrm.d") && 17 | die "Failed to process /etc/kernel/postrm.d"; 18 | } 19 | 20 | unlink "$imagedir/initrd.img-$version"; 21 | unlink "$imagedir/initrd.img-$version.bak"; 22 | unlink "/var/lib/initramfs-tools/$version"; 23 | 24 | # Ignore all invocations except when called on to purge. 25 | exit 0 unless $ARGV[0] =~ /purge/; 26 | 27 | my @files_to_remove = qw{ 28 | modules.dep modules.isapnpmap modules.pcimap 29 | modules.usbmap modules.parportmap 30 | modules.generic_string modules.ieee1394map 31 | modules.ieee1394map modules.pnpbiosmap 32 | modules.alias modules.ccwmap modules.inputmap 33 | modules.symbols modules.ofmap 34 | modules.seriomap modules.*.bin 35 | modules.softdep modules.devname 36 | }; 37 | 38 | foreach my $extra_file (@files_to_remove) { 39 | for (glob("/lib/modules/$version/$extra_file")) { 40 | unlink; 41 | } 42 | } 43 | 44 | system ("rmdir", "/lib/modules/$version") if -d "/lib/modules/$version"; 45 | 46 | exit 0 47 | -------------------------------------------------------------------------------- /debian/templates/pve-kernel.prerm.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | # Ignore all invocations uxcept when called on to remove 6 | exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ; 7 | 8 | # do nothing if run from proxmox installer 9 | exit 0 if -e "/proxmox_install_mode"; 10 | 11 | my $imagedir = "/boot"; 12 | 13 | my $version = "@@KVNAME@@"; 14 | 15 | if (-d "/etc/kernel/prerm.d") { 16 | print STDERR "Examining /etc/kernel/prerm.d.\n"; 17 | system ("run-parts --verbose --exit-on-error --arg=$version " . 18 | "--arg=$imagedir/vmlinuz-$version " . 19 | "/etc/kernel/prerm.d") && 20 | die "Failed to process /etc/kernel/prerm.d"; 21 | } 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | pkg_version=`date +%Y%m%d` 3 | 4 | git --git-dir linux/.git checkout FETCH_HEAD 5 | 6 | echo "update debchangelog" 7 | debchange -v 6.6-$pkg_version -D openeuler --force-distribution -U -M "Update to Linux $pkg_version" 8 | -------------------------------------------------------------------------------- /scripts/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script for parsing version information in the repository 3 | set -e 4 | set -o pipefail 5 | 6 | LINUX_REPOSITORY=linux 7 | LINUX_VERSION=$(sed -n "s/^VERSION = \([0-9]*$\)/\1/p" < linux/Makefile | xargs) 8 | LINUX_PATCHLEVEL=$(sed -n "s/^PATCHLEVEL = \([0-9]*$\)/\1/p" < linux/Makefile | xargs) 9 | LINUX_SUBLEVEL=$(sed -n "s/^SUBLEVEL = \([0-9]*$\)/\1/p" < linux/Makefile | xargs) 10 | LINUX_VERSION_FULL=$LINUX_VERSION.$LINUX_PATCHLEVEL.$LINUX_SUBLEVEL 11 | PACKAGE_VERSION=$(dpkg-parsechangelog -SVersion) 12 | PACKAGE_RELEASE=$(echo $PACKAGE_VERSION | sed -n 's/^.*-\([0-9]*\).*$/\1/p' | xargs) 13 | 14 | while getopts "MmnprdLh" OPTION; do 15 | case $OPTION in 16 | M) 17 | echo $LINUX_VERSION 18 | exit 0 19 | ;; 20 | m) 21 | echo $LINUX_PATCHLEVEL 22 | exit 0 23 | ;; 24 | n) 25 | echo $LINUX_VERSION.$LINUX_PATCHLEVEL 26 | exit 0 27 | ;; 28 | p) 29 | echo $LINUX_SUBLEVEL 30 | exit 0 31 | ;; 32 | r) 33 | echo $PACKAGE_RELEASE 34 | exit 0 35 | ;; 36 | L) 37 | echo $LINUX_VERSION_FULL 38 | exit 0 39 | ;; 40 | h) 41 | echo "version.sh [-Mmnprfh]" 42 | echo " -M major version" 43 | echo " -m minor version" 44 | echo " -n major minor version" 45 | echo " -p patch version" 46 | echo " -r package release" 47 | echo " -L Linux version" 48 | echo " -h this help message" 49 | exit 1 50 | ;; 51 | *) 52 | echo "Incorrect options provided" 53 | exit 1 54 | ;; 55 | esac 56 | done 57 | 58 | echo "$PACKAGE_VERSION" 59 | --------------------------------------------------------------------------------