Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 365485 - sys-fs/zfs-9999 /sbin/mount.zfs links to /usr/lib/lib-{spl,zfs}.so
Summary: sys-fs/zfs-9999 /sbin/mount.zfs links to /usr/lib/lib-{spl,zfs}.so
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-01 00:42 UTC by Marcin Mirosław
Modified: 2012-02-08 09:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
proposal of patch (libspl-libzfs-localization.patch,598 bytes, patch)
2011-05-01 00:43 UTC, Marcin Mirosław
Details | Diff
patch for ebuild (ebuild.patch,1.80 KB, patch)
2011-05-01 00:47 UTC, Marcin Mirosław
Details | Diff
proposal of ebuild (zfs-9999.ebuild,2.11 KB, text/plain)
2011-05-03 13:25 UTC, Marcin Mirosław
Details
change_location.patch (change_location.patch,1.24 KB, patch)
2011-05-03 13:27 UTC, Marcin Mirosław
Details | Diff
proposal of ebuild (zfs-9999.ebuild,2.00 KB, text/plain)
2011-05-17 08:47 UTC, Marcin Mirosław
Details
zfs_completion.bash (zfs_completion.bash,6.06 KB, text/plain)
2011-05-17 08:47 UTC, Marcin Mirosław
Details
zfs-0.6.0-includedir.patch (zfs-0.6.0-includedir.patch,586 bytes, patch)
2011-05-17 08:49 UTC, Marcin Mirosław
Details | Diff
zfs.initd (zfs.initd,2.00 KB, text/plain)
2011-05-17 08:52 UTC, Marcin Mirosław
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Mirosław 2011-05-01 00:42:29 UTC
It prevents to have /usr on diffrent partition than / .


Reproducible: Always
Comment 1 Marcin Mirosław 2011-05-01 00:43:41 UTC
Created attachment 271689 [details, diff]
proposal of patch

I'm completly not familiar with autotools, i suppose this patch is very bad. But it works for me:)
Comment 2 Marcin Mirosław 2011-05-01 00:47:36 UTC
Created attachment 271691 [details, diff]
patch for ebuild

This patch for ebuild fix:
- DEPEND
- checks for PREEMPT kernel
- changes localization libspl and libzfs
- unrecognized options: --with-prefix
- removes unneeded files installed in /usr/src/zfs
- removes .la and .a files
Comment 3 Marcin Mirosław 2011-05-01 10:17:08 UTC
I've forgot about checking if zlib is present in kernel.
Comment 4 Alexey Shvetsov archtester gentoo-dev 2011-05-01 13:07:14 UTC
Can you fix autotools patch so it will use $(get_libdir) to define libs so it will be multilib friendly =) After this i'll add zfs to tree
Comment 5 Marcin Mirosław 2011-05-03 11:30:05 UTC
I have no idea how to do it. Autotools is high level magic for me:)
I've noticed another script should'nt be in /usr. While booting, udev calls zpool_id but calls it before /usr is mounted. Zpool_id shoud be in /sbin and udev rules should have corrected paths.
Comment 6 Marcin Mirosław 2011-05-03 13:25:57 UTC
Created attachment 271979 [details]
proposal of ebuild

I've did it in diffrent way, i hope it will work correctly on multilib.
Comment 7 Marcin Mirosław 2011-05-03 13:27:01 UTC
Created attachment 271981 [details, diff]
change_location.patch

Patch fixing udev rules and location of zpool_id
Comment 8 Alexey Shvetsov archtester gentoo-dev 2011-05-14 19:37:48 UTC
Can you update your proposal ebuild and add all missing files? and after testing i'll try to merge this upstream
Comment 9 Marcin Mirosław 2011-05-17 08:47:24 UTC
Created attachment 273571 [details]
proposal of ebuild

Ebuild with support for bash-completion (taken from zfs-fuse).
Comment 10 Marcin Mirosław 2011-05-17 08:47:57 UTC
Created attachment 273573 [details]
zfs_completion.bash
Comment 11 Marcin Mirosław 2011-05-17 08:49:03 UTC
Created attachment 273575 [details, diff]
zfs-0.6.0-includedir.patch
Comment 12 Marcin Mirosław 2011-05-17 08:50:07 UTC
Comment on attachment 273573 [details]
zfs_completion.bash

File for bash completion.
Comment 13 Marcin Mirosław 2011-05-17 08:52:40 UTC
Created attachment 273579 [details]
zfs.initd

Init script taken from science overlay.
Comment 14 Marcin Mirosław 2011-05-17 08:53:13 UTC
If i forgot about any file, it should ba taken from science overlay.
Comment 15 Alexey Shvetsov archtester gentoo-dev 2012-02-04 16:47:49 UTC
Its no longer in sci overlay
Comment 16 Richard Yao (RETIRED) gentoo-dev 2012-02-04 19:39:13 UTC
I am willing to move the libraries and executables in /usr to / to be consistent with what the lvm2 ebuild puts things and where the shared libraries upon which ZFS' shared libraries depend are placed.

The correct way to control where libraries and excutables go is to set --exec-prefix, but the ZFS upstream code does not obey it for the shared libraries that it installs. That can be worked around by setting --libdir, but I cannot do that in the ebuild without either tripping the QA checks or making cross platform compatibility a nightmare. That makes part of the solution to this bug an upstream issue, which I plan to report.

With that said, you can workaround this on your system by passing these flags to emerge manually:

env EXTRA_ECONF="--exec-prefix= --libdir=/lib64" emerge -1v zfs spl

It might be possible to make this semi-permanent by using an env file, although I did not test this:

http://wiki.gentoo.org/wiki//etc/portage/env
Comment 17 Richard Yao (RETIRED) gentoo-dev 2012-02-04 22:50:39 UTC
Here is an update:

1. --exec-prefix= is now set by the ebuilds in-tree, so the binaries are installed in /sbin.
2. I have updated my genkernel patches to reflect the change in tree.
3. A fix for the libraries being installed in the wrong directories will come as soon as upstream acts. It will not require any further changes to genkernel or the ebuilds.

I will close this bug when upstream resolves the corresponding bug that I filed with them:

https://github.com/zfsonlinux/zfs/issues/559
Comment 18 Marcin Mirosław 2012-02-07 15:00:11 UTC
I can see none libraries from /usr are used now:
# ldd /sbin/zfs |grep usr
#
# ldd /sbin/mount.zfs |grep usr
#

Btw, is it good place to keep headers file in /usr/src/zfs-0.6.0-rc6/3.2.2-gentoo/ directory? Maybe /usr/include/zfs/ would be better place?
Comment 19 Richard Yao (RETIRED) gentoo-dev 2012-02-07 20:19:12 UTC
(In reply to comment #18)
> I can see none libraries from /usr are used now:
> # ldd /sbin/zfs |grep usr
> #
> # ldd /sbin/mount.zfs |grep usr
> #

I could have sworn that it was installing them in the wrong locations. In that case, this issue is resolved.

(In reply to comment #18)
> Btw, is it good place to keep headers file in
> /usr/src/zfs-0.6.0-rc6/3.2.2-gentoo/ directory? Maybe /usr/include/zfs/ would
> be better place?

That directory contains what would be in the kernel sources directory had these modules been in tree. The most appropriate location is in /usr/src.

I am marking this bug resolved.
Comment 20 Marcin Mirosław 2012-02-08 09:58:09 UTC
Thanks.