On Mon, 26 Aug 2013 09:16:44 -0400, Tanstaafl wrote:

> > You can get ZFS on Linux with relative ease, you just have to build it
> > yourself. Distros feel they can't redistribute that code.  
> 
> I know you can do this as a module - but is there an overlay or patch
> to get it built directly into the kernel? I'd love to use ZFS on my
> gentoo server, but I disable modules on servers for security reasons.

You can do it. You have to unmask the kernel_builtin USE flag to stop zfs
bringing in zfs_kmod, then unpack the sources and run the script to
install them into the kernel tree.

I run this script after emerging a new kernel

==================================================

#!/bin/sh

[[ -f /usr/src/linux/.config ]] || zcat /proc/config.gz
>/usr/src/linux/.config

SPL_EBUILD=$(ls -1 /var/portage/sys-kernel/spl/spl-0* | tail -n 1)
ZFS_EBUILD=$(ls -1 /var/portage/sys-fs/zfs/zfs-0* | tail -n 1)

SPL_DIR=$(ebuild $SPL_EBUILD clean prepare | awk '/Preparing source in/
{print $5}') ZFS_DIR=$(ebuild $ZFS_EBUILD clean prepare | awk '/Preparing
source in/ {print $5}')

cd $SPL_DIR
./configure --enable-linux-builtin --with-linux=/usr/src/linux
./copy-builtin /usr/src/linux
      
cd $ZFS_DIR
./configure --enable-linux-builtin --with-linux=/usr/src/linux
--with-spl=$SPL_DIR ./copy-builtin /usr/src/linux

==================================================

Then run make oldconfig and compile as usual.


-- 
Neil Bothwick

Cross-country skiing is great in small countries.

Attachment: signature.asc
Description: PGP signature

Reply via email to