]> git.proxmox.com Git - mirror_zfs.git/blame - copy-builtin
Tag 2.2.0
[mirror_zfs.git] / copy-builtin
CommitLineData
36e8abee 1#!/bin/sh
2ee4a18b 2
36e8abee 3set -ef
2ee4a18b
ED
4
5usage()
6{
7 echo "usage: $0 <kernel source tree>" >&2
8 exit 1
9}
10
11[ "$#" -eq 1 ] || usage
36e8abee 12KERNEL_DIR="$1"
2ee4a18b 13
2ee4a18b
ED
14if ! [ -e 'zfs_config.h' ]
15then
36e8abee 16 echo "$0: you did not run configure, or you're not in the ZFS source directory."
17 echo "$0: run configure with --with-linux=$KERNEL_DIR and --enable-linux-builtin."
18
2ee4a18b 19 exit 1
36e8abee 20fi >&2
2ee4a18b 21
36e8abee 22make clean ||:
109d2c93 23make gitrev
2ee4a18b
ED
24
25rm -rf "$KERNEL_DIR/include/zfs" "$KERNEL_DIR/fs/zfs"
36e8abee 26cp -R include "$KERNEL_DIR/include/zfs"
27cp -R module "$KERNEL_DIR/fs/zfs"
93ce2b4c 28cp zfs_config.h "$KERNEL_DIR/include/zfs/"
2ee4a18b 29
36e8abee 30cat > "$KERNEL_DIR/fs/zfs/Kconfig" <<EOF
2ee4a18b 31config ZFS
c90ea655 32 tristate "ZFS filesystem support"
9a512dca
RY
33 depends on EFI_PARTITION
34 select ZLIB_INFLATE
35 select ZLIB_DEFLATE
2ee4a18b 36 help
d0249a4b 37 This is the ZFS filesystem from the OpenZFS project.
2ee4a18b 38
d0249a4b 39 See https://github.com/openzfs/zfs
2ee4a18b
ED
40
41 To compile this file system support as a module, choose M here.
42
43 If unsure, say N.
44EOF
45
841fd303
AZ
46sed -i '/source "fs\/ext2\/Kconfig\"/i\source "fs/zfs/Kconfig"' "$KERNEL_DIR/fs/Kconfig"
47echo 'obj-$(CONFIG_ZFS) += zfs/' >> "$KERNEL_DIR/fs/Makefile"
2ee4a18b 48
36e8abee 49echo "$0: done. now you can build the kernel with ZFS support." >&2
50echo "$0: make sure you enable ZFS support (CONFIG_ZFS) before building." >&2