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