Bug#618592: zfsutils misses zdb, zinject and ztest (with patch)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Robert, > A small bit of advice: > > - The extra libraries could be linked statically instead of providing them > as packages. This solves the libavl API conflict. > - The alloca and __unused hacks could be done via CFLAGS (other packages > of FreeBSD code do this IIRC) > - Instead of embedding strlcpy() you can use the one in libbsd. I prepared a new version of the patch. Apply it as explained last time. This time I followed your advise and moreover I fixed some problems to get those binaries really working. zdb and zinject seem to be fine now, ztest segfaults after a bit, but that seems to be an upstream issue [1]. I don't know FreeBSD well enough to tell whether this bug has been fixed in trunk or not. The patch now links statically against libavl, adds a libumem0 and a libzpool0 library (both with udeb and -dev) and tweaks some Makefiles to get things working. I replaced the alloca(x) hack by a CFLAGS argument as you suggested, but I still left the __unused hack as is since it appears only a single time. Moreover I added another patch fixing some upstream quirks in ztest by cherry picking some commits from upstream. This gets ztest at least running, but still fails upon a certain point. This patch is DEP-3 complaint to ease tracking for you in future. You may drop it, as soon as you switch to a new(er) upstream branch. [1] http://freebsd.1045724.n5.nabble.com/How-to-run-ZFS-Test-Suite-ztest-td4034131.html - -- with kind regards, Arno Töll GnuPG Key-ID: 0x8408D4C4 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJNnO2qAAoJELBdpXvEXpo9jd4P/ioYW4MUjw/gj/6YoaWy7nYs 9V/8GD0G6Od1PhCVPc6cjqTiyR7qoB883Io+4fRmpo0a8wd1ZFNU4PjXPV22jSpn y9ZtmD3oTAKOy6DAsn5tLNhVYArNAbuQAQLNp2j8M1NeMZTtfDTtSLfdoJAtoAGw cOcssSWvk+BNV2+WZ4EClab0ogDjSX2wfxmpgsuO0kBkOfOIGvJxK3xmqSOU+DDB yebZZM362fBLbuyxYN1PsV2Sdq57HuVVJ7K6g8kB+2RakyKtP8WSCXa7Es4WjB10 2KhpVQKscl2ajJWJfidUF4RjgO8D3eOt6S0QVeNWa94dqneQ2rMUxH3CkxTQCHU4 8Bn0yuTVrK+UxvwI31QbhEmGTeJ4Q1oNDL2Ptd4JAlOcz3X1zM9yGtsJt3OSLY1D WhEyUQJ3uzTrIdoT+JqAApz0dPVf08iXLTryJeKUorbT24LSWoN0N6hr6ug2LwmL E7TrmXKptiTb7L34gX6dnXySjxKPcFexvXnZ1o/cPSE7BzcAJkXlN7YHi2X8ebFr Xnc1H+GQZ4Fwc6WP0iFAMgzaE3CJ7Bu7Aa1kI+KQQMb5AFO4boMzX2eCGC5sbHI7 jvYXcTAHLkV7aPzjCT79HVlju/0un6w5BcfJQZW/QNSFT1Uy/KIcLYQZLiwValA3 5DDl1a4zCuSwLrg7rk+B =c2FH -END PGP SIGNATURE- diff -ruN debian.orig/control debian/control --- debian.orig/control 2011-03-16 14:57:19.0 -0400 +++ debian/control 2011-04-06 18:31:38.0 -0400 @@ -4,7 +4,8 @@ Maintainer: GNU/kFreeBSD Maintainers Uploaders: Aurelien Jarno Build-Depends: debhelper (>= 7), quilt, freebsd-buildutils, libbsd-dev (>= 0.1.4), - libc0.1-dev (>= 2.10), kfreebsd-kernel-headers (>= 0.51), libgeom-dev, libsbuf-dev + libc0.1-dev (>= 2.10), kfreebsd-kernel-headers (>= 0.51), libgeom-dev, libsbuf-dev, + zlib1g-dev Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/zfsutils/ Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/zfsutils/ Standards-Version: 3.9.1 @@ -116,3 +117,58 @@ ZFS filesystems. . This is a minimal package for use in debian-installer. + + +Package: libumem0 +Section: libs +Architecture: kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenSolaris name-value pair library + This package contains the OpenSolaris libumem library, to detect + memory management bugs in applications + +Package: libumem-dev +Section: libdevel +Architecture: kfreebsd-any +Depends: libumem0 (= ${binary:Version}), ${misc:Depends}, libc0.1-dev | libc-dev +Description: Development files for libnvpair + This package contains the header files and static library needed to + compile applications that use libumem. + +Package: libumem0-udeb +XC-Package-Type: udeb +Section: debian-installer +Architecture: kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenSolaris name-value pair library + This package contains the OpenSolaris libumem library, to detect + memory management bugs in applications + + +Package: libzpool0 +Section: libs +Architecture: kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenSolaris name-value pair library + This package contains the OpenSolaris libzpool library. + . + This is a minimal package for use in debian-installer. + +Package: libzpool-dev +Section: libdevel +Architecture: kfreebsd-any +Depends: libzpool0 (= ${binary:Version}), ${misc:Depends}, libc0.1-dev | libc-dev +Description: Development files for libnvpair + This package contains the header files and static library needed to + compile applications that use libzpool. + +Package: libzpool0-udeb +XC-Package-Type: udeb +Section: debian-installer +Architecture: kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenSolaris name-value pair library + This package contains the OpenSolaris libzpool library. + . + This is a minimal package for use in de
Bug#618592: zfsutils misses zdb, zinject and ztest (with patch)
2011/3/16 Arno Töll : > However packages do not build (but compiling and usage of them succeeds > when using the proper libraries) because dpkg-shlibdeps fails to resolve > the dependency for libavl, as I did not provide a binary for this > package, it is included in the source though and builds fine. Problem > is, there is a non ABI and API compatible libavl package in Debian > already (http://packages.debian.org/source/squeeze/libavl) which clashes > with the implementation those utilities use. Hi, A small bit of advice: - The extra libraries could be linked statically instead of providing them as packages. This solves the libavl API conflict. - The alloca and __unused hacks could be done via CFLAGS (other packages of FreeBSD code do this IIRC) - Instead of embedding strlcpy() you can use the one in libbsd. -- Robert Millan -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#618592: zfsutils misses zdb, zinject and ztest (with patch)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Package: zfsutils Version: 8.1-4 Severity: normal Tags: patch, kfreebsd The currently shipped version of zfsutils lacks the commands `zdb', `ztest' and `zinject'. Upstream does ship those utilities, so I tried to patch the current package to include them. My patch fixes this issue and provides binaries ready to provides packages: root@kfreebsd:~/testbuild/zfsutils-8.1# LD_PRELOAD="./cddl/lib/libumem/libumem.so ./cddl/lib/libzpool/libzpool.so ./cddl/lib/libavl/libavl.so" ./cddl/usr.sbin/zdb/zdb zfs_pool version=14 name='zfs_pool' state=0 txg=4 pool_guid=10142712129494363932 hostname='kfreebsd' ... However packages do not build (but compiling and usage of them succeeds when using the proper libraries) because dpkg-shlibdeps fails to resolve the dependency for libavl, as I did not provide a binary for this package, it is included in the source though and builds fine. Problem is, there is a non ABI and API compatible libavl package in Debian already (http://packages.debian.org/source/squeeze/libavl) which clashes with the implementation those utilities use. You, as developer might choose how to resolve this conflict finally, maybe it is necessary to rename the "libavl" zfsutils expect for kfreebsd. I attached a patch for the debian directory which solves the original problem though, i.e. it provides a `zdb' enabled zfustils and provides some new binary packages required by those. It is not entirely straightforward to apply the patch, since the source package is, ... well, ... needs some time to get used to. You need a new orig.tar.gz to build the new package, I used r219701 from upstream's SVN. To apply the patch do: root@kfreebsd:~/testbuild# apt-get source zfsutils root@kfreebsd:~/testbuild# rm zfsutils_8.1.orig.tar.gz root@kfreebsd:~/testbuild# cd zfsutils-8.1/ root@kfreebsd:~/testbuild/zfsutils-8.1# patch -p0 < ../debian-diff/debian-diff.patch root@kfreebsd:~/testbuild/zfsutils-8.1# make -f debian/rules get-orig-source root@kfreebsd:~/testbuild# mv zfsutils-8.1/debian . root@kfreebsd:~/testbuild# rm -rf zfsutils-8.1 root@kfreebsd:~/testbuild# tar zxf zfsutils_8.1.orig.tar.gz root@kfreebsd:~/testbuild# cd zfsutils-8.1 root@kfreebsd:~/testbuild/zfsutils-8.1# mv ../debian . build as usual from here on. Please note I neither changed debian/changelog nor did I increase the version number. - -- with kind regards, Arno Töll GnuPG Key-ID: 0x8408D4C4 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJNgQY4AAoJELBdpXvEXpo9xZ0P/0za/cgC37JfuBM7yWNRaWPR QdyorS+lCBsi+yboCdJ28tk8pil3nd39cWbu9D7MlFKdkNb3tW+rRYHqHz0zOV9v 5LXTWofQezIqqUnlInfT3LXKe6MBknFx3q4UnmU4Yc1pvrwCKvOVVPVNsmvmMCIs h9an6Ag+6bqf+QhtAZ4kqz12pvq5jOfyrXFRNLSsNenxG7FRmH/29QClp8epX5wO mktTDvt1wbFRKgJXqL2c4MFyVvbej7tv1RtXQ0DCOq7UYbUBdh6F4dAk6v3CQval /3YMJ97zV0TpLN8GBmoztDoL9AbBL42GAMiXE2xEEjICpVchY7UEdlZJszltcH7L J2qV+lASGXjoqn6cpXvSzDEiEKIt+cUJusVVKe3hC3cH8ZeWS8++JB1/SeaoamqY u08PSCsru4FiDFA9Qz5FMf+1/NePdR1ykvFQLj1mcQCMU6jLuqSXXZr53O2j+6cz alC8UU02hk/vlYkQ/xHvsoIky9R7pMMDOKK4LjcEDRZefp8N9ftMBQAtkdRloYur OeWbCjUt1qljOegwuuracoXbfRwxjhAQZVjOIKpV6MH4eQIWTGx51vbZOB44xeJy tPYsW6iDUMoe23KJF9jJp7kctlsgohSQDv5Cn4Q3A6KDUChEeqrfCt2b8G1bt8PK EzSoiLnZxGNiLenRljnv =vmvZ -END PGP SIGNATURE- diff -ruN debian.orig/control debian/control --- debian.orig/control 2011-03-16 14:57:19.0 -0400 +++ debian/control 2011-03-16 15:00:42.0 -0400 @@ -4,7 +4,8 @@ Maintainer: GNU/kFreeBSD Maintainers Uploaders: Aurelien Jarno Build-Depends: debhelper (>= 7), quilt, freebsd-buildutils, libbsd-dev (>= 0.1.4), - libc0.1-dev (>= 2.10), kfreebsd-kernel-headers (>= 0.51), libgeom-dev, libsbuf-dev + libc0.1-dev (>= 2.10), kfreebsd-kernel-headers (>= 0.51), libgeom-dev, libsbuf-dev, + zlib1g-dev Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/zfsutils/ Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/zfsutils/ Standards-Version: 3.9.1 @@ -116,3 +117,36 @@ ZFS filesystems. . This is a minimal package for use in debian-installer. + + +Package: libumem0 +Section: libs +Architecture: kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenSolaris name-value pair library + This package contains the OpenSolaris libumem library, to detect + memory management bugs in applications + +Package: libumem-dev +Section: libdevel +Architecture: kfreebsd-any +Depends: libumem0 (= ${binary:Version}), ${misc:Depends}, libc0.1-dev | libc-dev +Description: Development files for libnvpair + This package contains the header files and static library needed to + compile applications that use libumem. + +Package: libzpool0 +Section: libs +Architecture: kfreebsd-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenSolaris name-value pair library + This package contains the OpenSolaris libzpool library. + +Package: libzpool-dev +Section: libdevel +Architecture: kfreebsd-any