1 |
First of all, thanks to everybody who answered my questions, and |
2 |
helped me get it working. Now for the setup. This is a home LAN, so I |
3 |
don't bother with ssh tunneling, etc, which will be necessary if you're |
4 |
going over untrusted links, e.g. the public internet. |
5 |
|
6 |
* The host, IP address 192.168.123.251, is an over 7 year old Dell |
7 |
Dimension 530 with a Core Duo, running 64-bit Gentoo. It will |
8 |
compile for the client. |
9 |
|
10 |
* The client, IP address 192.168.123.253, is an ancient Acer netbook, |
11 |
with an Atom CPU so old that it only runs 32-bit mode. |
12 |
|
13 |
*** On the host *** |
14 |
===================================================================== |
15 |
|
16 |
* emerge crossdev |
17 |
|
18 |
* build a toolchain that can compile for the client's architecture... |
19 |
|
20 |
crossdev -S -t <client's CHOST> |
21 |
|
22 |
You need to know what the CHOST variable is in the client's make.conf. |
23 |
e.g. on my netbook CHOST="i686-pc-linux-gnu" so the command would be |
24 |
|
25 |
crossdev -S -t i686-pc-linux-gnu |
26 |
|
27 |
The "-S" tells crossdev to build the latest stable gcc and utilities |
28 |
version. The default (without the "-S") is to build the absolute latest |
29 |
version available, as if gcc and utilities were keyworded. Note that |
30 |
the gcc versions must be essentially the same on the client and the |
31 |
server crossdev toolchain. E.g. for gcc-a.b.c, the 3rd part (the |
32 |
revison # "c") can differ. But if either the major or minor version |
33 |
portions differ, you are guaranteed to have problems. |
34 |
|
35 |
* emerge distcc |
36 |
|
37 |
* edit the DISTCCD_OPTS variable to indicate allowed clients. On my |
38 |
host machine, it's... |
39 |
|
40 |
DISTCCD_OPTS="--port 3632 --log-level notice --log-file /var/log/distccd.log -N 15 --allow 192.168.123.253" |
41 |
|
42 |
Notes; |
43 |
- The default port is 3632 |
44 |
- "N" is the "nice" level. |
45 |
- you can allow multiple addresses, e.g. |
46 |
"--allow 192.168.123.253 --allow 169.254.0.1" etc. |
47 |
|
48 |
* start up the distccd daemon with the command |
49 |
/etc/init.d/distccd start |
50 |
|
51 |
* optionally set it to come up whenever the machine boots up |
52 |
rc-update add distccd default |
53 |
|
54 |
*** On the client *** |
55 |
===================================================================== |
56 |
|
57 |
specify host(s) in /etc/distcc/hosts e.g. in my case |
58 |
|
59 |
192.168.123.251/6,lzo,cpp |
60 |
|
61 |
Notes; |
62 |
- you can have multiple entries, using a space as the separator. The |
63 |
leftmost entry will be the preferred host, and any additional entries |
64 |
will have descending priority. |
65 |
- the "/6" is not a CIDR number. It specifies how many simultaneous |
66 |
jobs to send to that server. The optimal number will vary depending |
67 |
on how powerful the server is, and whether it's also being used as a |
68 |
desktop, etc. |
69 |
- The "lzo" entry specifies lzo compression. It is necessary for "pump" |
70 |
mode. You will want pump mode. |
71 |
- The "cpp" entry is also necessary for "pump" mode. You will want pump |
72 |
mode. |
73 |
|
74 |
If you have "distcc distcc-pump" in FEATURES in make.conf, the |
75 |
"emerge" command will transparently invoke pump mode. Without them, |
76 |
builds will be done locally. Does that mean you have to edit your |
77 |
make.conf file each time you switch between local and distcc builds? |
78 |
NO. Remember how you can temporarily modify the USE variable for an |
79 |
emerge like so... |
80 |
|
81 |
USE="foo" emerge bar |
82 |
|
83 |
...the exact same method works for the FEATURES variable. |
84 |
|
85 |
* do *NOT* put "distcc distcc-pump" directly into FEATURES in make.conf |
86 |
|
87 |
* make an executable script /root/bin/xmerge with 2 lines... |
88 |
|
89 |
#!/bin/bash |
90 |
FEATURES="distcc distcc-pump" emerge ${*} |
91 |
|
92 |
Now compare the outputs of... |
93 |
emerge --info | grep ^FEATURES |
94 |
xmerge --info | grep ^FEATURES |
95 |
|
96 |
aa1 portage # emerge --info | grep ^FEATURES |
97 |
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" |
98 |
|
99 |
|
100 |
aa1 portage # xmerge --info | grep ^FEATURES |
101 |
FEATURES="assume-digests binpkg-logs distcc distcc-pump distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" |
102 |
|
103 |
Your FEATURES options will probably differ from mine. The important |
104 |
point is that when launched from the xmerge script, emerge sees the |
105 |
options "distcc distcc-pump" in FEATURES, and transparently uses distcc. |
106 |
When launched directly from the command line, emerge won't see this, and |
107 |
will therefore build locally. In the above example, only the parameter |
108 |
"--info" was passed to xmerge. But you can pass any legal energe |
109 |
parameters to xmerge, e.g. |
110 |
|
111 |
xmerge --changed-use --deep --update @world |
112 |
|
113 |
-- |
114 |
Walter Dnes <waltdnes@××××××××.org> |
115 |
I don't run "desktop environments"; I run useful applications |