Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Evolve III Maestro
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Tue Aug 02, 2022 5:38 pm    Post subject: Evolve III Maestro Reply with quote

I'm seeking some advice,

i got my hands on this mini laptop for about 60 bucks on a sale from Microcenter. It has a fully unlocked bios(Seriously 'every' option is available, fine-tuning the behavior of the igp, options to turn on or off 'audio enhancements' that other laptops brag about etc). , and you can replace the full lte cell card with a sata m.2 ssd. So i have been trying Duevan on it to use as a bluetooth music machine at work to ease off the use of my aging phone.
The problem is well, it's 60 bucks and while the hardware is 'great' for that price. the single antenna wifi-blutooth is a little animeic and does occasionally cut out in face of all the other signals in the area. The bluetooth usb adapter i have is stronger but Duevan doesn't like it even though it's one of the few binary distros without systemd.

So i decided to put gentoo on it. This is why i'm posting this. The machine is obviously way too anemic to compile a system, on it's own, in any reasonable sort of time. celeron n3450, 4gb of ram. And i know i can build a generic x86_64(it has most but not all the instructions listed for x86_64-v2 ( https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels ) build ina chroot and just copy it over, but that leaves updates as a question mark.

Optimally, Is there a way to set up my 32 core ryzen 5950x system to compile packages for it, and have it just grab those while only having it do this for packages it needs rather than the entire tree?
Or would i have to mess around with distcc and just dedicate 2-3 days a month on that?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Aug 02, 2022 6:03 pm    Post subject: Reply with quote

Build it on the "big" box, deploy it using a binary package host.

I use an AMD Phenom to build for my Intel laptop. I've personally opted for "amd64 generic", but I believe you can build with more specifics.

If I recall correctly, you can build in the chroot for different CPU capabilities. The key part is that not much has to run properly in the chroot. But since I use generic, I can't be of specific help there.

I make the binaries available to the client via http, but you can also use NFS, and possibly some other options. Using http, I've found that emerge options "-auDgKf" (fetch) followed by "-auDgK" work best.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Tue Aug 02, 2022 7:06 pm    Post subject: Reply with quote

pjp wrote:
Build it on the "big" box, deploy it using a binary package host.

I use an AMD Phenom to build for my Intel laptop. I've personally opted for "amd64 generic", but I believe you can build with more specifics.

If I recall correctly, you can build in the chroot for different CPU capabilities. The key part is that not much has to run properly in the chroot. But since I use generic, I can't be of specific help there.

I make the binaries available to the client via http, but you can also use NFS, and possibly some other options. Using http, I've found that emerge options "-auDgKf" (fetch) followed by "-auDgK" work best.


So i would just build the initial system in the chroot, but have it build the packages 'only' past the initial install (base system, display & wm, additional programs, etc). Set up the machine to have a nfs mount to the package dir and have it 'install packages only'?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Aug 02, 2022 8:04 pm    Post subject: Reply with quote

At least how I've implemented it, the chroot is a "complete" system. Inside that chroot, you will need all of the components to run anything required during the build process. sys-apps/portage, gcc, clang, llvm and any other similar dependencies. If you need to execute it in the chroot, then it needs to be compatible with the host architecture. At least that's my understanding.

So hypothetically, you build a web browser in the chroot with whatever optimizations the celeron n3450 has. The browser won't run in the chroot, but it doesn't need to.

I haven't set up NFS to provide the packages, but it doesn't look unusual. mount the NFS export and tell Portage where to find it.

EDIT:

I'll add that the binary host doesn't necessarily guarantee changes elsewhere in the file system are automatically propagated to the client. So in the normal way that you maintain /etc files, you'll need to do it "twice." Once in the chroot, and once on the client. I haven't found a way around that, though I'm sure something like git would work. I haven't found it to be too problematic, but it is something that could become "out of sync."

Also, repositories need to be the same on the chroot as they are on the client. For the Gentoo repository, I compress it into a suqashfs image. That image is then mounted in the chroot and copied to the client. You should be able to use NFS for that too.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Tue Aug 02, 2022 10:10 pm    Post subject: Reply with quote

pjp wrote:
At least how I've implemented it, the chroot is a "complete" system. Inside that chroot, you will need all of the components to run anything required during the build process. sys-apps/portage, gcc, clang, llvm and any other similar dependencies. If you need to execute it in the chroot, then it needs to be compatible with the host architecture. At least that's my understanding.

So hypothetically, you build a web browser in the chroot with whatever optimizations the celeron n3450 has. The browser won't run in the chroot, but it doesn't need to.

I haven't set up NFS to provide the packages, but it doesn't look unusual. mount the NFS export and tell Portage where to find it.

EDIT:

I'll add that the binary host doesn't necessarily guarantee changes elsewhere in the file system are automatically propagated to the client. So in the normal way that you maintain /etc files, you'll need to do it "twice." Once in the chroot, and once on the client. I haven't found a way around that, though I'm sure something like git would work. I haven't found it to be too problematic, but it is something that could become "out of sync."

Also, repositories need to be the same on the chroot as they are on the client. For the Gentoo repository, I compress it into a suqashfs image. That image is then mounted in the chroot and copied to the client. You should be able to use NFS for that too.


That might not be a bad way to do it, just emerge sync in both the main and the chroot system. since i only plan on updating once a month. this is going to be a music player more or less, though this can be used for other things too. It's quite a versatile system if you can get your hands on it despite the low power cpu.

Though how much does the potrage tree take? I have a system that i have on most, if not all of the time. wouldn't it be simpler to set up a local tree cache and just mount that as nfs? though that might be something to do later when i turn that always online system as a nas manager.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Wed Aug 03, 2022 1:10 am    Post subject: Reply with quote

There's no need to keep more than one copy of the data on any given system. NFS works fine, but if you want local storage, then you could sync once on the host, and have that subdirectory bindmounted where the chroot can see it too.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Aug 03, 2022 6:52 pm    Post subject: Reply with quote

truekaiser wrote:
Though how much does the potrage tree take? I have a system that i have on most, if not all of the time. wouldn't it be simpler to set up a local tree cache and just mount that as nfs?
I have no idea how big the tree is. My script that syncs and creates squashfs images allows for 800MB. I'm sure I picked 800MB as "big enough for growth, but still less than 1GB". I should probably add a free space check after the sync and before re-squashing it. I briefly tried switching to getting the images from a mirror (under gentoo/snapshots/squashfs/), but downloading the "current" image doesn't retain date information in the filename.

If you like NFS, use it. A lot of people go that route.

I've had too many production problems related to NFS, so I really dislike it and do my best to avoid it. My not-yet-sufficiently-automated process of build in chroot / put binaries on local http / download to client is annoying. But whenever I consider using NFS, I remember previously mentioned problems.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Wed Aug 03, 2022 11:05 pm    Post subject: Reply with quote

pjp wrote:
truekaiser wrote:
Though how much does the potrage tree take? I have a system that i have on most, if not all of the time. wouldn't it be simpler to set up a local tree cache and just mount that as nfs?
I have no idea how big the tree is. My script that syncs and creates squashfs images allows for 800MB. I'm sure I picked 800MB as "big enough for growth, but still less than 1GB". I should probably add a free space check after the sync and before re-squashing it. I briefly tried switching to getting the images from a mirror (under gentoo/snapshots/squashfs/), but downloading the "current" image doesn't retain date information in the filename.

If you like NFS, use it. A lot of people go that route.

I've had too many production problems related to NFS, so I really dislike it and do my best to avoid it. My not-yet-sufficiently-automated process of build in chroot / put binaries on local http / download to client is annoying. But whenever I consider using NFS, I remember previously mentioned problems.


I haven't had much problem with nfs, Question though, wouldn't symlinking the portage tree from the directory for the chroot to host system work as well? or would chrooting break the link?

I may change that to a nfs one once i get a nas set up on another system at the end of the year. Also which would be better, just plain amd_64 march, or that plus enabling flags for instructions it supports since the host system supports them too.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Aug 04, 2022 3:07 am    Post subject: Reply with quote

truekaiser wrote:
Question though, wouldn't symlinking the portage tree from the directory for the chroot to host system work as well? or would chrooting break the link?
I would expect the link to work, but I haven't tried that.

The chroot and the client need to keep their trees in sync. The chroot creates the binary packages based on a version of the tree. In order for the client to install those binaries, it needs the same tree. If the two trees do not match, emerge running will probably have a difficult time resolving the tree as compared to the available binaries.

When updating packages in the chroot, its tree will differ from the tree needed on the client, so you have to keep that tin mind. If the client needed to reinstall a binary, it would need the "old" tree.

I manage that by using date versioned squashfs images of the tree. The host's tree is treated independently from others. It syncs daily and creates the squashfs images. I often but not always update the chroot daily, but I only update the client weekly. Maybe earlier, maybe longer.

At the moment, I'm not sure exactly how I'd handle that using NFS. The simplest would be 3 separate trees with the chroot syncing from the host, the client from the chroot.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1998

PostPosted: Thu Aug 04, 2022 9:59 am    Post subject: Reply with quote

FWIW you can download or rsync prebuilt daily squashfs portage trees from (and other rsync mirrors):
http://rsync.us.gentoo.org/gentoo/snapshots/squashfs/
I then rsync them around to my other machines as needed.
I only sync weekly: using the lzo-compressed images, rsync typically cuts the download by 25-30%.

See my post for a script to handle the rsync.
_________________
Greybeard
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Fri Aug 05, 2022 11:49 pm    Post subject: Reply with quote

pjp wrote:
truekaiser wrote:
Question though, wouldn't symlinking the portage tree from the directory for the chroot to host system work as well? or would chrooting break the link?
I would expect the link to work, but I haven't tried that.

The chroot and the client need to keep their trees in sync. The chroot creates the binary packages based on a version of the tree. In order for the client to install those binaries, it needs the same tree. If the two trees do not match, emerge running will probably have a difficult time resolving the tree as compared to the available binaries.

When updating packages in the chroot, its tree will differ from the tree needed on the client, so you have to keep that tin mind. If the client needed to reinstall a binary, it would need the "old" tree.

I manage that by using date versioned squashfs images of the tree. The host's tree is treated independently from others. It syncs daily and creates the squashfs images. I often but not always update the chroot daily, but I only update the client weekly. Maybe earlier, maybe longer.

At the moment, I'm not sure exactly how I'd handle that using NFS. The simplest would be 3 separate trees with the chroot syncing from the host, the client from the chroot.


Yea no sadly I tried the symlink and portage bitches about invalid profiles and missing things.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Aug 06, 2022 12:53 am    Post subject: Reply with quote

Please describe exactly how you handled the symlink, and show us the output of namei -l /var/db/repos/gentoo (or such other path as you picked for $PORTDIR on the host).
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Sat Aug 06, 2022 3:57 am    Post subject: Reply with quote

Hu wrote:
Please describe exactly how you handled the symlink, and show us the output of namei -l /var/db/repos/gentoo (or such other path as you picked for $PORTDIR on the host).


Slatepaws is an older install, so the portdir is /usr/portage and i did a symlink from the '/var/db/repos/gentoo' I did symlink because hard-links are supposedly bad.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Aug 06, 2022 11:05 am    Post subject: Reply with quote

truekaiser,

Gentoo publishes a squashfs portage tree. Get your copy. It's 51M and you use it like that. My gentoo:: repo is 650M on a filesystem with 4k blocks.
Your kernel needs to support squashfs version 4 and either lzo or xz compression to match your image.

There is one point to be aware of. Its read only, so don't mount distfiles and your growing binary repo inside it.
There are knobs in make.conf to adjust that.
_________________
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: 21607

PostPosted: Sat Aug 06, 2022 3:37 pm    Post subject: Reply with quote

truekaiser wrote:
Slatepaws is an older install, so the portdir is /usr/portage and i did a symlink from the '/var/db/repos/gentoo' I did symlink because hard-links are supposedly bad.
User-managed explicit hard links to directories are unsupported in every modern filesystem I know of. Hard linking to files can be better or worse than symbolic links, depending on circumstances. Please note that I also asked for namei output, which you did not provide. I would have preferred that instead of the description you posted, you had showed us the shell command(s) you used and the working directory from which they were run, so that we could exactly reproduce your work.
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Sat Aug 06, 2022 5:15 pm    Post subject: Reply with quote

Hu wrote:
truekaiser wrote:
Slatepaws is an older install, so the portdir is /usr/portage and i did a symlink from the '/var/db/repos/gentoo' I did symlink because hard-links are supposedly bad.
User-managed explicit hard links to directories are unsupported in every modern filesystem I know of. Hard linking to files can be better or worse than symbolic links, depending on circumstances. Please note that I also asked for namei output, which you did not provide. I would have preferred that instead of the description you posted, you had showed us the shell command(s) you used and the working directory from which they were run, so that we could exactly reproduce your work.

When outside of the chroot i did
Code:
ln -s /usr/portage /mnt/Steam/Minifox/var/db/repos/gentoo
then chrooted to /mnt/Steam/Minifox
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Aug 06, 2022 8:14 pm    Post subject: Reply with quote

Is /mnt/Steam/Minifox/usr/portage where you store the shared tree? How did you configure the host side Portage to point to the shared tree?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Aug 06, 2022 9:49 pm    Post subject: Reply with quote

truekaiser,

That can't work by design as /usr/portage is outside the chroot.
Everything above /mnt/Steam/Minifox is no longer accessible once inside the chroot, so the symlink should appear to be broken.

A bind mound works.

distfiles sharing works too.

I use this wee ditty.
Code:
#!/bin/bash

# Mount the pesudo filesystem inside /usr/tuppenny
mount -o bind /dev /usr/tuppenny/dev
mount -t sysfs sysfs /usr/tuppenny/sys
mount -t proc  proc /usr/tuppenny/proc

# Share distfiles and the ::gentoo repo inside /usr/tuppenny
# Note that there are in the new default locations
mount -t ext4 /dev/mapper/storage-distfiles /usr/tuppenny/var/cache/distfiles
mount -t ext4 /dev/mapper/nvmestatic-portage /usr/tuppenny/var/db/repos/gentoo

# tmpfs is a very good thing
mount -t tmpfs tmpfs /usr/tuppenny/dev/shm

# and fix its permissions or build systems complain
chmod 1777 /usr/tuppenny/dev/shm

# Put our build space in RAM too. We don't want wear out the NVMe
mount -t tmpfs tmpfs /usr/tuppenny/var/tmp/portage

# Likewise, tmp in RAM too.
mount -t tmpfs tmpfs /usr/tuppenny/tmp

# fix the permissions to keep users separate
chmod 1777 /usr/tuppenny/tmp

# We need devpts in the chroot or we don't have any jobs
# Its picky about permissions too
mount -t devpts devpts /usr/tuppenny/dev/pts -o rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000


Take care to not mount your host packages in the chroot. :)
_________________
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
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Sat Aug 06, 2022 10:05 pm    Post subject: Reply with quote

Hu wrote:
Is /mnt/Steam/Minifox/usr/portage where you store the shared tree? How did you configure the host side Portage to point to the shared tree?


um. according to the ln manual, the first location is where the link will go to... Also, that's the new location of the portage tree if you do a new install rather than /usr/portage.

Quote:
truekaiser,

That can't work by design as /usr/portage is outside the chroot.
Everything above /mnt/Steam/Minifox is no longer accessible once inside the chroot, so the symlink should appear to be broken.

A bind mound works.

distfiles sharing works too.

I use this wee ditty.
Code:
#!/bin/bash

# Mount the pesudo filesystem inside /usr/tuppenny
mount -o bind /dev /usr/tuppenny/dev
mount -t sysfs sysfs /usr/tuppenny/sys
mount -t proc proc /usr/tuppenny/proc

# Share distfiles and the ::gentoo repo inside /usr/tuppenny
# Note that there are in the new default locations
mount -t ext4 /dev/mapper/storage-distfiles /usr/tuppenny/var/cache/distfiles
mount -t ext4 /dev/mapper/nvmestatic-portage /usr/tuppenny/var/db/repos/gentoo

# tmpfs is a very good thing
mount -t tmpfs tmpfs /usr/tuppenny/dev/shm

# and fix its permissions or build systems complain
chmod 1777 /usr/tuppenny/dev/shm

# Put our build space in RAM too. We don't want wear out the NVMe
mount -t tmpfs tmpfs /usr/tuppenny/var/tmp/portage

# Likewise, tmp in RAM too.
mount -t tmpfs tmpfs /usr/tuppenny/tmp

# fix the permissions to keep users separate
chmod 1777 /usr/tuppenny/tmp

# We need devpts in the chroot or we don't have any jobs
# Its picky about permissions too
mount -t devpts devpts /usr/tuppenny/dev/pts -o rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000


Take care to not mount your host packages in the chroot. :)


Oh wow, thank you. i'll just have to fix the install once it's done building everything. Should've thought of that since we already bind mount dev and other's. Right now i have the system being built on slateplaws including all the wm's and programs and have the bare bones needed for it to grab built packages from the chroot on slatepaws.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Aug 06, 2022 10:22 pm    Post subject: Reply with quote

truekaiser wrote:
um. according to the ln manual, the first location is where the link will go to...
Correct. It will go to /usr/portage. It will come from the location where you created the link. Since the link starts with a slash, we can ignore where the link is stored, and consider only the effective root directory of the process consuming the link. Since you placed the link itself under /mnt/Steam/Minifox/var/db/repos, we can infer that you intend the link to be consumed from inside the chroot. For processes inside the chroot, the / in /usr/portage is relative to the chroot's root directory. That is why I asked if /mnt/Steam/Minifox/usr/portage contains a Portage tree, since that is the result of resolving the symlink when using the effective root directory of processes in the chroot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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