1 |
Peter Humphrey wrote: |
2 |
> On Friday 01 August 2014 14:07:08 I wrote: |
3 |
> |
4 |
>> I run a couple of chroots on this box to build packages for other boxes on |
5 |
>> the LAN. So far, I haven't worked out what I should populate /etc/mtab with |
6 |
>> in each chroot. Is it enough to "grep ext4 /etc/mtab > |
7 |
>> /mnt/chroot/etc/mtab"? That catches all the physical partitions, but I |
8 |
>> imagine I need to add some /proc, /sys and /dev entries as well, but is |
9 |
>> there a simple formula for doing this? |
10 |
> I meant to add that one chroot is 32-bit and the other is 64. The host is an |
11 |
> i5 running openrc. |
12 |
> |
13 |
|
14 |
It has been a good while since I used this. So, make sure it makes |
15 |
sense to you before trying this. This may not work if something has |
16 |
changed in the past several years. Use with caution if at all. |
17 |
|
18 |
This is a little script, if you want to call it that, that I used to do |
19 |
mine. It also lists the command to use to do a 32 bit chroot from a 64 |
20 |
bit rig. Here it is: |
21 |
|
22 |
root@fireball / # cat /root/xx.chroot-mount-32bit |
23 |
|
24 |
|
25 |
mount -o bind /dev /mnt/gentoo32/dev |
26 |
mount -o bind /dev/pts /mnt/gentoo32/dev/pts |
27 |
mount -o bind /dev/shm /mnt/gentoo32/dev/shm |
28 |
mount -o bind /proc /mnt/gentoo32/proc |
29 |
mount -o bind /proc/bus/usb /mnt/gentoo32/proc/bus/usb |
30 |
mount -o bind /sys /mnt/gentoo32/sys |
31 |
mkdir -p /mnt/gentoo32/usr/portage/ |
32 |
mount -o bind /usr/portage /mnt/gentoo32/usr/portage/ |
33 |
|
34 |
|
35 |
echo " mounting finished" |
36 |
|
37 |
echo "run linux32 chroot /mnt/gentoo32 /bin/bash next" |
38 |
root@fireball / # |
39 |
|
40 |
|
41 |
You may have different mount points at the very least so edit to match |
42 |
what you have. Again, things could have changed and that no longer will |
43 |
work. It may not be a bad idea to let someone who has done this more |
44 |
recently to give a thumbs up to that. |
45 |
|
46 |
That last command should be: |
47 |
|
48 |
linux32 chroot /mnt/gentoo32 /bin/bash |
49 |
|
50 |
Dale |
51 |
|
52 |
:-) :-) |