Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@busybox.net
To: buildroot@uclibc.org
Subject: [Buildroot] [Bug 16075] New: Cannot use linux kernel extensions from external tree (building zfs into kernel)
Date: Wed, 15 May 2024 06:22:12 +0000	[thread overview]
Message-ID: <bug-16075-163@https.bugs.busybox.net/> (raw)

https://bugs.busybox.net/show_bug.cgi?id=16075

            Bug ID: 16075
           Summary: Cannot use linux kernel extensions from external tree
                    (building zfs into kernel)
           Product: buildroot
           Version: 2024.02.1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned@buildroot.uclibc.org
          Reporter: mscdex@mscdex.net
                CC: buildroot@uclibc.org
  Target Milestone: ---

I'm wanting to build zfs into the kernel, so after reading through the
documentation it seemed like the best way to go about it would be through
Buildroot's Linux kernel extension mechanism.

I already have an existing, working external tree, so according to the
documentation I added a `linux/Config.ext.in` and
`linux/linux-ext-zfs-inkernel.mk` to my external tree.

Re-running `make menuconfig` and navigating to the Linux Extensions section
shows both the built-in Buildroot extensions and my new extension. However,
after I select my extension and save the Buildroot configuration, just about
every make target except `menuconfig` fails with:

linux/linux.mk:646: *** Package 'linux' defined a second time in 'linux/';
previous definition was in '/home/foo/buildroot-external/linux/'.  Stop.
make: *** [Makefile:23: _all] Error 2

I tried explicitly adding a reference to the Config.ext.in in my external
tree's Config.in and adding a reference to the linux-ext-zfs-inkernel.mk in my
external tree's external.mk, but that did not make any difference.

For what it's worth here are the contents of the two files (there may be issues
with them as I obviously haven't been able to test them yet):

linux/Config.ext.in:
  config BR2_LINUX_KERNEL_EXT_ZFS_INKERNEL
      bool "In-kernel ZFS"
      help
        In-kernel ZFS module

linux/linux-ext-zfs-inkernel.mk:
  ZFS_INKERNEL_VERSION = 2.2.2
  ZFS_INKERNEL_SOURCE =
https://github.com/openzfs/zfs/releases/download/zfs-$(ZFS_INKERNEL_VERSION)
  ZFS_INKERNEL_INSTALL_STAGING = NO
  ZFS_INKERNEL_INSTALL_TARGET = NO
  define ZFS_INKERNEL_COPY_BUILTIN
    cd $(ZFS_INKERNEL_BUILDDIR) && ./copy-builtin $(LINUX_DIR)
  endef
  ZFS_INKERNEL_POST_CONFIGURE_HOOKS += ZFS_INKERNEL_COPY_BUILTIN
  LINUX_EXTENSIONS += zfs-inkernel
  ZFS_INKERNEL_CONF_OPTS = \
      --with-linux=$(LINUX_DIR) \
      --enable-linux-builtin
  ZFS_INKERNEL_MAKE = true
  $(eval $(autotools-package))

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2024-05-15  6:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15  6:22 bugzilla [this message]
2024-05-15 16:45 ` [Buildroot] [Bug 16075] Cannot use linux kernel extensions from external tree (building zfs into kernel) bugzilla
2024-05-15 19:12 ` bugzilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-16075-163@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@uclibc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox