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