From: Bryan Brattlof <hello@bryanbrattlof.com>
To: Krish Jain <krishjain02939@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Declare the file_operations struct as const
Date: Tue, 31 Aug 2021 13:35:51 +0000 [thread overview]
Message-ID: <20210831133533.6aayzjghdakrhy56@h510> (raw)
In-Reply-To: <CAPGkw+wyH3Pj6DV_m8wqCV5yujhjRwTwVNs6dK4i9JO-Y3ys6w@mail.gmail.com>
On this day, August 31, 2021, thus sayeth Krish Jain:
> Hi, could someone help with this? Still stuck. Maybe someone else has
> some insight into this issue too? Or Greg or Bryan.
>
> Thanks
>
Just another friendly reminder about top posting. I liked Greg's link to
John Gruber's opinion. TLDR: It's poor form.
http://daringfireball.net/2007/07/on_top
Ignoring these bits of advice send signals to the community that you
don't value the time we donate to you.
>
> On Mon, Aug 30, 2021 at 3:01 PM Krish Jain <krishjain02939@gmail.com> wrote:
> >
> > One sec this got even more confusing. I saw
> > https://stackoverflow.com/questions/23184181/error-while-running-make-install-include-generated-autoconf-h-or-include-confi
> > and it says
> >
> > -------
> > You are including the V=1 which causes Make to show the commands as
> > they're being run. From the looks of it, you're not actually seeing
> > the error itself, but you're seeing the test that it's running to
> > check if those files exist:
> >
> > test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
> > ( \ ... echo error messages here ... \ )
> >
> > That test is being run, and if it fails, it would echo those messages
> > to standard error, which it's not. If your module isn't building it's
> > probably due to some other issue.
> > ------
> >
> > So where is it going all wrong? Messing up the file ashmem.c does not
> > print the errors.
> >
I have no clue where you got V=1 from. Are you sure you need it?
As for "So where is it going all wrong?"
Like Greg said a few emails ago:
"Are you sure the file is being built at all? You usually have to
select the proper configuration option to enable that driver as well."
After a response from Greg like that, I would ask myself: How do I
select the proper configuration options? and How do I know if the proper
one is set?
Having had the same issue as you when I first started, I will try to
save you some time. Read the documentation, it is faster than you think
and will give you more information than I can give you over email:
https://www.kernel.org/doc/html/latest/kbuild/makefiles.html
> > >
> > > https://pastebin.com/NuvqMUWu is the link to the .config file.
> > > The error I get is https://imgur.com/gkwh7Sb .
> > >
Your .config will be different to everyone else. I have different
hardware to you, Greg or Fabio. And I will need different modules and
options enabled. I have no idea if your .config file is correct.
This error seems to indicate you're missing your Module.symvers file,
not your .config file. It's hard to tell with the V=1 option set.
> > > >
> > > > When a module is loaded/used, the values contained in the kernel are
> > > > compared with similar values in the module; if they are not equal, the
> > > > kernel refuses to load the module. I don't need it in my case.
> > > >
> > > > > 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?
> > > >
> > > > The kernel would refuse to load the module.
> > > >
Excellent! This has nothing to do with test building our shared memory
system. We can either turn the warning off, find a way to generate the
file, or fake that we've generated the file.
Though it's important you know the impact of your decision.
> > > > > >
> > > > > > 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?
> > > > > >
After everything above, (See what we mean about top posting?) Are you
sure you're getting this ERROR?
> > > > >
> > > > > Are there any other 'make *config' options we could try?
> > > >
> > > > Yes, like main menuconfig. I tried it but it still doesn't work.
> > > >
There are more (faster) options. Though 'menuconfig' would be a great
option to select specific modules you would like to build.
> > > > >
> > > > > Do we really need CONFIG_INFINIBAND turned on if we're working in the
> > > > > drivers/staging tree of the kernel?
> > > >
> > > > No, we don't. I removed it.
> > > >
"removed it" makes me think your editing your .config file by hand.
It's not wrong to do so, just be sure you know what you're doing.
> > > >
> > > > > What would we gain from having a compiled kernel if we want to test a
> > > > > single staging driver?
> > > >
> > > > No need to compile the entire kernel I guess for my use case. But
> > > > after all this reading :( I still don't get why " sudo make
> > > > CCFLAGS=-Werror W=1 M=drivers/staging/android/ V=1" worked for you
> > > > but not for me. I still get the following errors
> > > >
> > > >
> > > > test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
> > > > echo >&2; \
> > > > echo >&2 " 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."; \
> > > > echo >&2 ; \
> > > > /bin/false)
> > > > .....
> > > >
> > > >
> > > > How can I fix this?
> > > >
My advice would be to familiarize yourself with how modules are built
with "Linux Kernel Makefiles" section in the documentation.
https://www.kernel.org/doc/html/latest/kbuild/makefiles.html
It describes everything in greater detail than I could ever give here.
If anyone else wants to jump in here, feel free.
~Bryan
next prev parent reply other threads:[~2021-08-31 13:36 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-29 14:45 [PATCH] Declare the file_operations struct as const Bryan Brattlof
2021-08-29 16:20 ` Krish Jain
2021-08-29 16:34 ` Krish Jain
2021-08-29 16:49 ` Bryan Brattlof
2021-08-29 16:56 ` Krish Jain
2021-08-29 18:28 ` Krish Jain
2021-08-29 18:46 ` Krish Jain
2021-08-29 21:00 ` Bryan Brattlof
2021-08-29 22:11 ` Krish Jain
2021-08-30 12:40 ` Krish Jain
2021-08-30 13:01 ` Krish Jain
2021-08-31 0:42 ` Krish Jain
2021-08-31 13:35 ` Bryan Brattlof [this message]
2021-08-31 14:00 ` Fabio M. De Francesco
2021-08-31 23:00 ` Bryan Brattlof
2021-09-01 15:20 ` Krish Jain
2021-09-01 15:30 ` Greg KH
2021-09-01 15:34 ` Krish Jain
2021-09-01 16:51 ` Greg KH
2021-09-01 17:34 ` Bryan Brattlof
2021-09-01 18:04 ` Krish Jain
2021-09-01 20:29 ` Bryan Brattlof
[not found] <CAPGkw+x+B1731SL=afoSKiWwH-n-FA5YJ+WOwYdv8iyFhWk1zA@mail.gmail.com>
[not found] ` <3634721.RBzQ2xsved@localhost.localdomain>
2021-08-27 7:48 ` Fabio M. De Francesco
2021-08-27 8:50 ` Krish Jain
2021-08-27 18:38 ` Krish Jain
2021-08-27 19:46 ` Krish Jain
2021-08-27 23:38 ` Bryan Brattlof
2021-08-28 9:37 ` Krish Jain
2021-08-28 9:46 ` Greg KH
2021-08-28 9:52 ` Krish Jain
2021-08-28 11:13 ` Fabio M. De Francesco
2021-08-29 2:13 ` Krish Jain
2021-08-29 2:16 ` Krish Jain
2021-08-29 6:16 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2021-08-27 2:19 Krish Jain
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=20210831133533.6aayzjghdakrhy56@h510 \
--to=hello@bryanbrattlof.com \
--cc=gregkh@linuxfoundation.org \
--cc=krishjain02939@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).