View previous topic :: View next topic |
Author |
Message |
avidseeker n00b
Joined: 28 May 2023 Posts: 25
|
Posted: Mon Mar 11, 2024 10:46 pm Post subject: Build on PC. Install on laptop |
|
|
Is there a way to compile packages on a separate machine, then install the compiled binaries locally? |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3637 Location: Rasi, Finland
|
Posted: Mon Mar 11, 2024 11:15 pm Post subject: |
|
|
Yes. ;) _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
RIA77 Guru
Joined: 24 Feb 2016 Posts: 388
|
Posted: Thu Mar 21, 2024 6:21 pm Post subject: Re: Build on PC. Install on laptop |
|
|
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 |
|
|
e8root Tux's lil' helper
Joined: 09 Feb 2024 Posts: 94
|
Posted: Fri Mar 22, 2024 5:51 am Post subject: |
|
|
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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3348
|
Posted: Fri Mar 22, 2024 11:42 am Post subject: |
|
|
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 |
|
|
plasmonics n00b
Joined: 16 Mar 2011 Posts: 10
|
Posted: Fri Mar 22, 2024 2:03 pm Post subject: |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54550 Location: 56N 3W
|
Posted: Fri Mar 22, 2024 11:00 pm Post subject: |
|
|
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 |
|
|
|