]> git.proxmox.com Git - mirror_zfs-debian.git/blob - debian/patches/0001-Prevent-manual-builds-in-the-DKMS-source.patch
Refresh debian/patches after upstream merge.
[mirror_zfs-debian.git] / debian / patches / 0001-Prevent-manual-builds-in-the-DKMS-source.patch
1 From 7aae00a440e25f340fc89d2ff2447e2eac9d2df4 Mon Sep 17 00:00:00 2001
2 From: Darik Horn <dajhorn@vanadac.com>
3 Date: Tue, 17 Jan 2012 19:45:07 -0600
4 Subject: [PATCH 1/7] Prevent manual builds in the DKMS source.
5
6 Print an instructive error messsage and exit if the `dkms.conf` file
7 exists when the userland is configured. (ie: `--with-config=user`)
8
9 A non-trivial number of people try to rebuild ZoL from the
10 `/usr/src/zfs` tree, which is modified to better satisfy Debian
11 packaging policy and contains only the module sources for DKMS.
12
13 Regardless, local installations usually break managed installations,
14 so this autotools test could be further enhanced to check whether
15 ZFS has a DKMS registration.
16 ---
17 config/dkms.m4 | 14 ++++++++++++++
18 config/user.m4 | 1 +
19 config/zfs-build.m4 | 6 +++---
20 3 files changed, 18 insertions(+), 3 deletions(-)
21 create mode 100644 config/dkms.m4
22
23 diff --git a/config/dkms.m4 b/config/dkms.m4
24 new file mode 100644
25 index 0000000..cfa1152
26 --- /dev/null
27 +++ b/config/dkms.m4
28 @@ -0,0 +1,14 @@
29 +dnl #
30 +dnl # Prevent manual building in DKMS source tree.
31 +dnl #
32 +AC_DEFUN([ZFS_AC_DKMS_INHIBIT], [
33 + AC_MSG_CHECKING([for dkms.conf file])
34 + AS_IF([test -e dkms.conf], [
35 + AC_MSG_ERROR([
36 + *** ZFS should not be manually built in the DKMS source tree.
37 + *** Remove all ZFS packages before compiling the ZoL sources.
38 + *** Running "make install" breaks ZFS packages.])
39 + ], [
40 + AC_MSG_RESULT([not found])
41 + ])
42 +])
43 diff --git a/config/user.m4 b/config/user.m4
44 index 4fcef3d..16b8a76 100644
45 --- a/config/user.m4
46 +++ b/config/user.m4
47 @@ -2,6 +2,7 @@ dnl #
48 dnl # Default ZFS user configuration
49 dnl #
50 AC_DEFUN([ZFS_AC_CONFIG_USER], [
51 + ZFS_AC_DKMS_INHIBIT
52 ZFS_AC_CONFIG_USER_UDEV
53 ZFS_AC_CONFIG_USER_ARCH
54 ZFS_AC_CONFIG_USER_IOCTL
55 diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
56 index 6bfea51..fda0a4f 100644
57 --- a/config/zfs-build.m4
58 +++ b/config/zfs-build.m4
59 @@ -81,10 +81,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
60 ZFS_AC_CONFIG_ALWAYS
61
62 case "$ZFS_CONFIG" in
63 - kernel) ZFS_AC_CONFIG_KERNEL ;;
64 user) ZFS_AC_CONFIG_USER ;;
65 - all) ZFS_AC_CONFIG_KERNEL
66 - ZFS_AC_CONFIG_USER ;;
67 + kernel) ZFS_AC_CONFIG_KERNEL ;;
68 + all) ZFS_AC_CONFIG_USER
69 + ZFS_AC_CONFIG_KERNEL ;;
70 srpm) ;;
71 *)
72 AC_MSG_RESULT([Error!])
73 --
74 1.7.9.5
75