Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [SOLVED] gcc-6.4.0-r1::gentoo failed (compile phase)
Date: Wed, 28 Mar 2018 18:08:29
Message-Id: 899d5b2b-c748-b9aa-7df0-327d8834e8cd@sys-concept.com
In Reply to: Re: [gentoo-user] [SOLVED] gcc-6.4.0-r1::gentoo failed (compile phase) by Peter Humphrey
1 On 03/28/2018 10:40 AM, Peter Humphrey wrote:
2 > On Wednesday, 28 March 2018 16:14:49 BST thelma@×××××××××××.com wrote:
3 >> On 03/28/2018 01:32 AM, Peter Humphrey wrote:
4 > [...]
5 >>> I have a similar system, but Atom N270. I wouldn't want to compile much on
6 >>> it, and certainly not GCC. I NFS-export its $PORTDIR to this much more
7 >>> powerful box, do the emerging here and then just install packages on the
8 >>> Atom. Still not exactly fast, but incomparably better.
9 >>
10 >> I should have done it as well, it is a bit too late I have only
11 >> 45-packages left to compile out of 710.
12 >> Is it better use NFS or distcc?
13 >> Do you have a good link how to do it with: "NFS-export $PORTDIR"
14 >
15 > I think NFS may be simpler to operate, but that may be because I'm more
16 > familiar with it. You just need something like this in the Atom's /etc/
17 > exports: /usr/portage 192.168.1.5(rw,no_subtree_check,anonuid=250,anongid=250,no_wdelay)
18 >
19 > That IP address is the big beast host, and of course 250 is the portage user.
20 >
21 > I don't know of a guide on the web, but basically, the method is to construct
22 > a 32-bit chroot on your host system and install a mirror of your Atom system
23 > in it. Copy your Atom's /etc/portage directory into the chroot and adjust
24 > things like --jobs to suit the chroot host, but make sure all the USE flags
25 > are the same as on the Atom. It'll take an hour or two to build the system,
26 > but you only have to do it once, and of course it'll be done at the speed of
27 > your host machine. You don't need to keep running etc-update or equivalent;
28 > just build the binaries.
29 >
30 > My chroot is /mnt/atom and this script starts it ready to chroot into:
31 >
32 > $ cat /etc/init.d/atom
33 > #!/sbin/openrc-run
34 >
35 > depend() {
36 > need localmount
37 > need bootmisc
38 > }
39 >
40 > start() {
41 > ebegin "Mounting 32-bit chroot dirs under /mnt/atom"
42 > mount -t proc /proc /mnt/atom/proc
43 > mount --rbind /dev /mnt/atom/dev
44 > mount --rbind /sys /mnt/atom/sys
45 > mount -t tmpfs tmpfs -o noatime,nosuid,nodev,noexec,mode=1777 /mnt/atom/tmp
46 > mount -t tmpfs tmpfs -o noatime,uid=portage,gid=portage,mode=0775 /mnt/atom/var/tmp/portage
47 > mount -t nfs -o vers=3 192.168.1.2:/usr/portage /mnt/atom/usr/portage
48 > rm -f /mnt/atom/etc/mtab
49 > cp /etc/mtab.atom /mnt/atom/etc/mtab
50 > eend $? "Error mounting 32-bit chroot directories"
51 > }
52 >
53 > stop() {
54 > ebegin "Unmounting 32-bit /mnt/atom chroot dirs"
55 > rm /mnt/atom/etc/mtab
56 > ln -s /proc/self/mounts /mnt/atom/etc/mtab
57 > umount -R /mnt/atom
58 > mount /mnt/atom
59 > }
60 >
61 > You may prefer not to bother with tmpfs, but I have 32GB RAM on my host, so
62 > it's efficient here. That IP address is the Atom machine.
63 >
64 > No doubt someone more skilled than me at bash scripting could improve on my
65 > script; suggestions welcome.
66 >
67 > After updating the chroot you can emerge -k or -K on your Atom machine, after
68 > syncing which will now be the most time-consuming part of the operation.
69 >
70 > Let me know if anything isn't clear.
71 >
72 > Thanks to Neil Bothwick, who showed me how to do this several years ago.
73
74 I will try do it but I'm trying to decipher the code your wrote :-)
75 My atom-330 is 64-bit.
76 I think your approach was discussed in this forum topic:
77 https://forums.gentoo.org/viewtopic-p-6817608.html#6817608
78
79 -------copy------------
80 #!/bin/sh
81
82 HOST=${0##*/}
83 HOST=${HOST#*-}
84
85 mkdir -p --mode=0755 /mnt/${HOST}
86
87 mount -t nfs -o rw,intr,noatime,actimeo=60,vers=4,fsc ${HOST}:/ /mnt/${HOST}
88 mount --bind /dev /mnt/${HOST}/dev
89 mount --bind /dev/shm /mnt/${HOST}/dev/shm
90 mount --bind /proc /mnt/${HOST}/proc
91 mount --bind /sys /mnt/${HOST}/sys
92 mount --bind /usr/portage /mnt/${HOST}/usr/portage
93 mount --bind /usr/local/portage /mnt/${HOST}/usr/local/portage
94 mount --bind /var/tmp/portage /mnt/${HOST}/var/tmp/portage
95
96 env -i - HOME="/root" TERM="$TERM" chroot /mnt/${HOST} /bin/bash -l
97
98 umount /mnt/${HOST}/dev/shm
99 umount /mnt/${HOST}/dev
100 umount /mnt/${HOST}/proc
101 umount /mnt/${HOST}/sys
102 umount /mnt/${HOST}/usr/portage
103 umount /mnt/${HOST}/usr/local/portage
104 umount /mnt/${HOST}/var/tmp/portage
105 umount /mnt/${HOST}
106 ------end copy--------------
107
108 In the link above I think the Moderator suggested the change:
109 ...
110 mkdr /var/tmp/portage/$HOST
111 mount --bind /var/tmp/portage/$HOST /mnt/${HOST}/var/tmp/portage
112 ---
113
114 I'm still searching for a good guid howto over NFS.
115 It is till not clear to me what to do before or after. I need to start
116 with emerging NFS :-/
117
118 On my Atom-330 with MAKEOPTS="-j1" it took me over 12-hours to compile
119 just gcc-6.4.0-r1 :-/
120 and I have server on that network 8-core AMD with 32-GB or RAM (so I
121 might as well put it into a good use).
122
123 --
124 Thelma

Replies