# New Motherboard + cpu = reinstall? [solved]

## beerisgoodmate

My current system is an AMD x2 3800 And I am upgrading to an intel core 2 quad q6600.

Currently I am running amd64.

What is the best path to take?  Start from scratch? 

Or 

change -march=nocona -j8 in make.conf 

recompile kernel

emerge -Dup world

(anything else)?

CheersLast edited by beerisgoodmate on Sun Dec 02, 2007 2:04 am; edited 1 time in total

----------

## BradN

the easiest way to rebuild everything after changing make.conf is: emerge --emptytree world

The only possible problem I can see is that athlon 64's support 3dnow which I don't think intel ones do, so you may want to rebuild before you swap the hardware.  Also, if you're using an older athlon64 without sse3, that could cause problems running the newly compiled stuff on the old hardware, so in the worst case you'd have to do 2 recompiles - first to generic binaries and then again once you switch the hardware.  (you can compile it generically by removing the march option entirely)

----------

## beerisgoodmate

Thanks Brad.

I'm not confident I understand everything at the moment.  

option 1 is:

edit make.conf to suit the new hardware

emerge --emptytree world

I assume I would recompile the kernel to include drivers for the new mobo?

install new hardware

option 2 is:

edit make.conf for generic arch and rebuild,

install new hardware

edit make.conf for the new hardware and rebuild again?

All AM2 x2's have sse3 though I didn't see sse3 listed in the safe cflags for the c2quad:http://gentoo-wiki.com/Safe_Cflags#Intel_Core_2_Duo.2FQuad_.2F_Xeon_51xx.2F53xx.  3dnow is implied by the current march=athlon64 so I assume changing to march= nocona should deal with that?

And finally, would changing make.conf in option 1 and compiling with current hardware break my system?  If not why not? Or would it only break if I rebooted keeping the current hardware?

Just trying to understand whats going on  :Smile: 

----------

## d2_racing

Maybe the best may is to change your /etc/make.conf and run this

```

# emerge -e system

# emerge -e system

# emerge -e world

```

So, you will compile everything with the new hardware.

----------

## beerisgoodmate

Thanks d2_racing,

can you explain the two emerge -e systems?  Do I change the hardware in between them?

----------

## gsoe

My 2 cents:

On the current hardware:

1: Remove all CFLAGS and CXXFLAGS entries to get a generic system.

2: emerge -e system (you don't get a clean, perfect toolchain, but you get one that will run on any system. Forget about the "world" for now, you just need the "system" to be able to run on the new hardware.)

3: Enable the drivers for the new hardware and recompile the kernel.

On the new hardware:

1: Enable whatever CFLAGS and CXXFLAGS you want.

2: Recompile gcc

3: Recompile world using Guenther Brunthaler's script, see the thread here. If you aren't convinced about Guenther's method, you should do the traditional: emerge [toolchain], emerge -e system, emerge -e world (maybe even another emerge -e world).

4: Remove unneeded drivers and recompile the kernel.

Happy compiling!

----------

## h0mer`-

just did the same thing... changed from x2 4600 to q6600.

1. swapped hardware

2. booted minimal boot disc and chrooted into my enviroment

3. changed cflags in make.conf

4. rebuilt the kernel for new hardware support

5. booted with new kernel into my system

6. changed some use flags

7. emerge -eD world

8. done

had no problems at all besides apache which didnt compile... dunno the reason just skipped it at first and emerged it after everything else and it worked.

hope it will be that easy for you too.  :Wink: 

may i ask which mainboard you are planning to use?

----------

## gsoe

h0mer: OK, then we've got evidence that the compiler will work, even when changing between these two cpu architechtures. Your "emerge -eD world" won't give a clean toolchain and system though, that's probably why you had a problem compiling apache. My proposal would then be the following:

On the new hardware:

1: Boot the minimal CD and chroot.

2: Change the CFLAGS and CXXFLAGS.

3: Recompile gcc.

4: Recompile world using Guenther's script.

5: Enable the drivers for the new hardware, disable unneeded drivers, change cpu type in the kernel (forgot that in my last post) and recompile the kernel.

----------

## d2_racing

The emerge -e system, it's because before compiling your new GCC, there about 5-10 packages that will be compile agains your GCC...so emerging twice the system will recompile everything with your new GCC compiler.

I saw a thread about that last week.

I will post the source in a short time.

----------

## d2_racing

Found :  https://forums.gentoo.org/viewtopic-t-616853-start-0.html

----------

## beerisgoodmate

Thanks for the help so far  :Smile: 

I decided agains the script thing, thinking it wouldn't take too long on a q6600,

I'm currently on emerge 10 of 116 of the emerge -e system...

Does compiling from a live cd increase the compiling times?? gcc took forever to recompile... maybe 20-40 mins.

Cheers

----------

## h0mer`-

20 minutes for compiling gcc is absolutely normal.

----------

## beerisgoodmate

fair enough.

I'm still recompiling my system.  I would have thought a q6600 would be quicker.  I get the feeling my amd 3800 was quicker for compiling....  does compiling only use one core?  cpu is about 10-25% according to top.  And yes SMP is enalbled in the kernel and hdparm is all good.

----------

## rlittle

I'm not an expert, but I think when building certain crucial packages (gcc and the kernel), the ebuild forces -j1 (i.e. you only use one core). The idea (or so I read) is that the sequence in which certain things are built in (say) gcc is important, and if you build some jobs on one core and some on the another, you can't guarantee success.

----------

## beerisgoodmate

Ah, that makes sense  :Smile: 

fwiw, I havn't timed anything, but If my memory serves me correctly I have rebuilt the hardware and software for my system in ~ 24 hours which includes a lot of stuffing around.... my biggest mistake was not doing a emerge -Du world before hand, which meant I had to fix a whole heap of blocks from the terminal = no X and no internet only.

Thanks everybody!

----------

## d2_racing

 *beerisgoodmate wrote:*   

> Thanks for the help so far 
> 
> I decided agains the script thing, thinking it wouldn't take too long on a q6600,
> 
> I'm currently on emerge 10 of 116 of the emerge -e system...
> ...

 

Did you had the framebuffer enabled, because it can slow down your compilation.

----------

## BradN

If you're using a framebuffer (or an X terminal with slow, fancy font rendering), you can just switch to a different terminal or hide the window, and it'll go about full speed.

As to the actual question, booting from a livecd shouldn't measurably affect anything, especially since all the programs are running from the hard drive in the chroot'ed environment anyway.

----------

