Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Configuring Gentoo 2004.2 for linux 2.6 and NPTL (Updated)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Tue May 04, 2004 3:33 am    Post subject: Configuring Gentoo 2004.2 for linux 2.6 and NPTL (Updated) Reply with quote

This guide is intended to help those wanting to build a Gentoo system using the NPTL and a 2.6 kernel.

Getting started:
You will need a Gentoo 2004.2 LiveCD, and an internet connection.

Installing Gentoo Linux:
With your LiveCD burned to a disk and your Bios configured to boot from CD go head and restart your PC.

Refer to the Gentoo Hanbook for more information about obtaining and burning a Gentoo 2004.2 LiveCD.

Now boot from the LiveCD and type smp at the boot prompt.
Code:
boot: smp


smp is a 2.6 kernel that will allow proc to be populated with information from a running 2.6 kernel rather than a 2.4 kernel like gentoo.

Refer to the Gentoo Handbook for options passable to the kernel during boot.

Check to ensure your PC has the correct time.
Code:
date


Preparing your hard drive for Gentoo Linux:
In this guide i will use fdisk to partition my hard drive.
Code:
fdisk /dev/hda


You will need atleast a / (root) and swap partition.

Create filesystems and mount partitions.
Code:
mke2fs /dev/hda1
mke2fs -j /dev/hda5
mkswap /dev/hda6
swapon /dev/hda6
mount /dev/hda5 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/hda1 /mnt/gentoo/boot


It is important that you have booted using the smp kernel at this point in order for glibc to be compiled with NPTL support the kernel loaded must support it ie: 2.6

Installing the Gentoo Installation Files:
Change to the /mnt/gentoo directory.
Code:
cd /mnt/gentoo


Use links to download a stage1 tarball from a gentoo mirror.
Code:
links http://www.gentoo.org/main/en/mirrors.xml


You must have networking configured and enabled.

After downloading the stage1 tarball extract it.
Code:
tar -xvjpf stage?-*.tar.bz2 && rm stage?-*.tar.bz2


Mounting the proc filesystem.
Code:
mount -t proc none /mnt/gentoo/proc


Configuring make.conf.
Code:
nano -w /mnt/gentoo/etc/make.conf


Included as an example:
Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe"
CXXFLAGS="${CFLAGS}"
USE="nptl"


Installing the Gentoo Base System
Optional
Selecting mirrors.
Code:
mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' >> /mnt/gentoo/etc/make.conf


This command will populate GENTOO_MIRRORS in make.conf.

Copy DNS info.
Code:
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf


Before we chroot into the new Gentoo environment you may want to run passwd to change the root password so it is possible to log into another vt.

Chrooting into the new Gentoo environment.
Code:
chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile


Syncing the portage tree.
Code:
emerge sync


Installing the 2.6 kernel headers.
Code:
emerge -C linux-headers
emerge --nodeps linux26-headers


Bootstrapping the system.
Code:
cd /usr/portage
scripts/bootstrap.sh && env-update && source /etc/profile


To check if NPTL support was compiled into glibc type: /lib/libc.so.6 you should see NTPL in the output.

Building the base system.
Code:
emerge system && env-update && source /etc/profile


Configuring the Kernel
Configure timezone.
Code:
ln -sf /usr/share/zoneinfo/UTC /etc/localtime


Remember to use your own timezone!

Selecting and configuring a kernel:
Code:
emerge gentoo-dev-sources


Refer to the Gentoo Handbook for other 2.6 kernels available and howto configure and install them.

Optional:
Installing udev.
Code:
emerge udev


Installing hotplug.
Code:
emerge hotplug && rc-update add hotplug default


Installing alsa.
Code:
emerge alsa-utils && nano -w /etc/modules.d/alsa && modules-update && rc-update add alsasound boot


Refer to the ALSA Handbook for further information on configuring a sound card.

Configuring your System:
Refer to the Gentoo Handbook on editing fstab, rc.conf, and network configuration files.

Installing Necessary System Tools
Install a system logger.
Code:
emerge metalog && rc-update add metalog default


Install a cron daemon.
Code:
emerge vixie-cron && rc-update add vixie-cron default


Optional
Installing gentoolkit.
Code:
emerge gentoolkit

Contains tools for working with portage.

Configuring the Bootloader:
Installing grub.
Code:
emerge grub


Refer to the Gentoo Handbook on configuring grub.

Finishing up:
Setting a root password.
Code:
passwd


Creating a user.
Code:
useradd username -m -G users,wheel,audio,tty -s /bin/bash
passwd username


You can now safely exit and restart your PC and boot into your new Gentoo installation.
Code:
exit
cd /
umount /mnt/gentoo/boot
umount /mnt/gentoo/proc
umount /mnt/gentoo
reboot


Last edited by Snooper on Fri Oct 15, 2004 12:56 am; edited 26 times in total
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Tue May 04, 2004 3:42 am    Post subject: Compiling xorg-x11 Reply with quote

To compile xorg-x11 you must first edit the ebuild and remove the following code:

/usr/portage/x11-base/xorg-x11/xorg-x11-6.7.0.ebuild

# Makes ld bail at link time on undefined symbols
# Suggested by Mike Harris <mharris@redhat.com>
echo "#define SharedLibraryLoadFlags -shared -Wl,-z,defs" \
>> config/cf/host.def

this line makes xorg bomb out at XF86Rush. from what i can gather it's an issue with the new binutils 2.15 and up.

then just run:
emerge xorg-x11

and enjoy!
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Tue May 04, 2004 3:48 am    Post subject: Reply with quote

While running the smp kernel from the livecd i had some issues with keycodes i am using a microsoft wireless multimedia keyboard and to get rid of those just type:

setkeycodes ### ## for me it was setkeycodes e001 81 at some point i need to figure out how to fix this and add them to the keymap. both of the numbers should show the first with the error and the second above the error in the form of 0x81 or what ever for the key...
Back to top
View user's profile Send private message
ian!
Bodhisattva
Bodhisattva


Joined: 25 Feb 2003
Posts: 3827
Location: Essen, Germany

PostPosted: Tue May 04, 2004 8:09 pm    Post subject: Reply with quote

Moved from 'IG' to 'DT&T'.
_________________
"To have a successful open source project, you need to be at least somewhat successful at getting along with people." -- Daniel Robbins
Back to top
View user's profile Send private message
StringCheesian
l33t
l33t


Joined: 21 Oct 2003
Posts: 887

PostPosted: Tue May 04, 2004 11:39 pm    Post subject: Re: Configuring Gentoo 2004.1 for linux 2.6.5 and NPTL Reply with quote

Snooper wrote:
once you have finished downloading a stage1 tarball we need to extract it:
tar -xvjpf stage?-*.tar.bz

you can delete the tarball after it has been extracted:
rm stage?-*.tar.bz

Not that it matters (it wouldn't really confuse anybody here anyway), but I think those .bz's are supposed to be .bz2's.
Back to top
View user's profile Send private message
TenPin
Guru
Guru


Joined: 26 Aug 2002
Posts: 500
Location: Kansas City

PostPosted: Wed May 05, 2004 12:54 am    Post subject: Reply with quote

Why is it necessary to emerge alsa-oss if you are running a 2.6.5 kernel which includes the alsa-oss kernel module ?
_________________
For since in the wisdom of God the world by its wisdom did not know God, God was pleased to save those who believe by the foolishness of preaching.
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Wed May 05, 2004 4:29 am    Post subject: Reply with quote

i was going off the alsa configuration guide when i installed alsa-oss i can remove it if it really isn't needed i have nore heard otherwise doubt it hurts anything being there though?
Back to top
View user's profile Send private message
dotme
n00b
n00b


Joined: 02 May 2004
Posts: 5

PostPosted: Wed May 05, 2004 7:59 am    Post subject: Reply with quote

Followed your HOWTO to replace my old rh8-installation.

Unfortunately binutils-2.15* got masked this night. Exactly at the moment when I were advancing from bootstrapping to 'emerge system'. I noticed that binutils get downgraded in the output of 'emerge --pretend system', but didn't realized the drawback:

ld's cmd switch '--as-needed' no longer exists

and breaks gcc (gcc conftest.c - ld error).

Think I have to start again.
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Wed May 05, 2004 8:13 am    Post subject: Reply with quote

Yes if you bootstrap one version and you try to downgrade to another version it breaks binutils. i'm sure they masked it because of xorg-x11.

if you just start again and bootstrap it will use the other binutils and you should be fine. if it's 2.14 you don't need to edit the xorg-x11 ebuild.
Back to top
View user's profile Send private message
BlackDuck
n00b
n00b


Joined: 28 Jun 2003
Posts: 67
Location: Canberra.au

PostPosted: Fri Jun 11, 2004 10:58 am    Post subject: Reply with quote

Thanks for this How-To. I've been meaning to give NPTL a go. Will try setting up the system over the weekend. :)
_________________

Join the unanswered post initiative
Dell GX1 PIII 500 512MB Onboard ATI Rage Pro 3D | HP P1120 21" 1600x1200@85Hz
2 HP Vectra VE PIII 500 512MB Onboard Matrox G200
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Wed Jul 14, 2004 2:00 pm    Post subject: Reply with quote

I had this built, albeit with some kludging on friday. Then I went off for the weekend and came back. Thought to myself "let's do it properly - save problems long term". And I find there's a new version of portage and linux26-headers and bootstrap-2.6.sh don't want to play nice together. Specifically, I get the "Blocked" message when it tried to upgrade the headers.

Any ideas?
_________________
Don't let THEM immanentize the Eschaton!
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Wed Jul 14, 2004 2:48 pm    Post subject: Reply with quote

I have noticed that myself and am working to fix it but until portage x.x.51 comes out i don't think we can do a bootstrap-2.6 you have to start with a stage 2 or 3 and emerge -C linux-headers then emerge --oneshot linux26-headers then put in the nptl use flag and go from there i was thinking about making a stage1 with the linux26-headers included but i'm waiting for 2004.2 when i figure all this mess in portage will be cleaned up. they moved it in order to make it easyer but broke how we do it know and it's in preperation for the new gcc/glibc coming soon with better nptl support but in the mean time you can do the above then emerge -e world would recompile everything against the 2.6 headers and glibc with nptl support
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
yoosty69
n00b
n00b


Joined: 03 Jan 2004
Posts: 35

PostPosted: Thu Jul 15, 2004 7:14 pm    Post subject: Reply with quote

Hmm... I have a quick and dirty hack that seems to be working for me at the moment...

1. I created a tbz2 pkg of linux26-headers on my working gentoo box
2. Transferred it to the new gentoo box
3. Changed my /etc/make.profile/virtuals from:

Code:

...
virtual/kernel                  sys-kernel/linux-headers
...
virtual/os-headers              sys-kernel/linux-headers
...


to

Code:

...
virtual/kernel                  sys-kernel/linux26-headers
...
virtual/os-headers              sys-kernel/linux26-headers
...


4. unmerged linux-headers
5. Emerging the pkg didn't seem to work, so I just unzipped the pkg into the root dir
6. cd /usr/portage
7. ./scripts/bootstrap-2.6.sh


Dirty? Yes
Working so far? Yes
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Thu Jul 15, 2004 7:52 pm    Post subject: Reply with quote

I was just about to report back. Snooper, that worked fine for me, thank you for all your efforts. The only issue so far is some segfaulting plugins for xmms, which I fixed by removing the shared libs - it's on bugzilla somewhere, so no worries there. Apart from that things are looking very good.

For anyone pondering going NPTL - at first blush this looks very good. The system feels smooth and responsive. Well worth the effort.
_________________
Don't let THEM immanentize the Eschaton!
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Sun Jul 18, 2004 5:33 pm    Post subject: Reply with quote

I have come up with one more option for a 2.6 NPTL system.

Start with a stage1, bootstrap it using bootstrap.sh. Then once that has finished emerge unmerge linux-headers, then emerge linux26-headers.
Then emerge -e system with nptl in your use flags.

This way you can bootstrap with your cflags and use flags excluding nptl then once that finishes remove the 2.4 headers install the 2.6 and emerge the system using -e this will recompile everything and give you a stage3 where everything has been compiled against 2.6 headers and nptl support:-)
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Sun Jul 18, 2004 6:01 pm    Post subject: Reply with quote

Oddly enough, I was just trying this. I've been happy enough with NPTL on my desktop, so I thought I'd give the laptop the same treatment.

Anyhow. I did just that: bootstrap from stage one, unmerge linux-headers, emerge linux26 headers, edit make.config and emerge -e system

And it died moaning about not finding perl. No idea why. That said, I typed emerge perl and then emerge system and it seems to be back on track. Once it's finished, I'll probably do another -e system. But I found it needs a little nursing
_________________
Don't let THEM immanentize the Eschaton!
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Sun Jul 18, 2004 6:42 pm    Post subject: Reply with quote

It could be the use flags you have selected when doing the bootstrap and emerge system you should use only what is needed and nothing more until it's finished and then start adding the use flags you want for other things. you can do this by USE="-* hardened pie pic ncurses perl python xml nptl" etc...

better yet just use the default profile and leave your use flags empty until you need nptl than add that and then emerge system and go from there.
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Sun Jul 18, 2004 7:17 pm    Post subject: Reply with quote

That's probably it then - I copied over my make.conf from the live partition.

Useful to know, thanks
_________________
Don't let THEM immanentize the Eschaton!
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Tue Jul 20, 2004 8:41 pm    Post subject: Reply with quote

One more method, and i think i'll rewrite the howto soon when i have more time.

Starting with a stage1 tarball:
in /etc/make.profile/virtuals change any instance of linux-headers to linux26-headers there should be 2 one for kernels, and the other for os-headers.

then after an emerge sync, emerge patch, emerge -C linux-headers,
edit /etc/portage/package.keywords and add sys-kernel/linux-headers -* ~x86 then emerge --oneshot linux26-headers.

Now cd /usr/portage, and run scripts/bootstrap-2.6.sh then emerge -e system or just emerge system to take up less time.

to get a stable base with the 2.6 headers and kernel just add the kernel to the package.keywords like so:
sys-kernel/hardened-dev-sources -* ~x86
sys-kernel/gentoo-dev-sources -* ~x86
instead of using ACCEPT_KEYWORDS="~x86" in make.conf... hope this helps
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Thu Jul 22, 2004 12:49 pm    Post subject: Re: Configuring Gentoo 2004.1 for linux 2.6.5 and NPTL Reply with quote

Very nice installation guide.

However, is this really necessary?
Snooper wrote:
Sync the portage tree.
Code:
emerge sync


I prefer to invoke this command atleast 3 times to ensure an up to date portage tree (emerge sync && emerge sync && emerge sync)

Presumably you want to make sure that you get the most up to date mirror, which is why you are emerge sync'ing 3 times in a row. But according to this logic, you would emerge sync 3 times in a row every time you want to update your portage tree. Portage netiquette suggests that you only emerge sync once every 24 hours. For an initial install, one reasonably up to date portage tree is probably good enough.
_________________
I'm only hanging out in OTW until I get rid of this stupid l33t ranking.....Crap. That didn't work.
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Thu Jul 22, 2004 3:04 pm    Post subject: Reply with quote

True, it was just my way of making sure i was upto date as of the moment i build from scratch i have had so many times where i build sync an hour later and 1 or 3 packages have been updated when using the unstable tree:-) it's at your discretion and be sure to read the rest of the post there have been many updated to portage concerning linux26-headers and how to install them for a bootstrap these days...
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
MaxDamage
l33t
l33t


Joined: 03 Jan 2004
Posts: 650
Location: Oviedo, Spain

PostPosted: Sun Jul 25, 2004 7:35 pm    Post subject: Reply with quote

What's the problem with the "patch" package? Won't I be able to update it when I have installed the 2.6 headers?
_________________
La PDA de tungsteno
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Mon Jul 26, 2004 5:43 pm    Post subject: Reply with quote

you can update it right enough. It's just one of those circular dependency things. once it's all in place the package updates just fine. you just need to be a little presuasive when it comes to getting the nedw headers in and glibc compiled without patch trying to recompile itself first.

It all works very well on this box anyhow :D
_________________
Don't let THEM immanentize the Eschaton!
Back to top
View user's profile Send private message
blackwhite
Apprentice
Apprentice


Joined: 24 Jun 2004
Posts: 250

PostPosted: Thu Jul 29, 2004 12:11 am    Post subject: does 2.6.7.4 support nptl? Reply with quote

In the compling, it warned that
Quote:

Calculating dependencies ...done!
>>> emerge (1 of 1) sys-libs/glibc-2.3.3.20040420 to /
>>> md5 src_uri ;-) glibc-2.3.2.tar.bz2
>>> md5 src_uri ;-) glibc-linuxthreads-2.3.2.tar.bz2
>>> md5 src_uri ;-) glibc-2.3.3-branch-update-20040420.patch.bz2

nptl
* Checking kernel headers for broken sysctl.h ... no
nptl

* You have "nptl" in your USE, but your kernel version or
* architecture does not support it!

Afer check the ebuild:
Code:
nano /usr/portage/sys-kernel/linux26-headers/linux26-headers-2.6.7-r4.ebuild

you will find it only supports:
Quote:
KEYWORDS="-* ~amd64"

How can I solve this? BTW, booted with livecd2004.2
Thanks a lot.
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Thu Jul 29, 2004 1:27 am    Post subject: Reply with quote

Well that error could be a number of things usually not booting with a 2.6 kernel. When you boot from the LiveCD you need to make sure you use the "smp" kernel this is a 2.6 kernel.

second it could be header related as in you don't have the 2.6 headers installed. to install the headers you need to follow the guide and thats installing patch then removing linux-headers and installing linux26-headers.

Then make sure you have edited the virtuals file if you don't bootstrap will downgrade the headers back to 2.4.

also make sure sys-kernel/linux26-headers -* ~x86 is in your package.keywords file else you will not be able to install the headers.

-* is simply a blocker for other archs when you see "arm hppa etc" that means it's stable on those arches, when it's "-* ~x86 ~arch etc" that means it's available in the unstable branch using ACCEPT_KEYWORDS="~x86" to use. and "-*" is just a blocked by that keyword and is not tested on much of anything to be stable. so it needs to go into package.keywords like so sys-kernel/linux26-headers -* and that will allow you to use that package that is blocked by the -* keyword:-)
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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