LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 02-16-2008, 05:48 AM   #1
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
All the steps required for building a functional Gentoo stage4 from scratch.


I am starting this as a new thread, because I was going off topic elsewhere. This will be a diary of sorts, relating how to build a Gentoo stage4 from scratch. A stage4 tarball is one which contains a fully functioning desktop with KDE and/or Gnome. I will also be adding many packages specific to development. Particularly for visualization systems and mathematics. I will also include LTSP, Gluster, Condor, Xen and others. Many of these are not included in Gentoo, and must be built independently.

All of this came about because of difficulty with having chosen the wrong stage3 from the beginning. I would advise against using the hardened-multilib, if you're inclined to be updating packages as I will here. The hardened-multilib stage3 is rarely updated, mostly for security reasons. So it is definitely the wrong stage3 to chose for development purposes.

For much of the external work with sources not from Gentoo, I will be using a terrific little package called src2pkg by Gilbert Ashley. It is also discussed in detail on this forum in many threads.

So I will now start by closing this and reposting the beginning of my remarks taken from elsewhere which led up to this.

Shingoshi
 
Old 02-16-2008, 05:49 AM   #2
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474

Original Poster
Blog Entries: 28

Rep: Reputation: 34
The lead in from my previous thread.

Quote:
Originally Posted by Emerson View Post
I write notes for my systems so I know where things may be wrong and have pretty good ideas how to fix.
Unfortunately I have no clues for your box. All I know you changed profile from hardened to regular. Hardened profile is throughly tested, due to this program versions are older. I suspect your problems come from the fact you have a mixed system right now. I'm not saying it will cure everything, but here's what I'd do: emerge binutils, gcc, glibc, libtool; in this order. After that, emerge -e system. And I'd put that sandbox back to features.
I decided to restart with a completely clean Gentoo root. I am documenting my steps as I go along, so as to have a script to automatically repeat this entire process.

So far, I have run in this order:
emerge -sync
emerge portage
emerge binutils
emerge gcc

Now here is where the instructions given here diverge from reality. emerging gcc gives you 37 total packages which must be installed. gcc cannot be built on it's own, separate from anything else. If there is a way to do that, it wasn't explained here. So just be aware, emerging gcc amounts to more than just a single build of one binary. It requires a total of 37 sources to be built as well. I should also add that I set this in /etc/make.conf:
EMERGE_DEFAULT_OPTS="--with-bdeps=y --buildpkg --deep"
So this may have influenced the build process, by adding more packages than would have
otherwise been emerged.

Be aware however, this is with a new installation. The instructions may have been valid if performed on a system that was already in place and running. However, I chose to start with a CLEAN system, and run the instructions given above, to ensure that I have the most up-to-date configuration possible. In any case, I have not encountered any problems yet.

I finally completed the process as stated above, with the exception of "emerge -e system". At that point, I found that I had a conflict between util-linux and setarch. So I decided to upgrade setarch, thinking that having a newer version might eliminate the problem. I was able to update setarch just fine, but that didn't fix the problem. I still have a conflict between setarch and util-linux, where each is blocking the other.

So I would like to hear now how to continue from this point, so that I have a completed upgrade. I will check on the net with Google, to see if there are any solutions given to resolve this conflict.

Ok. The solution was found. setarch in now included in util-linux, and can be safely removed to continue with "emerge -e system", which is running now. 98 packages have to be emerged.
http://www.tummblr.com/linux/gentoo-...erge-ud-world/

Shingoshi
 
Old 02-16-2008, 05:52 AM   #3
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474

Original Poster
Blog Entries: 28

Rep: Reputation: 34
Are you referring to the old setup which I have since dropped into a basket.

Quote:
Originally Posted by Electro View Post
I suggest using the following command as root.

revdep-rebuild --ignore --pretend

This will hopefully fix your setup.
The original setup which I was trying to fix, has been dropped into a folder named ".old" in my root directory. I have since abandoned that old root entirely, and started over with a new stage3. The stage3 I used before was for the hardened-multilib. That was a nightmare. So I decided to start over from scratch, rather than beating my head against the wall. Maybe, just maybe, I'll go back and try to repair that old root later. But right now, I am committed to building the new root from a new (generic) stage3 (I made a mistake here and wrote stage2).

For the purposes that I'm engaging in, I haven't even chosen a different profile, other than what is specified by the default installation of stage3. My present thinking is this. I will use this new root as my build engine. I will use it to construct a stage4 installation. That tarball will then be copied to my functional system, and will then be used for daily operations. But the present build I'm engaged in now, will remain in pristine condition. Meaning I will make no changes (ie. customizations) in it except to add all of the packages I want to use in my working system. I will let conf-update handle all of the changes in /etc. Beyond that, I won't do anything else to it.

I am also thinking that I should start this as a new thread, explaining how to complete this process in detail for new users like myself.

Presently, I'm in the final stages (95 of 98 @ glibc-2.6.1) of running "emerge -e system". When this is done, I will then install the following:
lzma-utils (For my man pages)
conf-update (Wanted something to handle my /etc files)
sandbox (This is what started the whole mess in the first place!) This was installed by running "emerge -e system". So this step is unnecessary.
slang (Needed for the installation of mc.)
mc (I never work without this.)
gentoolkit-dev (For all the extra functions I will need in the future.)
autounmask (Now on to the fun stuff.)
ufed (Because I really like seeing what I'm doing in a gui.)

cppunit (I will doing a lot of compilations)
distcc
doxygen
ccache
revdeps-rebuild (Required by rebuilding glibc.)

boost (Because most of what I'll be doing in the future, requires this.)

I will be adding more to this as I go along. This probably really ought to be a new thread.

Shingoshi

Last edited by Shingoshi; 02-16-2008 at 01:03 PM. Reason: I've found that some things changed from what was expected.
 
Old 02-16-2008, 06:49 PM   #4
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474

Original Poster
Blog Entries: 28

Rep: Reputation: 34
I have a question about these flags as they appear.

I have encountered this on a couple of ebuilds, and am not sure what they mean. Does this indicate these ebuilds will be rebuilt or removed?

starbase64 / # emerge lm_sensors --pretend

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] sys-devel/binutils-2.18-r1 USE="multislot*"
[ebuild R ] sys-apps/groff-1.19.2-r1 USE="X*"
[ebuild N ] sys-apps/lm_sensors-2.10.4 USE="-sensord"

I had changed the use flags on some things as required for their builds. Now, I am stopped at every emerge by this concerning binutils and groff.

Shingoshi
 
Old 02-17-2008, 02:23 AM   #5
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
The ebuild lmsensors will be NEWLY installed while the others will be REBUILT. Look in the manual for emerge. The multislot USE flag means for multiple compilers. For developers, multislot is OK, but it might be a pain to work with at times.

harden installs is used for servers or paranoid desktop/notebook user.

mult-lib installs provides 32-bit libraries to be used with 32-bit programs such as Adobe Flash Player, Adobe SVG, Windows codecs, Sun Microsystems JAVA and a few others on a 64-bit installation.

A developer can go far using an stage3 install. If you have a 80686 (Pentium Pro) or better, use the i686 version. If you have a 80386, use the x86 install. If you are starting with stage1, use the catalyst script to help you through it.

If you want to introduce new programs in the Portage tree, talk to the Gentoo developers and add your programs to the Sunrise Portage tree overlay. This overlay gets overlooked from Gentoo developers to include more programs in the main Portage tree.

About a week ago I recently did a re-install of Gentoo because I have not done a world update since the old install of Gentoo which was a year and a half ago. I just did a stage3 install using the i686. I had problems with EAPI, so I had to change my plans installing kde first and then xfce4 and gnome last until emerge --sync saids I need to up date portage. I masked mysql-5 because I can not log in to mysql shell to set it up. I am using mysql-4 because it works as expected. I used "march=pentiumpro mtune=pentium4 --pipe -Os" as the CFLAGS. I think I can copy my install to my AMD Athlon (Slot A) and Pentium II.

XEN is in the main Portage tree. It just a keyword mask. This means it is experimental. VMware is better because it has a lot of features and it is easy to setup. VMware Server is free just like XEN.

I suggest do a complete install with out upgrading the whole system. Then backup the install and do a complete world update. If the compiler needs to be updated, do it first but only after backing up the install.

Some good Gentoo sites.
http://www.gentoo-portage.com/
http://www.gentoo.wiki.com/
 
Old 02-18-2008, 01:40 PM   #6
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474

Original Poster
Blog Entries: 28

Rep: Reputation: 34
Your comments are greatly appreciated, and will be thoroughly considered.

I have not journaled everything in this process, because I had been redirected several times by packages that needed new USE flags, and/or dependencies to be installed first before proceeding with the installation. But I have tried to journal as much as possible, so that it can be easily repeated by the use of a script.

I have done a few things which many would probably say I should not have done (and they may be right). So far, I am running my Gentoo system in the chroot which I setup, and all seems to be going well. I have had a few missteps along the way, but they seem to have been resolved. The big NO NO that I've done, is upgrade to gcc-4.2.3. I will now continue with installing the rest of the packages I want as you have suggested. Then I will follow that with the "emerge world".

I just wish that I were able to use both of my dual-core Opterons. But since I have managed to damage my motherboard, and my system is barely running to capacity, I'm making do with what I have.

Please feel free to offer further suggestions as they come to mind.

Thank you!
Shingoshi
 
Old 03-04-2008, 04:05 PM   #7
JackTrust
LQ Newbie
 
Registered: Mar 2008
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
Use eselect profile list to see common profiles. Profiles are stored in /usr/portage/profiles/, to use them symlink desired one to /etc/make profile.

/etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2007.0

If you have working sandbox you can skip the build in emerge -e system/world process, use emerge --skipfirst, you can even come back after emerge -e is finished and try again, it may build then.
You can also live without sandbox, to turn it off permanently add FEATURES="-sandbox" to your make.conf.


@billymayday
Setting FEATURES in make.conf has same effect as setting it from command line. Actually command line overrides everything else. -oneshot option does not change anything in build process, the only difference it makes is package is not stored in world file.


I attempted to do this by typing;

/etc/make.profile -> ../usr/portage/profiles/default-linux/amd64/2007.0

at the prompt and it comes back with "There is no such file or directory"

I also tryed without the two dots (..) in front of /usr/portage/profiles/default-linux/amd64/2007

and it says it's a directory.

I have confirmed and verified that both directories exist.

What am I doing wrong here?

Thanks
 
Old 03-09-2008, 10:26 AM   #8
Curtman
LQ Newbie
 
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by JackTrust View Post
I attempted to do this by typing;

/etc/make.profile -> ../usr/portage/profiles/default-linux/amd64/2007.0

What am I doing wrong here?
What you want to type is this:

ln -s /usr/portage/profiles/default-linux/amd64/2007.0 /etc/make.profile
 
Old 05-10-2008, 11:22 AM   #9
harryhaller
Member
 
Registered: Sep 2004
Distribution: Slackware-14.2
Posts: 468

Rep: Reputation: Disabled
Thanks, Shingoshi.

I am just starting with Gentoo - I have just compiled the kernel so it's early days yet. I am doing this with the view to moving onto LFS later on, so as to be even more independent.

Clearly at this early stage I have little to add or ask, but any journal such as this is very helpful - and also motivating.

I wish more posters would post such threads.

Thanks again.

Last edited by harryhaller; 05-10-2008 at 11:23 AM. Reason: minor corrections
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building System from Scratch ScottyBaby Linux - Hardware 20 10-03-2006 01:46 PM
re: steps for building pc ergo_sum Linux - Hardware 5 10-09-2005 02:51 PM
First steps to building a Server tommytomato Linux - General 1 05-31-2004 10:08 PM
Building Linux from scratch linuxcam Linux - Software 9 12-19-2001 08:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration