aboutsummaryrefslogtreecommitdiff
blob: 73b1ea3dddd7ef2da52ef77207f1891c5d8ec14a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/sbin/runscript

depend() {
   need localmount
   need bootmisc
}

start() {
    ebegin "Mounting 32bits chroot dirs"
    mount -o bind /dev /chroot/x86/dev >/dev/null
    mount -o bind /dev/pts /chroot/x86/dev/pts >/dev/null
    mount -o bind /dev/shm /chroot/x86/dev/shm >/dev/null
    mount -o bind /proc /chroot/x86/proc >/dev/null
    mount -o bind /proc/bus/usb /chroot/x86/proc/bus/usb >/dev/null
    mount -o bind /sys /chroot/x86/sys >/dev/null
    mount -o bind /tmp /chroot/x86/tmp >/dev/null
    mount -o bind /usr/portage /chroot/x86/usr/portage/ >/dev/null
    mount -o bind /usr/portage/distfiles /chroot/x86/usr/portage/distfiles/ >/dev/null
    mount -o bind /usr/local/portage /chroot/x86/usr/local/portage/ >/dev/null
    eend $? "An error occured while attempting to mount 32bit chroot directories"
    ebegin "Copying 32bits chroot files"
    cp -pf /etc/resolv.conf /chroot/x86/etc >/dev/null
    cp -pf /etc/passwd /chroot/x86/etc >/dev/null
    cp -pf /etc/shadow /chroot/x86/etc >/dev/null
    cp -pf /etc/group /chroot/x86/etc >/dev/null
    cp -pf /etc/gshadow /chroot/x86/etc >/dev/null
    cp -pf /etc/hosts /chroot/x86/etc > /dev/null
    cp -Ppf /etc/localtime /chroot/x86/etc >/dev/null
    eend $? "An error occured while attempting to copy x86 chroot files."
}

stop() {
    ebegin "Unmounting 32bits chroot dirs"
    umount -f /chroot/x86/dev/pts >/dev/null
    umount -f /chroot/x86/dev/shm >/dev/null
    umount -f /chroot/x86/dev >/dev/null
    umount -f /chroot/x86/proc/bus/usb >/dev/null
    umount -f /chroot/x86/proc >/dev/null
    umount -f /chroot/x86/sys >/dev/null
    umount -f /chroot/x86/tmp >/dev/null
    umount -f /chroot/x86/usr/portage/distfiles >/dev/null
    umount -f /chroot/x86/usr/portage >/dev/null
    umount -f /chroot/x86/usr/local/portage >/dev/null
    eend $? "An error occured while attempting to unmount x86 chroot directories"
}