Re: "Permission denied" when using system-installed kernel headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

On Thu, Oct 29, 2020 at 6:21 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
>
> On Fri, Oct 30, 2020 at 2:35 AM Anatol Pomozov <anatol.pomozov@xxxxxxxxx> wrote:
> >
> > Hi folks
> >
> > Here is a follow-up for this issue
> > https://github.com/Open-CAS/open-cas-linux/issues/540
> >
> > opencas project builds an out-of-tree kernel module and uses
> > system-level kernel header. In my case these headers are installed to
> > /lib/modules/5.9.1-arch1-1/build
> >
> > So if I do
> >
> > $ cd /lib/modules/5.9.1-arch1-1/build
> > $ make kernelversion
> >
> > I get following output:
> >
> > mkdir: cannot create directory ‘.tmp_86541’: Permission denied
> > mkdir: cannot create directory ‘.tmp_86543’: Permission denied
> > mkdir: cannot create directory ‘.tmp_86545’: Permission denied
> > mkdir: cannot create directory ‘.tmp_86547’: Permission denied
> > .......
> > mkdir: cannot create directory ‘.tmp_86626’: Permission denied
> > mkdir: cannot create directory ‘.tmp_86628’: Permission denied
> > mkdir: cannot create directory ‘.tmp_86630’: Permission denied
> > 5.9.1-arch1
>
>
>
> This is because you did not pass M= option.
>
>
>
> /lib/modules/$(uname -r)/build
> is used for building external modules.
>
> You cannot work in that directory
> since it is usually read-only.
>
>
> You need to pass M=<path-to-your-module>
>
>
> This may work for you.
>
>
>
> $ cd  /lib/modules/$(uname -r)/build
> $ mkdir $HOME/foo
> $ make M=$HOME/foo  kernelversion

Thanks a lot, it works!




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux