Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Where are the repo information unpacked?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
linuxfluesterer
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2016
Posts: 130
Location: Germany

PostPosted: Thu Nov 15, 2018 1:01 pm    Post subject: [Solved] Where are the repo information unpacked? Reply with quote

Hallo friends.
To reduce nvme (like ssd) write access I 'outsourced' the PORTAGE_TEMPDIR to a tmpfs ramdisk as you can see in my following make.conf:
Code:
cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
# CFLAGS="-march=broadwell -O2 -pipe"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j8 -l8"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
EMERGE_DEFAULT_OPTS="--jobs=8 --load-average=6"

# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/mnt/tmpfs/portage/"

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C
LINGUAS="de en"
L10N="de en"
# PYTHON_SINGLE_TARGET="python2_7"
# PYTHON_TARGETS="python2_7 python3_5 python3_6"
ALSA_CARDS="hda-intel"
VIDEO_CARDS="intel
"
# GENTOO_MIRRORS="ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo"

GENTOO_MIRRORS="ftp://ftp.halifax.rwth-aachen.de/gentoo/"
USE="${CPU_FLAGS_X86} ffmpeg dbus dvd cdr nls sockets pulseaudio"

# USE="-ipv6 kde -gnome pulseaudio smp v4l -aim -infiniband -cjk -qt4 icu -oci8 -oscar ffmpeg dbus dvd cdr nls sockets twolame usb X udev alsa udisks libnotify thunar xinerama qt5 -xscreensaver aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"


When I execute the command
Code:
eix-sync
then about 172.000 ebuild files are synced with the repo content on my computer (Is that right?).
I assume, to sync, all ebuild files from remote repo are unpacked and then checked with a checksum to compare them with my own ebuild files.

Is this the right way to understand, what happens when eix-sync is running?

If so, I would like to know, in which directory are the repo files downloaded in, then unpacked and then synced to the existing ebuild files on my computer.
The more interesting question for me is: Can I change this mysterious directory of downloading and unpacking the ebuilds from remote server
and where do I need to enter this directory then, like outsourcing the PORTAGE_TEMPDIR

Thank you in advance.

-Linuxfluesterer


Last edited by linuxfluesterer on Thu Nov 15, 2018 6:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Thu Nov 15, 2018 2:53 pm    Post subject: Reply with quote

@all: this thread is related to: https://forums.gentoo.org/viewtopic-t-1089106-start-0-postdays-0-postorder-asc-highlight-.html

@linuxfluesterer:

1) In order to reduce writes to your SSD, you could add the lines below to /etc/fstab

Edit: The code below is incomplete and wrong. Don't use it. See my next post below.
Code:
tmpfs             /tmp                          tmpfs                         0 0
tmpfs             /var/tmp                      tmpfs                         0 0

There's no need to change PORTAGE_TMPDIR. If your machine already mounts /tmp as tmpfs, you don't need the first line. Be warned that if /var/tmp is smaller than 8GB, it might be too small to compile large packages (libreoffice, gcc, etc.).

2) eix-sync is mostly similar the commands below:
Code:
emerge --sync
eix-update

3) 'emerge --sync' syncs files in /usr/portage. If only a few packages have changed, emerge --sync won't write much data. If, on the other hand, package signatures have changed, it will touch many files.

4) 'eix-update' builds an index in /var/cach[/code]e/eix/. It will write approx. 10 MB every time you run it.


Last edited by mike155 on Fri Nov 16, 2018 12:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Thu Nov 15, 2018 3:29 pm    Post subject: Reply with quote

mike155 wrote:
Code:
tmpfs             /tmp                          tmpfs                         0 0
tmpfs             /var/tmp                      tmpfs                         0 0

Code:
tmpfs             /var/tmp/portage                      tmpfs                         0 0
b/c /var/tmp is intentionally the place for temp data which should survive a reboot.[/code]
Back to top
View user's profile Send private message
linuxfluesterer
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2016
Posts: 130
Location: Germany

PostPosted: Thu Nov 15, 2018 6:18 pm    Post subject: Reply with quote

mike155 wrote:
@all: this thread is related to: https://forums.gentoo.org/viewtopic-t-1089106-start-0-postdays-0-postorder-asc-highlight-.html

@linuxfluesterer:

1) In order to reduce writes to your SSD, you could add the lines below to /etc/fstab
Code:
tmpfs             /tmp                          tmpfs                         0 0
tmpfs             /var/tmp                      tmpfs                         0 0

There's no need to change PORTAGE_TMPDIR. If your machine already mounts /tmp as tmpfs, you don't need the first line. Be warned that if /var/tmp is smaller than 8GB, it might be too small to compile large packages (libreoffice, gcc, etc.).

2) eix-sync is mostly similar the commands below:
Code:
emerge --sync
eix-update


3) 'emerge --sync' syncs files in /usr/portage. If only a few packages have changed, emerge --sync won't write much data. If, on the other hand, package signatures have changed, it will touch many files.

4) 'eix-update' builds an index in /var/cach[/code]e/eix/. It will write approx. 10 MB every time you run it.


Thank you very much for quick reply, both of you!
I think, at least I will add /tmp as type tmpfs to my /etc/fstab. The other directory (/var/tmp) I will keep under investigation.

Have a nice evening!

-Linuxfluesterer
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Thu Nov 15, 2018 6:28 pm    Post subject: Reply with quote

IMO /tmp is not the problem, /var/tmp/portage however is mcuh more interesting. You might consider something like this too:
Code:
tfoerste@t44 ~ $ grep tmpdir /etc/portage/package.env/z_misc
dev-qt/qtwebengine        tmpdir
tfoerste@t44 ~ $ cat -v /etc/portage/env/tmpdir
PORTAGE_TMPDIR=/var
look at Gentoo wiki pages for details.
Back to top
View user's profile Send private message
linuxfluesterer
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2016
Posts: 130
Location: Germany

PostPosted: Thu Nov 15, 2018 9:39 pm    Post subject: Reply with quote

mike155 wrote:
@all: this thread is related to: https://forums.gentoo.org/viewtopic-t-1089106-start-0-postdays-0-postorder-asc-highlight-.html

@linuxfluesterer:

1) In order to reduce writes to your SSD, you could add the lines below to /etc/fstab
Code:
tmpfs             /tmp                          tmpfs                         0 0
tmpfs             /var/tmp                      tmpfs                         0 0

There's no need to change PORTAGE_TMPDIR. If your machine already mounts /tmp as tmpfs, you don't need the first line. Be warned that if /var/tmp is smaller than 8GB, it might be too small to compile large packages (libreoffice, gcc, etc.).


Sorry, this was no solution for me. After changing my fstab and rebooting then, the boot process stopped, so that I had to reboot with a Gentoo live USB stick to remove the before added lines (see above) on my Gentoo system on disk.

-Linuxfluesterer
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Fri Nov 16, 2018 2:39 am    Post subject: Reply with quote

mike155 wrote:
Code:
tmpfs             /tmp                          tmpfs                         0 0
In my opinion, an tmpfs that is world writable should have mount options to restrict abuse. I like nodev,noexec as standard. If you have a large amount of RAM, you may also want a size= parameter to restrict how much RAM the tmpfs can consume. If not specified, the default is for size=half-system-RAM.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Fri Nov 16, 2018 12:30 pm    Post subject: Reply with quote

Thanks for your replies. So my recommendation in my post above was incomplete and wrong in multiple ways. Sorry for that. It should have been:

In order to reduce writes to your SSD, you could add the lines below to /etc/fstab
Code:
tmpfs   /tmp               tmpfs   rw,nosuid,noatime,nodev,mode=1777          0 0
tmpfs   /var/tmp/portage   tmpfs   uid=portage,gid=portage,noatime,mode=775   0 0

Please consider:
  • If your machine already mounts /tmp as tmpfs, you don't need the first line.
  • You might want to add the 'size=' parameter to control the size of the tmpfs. If not specified, the default is for size=half-system-RAM.
  • Be warned that if /var/tmp/portage is smaller than 8GB, it might be too small to compile large packages (libreoffice, gcc, rust, etc.).
  • You might want to add additional flags like 'nosuid', 'noexec', ... (see post from Hu above)
Please read the articles below. They contain important additional information:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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