Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Installing manually compiling kernel (no genkrn)?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
xsi
n00b
n00b


Joined: 23 Dec 2011
Posts: 50
Location: Ukraine, Kiev, russian language

PostPosted: Fri Dec 23, 2011 2:30 pm    Post subject: [Solved] Installing manually compiling kernel (no genkrn)? Reply with quote

There was a question about installation on Google Answers "Why does compilation of the core is so important and the size of the kernel too?" ... some kilos or some megs essentially influence in the contemporary systems (mine has 16 gigs of RAM on Phenom X2 for future Xen or KVM virtualization). I've made an assumption "it might be that when kernel is invoked it forks a copy and that and other features also consumes CPU's time and RAM".
They answered that Gentoo is ahead not because of compiling everything but besause of USE flags. And the only thing about compiling it is stability. And as I don't know the architecture perfectly (according to answers "full Computer Science course is a must"). It would be the best bet to me to install Gentoo using genkernel.


Last edited by xsi on Wed Oct 10, 2012 4:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Fri Dec 23, 2011 2:53 pm    Post subject: Reply with quote

xcislav,

Welcome to Gentoo.

There are several ways you can make your kernel. genkernel is no more than a get you going approach. Your box will probably boot, it won't support sound or 3D hardware acceleration and a few other things too. This is because genkernel takes a blunderbus approach and builds everything that might be useful to most people. Where there is a choice, and Gentoo is about choice, genkernel leaves things out - you must make the choices. You can do that with the --menuconfig option to genkernel. It will still make a big bloated kernel.

Next, there is Pappys Seeds, the seeds are lean mean .config files without any hardware support. They are good places to start. The site also guides you through identifying your hardware and setting the correct kernel options in make menuconfig for it.

Lastly, there is the Do It Yourself approach. This will take a bit of trial and error and a huge pot of coffee. Proceed as follows.
Code:
cd /usr/src/linux
make menuconfig
read the help on each and every option then apply the following rules
Code:
1. If its needed for booting, make it <*>
2. IF its never needed, make it < >
3. If you my need it sometime, or its a driver that needs firmware, make it <M>
4. If the help is no help at all, leave the option alone.

This approach is faster than genkernel on older systems, since you can do the manual config and build faster than genkernel cn do its bloated build.
Its also possible to follow the commentary of kernel-seeds while you configure your own kernel.

Hint: Don't worry about the kernel not working first time. Post the error message and we can help you fix it. Changes to make menuconfig are cumulative. You don't start at the beginning again ever.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Telemin
l33t
l33t


Joined: 25 Aug 2005
Posts: 753
Location: Glasgow, UK

PostPosted: Fri Dec 23, 2011 3:08 pm    Post subject: Reply with quote

Hi Xcislav,

As I see it are several advantages to compiling your own binaries, and I will attempt to outline them here:

N.B here I am comparing Gentoo against Debian as "the representative distributions that spring to mind", and because I have first hand experience of the two to compare, I am explicitly *not* distro bashing, the following points transfer to the binary vs source debate more generally:

1. Choice - With debian, you download a package and it is built as the debian developers chose to build it. If you want it differently, compiled with different options or support for different experimental features/external libraries you will have to compile from source by hand, without a build system like portage to make it easy. With the portage's USE flags you can choose exactly what support to compile in for a given application, so it's easy to choose between DB backends, enable/disable X support etc and so you can create leaner binaries which have a smaller memory footprint and *potentially* run faster that their binary distribution couterparts. You will widely find gentoo described as a meta-distribution because it allows a huge amount more customizability than the average distribution, with this being partly down to portage and USE.

2. Compile time optimizations - When binary packages are built for debian they must be built for a wide variety of processors with different instruction sets. Usually for example you choose to support the subset of instructions available in all i686 processors. This means you can't as heavily optimise for all the instructions available in the latest AMD Bulldozer core chip for example, and so you will have slower executing code but executable on a wider range of systems. With gentoo you need not make this compromise and can choose to fully optimize for your native architecture.

Essentially what I'm meaning here is that for example some recent processors include the AES-NI instruction set, these are extra instructions on top of standard x86_64 which allow faster execution of AES encryption and decryption. Now it is possible to build a binary which uses them if they are there and doesn't if they aren't but this will still be a larger binary, and less efficient than one which doesn;t need to check because it is built for a system which definitely has them. Now apply this idea to all the other instruction set extensions designed to streamline execution and you will see why full optimization can be a good thing.

3.Security - Compiling your own binaries from source means that you can be sure that the binaries have not been tampered with, malicious code inserted etc, which you cannot do the same way with a binary distribution. For example if you pull down a copy of e.g the latest GCC from a debian apt repository, you have to trust the debian devs - and they're pretty nice folk so no reason not to ;) - but trust them nevertheless that it is a bona fide copy of gcc which has not been tampered with. With gentoo on the other hand, you can follow back to make sure the checksums on the source tarball match those published by the GCC devs on their site so have to trust nobody apart from them. And you can presume fairly safely that people would have noticed if the gcc code had been tampered with. Also for maximum paranoia you can always check the source in /usr/portage/distfiles after you download it and self audit.

With regard to the kernel, the above features are all still true, with the added note that the smaller the kernel is, and the better tuned to your system it is - i.e choosing the most appropriate options and only compiling in necessary drivers - then it should run faster and smoother than a one-size-fits-all kernel like genkernel. Again customizability is king for kernel compilation, and despite some people claiming otherwise it isn't that hard to do. The install guide is excellent and lspci is your best friend.

Bottom line is that size and optimization of a binary is important and something that gentoo does well for increased speed. But you will find that the vast majority of gentoo users, as you have been correctly told elsewhere do indeed use Gentoo because of portage, and the flexibility it gives you in running your system the way you want to. That doesn't just mean USE flags, but they are definitely at the heart of the gentoo way of doing things.

Don't expect compiling things perfectly optimized for your specific processor to be a silver bullet for speed issues, it won't be. I've personally never looked at the speed differences between an -march=generic and -march=native compile for a package, and never will because it isn't that important.

If ease speed of installing packages is of paramount importance for you then Gentoo possibly isn't your distro. On the other hand if you want a customizable system that does exactly what you want it to, and are prepared/want to learn about linux under the hood on the way then Gentoo should provide everything you need.

I hope this long ramble answers most of your questions...

-Telemin-
_________________
The Geek formerly known as -Freestyling-
When you feel your problem has been solved please add [Solved] to the topic title.
Please adopt an unanswered post
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Fri Dec 23, 2011 3:09 pm    Post subject: Reply with quote

Also, ALWAYS have at least one bootable kernel configured.

Once you get your system up with genkernel, start working on pappy's or the manual approach. Install that one as a second kernel, not the primary one. Always default the build to the known-to-be-working kernel.

Once you've tested your new kernel thoroughly, you can "promote" it and get rid of your previous primary kernel. Don't forget to delete the old kernels from /boot as you remove the configurations.

I sometimes have 2 working kernels at a time, and a third one that I'm trying to get right.

I also sometimes add a letter to the build name so I can keep the kernels straight. Not really necessary.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Fri Dec 23, 2011 5:53 pm    Post subject: Reply with quote

1clue,

1clue wrote:
I also sometimes add a letter to the build name so I can keep the kernels straight. Not really necessary.


Careful here. If you have <working_kernel> and <broken_kernel> both with the same
Code:
uname -r
then both sets of modules go into
Code:
/lib/modules/`uname -r`
actually, thats not quite true. You get only the last set installed. If they belong to <broken_kernel> you may well find that <working_kernel> is now broken too, or at least its modules no longer work.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
xsi
n00b
n00b


Joined: 23 Dec 2011
Posts: 50
Location: Ukraine, Kiev, russian language

PostPosted: Sun Dec 25, 2011 8:16 pm    Post subject: Reply with quote

I was so in a hurry skipping unneeded parameters and forcing myself with overtask on installing Xen tonight
THAT finally I've come with neigther root password set nor even a user one!
In a new system what is the default root password?

i was not able to hack by the first attempt in googling:
Code:
mount / and proc, chroot, env-update,source,passwd
On this stage

/usr/lib64/cracklib_dict.pwd.gz
 not found!


I used genkernel. so initrd exists in grub
and how to solve a cracklib problem

Also I've got the proflem of rc-update

Code:

rd update add net.eth0 default
rc-update: service `net.eth0 does not exist'

It can cause a problem: lack of net-config .
After cd /etc/init.d and before rc-update
I used another command than ln (ls , misprinted), so it was
ls -s net.lo net.eth0
then it appeared with error of not existing directory net...
And then, when I realized the misprint I deleted both net.lo and net.eth0

PS; very tired and bewildered. going to sleep ! thanks! cause it's very much for me today[/quote]


Last edited by xsi on Mon Dec 26, 2011 10:33 pm; edited 3 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun Dec 25, 2011 8:25 pm    Post subject: Reply with quote

xcislav,

There is no password set by defualt. That means you can't log in.
You need to chroot and issue the passwd command.

If you have access to grub.conf and you do not use an initrd, add init=/bin/bash to the kernel line.
When it cones up, its you, the kernel and bash. You can set the root password from there.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
xsi
n00b
n00b


Joined: 23 Dec 2011
Posts: 50
Location: Ukraine, Kiev, russian language

PostPosted: Mon Dec 26, 2011 10:30 am    Post subject: Reply with quote

It couldn't help
Next free time on NY-eve I'll reinstall gentoo again
Thx
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Mon Dec 26, 2011 4:15 pm    Post subject: Reply with quote

xcislav,

There is no need to reinstall. Thats a bad habit you have picked up from another OS.
To set your root password do the following.

Boot your CD. mount your filesystems and perform the chroot steps. Do not make any partitions, do not make any filesystems, do not download or install anything but otherwise, its just like the start of the Gentoo Handbook.
Once back into your chroot, its like you had never left.
Now you can do
Code:
passwd
to set your root password.

Its actually very difficult to trash gentoo so badly that the only way out is to reinstall.

You will learn more from fixing your install when you make errors tahn you will from following the handbook and having it just work.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum