Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Build on PC. Install on laptop
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
avidseeker
n00b
n00b


Joined: 28 May 2023
Posts: 24

PostPosted: Mon Mar 11, 2024 10:46 pm    Post subject: Build on PC. Install on laptop Reply with quote

Is there a way to compile packages on a separate machine, then install the compiled binaries locally?
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3345
Location: Rasi, Finland

PostPosted: Mon Mar 11, 2024 11:15 pm    Post subject: Reply with quote

Yes. ;)
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 343

PostPosted: Thu Mar 21, 2024 6:21 pm    Post subject: Re: Build on PC. Install on laptop Reply with quote

avidseeker wrote:
Is there a way to compile packages on a separate machine, then install the compiled binaries locally?

Yes.
Try to pull out hard drive and put it in external case.
Connect to some speedy laptop and build.
Then connect hard disk again to your slow machine.
You can build packages in slow machine without bin pkg.
Just pay attention on your CPU, change termal paste and you are ready to go.
Back to top
View user's profile Send private message
e8root
n00b
n00b


Joined: 09 Feb 2024
Posts: 71

PostPosted: Fri Mar 22, 2024 5:51 am    Post subject: Reply with quote

Wondering about this myself.

One obvious way is to take disk from slower machine to fast, chroot in to it, make sure parameters like -march are not set to native but rather specific target CPU model and then build all packages like that. This approach seems the best for initial install but not to deploy updates later on. It also is only viable for the same basic CPU architecture so mostly i386/amd64 if build machine is amd64.

Then from there there can be few better or worse ways to approach this whole topic. Especially useful case but probably the hardest is when slower machine also has different processor architecture e.g. building packages for Raspberry Pi on fast gaming amd64 PC. In the latter case crossdev seems to be obvious preferred solution but how one makes sure packages are build with right use flags and then deploys packages I am not sure. There apparently is a way to setup binary packages host and use it as the preferred way to get binary packages from. Other way is using QEMU but in this case most performance advantages are nullified by need to emulate target CPU and in case of Raspberry Pi 5 (or even 4) it might be just faster (not to mention more energy efficient) to build packages directly on RPi. But then there is memory size that also has to be taken in to accound. Something like 8GB Raspberry Pi 4/5 should easily be able to build all packages and especially when using zram swap. For lower end machines with 4GB I can always reduce -j in MAKE_OPTS. Less memory than that for some older systems and it might be necessary to setup whole crossdev/qemu and binpkg infrastructure...

At this point I am only pondering about this topic but in the long run I have few machines I will like to use Gentoo on and these include few x86 machines, aarch64 based RaspberryPi 4/5 and last but not least super loud and super power inefficient PowerPC G5 beast for which I will need to setup whatever solution (might even be qemu for all I care) which will allow avoid building firefox and libreoffice on it...
_________________
Unix Wars - Episode V: AT&T Strikes Back
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3137

PostPosted: Fri Mar 22, 2024 11:42 am    Post subject: Reply with quote

Quote:
One obvious way is to take disk from slower machine to fast, chroot in to it,
One obvious way is to export root over NFS. Not very secure though, only use in your very private network.
I've been using this a long long time ago to lend the power of amd64 quad core to an old Pentium 3. They both can run code for i686, so there were no compatibility issues.

With a bunch of more similar machines I'd just build binary packages though.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
plasmonics
n00b
n00b


Joined: 16 Mar 2011
Posts: 6

PostPosted: Fri Mar 22, 2024 2:03 pm    Post subject: Reply with quote

I did it recently. My laptop is very thin, weighs 2.2 lbs and prone to overheating. It is also 3 times slower than my desktop. Given how much it cost, I didn't want to damage it compiling gentoo.

I already had a working gentoo on my desktop. So I rsync'ed the root partition from desktop to laptop over the wifi. The main complication is that the desktop has nvidia gpu and the laptop amd vega 10. Before booting gentoo on the laptop, I booted my main distro (fedora) and recompiled the gentoo kernel in chroot. I also deleted the nvidia driver and installed the amdgpu driver. Gentoo booted up without any problem.

The hard part was to configure the kernel to include support for the elantech touchpad. Another difficulty was to get the realtek sd card reader to work. I was able to get the kernel configured correctly. Everything works.

So far the difference in -march has not been a problem.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Mar 22, 2024 11:00 pm    Post subject: Reply with quote

avidseeker,

There are many ways.

Export the filesystem tree of the slow system to the fast system and chroot into it there.
The fast system provides swap, build space distfiles and so on, s speed will probably be network limited.

Building in a chroot.

The official Gentoo binhost.

Physically connect the drive from the slow system to the fast system for installing/updating.

It all comes down to running gentoo and installing/updating gentoo are two separate things.

Probably other ways too.
_________________
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
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