Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi everyone... Thanks to all of you.. I am trying to build a kernel for Linux (Debian) and have the proper (I believe) software to do that. I'm following an ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    285

    Permissions prevent kernel build


    Hi everyone... Thanks to all of you..

    I am trying to build a kernel for Linux (Debian) and have the proper (I believe) software to do that. I'm following an article that has in one step to "make oldconfig". As a user is supposed to be able to build their own kernel, I am having permissions problems during that make process.

    I have built this an a new HD that is mounted on /mnt, if that makes any difference.

    I don't think I should have to got through my /bin directory to set them all for rwx. Have I missed something that prevents this from building. I even tried it as root and it failed.

    Here is the error message:

    Code:
    $ make oldconfig
      HOSTCC  scripts/basic/fixdep
    /bin/sh: 1: scripts/basic/fixdep: Permission denied
    make[1]: *** [scripts/basic/fixdep] Error 126
    make: *** [scripts_basic] Error 2
    $
    I'm not sure I'm reading this error, but I guess it's saying that it's running a script that is in /bin/sh trying to access scripts/basic/fixdep . I have set the permissions of fixdep (in fact the complete tree to a=rwx), but it seems to fail when it access my main HD.

    Thanks to all for assistance. And this is supposed to be easy...

    I tried to go to scripts/basic and run fixdep.. This is an added after the fact...
    I moved into the directory and tried to run fixdep by itself, you can see it and the permissions. For some reason it fails to execute. I don't read it as if it's trying to access other areas, seems like the failure is with the execution of fixdep itself.

    Code:
    jack@debian:/mnt/Development/linux-3.15.6/scripts/basic$ ls -la
    total 48
    drwxrwxrwx  2 jack jack  4096 Jul 26 06:38 .
    drwxrwxrwx 13 jack jack  4096 Jul 17 16:23 ..
    -rwxr-xr-x  1 root root 14500 Jul 26 06:38 fixdep
    -rwxrwxrwx  1 jack jack 11679 Jul 17 16:23 fixdep.c
    -rwxrwxrwx  1 jack jack  2899 Jul 26 06:38 .fixdep.d
    -rwxrwxrwx  1 jack jack     0 Jul 26 06:38 .fixdep.tmp
    -rwxrwxrwx  1 jack jack     7 Jul 17 16:23 .gitignore
    -rwxrwxrwx  1 jack jack   671 Jul 17 16:23 Makefile
    jack@debian:/mnt/Development/linux-3.15.6/scripts/basic$ ./fixdep
    bash: ./fixdep: Permission denied
    jack@debian:/mnt/Development/linux-3.15.6/scripts/basic$ sudo ./fixdep
    [sudo] password for jack: 
    sudo: unable to execute ./fixdep: Permission denied

    Jack
    Last edited by jkwilborn; 07-26-2014 at 04:57 PM. Reason: addtional information

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,281
    Let's start at the beginning. /bin/sh isn't a script, it's a link to the program that interprets and runs scripts. On Debian, that would be dash (most other distros use bash for this sort of thing).

    Secondly, you should always unpack your kernel sources in a directory that belongs to you. That way, you won't get any permissions errors. If you want to do it on a separate mounted partition, create a directory on that partition and (as root) chown it to yourself. Copy the tarball into it, then unpack it. In any case you should get rid of the existing Linux directory tree and start again.

    Thirdly, oldconfig is not really what you want. That option is used for upgrading kernels, where you already have a satisfactory configuration file that you created for an earlier version. You will then only be shown the new features of this new kernel. To build your first kernel, use make menuconfig. Alternatively, if you have a Gnome desktop, you can use make gconfig to get the graphical version of the menu, so that you can use your mouse to make selections. I think this will work on an LXDE desktop too. With menuconfig, you only get a pseudo-graphical interface that you have to navigate with your keyboard, which some people find non-intuitive.

    Use kernel help as much as possible while configuring. It will tell you not only what the options mean but very often if you should be using them ("If in doubt, say no").

    When you have tweaked the configuration to your satisfaction, you can do the actual build, then (as root) install it alongside your current kernel, update GRUB and try it out. It's not that difficult!
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #3
    Linux User jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    285
    hazel, thanks for the info. I guess I should have snapped about /bin/sh

    The idea of building this on another volume is that if I, in the future, wish to re-install the system, I wouldn't lose the work I've done. As in the past, when I've made a serious mistake.

    I will follow your instructions. The 'make oldconfig' was to establish some kind of existing configuration, as I understand it. Anyway I will abandon that and follow your instructions. Again thanks for your time in explaining some of the goings on.

    I moved the whole mess back to my /home/jack/linux-3.15.6 directory and it seems to be working, even though I thought I should be using gconfig, it cound't find some parts. I will try just the configuration on it's own. Still would like to know why I can't use it anywhere I wish (that I own).

    Jack
    Last edited by jkwilborn; 07-26-2014 at 07:35 PM.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    285
    hazel, I moved everything to my home directory (/home/jack/) and built it there. I had no permissions problems. I still would like to know why I can't do that on the other drive or mounted drive. However it took a few minutes as I timed it with 'time' and received:

    real 40m33.495s
    user 36m59.699s
    sys 3m10.884s

    this for the time, seems funny that it only took 3 minutes of CPU time and 40 minutes of real time to compile and link.

    However, I noticed that there are many modules being linked that I did not see a selection. The most noticed was one with 'touchscreen' in the path. As I don't have anything that is a touch screen, I wonder what I've built. Thanks for your help..

    Jack

  6. #5
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,281
    I'm glad you got it to work. I agree with having things on a separate partition, but most people handle that by having a separate partition for their home directory and mounting it on /home/(MyName).

    If gconfig needs extra software to run, why not install it using apt-get or synaptic?

    Your kernel took a long time to build and has a lot of modules because you used a default configuration. Now that you know how to do it, the real fun begins. You can cut your kernel down to size by stripping out drivers for hardware that you don't have and filesystems that you don't use. Experiment. As long as you keep a kernel around that you know works, you are fairly safe.

    As regards permissions, remember that Linux is a basically friendly system. If it doesn't allow you to do something, that's because you are trying to do something that could cause problems further down the line. So never just override a permissions problem. Take the hint and go and do your work somewhere else.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Quote Originally Posted by jkwilborn View Post
    hazel, I moved everything to my home directory (/home/jack/) and built it there. I had no permissions problems. I still would like to know why I can't do that on the other drive or mounted drive. However it took a few minutes as I timed it with 'time' and received:

    real 40m33.495s
    user 36m59.699s
    sys 3m10.884s

    this for the time, seems funny that it only took 3 minutes of CPU time and 40 minutes of real time to compile and link.

    However, I noticed that there are many modules being linked that I did not see a selection. The most noticed was one with 'touchscreen' in the path. As I don't have anything that is a touch screen, I wonder what I've built. Thanks for your help..

    Jack
    The problem was with the fixdep directory having root-only permissions (and probably files and sub-directories therein). You had read, but not write permissions. When you copied the tree to your home directory, it made the directories and files there owned by you (jack), so you were able to build the kernel there.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #7
    Linux User jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    285
    Thanks to all of you that have replied... I have been working on stripping out what is not needed, and although I am a hardware person, some of the terms have me looking to see if it's supported on my motherboard. Build time is shrinking!

    I do have a problem, in that the docs I have state that the menu for GRUB is in a file (menu.lst) that is not on my machine. I've see other articles that state it's been changed. Does anyone know where the menu that GRUB puts up lives and the best way to modify it? Or some docs that support the current versions? This means, of course that I haven't run it yet!

    I am also running an Intel i5-4440 CPU and even thought it has 4 cores, I understood that I was to compile the kernel with a 686 type processor. I have it set to the closest thing I could find in the configuration setup (I have, 'core 2/newer Xeon' selected). Its confusing when I do a help on 'Symmetric multi-processing support' it states information about selecting a 586 based machine, but can't find it under the named 'processor type' selections as stated in the previous help.

    It seems that it appears that I'm still getting a x-86 based build, as I don't see any other directories under 'arch'. As I see images in the arch/x86 (3.5 MB) and arch/x86_64 (3.6 MB). I'm trying to build the 64 bit image and have it selected in the config file. It also creates some files with zero bytes of size, such as 'modules.order' that appear in more than one directory.

    I've always started with a 'make config' and spent a number of hours during the config. It appears that even if I modify it, when I do the 'make config' I get the one I've been working on correct?

    Thanks to all. It's too bad there are so many docs on the previous way to build a kernel, with no reference to the current way it's built (at least with GRUB).

    Jack
    Last edited by jkwilborn; 07-31-2014 at 03:07 PM.

  9. #8
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,281
    Quote Originally Posted by jkwilborn View Post
    I do have a problem, in that the docs I have state that the menu for GRUB is in a file (menu.lst) that is not on my machine. I've see other articles that state it's been changed. Does anyone know where the menu that GRUB puts up lives and the best way to modify it?
    I think menu.lst was part of GRUB1 (usually called legacy-GRUB these days). Most modern distros use GRUB2. which is a lot more complicated. I don't use GRUB at all but lots of other folk here do and they can give you a hand.

    I've always started with a 'make config' and spent a number of hours during the config. It appears that even if I modify it, when I do the 'make config' I get the one I've been working on correct?
    I hope you aren't literally using make config. That's a pig to use because you can only go forwards, not back. If you make a mistake, you have to start again from the beginning. Menuconfig and gconfig are much easier as they allow you to go back and make changes.

    The actual configuration file is called .config. Each time you make config|menuconfig|gconfig, you load that file and modify it, then save the modified version.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  10. #9
    Linux User jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    285
    Hazel, yes that's what I'm using! Don't know any better, although I did manage to find some docs on Grub 2, that have left me more confused than with the original. I found no information that showed how it was supposed to look or how to create it or it was just over my head... Do you think I should start a new thread about grub itself to some of these answers?

    I know I tried to select the processor type, but couldn't find anything about 586 or 686 processors, even thought the 'help' in it refers to them. I didn't seem to have any problems with backing up when I ran the 'make config' process, although many of the options that I expected didn't seem to be there. Do you know where that .config file is located? grub.d or etc/defaults ?

    Right now, I've successfully compiled the kernel, but can't seem to figure out how to get GRUB to let me select it for a boot. I need to be confident that I can pick the original if new one fails for some reason. I don't expect a perfect running kernel, with all of the options that have to choose from. Some, I'm not to clear about. As I asked before should I start another thread? If so what would be a good title that would get the people that I need and what area should I put it in?

    Thanks for your help, without your types, I would be nowhere... I hope to think that when I help someone they understand.

    Jack

  11. #10
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Myself, I generally prefer "make xconfig" - it provides a much nicer (X-Windows) interface to configuring the kernel.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •