LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   installing linux from source code (https://www.linuxquestions.org/questions/linux-newbie-8/installing-linux-from-source-code-792332/)

_Linux_Learner 03-01-2010 07:38 AM

installing linux from source code
 
Hi all,

I am trying to install linux from its source code. After running make bzImage and adding its path in menu.lst file of grub when I boot this kernel, than many of the functionalities do not work like mouse, low graphics mode is enabled etc... I use make oldconfig to configure.

Please help..........

Regards
_Linux_Learner

Simon Bridge 03-01-2010 07:57 AM

AFAIK: make oldconfig looks for an old configuration file (.config or .config.old). If you don't have one then it won't help. You now need to go through and make menuconfig to make sure you got everything.

Note: you should also say where you got your kernel and what version it is.

usdanskys 03-01-2010 07:58 AM

Quote:

Originally Posted by _Linux_Learner (Post 3880956)
Hi all,

I am trying to install linux from its source code. After running make bzImage and adding its path in menu.lst file of grub when I boot this kernel, than many of the functionalities do not work like mouse, low graphics mode is enabled etc... I use make oldconfig to configure.

Please help..........

Regards
_Linux_Learner

Did you create an initrd or initramfs file to go with your kernel so as to ensure loading of all of the needed device drivers?

I haven't ever tried it, but this might help:
http://www.linuxfromscratch.org/lfs/

damgar 03-01-2010 08:12 AM

Quote:

Originally Posted by usdanskys (Post 3880977)
Did you create an initrd or initramfs file to go with your kernel so as to ensure loading of all of the needed device drivers?

I haven't ever tried it, but this might help:
http://www.linuxfromscratch.org/lfs/

If the system booted then there's no need for the initramfs or an initrd as this is only needed to load modules that will be needed during bootup.

As far as LFS goes I don't think the OP is talking about building an entire distro from source although in the title it sounds that way. It sounds like OP is just trying to roll his own kernel. While LFS is in large part following directions, it's probably a little involved for a brand new linux user.

What tutorial or HOW-TO is being followed and what kernel version is presently installed as well as the version being added. Are you using proprietary video drivers at all?

_Linux_Learner 03-01-2010 10:04 PM

reply
 
Quote:

Originally Posted by damgar (Post 3880991)
If the system booted then there's no need for the initramfs or an initrd as this is only needed to load modules that will be needed during bootup..........................

You are absolutely right that I am not trying LFS. My aim is only to add a system call into linux Kernel. I did it successfully but the problem is while booting that new kernel.

Currently I am using ubuntu 9.04 and the kernel version is 2.6.28-18-generic and I am trying to compile linux 2.6.32.8 version.....

Regards
_Linux_Learner

damgar 03-01-2010 11:00 PM

I'm no expert, but I've rolled several kernels in the last 6 months (the latest one was actually the oldest one yet, 2.6.27.4 for LFS, which I finished the 6.4 book today............AND IT BOOTED! Sorry, but I had to tell someone). The obvious points to look at are going to be in the build configuration stage. If you were following an online how-to or tutuorial please post the link. I'm thinking that maybe there was a problem with
Code:

make oldconfig
Either it wasn't run or there wasn't a .config file in the source directory. Easiest thing to do is get the current working .config file, copy it into the new kernel source directory issue
Code:

make oldconfig #hit enter for defaults to all the new options
make {g/menu}config #find the changes you are trying to make

and then follow a recommended method for your distro or a related distro for instance I've heard of the Debian-method which involved a couple of commands I've never used build Slackware kernels.

The above should work fairly well, the wildcard being does your distro use a heavily patched kernel where those patches aren't available in the vanilla kernel from kernel.org?

Simon Bridge 03-02-2010 04:57 AM

Second that - advise as post #2 stands:
Check you have a .config file in your source - if so, redo from make oldconfig.
Either way, do a make menuconfig to make sure all the needed drivers are present.

If you have working kbd, then try manually loading the extra modules.

i92guboj 03-02-2010 05:35 AM

Quote:

Originally Posted by _Linux_Learner (Post 3881872)
You are absolutely right that I am not trying LFS. My aim is only to add a system call into linux Kernel. I did it successfully but the problem is while booting that new kernel.

Currently I am using ubuntu 9.04 and the kernel version is 2.6.28-18-generic and I am trying to compile linux 2.6.32.8 version.....

Regards
_Linux_Learner

That's useful info. First, be aware that you are going to need some manual work. If you don't want so, better pick up a 2.6.28/29 kernel, since that will be closed to yours, and hence, you will have to guess a lesser number of things.

"oldconfig" is a target that takes a config file from an older kernel and configures it to fit the current sources. The problem is that in between .29 and .32 a lot (and I really mean A WHOLE LOT) of things changed.

Your best bet, if you are using a .28 kernel, is to pick the latest 2.6.28 kernel from kernel.org. Download, save and uncompress it. Boot your regular Ubuntu kernel, then go to the directory where your new kernel sources live and do this:

Code:

zcat /proc/config.gz > .config
make oldconfig

And go from there.

Code:

make && make install modules_install
Configure your grub.conf or whatever and boot your new kernel. Once you've done that training, you can then worry about upgrading to .32 if you really need to do so.

_Linux_Learner 03-03-2010 07:21 AM

no config.gz
 
Code:

zcat /proc/config.gz > .config
I have no such config.gz in /proc directory..... What to do now?

regards
_Linux_Learner

i92guboj 03-03-2010 07:34 AM

Oh, yet another "smart" thing from the Ubuntu guys, it doesn't surprise me at all. That means that you won't be able to retrieve your current kernel config, so you'll have to configure the kernel yourself, or pick a working .config file from another distro you've got installed.

sundialsvcs 03-03-2010 08:06 AM

The easiest way to "add a system call" is actually to implement a kernel module. Also, it is easiest to define a "virtual device" that you can talk to via ioctl() calls.

usdanskys 03-03-2010 09:50 AM

Quote:

Originally Posted by i92guboj (Post 3883865)
Oh, yet another "smart" thing from the Ubuntu guys, it doesn't surprise me at all. That means that you won't be able to retrieve your current kernel config, so you'll have to configure the kernel yourself, or pick a working .config file from another distro you've got installed.

Current kernel config is in /boot.
Code:

/mnt/Lucid/boot$ ls
abi-2.6.32-14-generic        memtest86+.bin
config-2.6.32-14-generic      System.map-2.6.32-14-generic
grub                          vmcoreinfo-2.6.32-14-generic
initrd.img-2.6.32-14-generic  vmlinuz-2.6.32-14-generic


_Linux_Learner 03-20-2010 12:56 AM

Back To Track
 
Hi all

Sorry for late resume but I faced a number of problems while going through this process of adding system call. But the result is still I didn't get the answer..........

Is there any command in linux to check all available system calls in linux kernel....

Thanks in advance

i92guboj 03-20-2010 04:05 AM

Quote:

Originally Posted by _Linux_Learner (Post 3905227)
Hi all

Sorry for late resume but I faced a number of problems while going through this process of adding system call. But the result is still I didn't get the answer..........

To my eyes, every question you asked has been answered. We don't have a crystal ball though, and we can't read your mind. So, if you feel that something isn't clear enough just ask again, and ask for clarification in any concrete aspect.

Quote:

Is there any command in linux to check all available system calls in linux kernel....

Thanks in advance
I doubt it. Even more, considering that it will depend on the concrete kernel version you are using. The kernel is alive and changes everyday. The kernel headers are probably the most comprehensive guide ever that you will find about the kernel API.

_Linux_Learner 03-20-2010 04:49 AM

Quote:

Originally Posted by i92guboj (Post 3905310)
To my eyes, every question you asked has been answered. We don't have a crystal ball though, and we can't read your mind. So, if you feel that something isn't clear enough just ask again, and ask for clarification in any concrete aspect.

You took me wrong. I mean that I was not able to solve my problem of adding system call even with so much help. Sorry if I was rude....

Regards
_Linux_Learner


All times are GMT -5. The time now is 03:54 AM.