Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can Gentoo install another gentoo for another system?
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
TheMachinesTeacher
n00b
n00b


Joined: 09 Sep 2017
Posts: 46
Location: Somewhere over there

PostPosted: Sun Oct 15, 2017 8:03 pm    Post subject: Can Gentoo install another gentoo for another system? Reply with quote

I am about to get a laptop and I would like to install Gentoo on it. The thing is that Gentoo takes a long time to install and I won't get the laptop until the end of the week, so I have some time to prepare a hard drive for the laptop.

I have a Gentoo installation on a Ryzen system, which is much faster than the laptop I am going to get. The laptop has a Intel Pentium Processor N3710. I would like to have the Ryzen system install Gentoo on a hard drive that I could then drop into the laptop and would boot into Gentoo without having to go through all of the installation steps on the laptop. My only concern is the -march flag. My Ryzen system is using znver1, but that will not work on the Pentium. I am positive I could partition the drive, install the tar ball, and configure the various configuration files on the Ryzen system for the Pentium system, but I am not sure what to do for the -march flag. I would like for the Ryzen system to install KDE, Libreoffice, and other various packages that take a long time to install for the Pentium system because the Ryzen system is much faster.

Would -march=native be the right choice? It seems like that would generate instructions native to the Ryzen system, not the pentium. Is there like a -march=generic flag that would work? Is that a good idea? I know -march=pentium is an option, but it seems like those are for older pentiums.

I am just looking for some advice on the march flag, but if you know of some things that I am not considering or should be aware of, please let me know!

The Ryzen system has gcc 6.3 using amd64 architecture. I am comfortable making the Pentium system use the same gcc version and arch. Sound doable?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Sun Oct 15, 2017 8:15 pm    Post subject: Reply with quote

Yes and no.

You will have to cross compile for the cpu -march flag to work.

Whatever hardware you know will be on there, you can build for that. You can probably count on the cpu to be at least close to what's advertised, and if they advertise specific networking and other hardware you can probably count on that at least being close to what's advertised, most of the time.

The thing is, assembly lines tend to switch parts off rapidly and without warning. In my experience there is at least one or two peripherals which don't match what was advertised, and in those cases the final product may not even be the same brand of part.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Oct 15, 2017 8:21 pm    Post subject: Reply with quote

TheMachinesTeacher,

You need to compare the Ryzen and N3710 instruction sets and set an -march that will work on both.

The Ryzen is going te be running the N3710 code for the install.
The bottom line is to leave -march unset and set -mtune=generic. That will produce run anywhere code for amd64 but it will not use any optimisations.
That's used in the Gentoo stage 3 tarballs.
_________________
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
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13842

PostPosted: Sun Oct 15, 2017 8:22 pm    Post subject: Reply with quote

Cross-compilation should not be necessary, if these are both x86_64 systems. The new system is 64-bit capable and OP says the old one is running amd64, so both systems should be x86_64.

Omitting the -march flag entirely is legal, and is the simplest way to build for a generic system. If you want to continue to build Ryzen-targeted binaries on the desktop, I suggest that the desktop chroot into the other drive and then follow the handbook, with the desktop taking the role normally held by the LiveCD and the drive destined for the laptop taking the role normally held by the to-be-installed system. As 1clue says, try not to assume too much about the hardware except where specifically guaranteed in the purchase receipts.
Back to top
View user's profile Send private message
TheMachinesTeacher
n00b
n00b


Joined: 09 Sep 2017
Posts: 46
Location: Somewhere over there

PostPosted: Sun Oct 15, 2017 8:27 pm    Post subject: Reply with quote

Thanks for the quick replies! I'll give it a try. I was going to do the chroot thing that Hu mentioned.

Reading this, it seems like once I have the laptop I am going to have to set the march flag and wait through a system rebuild for a nice optimized system. Oh well. At least I will have a working gentoo laptop when I get it.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Oct 15, 2017 8:39 pm    Post subject: Reply with quote

TheMachinesTeacher,

You largely won't notice the optimisation. There are a few exceptions, like multimedia apps.
For libreoffice, you won't be able to type fast enough to catch it out :)
You can optimise as things get updated, so you avoid the total rebuild.

Once you have the laptop, set up distcc, so the Ryzen still does the hard 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
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Mon Oct 16, 2017 12:39 am    Post subject: Reply with quote

IMO you should build a very minimal system and then create a list of apps to install once your drive is installed in the new laptop.


  1. Create a non-optimized basic command line environment.
  2. Get your new hardware
  3. Swap drives
  4. Tweak existing environment for optimization
  5. Rebuild @system & @world
  6. emerge <app list>
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Mon Oct 16, 2017 12:57 am    Post subject: Reply with quote

For my AMD k6-3 (32bit) I set up a 32bit gentoo install and build everything as packages there. Is that really an old 32 bit Pentium? Or a 64 bit that's named Pentium.

If it's a 32 bit i586, I can expand on how I setup my 32bit install.

It's an alternative to distcc. My 32bit Gentoo thinks it's running on a 3.2GHz six core k6-3.
Back to top
View user's profile Send private message
joanandk
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2017
Posts: 80

PostPosted: Mon Oct 16, 2017 5:16 am    Post subject: Re: Can Gentoo install another gentoo for another system? Reply with quote

TheMachinesTeacher wrote:
Would -march=native be the right choice?


If you are compiling it on your Ryzen, then the answer is NO! This would make the optimization for Ryzen and not Pentium N....

I have done many installations and would recommend waiting for your laptop and doing all there (may be with the help of distcc). The reason:
a) You can use march=native on the laptop. Or you could even find out the best flags for CFLAGS
b) On modern CPU compiling does not take that long to have a base system (1 day for minimal, after 3 days you should have all what you need, even the program you use very seldom).
c) If you are compiling the CPU, you could use lspci to get the list of the devices on your hardware.


If you look at my other thread, you will recognize that I have used VIrtualbox to create generic installation for different systems. I have made the experiences that while 80% works, there are still 20% which will not and need special treatment. I also have realized that the 20% need much more time to fix than compiling it directly on the system even if it is slower.

BR and have fun with your new laptop
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