1 |
On Sunday, August 21, 2011 10:41:56 AM Peter Humphrey wrote: |
2 |
> On Sunday 21 August 2011 04:04:05 Matthew Finkel wrote: |
3 |
> > On Sat, Aug 20, 2011 at 10:46 PM, Dale <rdalek1967@×××××.com> wrote: |
4 |
> > > How hard is it to set up a 64 bit machine to compile programs for a |
5 |
> > > 32 |
6 |
> > > bit system? |
7 |
> > > |
8 |
> > > Dale |
9 |
> > > |
10 |
> > > :-) :-) |
11 |
> > |
12 |
> > It's actually quite easy. IIRC, when I did it last, the only difference |
13 |
> > is that when you chroot into the subsystem you need prefix the command |
14 |
> > with linux32, e.g. linux32 chroot /path/to/chroot /bin/bash |
15 |
> |
16 |
> Yes, just follow this guide: |
17 |
> http://www.gentoo.org/proj/en/base/amd64/howtos/chroot.xml |
18 |
> |
19 |
> I did that and it was straightforward as far as I remember. I did spend some |
20 |
> time thinking at a few stages, to get an understanding of what I was doing |
21 |
> rather than just blindly following somebody else's prescription. |
22 |
> |
23 |
> Then it's a matter of writing some simple scripts to mount the packages |
24 |
> directory on the big host. Here's mine, most of which I scrounged from |
25 |
> somewhere: |
26 |
> |
27 |
> $ cat /etc/init.d/atom |
28 |
> #!/sbin/runscript |
29 |
> |
30 |
> depend() { |
31 |
> need localmount |
32 |
> need bootmisc |
33 |
> } |
34 |
> |
35 |
> start() { |
36 |
> ebegin "Mounting 32-bit chroot dirs" |
37 |
> mount -o bind /dev /mnt/atom/dev >/dev/null |
38 |
> mount -o bind /dev/pts /mnt/atom/dev/pts >/dev/null |
39 |
> mount -o bind /dev/shm /mnt/atom/dev/shm >/dev/null |
40 |
> mount -t proc /proc /mnt/atom/proc >/dev/null |
41 |
> mount -o bind /sys /mnt/atom/sys >/dev/null |
42 |
> mount -o bind /tmp /mnt/atom/tmp >/dev/null |
43 |
> mount -t nfs -o vers=3 192.168.2.2:/usr/portage/packages |
44 |
> /mnt/atom/usr/portage/packages |
45 |
> eend $? "An error occurred while attempting to mount 32-bit chroot |
46 |
> directories" |
47 |
> ebegin "Copying 32-bit chroot files" |
48 |
> cp -pf /etc/resolv.conf /mnt/atom/etc/ >/dev/null |
49 |
> cp -pf /etc/passwd /mnt/atom/etc/ >/dev/null |
50 |
> cp -pf /etc/shadow /mnt/atom/etc/ >/dev/null |
51 |
> cp -pf /etc/group /mnt/atom/etc/ >/dev/null |
52 |
> cp -pf /etc/hosts /mnt/atom/etc/ > /dev/null |
53 |
> cp -Ppf /etc/localtime /mnt/atom/etc/ >/dev/null |
54 |
> eend $? "An error occurred while attempting to copy 32-bit chroot |
55 |
> files." } |
56 |
> |
57 |
> stop() { |
58 |
> ebegin "Unmounting 32-bit chroot dirs" |
59 |
> umount -f /mnt/atom/dev/pts >/dev/null |
60 |
> umount -f /mnt/atom/dev/shm >/dev/null |
61 |
> umount -f /mnt/atom/dev >/dev/null |
62 |
> umount -f /mnt/atom/proc >/dev/null |
63 |
> umount -f /mnt/atom/sys >/dev/null |
64 |
> umount -f /mnt/atom/tmp >/dev/null |
65 |
> umount -f /mnt/atom/usr/portage/packages >/dev/null |
66 |
> eend $? "An error occurred while attempting to unmount 32-bit chroot |
67 |
> directories" |
68 |
> } |
69 |
> |
70 |
> I could list the steps of my daily routine to upgrade both the client and |
71 |
> the chroot if that would help. |
72 |
|
73 |
That would help as I'm planning on setting this up myself as well for my |
74 |
netbook. |
75 |
|
76 |
Is there a way to automate the steps inside the chroot without having to have |
77 |
a script inside the chroot? |
78 |
|
79 |
-- |
80 |
Joost |