[Buildroot] [PATCH v3] package/zfs: new package

Romain Naour romain.naour at gmail.com
Sun Aug 22 13:10:15 UTC 2021


Hello José Luis,

Le 22/08/2021 à 14:13, José Luis Salvador Rufo a écrit :
> Hello Romain,
> 
> I added Philippe Serbruyns to CC (from another related thread).
> 
> I'm on it. Currently we have two main issues with ZFS:

Ok, thanks!

> 
> - AIO uClibc support for zfs 2.1.X and beyond:
> 
>     This is the reason I didn't send the `zfs 2.1.x bump version` yet.
> 
>     This commit added AIO in order to improve the speed importing volumes parallely:
>     https://github.com/openzfs/zfs/commit/e50b5217e7a85f1466edf88d5f3ea5aed0c2fd22
>     <https://github.com/openzfs/zfs/commit/e50b5217e7a85f1466edf88d5f3ea5aed0c2fd22>
> 
>     But uClibc doesn't support `#include <aio.h>`. So I need to only import this
>     library when it is not uClibc. I don't figure out yet how (attached a
>     `poc.patch` for ZFS that does not work).
> 
>     I'm trying to create a proper patch for upstream.
> 
> 
> 
> - Cross-platform-compilations and the `empty module` test:
> 
>     This issue is very old, and everything is about environments and
>     cross-platform-compilations. The problem comes from here:
>     https://github.com/openzfs/zfs/blob/master/config/kernel.m4#L598
>     <https://github.com/openzfs/zfs/blob/master/config/kernel.m4#L598>
> 
>     In this test, the `make` (modules) is from the host because (I think)
>     somewhere someone unset all environments. Some people include `export PATH`
>     in order to execute the `make` from the cross-compilation environment. I am
>     still thinking about a proper patch for upstream.
> 
>     Here is my `build.log` from the referred `make`:
> 
>         make[2]: Entering directory
>         '/home/jlsalvador/src/buildroot-rpi4-tmp/build/linux-custom'
> 
> 
>           ERROR: Kernel configuration is invalid.
> 
>                  include/generated/autoconf.h or include/config/auto.conf are
>         missing.
> 
>                  Run 'make oldconfig && make prepare' on kernel src to fix it.
> 
>         make[2]: *** [Makefile:719: include/config/auto.conf] Error 1
> 
>         make[2]: Failed to remake makefile 'include/config/auto.conf'.
> 
>           CC [M]
>          /home/jlsalvador/src/buildroot-rpi4-tmp/build/zfs-2.0.5/build/conftest/conftest.o
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized argument
>         in option ‘-mcmodel=kernel’
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: note: valid arguments to
>         ‘-mcmodel=’ are: large small tiny
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized
>         command-line option ‘-mno-sse’; did you mean ‘-fno-dse’?
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized
>         command-line option ‘-mno-mmx’
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized
>         command-line option ‘-mno-sse2’
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized
>         command-line option ‘-mno-3dnow’
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized
>         command-line option ‘-m64’
> 
>         aarch64-buildroot-linux-uclibc-gcc.br_real: error: unrecognized
>         command-line option ‘-mno-red-zone’
> 
>         make[3]: *** [scripts/Makefile.build:279:
>         /home/jlsalvador/src/buildroot-rpi4-tmp/build/zfs-2.0.5/build/conftest/conftest.o]
>         Error 1
> 
>         make[3]: Target '__build' not remade because of errors.
> 
>         make[2]: *** [Makefile:1824:
>         /home/jlsalvador/src/buildroot-rpi4-tmp/build/zfs-2.0.5/build/conftest]
>         Error 2
> 
>         make[2]: Target 'modules' not remade because of errors.
> 
>         make[2]: Leaving directory
>         '/home/jlsalvador/src/buildroot-rpi4-tmp/build/linux-custom'
> 
>     The `include/config/auto.conf` file exists:
> 
>         $ file
>         /home/jlsalvador/src/buildroot-rpi4-tmp/build/linux-custom/include/config/auto.conf
>         /home/jlsalvador/src/buildroot-rpi4-tmp/build/linux-custom/include/config/auto.conf:
>         Linux make config build file, ASCII text
> 
> 
>     But because the `make` is from a x86, and the final platform is a Arm64, the
>     LINUX config is incorrect.
> 
>     As you already saw, I need to figure out how to use the `make` from the
>     cross-compilation path instead of the host path for this test.
> 
> 
> This is the current status. I'm trying to fix the second issue today. Any help
> is more than welcome.

Thanks for the feedback, I'm currently looking at the Buildroot testsuite issues
for the upcoming release. I'll try to take a look if I have time.

Best regards,
Romain


> 
> Greetings.
> 
> El dom, 22 ago 2021 a las 12:38, Romain Naour (<romain.naour at gmail.com
> <mailto:romain.naour at gmail.com>>) escribió:
> 
>     Hello José Luis, All,
> 
>     Le 13/04/2021 à 23:16, Yann E. MORIN a écrit :
>     > José Luis, All,
>     >
>     > On 2021-03-17 10:52 +0100, José Luis Salvador Rufo spake thusly:
>     >> OpenZFS is an advanced file system and volume manager which was originally
>     >> developed for Solaris and is now maintained by the OpenZFS community. This
>     >> repository contains the code for running OpenZFS on Linux and FreeBSD.
>     >>
>     >> http://zfsonlinux.org/ <http://zfsonlinux.org/>
>     >>
>     >> Signed-off-by: José Luis Salvador Rufo <salvador.joseluis at gmail.com
>     <mailto:salvador.joseluis at gmail.com>>
>     >
>     > I did a few substancial changes:
>     >
>     >   - fix test case on how to use a pre-built toolchain
>     >   - reorder the test case config
>     >   - add test case with glibc
>     >   - drop superflous test timeout override
>     >   - only select libtirpc when C library lacks native RPC
>     >   - drop unused ZFS_MODULES variable
>     >   - drop ZFS_CPE_ID_PREFIX and ZFS_AUTORECONF_OPTS which are defaults
>     >   - drop NLS options, already set in a generic manner
>     >   - drop incomplete/improper sysvinit support
>     >   - some cosmetics
>     >
>     > Applied to master with the above changes, thanks.
>     >
>     > Regards,
>     > Yann E. MORIN.
>     >
>     >> ---
>     >> Changes v2 -> v3:
>     >>   - Updated OpenZFS to 2.0.4
>     >> Changes v1 -> v2:
>     >>   (suggested by Yann E. MORIN)
>     >>   - Config.in: check-package accomplished
>     >>   - Config.in: fixed Config.in dependences
>     >>   - zfs.hash: proper zfs.hash format
>     >>   - zfs.mk <http://zfs.mk>: added cpe for openzfs
>     >>   - zfs.mk <http://zfs.mk>: uclibc patch merged into upstream
>     >>   - zfs.mk <http://zfs.mk>: removed futile comments as "zfs needs"
>     >>   - zfs.mk <http://zfs.mk>: added comments about the kernel dependence
>     >>   - zfs.mk <http://zfs.mk>: removed autotools default arguments values
>     >>   - zfs.mk <http://zfs.mk>: added optional PAM dependence
>     >>   - zfs.mk <http://zfs.mk>: replaced inline conditionals by full
>     explained blocks
>     >>   - zfs.mk <http://zfs.mk>: added comments about optionals systemd and sysv
>     >>   - zfs.mk <http://zfs.mk>: removed --disable-silent-rules
>     >>   - zfs.mk <http://zfs.mk>: reordered autoreconf
>     >>   - zfs.mk <http://zfs.mk>: removed futile shared, static, and both logic
>     >>   - zfs.mk <http://zfs.mk>: fixed optional python(2|3) support for pyzfs
>     >>   - zfs.mk <http://zfs.mk>: removed futile kernel fragment
>     >>   - test_zfs: replaced external toolchain by already defined bootlin
>     >>   - test_zfs: increased memory a bit to prevents OOM
>     >>   - test_zfs: added pyzfs test
>     >>
>     >>  DEVELOPERS                                |  4 +
>     >>  package/Config.in                         |  1 +
>     >>  package/zfs/Config.in                     | 32 ++++++++
>     >>  package/zfs/zfs.hash                      |  6 ++
>     >>  package/zfs/zfs.mk <http://zfs.mk>                        | 90
>     +++++++++++++++++++++++
>     >>  support/testing/tests/package/test_zfs.py | 61 +++++++++++++++
> 
>     The test_zfs doesn't build in our gitlab CI:
> 
>     https://gitlab.com/kubu93/buildroot/-/jobs/1522848483
>     <https://gitlab.com/kubu93/buildroot/-/jobs/1522848483>
> 
>     zfs use the host compiler to check if it can build zfs modules for the target
> 
>     checking kernel source directory...
>     /builds/kubu93/buildroot/test-output/TestZfsGlibc/build/linux-5.12.13
>     checking kernel build directory...
>     /builds/kubu93/buildroot/test-output/TestZfsGlibc/build/linux-5.12.13
>     checking kernel source version... 5.12.13
>     checking kernel file name for module symbols... Module.symvers
>     checking whether modules can be built... no
>     configure: error:
>             *** Unable to build an empty module.
> 
>     See build-host-gcc-6.log
> 
>       CC [M]
>     /home/br-user/buildroot/testsuite/TestZfsGlibc/build/zfs-2.0.5/build/conftest/conftest.o
>     In file included from <command-line>:0:0:
>     ./arch/x86/include/asm/segment.h: In function 'vdso_read_cpunode':
>     ././include/linux/compiler_types.h:250:24: error: expected '(' before '__inline'
>      #define asm_inline asm __inline
> 
>     The check pass if a newer host gcc is used (gcc 10.3 here).
> 
>     Can you have a look ?
> 
>     Best regards,
>     Romain
> 



More information about the buildroot mailing list