Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3107853pxb; Sun, 29 Aug 2021 14:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu4mbU7Fj8qjbjQjEIXwrEAScJZPFajRif+0vuQYZNLVX6x7HyfADx7P4vyUFhHQjkUupS X-Received: by 2002:a50:a452:: with SMTP id v18mr20767257edb.17.1630270917394; Sun, 29 Aug 2021 14:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630270917; cv=none; d=google.com; s=arc-20160816; b=UUeDk14fJW9HuEbFgwAWjK7igtf5egpFHJnu297FIrz56XKCLVerJ0eFlqaXQ0rpMY rgdiznADpos5FSZBIuIUgNSKE9taIl1VUycQW6WKOG6tELNUBxtopo79jm00FL1X3S8M 84dQkPGLjlYS9kD73nX6crmiY9Q5Ks/BeWy8yGh0J8sDw3d6zZOyO4avQV070S44352f CmGe8cgmYgWXGIkVK/BHUQmw1qWb1j0si4yj2lhC+XPu1DCp4GWPqD7iMxMUKIedDs5M AMEuAON1nEAJzBAL5mSxTwQvCZx/S0+N9KxWQsf8qbVyU1tTMqoSNSiHtxYfhqvUHnIQ vcqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=wz6zZHmKi+d39glEis2kDxC7Ii0oe40CPrCIf0zI8ys=; b=LlqES3J3lbI8PzMVxH89RonxNS6ZARfyUML5eynzR4lsGgkxdjQ9z2kZxRRmbH+sJI tbV5bD981B0gYsZNxI0uOWrMaie4ndgYuHsSurybZ7MhCCwr//enaHznCRJs+I8lk3jk gbM9quvgwmFMKXMGVS/l9ZDNQXS1Z05q8rRVKm35NDhBKrx6ReALS59NAYr1GnKfmhOt 1dR33t3us7ubCfHrgxfu0E20PKYjGqH4c/KA74iNVbiZ297Tga4481PGUHN0twzK1iO3 St1U2GRwl2hCiZ//BubZxujjiD2No18DN4OJginsmBK7bbHioToDQkdcfMK9xxrrBFov gIig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail header.b=Mr8eciYD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si6100718edc.287.2021.08.29.14.01.32; Sun, 29 Aug 2021 14:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail header.b=Mr8eciYD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233072AbhH2VBC (ORCPT + 99 others); Sun, 29 Aug 2021 17:01:02 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:37847 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232450AbhH2VBC (ORCPT ); Sun, 29 Aug 2021 17:01:02 -0400 Date: Sun, 29 Aug 2021 21:00:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bryanbrattlof.com; s=protonmail; t=1630270807; bh=wz6zZHmKi+d39glEis2kDxC7Ii0oe40CPrCIf0zI8ys=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Mr8eciYDm5K8u30m1SFYMb8KMW7+EuCZ1SzC2oY4FM9OFqAVwNodL3mZHbiNAtMZF VUFQ7wH/A5anJBvBt5XPhC1Lz+fBsr4JTFDTiH51s5+gA/NOwB/T6TqpKSF1hNE1Ov wzxyzH1QHfKK47pQKolt6WtGewRPZ2S9Itk1oLMSOZAIoL7flPry2H+Z06Qaqx+twX 9U4ILdTEj7/zPOC7DsAn8Qk2W2cHzZKosAK5qBA7HDm2pK5R4He+uTS/BhEZmrhstQ 2FsSOB8H0al1xClZb4kN2NXt1pjpuJ2eLDo19Rw2yEHZm2Sb/eSQ/+5FYYCsl4O5Lx m0OYcc6LmQbSw== To: Krish Jain From: Bryan Brattlof Cc: Greg KH , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Reply-To: Bryan Brattlof Subject: Re: [PATCH] Declare the file_operations struct as const Message-ID: <20210829205953.63ebc32xlyudsqzg@h510> In-Reply-To: References: <20210829144531.c2syu4vv4s22dlg7@h510> <20210829164921.u5ntqk5jz2v3hlgr@h510> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On this day, August 29, 2021, thus sayeth Krish Jain: > Keeping you updated. Small win. The "Symbol version dump > "Module.symvers" is missing. " error disappeared. Now I still don't > know why > Whoop! Any win, no matter their size, always feel great. I ran around the house yesterday after cross compiling DOOM! for an armel chip. It's that "win" feeling you get that keeps me involved. It is important that you find out why though. What is the importance to having Module.symvers? and why is it a WARNING and not an ERROR? What would happen if we didn't have the proper symbols when compiling or installing this driver? How and what generates the Module.symvers file when we *do* need it? How can we turn this warning off when we don't need it? This is covered in chapter "6. Module Versioning" https://www.kernel.org/doc/html/latest/kbuild/modules.html > > ERROR: Kernel configuration is invalid."; \ > echo >&2 " include/generated/autoconf.h or > include/config/auto.conf are missing.";\ > echo >&2 " Run 'make oldconfig && make prepare' on kernel src > to fix it."; \ > > > is still present. > > How can I fix this? > Are there any other 'make *config' options we could try? What does 'make prepare' even do? Why do we even need a configuration file? https://www.kernel.org/doc/html/latest/kbuild/kconfig.html > > Best Regards > > On Sun, Aug 29, 2021 at 8:28 PM Krish Jain wro= te: > > > > Basically it says "you must have a prebuilt kernel available that > > contains the configuration and header files used in the build." Since > > for the staging kernel "make oldconfig" asked me for more > > configurations apart from my old configuration file (as it reads the > > existing .config file that was used for an old kernel and prompts the > > user for options in the current kernel source that are not found in > > the file) . So I *don't* currently have a prebuilt kernel that > > contains all the configuration in my staging kernel's .config file. So > > do I have to build the kernel once before I can just build the module > > with "make CCFLAGS=3D-Werror W=3D1 M=3Ddrivers/staging/android" ? > > What do all these other configuration settings turn on and off anyway? Do we really need CONFIG_INFINIBAND turned on if we're working in the drivers/staging tree of the kernel? What would we gain from having a compiled kernel if we want to test a single staging driver? If you found what Module.symvers does, you should know this. > > > > > > > > Again, do not allow others to rob you of learning how to solve thes= e > > > > issues yourself. I *strongly* encourage you to familiarize yourself= with > > > > the Kernel Build System in the Documentation. > > > > > > > > https://www.kernel.org/doc/html/latest/kbuild/modules.html > > > > > > > > Specifically the first paragraph of "2. How to Build External Modul= es" > > > > > > > > It may seem like a lot for such a simple issue but it *is* worth it= . > > > > ~Bryan > > > > > > > > > > That section says > > > > > > > > > "To build external modules, *you must have a prebuilt kernel > > > available* that contains the configuration and header files used in > > > the build. Also, the kernel must have been built with modules enabled= . > > > If you are using a distribution kernel, there will be a package for > > > the kernel you are running provided by your distribution. > > > > > > An alternative is to use the =E2=80=9Cmake=E2=80=9D target =E2=80= =9Cmodules_prepare.=E2=80=9D This > > > will make sure the kernel contains the information required. The > > > target exists solely as a simple way to prepare a kernel source tree > > > for building external modules. > > > > > > NOTE: =E2=80=9Cmodules_prepare=E2=80=9D will not build Module.symvers= even if > > > CONFIG_MODVERSIONS is set; therefore, *a full kernel build needs to b= e > > > executed to make module versioning work.*" > > > > > > So I am just trying to confirm with you whether I have to first build > > > the kernel with like "make" or not? As you can imagine my hardware > > > takes *very* long to build a kernel as I did in my last attempt so I > > > am asking whether it is needed. Hope you understand. > > > I understand. Though I still don't wish to rob you of this opportunity. Your ability to come up with these questions and answer them yourself is what will make you a better programmer and developer. Don't get me wrong. Greg knows all too well the garbage I can shovel his way. It's not about knowing the answer. It about knowing how to find the answer yourself. ~Bryan