Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cross-Distribution Upgrade to Gentoo 1.2
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
deornoth
Guest





PostPosted: Thu Jul 04, 2002 10:18 am    Post subject: Cross-Distribution Upgrade to Gentoo 1.2 Reply with quote

Well, after working with a vanilla Gentoo install on a small machine that I own, I decided that it was high time to relieve my main machine of it's RPM dependencies. The only snag in this plan was that I already had a system that was working great, and up for almost a month straight. Not wanting to tarnish my uptime (who would blame me... :roll: ), I unpacked the Gentoo 1.2 Stage 1 tarball onto the system, and started hacking away.

What I'm interested in knowing is, is there anybody who would be amused/interested in this same thing? If so, I'm more than willing to provide a write-up of just how I upgraded my RedHat 7.2 machine to a Gentoo 1.2 machine. There are a few things to copy, some RPM's to remove, and a lot of compiling to do, but it's not all that difficult, and a standard HOWTO should fill the bill perfectly. I just want to test the waters a little before going all the way with a full-blown HOWTO on this.

-Deornoth
Back to top
Kalle
Guest





PostPosted: Thu Jul 04, 2002 1:34 pm    Post subject: Yes please:) Reply with quote

Ive just downloaded the stage 3 iso. Have Red Hat 7.3 on my computer. If there was a simple way, like as simple as the boot-cd-prosedure(even that might be too dificult for people like me (used Linux for not so many days)), to upgrade to Gentoo, I would choose your way for sure.
Back to top
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Thu Jul 04, 2002 2:10 pm    Post subject: So far so... uhh.. Reply with quote

So far so good... sorta. I've managed to get portage onto the system, and had removed gcc 2.nasty.96.fuggly.x as well as it's accompanying cpp. Copied over all required info for portage to run, and gcc 2.95.3 and cpp 2.95.3. Started ./scripts/bootstrap.sh from /usr/portage, and all was going well... until I realized that I forgot to protect my /etc and /dev directories... Ooops! :oops:

Well, so far all it results in is /usr/lib/portage/bin/megadigest reporting false md5sums (double checked against /usr/bin/md5sum, and megadigest is wrong), which is bad in that it now thinks every file that portage downloads is either corrupt or incomplete. No idea how to fix this, as I've tried portage 1.9.9, 2.0.5, 2.0.8, and 2.0.9, all to no avail. I've a bad feeling something in /etc got clobbered. But hey, lose nothing, learn nothing. I've still all my data... it just looks like my prescioussssss uptime might have to die.

I'll keep working on it, but it does look very doable, assuming when you do it you cover your own bum in /etc and /dev :!:

Oh, and if my opening post made it sound like this was a done deal, I'm sorry for misleading, I'm still very much up to my elbows in the upgrade. Heck, I'm typing this on the machine that is being upgraded. I'll do a few more upgrades to hone the process after this one though, as well as to actually write down the steps... :lol:

-Deornoth
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Fri Jul 05, 2002 5:51 am    Post subject: Onward and Forward Reply with quote

Well.. I installed a plain jane version of RedHat 7.2 on a spare system here, and proceeded to convert it to a Gentoo 1.2 system. As of this writing, I have not rebooted any other time except for after the RedHat install. /usr/portage/scripts/bootstrap.sh is running just fine, and all is looking well.

I managed to remember to CONFIG_PROTECT="/etc /dev" this time, and things are running much smoother :wink: I have also drafted up a preliminary document outlining the process. It goes into a fair bit of detail, but it was written as I was performing the upgrade and figuring little things out. I will run through the instructions once the machine is successfully converted, to be sure that they work.

(Edit) Note that the spare machine is a Celery 500MHz with 192MB Ram and a 6GB IDE HD... so it might be a while before things come together (/Edit)

Possible test Distro's include, but are not limited to: RedHat 7.2, RedHat 7.1, RedHat 6.2, Debian 'Potato' 2.<something old>, and I might even get masochistic enough to try it on Apple's Darwin release.... Gentoo on a BSD kernel... hmm :twisted:

-Deornoth
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Fri Jul 05, 2002 6:01 am    Post subject: Re: Yes please:) Reply with quote

Kalle wrote:
If there was a simple way, like as simple as the boot-cd-prosedure(even that might be too dificult for people like me (used Linux for not so many days)), to upgrade to Gentoo, I would choose your way for sure.


Not sure exactly how simple it will be. It's currently at about two full pages of text instructions of files and directories to copy out of the Stage1 bzball, and files to modify. It basically skips the partitioning, formatting, and population of directories, as well as gaining the side perks of already being configured as you like it, with the services you want.

The hard part comes in when you try to unload the portage system into a distribution that isn't designed for it. Portage can handle it fine, as long as you put everything where it wants it, but the snafoo is keeping your old system there while you do it.

In short, all I'm changing is the steps preceeding 'emerge rsync, ./scripts/bootstrap.sh' etc. Once you are there, everything is pretty much cool and ready to go.

-Deornoth
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Sat Jul 06, 2002 2:23 am    Post subject: Small Snafoo Reply with quote

Well all was going well. After examining the results on screen, and checking Portage's temporary locations for clues, it appears the after glibc was installed, everything died. Binary commands that were part of the original distribution now issue Segmentation Faults, and Binary commands that were part of Gentoo complain about /lib/libpthread.so missing a function.

I'm no genious, but the symptoms look like a library was whacked, hard, by the glibc install. If any Linux library guru's out there can give me a hint or two, that would be great. Since the system is a spare one, I'm not in a world of hurt; it just means that I'm currently reinstalling RedHat and going to follow the instructions I wrote, and see if it does the same thing. Hopefully it either works, someone gives me some info, or I figure out the problem. If any of those three happen, I'll have full instructions for converting an existing system to Gentoo Linux!

-Deornoth
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Sat Jul 06, 2002 4:52 am    Post subject: Reply with quote

Hmm... no go second time. The error about /lib/libpthread is no longer, but the segfaults are still there. This occurs at the very end of the first time /usr/portage/scripts/bootstrap.sh installs glibc 2.2.5. No errors, it just ends, and then a lot of stuff segfaults, including emerge.

Some symptoms: 'ls' works, 'ls -l' segfaults. 'emerge' segfaults. 'python' works fine. 'vi' segfaults. 'nano' works. 'gcc' works. 'wget' works. 'less' works as well as 'cat'.

/var/tmp/portage contains:
baselayout-1.7.9-r1 glibc-2.2.5-r4 linux-headers-2.4.18 portage-2.0.9

/usr/portage/distfiles contains:
glibc-2.2.5.tar.bz2 glibc-linuxthreads-2.2.5.tar.bz2 linux-2.4.18.tar.bz2 sysvinit-2.83.tar.gz

I believe that somehow glibc is destroying an important library, but I don't seem to be able to figure out which one it is. I've already tried to copy all of the stage1's /lib and /usr/lib files to the system, over what is there, and nothing changed.

Before you ask if bootstrapping is needed, yes it is. The system I'm messing with has no compiler of it's own, and I'm also trying to make it so that those of us who are stuck with gcc 2.96 as a compiler can convert to 2.95 or 3.1.

A little help would be appreciated.

-Deornoth
Back to top
View user's profile Send private message
masseya
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 2602
Location: Baltimore, MD

PostPosted: Sat Jul 06, 2002 5:34 am    Post subject: Reply with quote

I don't really have any technical help or advice, but I do want to say that I would like to see this document come into existance. I would be interested in seeing how it's done. :) Keep up the good work!
_________________
if i never try anything, i never learn anything..
if i never take a risk, i stay where i am..
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Sat Jul 06, 2002 5:43 am    Post subject: Reply with quote

Tristam29 wrote:
I don't really have any technical help or advice, but I do want to say that I would like to see this document come into existance.


Seeing as this clobberred library that I can't find is the only thing keeping me from finishing the instructions... :x

Well... I guess I'll keep checking here, and hacking away at the box.

-Deornoth
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Sat Jul 06, 2002 2:32 pm    Post subject: Reply with quote

Figured out the problem, and the system is currently working on perl in an emerge system. I'll try it on a system that starts with a compiler when this finishes, then start trying other distros. If anyone wants the current version of the instructions, just email me a request.

-Deornoth
_________________
"If you want code to be portable, you shouldn't necessarily create an abstraction layer to achieve portability. Instead you should just program intelligently."
-- Linus Torvalds
Back to top
View user's profile Send private message
deornoth
n00b
n00b


Joined: 04 Jul 2002
Posts: 13

PostPosted: Sat Jul 06, 2002 4:30 pm    Post subject: Instructions Reply with quote

Not sure if this is the best place to put this... but hey, here we go!

Remember, this isn't guaranteed, extensively tested, or even making the claim of completeness... it just worked the last few times I tried it. You have been warned!

---------------
Code:

I assume that you already have access to a computer system running a
Linux-based OS, and that you have the legal right to use the root account
on the machine. I also assume that this is the same machine you want to
upgrade to Gentoo, but without shutting it down, or rebooting!

I also assume that you have installed Gentoo in the regular manner on at
least one other system, and if not, you read the Gentoo installation
instructions very thoroughly. Also, hopefully you have some Linux
installation and administration experience to work with. I will not take
responsibility in any way for anything that you mess up by following the
instructions in this document.

All is possible, my friend. Just remember, these instructions worked for
me, but that's as far as I'm willing to put my money on them. I've tested
them, and tried them myself, and they seem to work. But I make no
guarantees if you royally hose your system while following (or not
following) any of the instructions in this document. Root access is a
privilege, and a dangerous one at that. Be careful and cautions with it,
and you shouldn't have any problems.

You may also perform the following:
# export GENT="/mnt/gentoo"
and instead of all those '/mnt/gentoo's, just put a $GENT (or whatever
you named the variable), ie: $GENT/usr/bin

HOWTO!

Unpack Gentoo Stage 1 bz2 into /mnt/gentoo (for simplicity):
# mkdir /mnt/gentoo
# cd /mnt/gentoo
# tar -xjpf /path/to/stage1-ix86-1.2.tbz2

Setup ebuild make configuration:
# mv /mnt/gentoo/etc/make.conf /mnt/gentoo/etc/make.globals /etc

Edit /etc/make.conf, and add the line:
CONFIG_PROTECT="/etc /dev"
somewhere in the file.

(If you feel like losing ALL your configuration information, and any
special settings on devices, go ahead and ignore this step... but I
warned you!)

Make any other changes you feel are necessary. I like to change the
MAKEOPTS="-j2" option in /etc/make.globals to a "-j3" on my dual-cpu
SMP system, as it speeds up compilation.

Finish ebuild's make configuration
# mkdir -p /usr/portage/profiles/default-1.0
# ln -s /usr/portage/profiles/default-1.0 /etc/make.profile

Copy over the blank ebuild database that ships with Gentoo:
# mv /mnt/gentoo/var/cache/edb /var/cache/

Copy over the base Portage files needed to emerge packages:
# mv /mnt/gentoo/usr/lib/portage /usr/lib/

If Python 2.2 not installed, you will need to:
# mv /mnt/gentoo/usr/bin/py* /usr/bin

Install the Python 2.2 Portage modules:
# mv /mnt/gentoo/usr/lib/python2.2 /usr/lib/
# mv /mnt/gentoo/usr/include/python2.2 /usr/include/

If any version of GCC is installed that would interfere with Gentoo,
uninstall it now. This specifically includes the 2.96.x version shipped
with RedHat 7.x distributions.

To use Gentoo's GCC (highly reccomended), simply:
# mv /mnt/gentoo/usr/bin/gcc /mnt/gentoo/usr/bin/cpp /usr/bin

If using the prebuilt GCC from Gentoo, you also need it's lib and include
files:
# mv /mnt/gentoo/usr/include/* /usr/include
# mv /mnt/gentoo/usr/lib/gcc-lib/* /usr/lib/gcc-lib/
# mv /mnt/gentoo/usr/i486-pc-linux-gnu /usr/
# mv /mnt/gentoo/usr/lib/* /usr/lib

Copy the Sandbox library over to our system, so we can use it:
# mv /mnt/gentoo/lib/libsandbox.so /lib

Update the system, so it knows about the new libraries:
# ldconfig

If you decided to remove your old compiler, you can compile programs again
from this point on.

We need to allow emerge to see Gentoo's sysvinit generic script functions:
# mv /mnt/gentoo/sbin/functions.sh /sbin
# ln -s /sbin/functions.sh /etc/init.d/functions.sh

Make sure we have some necessary tools:
# mv /mnt/gentoo/bin/* /bin
# mv /mnt/gentoo/sbin/* /sbin
# mv /mnt/gentoo/usr/bin/* /usr/bin
# mv /mnt/gentoo/usr/sbin/* /usr/sbin

Make sure bison will compile:
# mv /mnt/gentoo/usr/share/bison /usr/share

Once you have reached this point you should have no need of the /mnt/gentoo
directory, and it can be safely 'rm -rf'd.

Note: Once you start emerging, somehow cp, rm, and mv all get aliased to have
a -i argument. This means you will have to answer 'y' to all questions during
an emerge.  ... I just 'yes | emerge <whatever>'

Now we finally get to start the fun!
# emerge rsync

Now to bring the system up to Gentoo-date:
# emerge --pretend gcc

Make note of which version of baselayout is supposed to be installed. Once
you have the version, do a:
# emerge inject sys-apps/baselayout-x.y.z
where x.y.z is the version number and any revision addition (-r1 etc).

If you don't do this, baselayout will be built, clobbering /etc and /dev,
even though they are protected by CONFIG_PROTECT. All it does is build
glibc and gcc statically. We already have a compiler and shared libraries,
so we should be able to safely ignore it.

Once you have told portage that you already have a baselayout, go ahead and
upgrade/install glibc by typing:
# emerge glibc

If you are using RedHat 7.x, emerge glibc will fail at the very end. Don't
worry about this, it just clobbered a RedHat binary's library. Simply do
the following to fix it for now:
# rm -rf /lib/i686

Now we do gcc:
# emerge gcc

And finally upgrade/rebuild the system with:
# emerge system

After this emerge system, baselayout should no longer give us a problem,
as we are working with a bona-fide Gentoo system now! emerge -e system
all you want!

The rest of the installation should be just like a regular Gentoo install.
If you want to tell emerge that you already have a program installed, and
don't want to compile a version right now, just do a:
# emerge inject <package>
to insert it into the ebuild tree, and have it seen as 'on' by the system.
Say you already have syslogd and you don't want to reinstall it, just do
this:
# emerge inject syslogd-x.y.z
(x.y.z are a version number, of course) and presto, it's added to the
system, ready to update on an 'emerge -e system' or however you do a
global update. You'll most likely not want to do this too much, as the
old version may be in an odd location, or just simply a non-Gentoo location.
If this occurs, simply remove the package using your old package tools
(you did keep those, right?), and emerge the new one.

Aside from the possible kernel update (if you want to), there is no reason
that you should have to reboot your computer during any part of this
process. Heck, you could probably leave the system up and running as a
server if you wanted too. Just remember, if you kill your old C compiler
to install Gentoo's 2.95 one, let your users know about it beforehand,
as they won't like the results of using a compiler that dissappears. ;-D


[edit 7/10/02] Fixed a few bugs in the document. Moved copy of bison data above point where you delete /mnt/gentoo, and mentioned the 'yes' command concerning questions asked in the intial emerges.

-Deornoth
_________________
"If you want code to be portable, you shouldn't necessarily create an abstraction layer to achieve portability. Instead you should just program intelligently."
-- Linus Torvalds


Last edited by deornoth on Wed Jul 10, 2002 10:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
fghellar
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 856
Location: Porto Alegre, BR

PostPosted: Sat Jul 06, 2002 6:48 pm    Post subject: Re: Instructions Reply with quote

deornoth wrote:
Not sure if this is the best place to put this... but hey, here we go!

Just keep your good work! We'll find a home for it when it's ready... :wink:
_________________
| www.gentoo.org | www.tldp.org | www.google.com |
Back to top
View user's profile Send private message
me22
n00b
n00b


Joined: 30 Jun 2002
Posts: 45
Location: Canada

PostPosted: Sat Jul 06, 2002 8:12 pm    Post subject: Reply with quote

I did something like that. I couldn't get Sympatico DSL working from the iso so I installed lycoris and installed direct from that.

However, I installed to /mnt/gentoo following all the instructions from /install.txt

Then I used TomsRtBt to move all the lycoris files to a different dir and moved /mnt/gentoo to /

Worked fine =)
_________________
~ Scott "me22" McMurray
Back to top
View user's profile Send private message
dripton
n00b
n00b


Joined: 16 Aug 2002
Posts: 65
Location: Virginia USA

PostPosted: Thu Aug 22, 2002 2:12 am    Post subject: Reply with quote

Tried the Gentoo-over-RedHat install.

It mostly worked. But the remaining RedHat cruft really got in the way.

Example during the install process:
Some of the " mv {gentoo directory} {existing system directory}" commands only partially succeeded, because mv does not clobber subdirectories. Meaning that I had to do a lot of manual tweaking of such steps. If you're too aggressive with this then it's easy to wipe out shared libraries that are currently in use, at which point your box starts having problems.

Also, there were major issues with the system after I finished, which caused me to wipe it and start over from a clean Gentoo CD.

Example after the install process:
inittab still called the RedHat init logic (/etc/rc3.d) instead of the Gentoo init stuff (/etc/runlevels/boot and default). Meaning that devfsd wasn't run, so /dev/hda wasn't seen at boot (since that's not the actual devfs name, but a legacy compatibility name created by devfsd), so the machine went nuts when the RH init scripts tried to check disks at boot. You can fix this kind of problem too, of course, but only if you have pretty solid knowledge of how both RedHat and Gentoo work.

In short, it's only a shortcut if you really know what you're doing. And even then you're going to end up with cruft, instead of the Gentoo ideal of a system where you installed everything intentionally and know how it all fits together. So while this is a neat procedure, and possibly useful for a few people, for most people I recommend backing up, reinstalling Gentoo from scratch, and then selectively restoring parts of your backups.
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