This is an old revision of the document!


How-to chroot into Gentoo

Files needed

Installing steps

  1. ln -s /mnt/HD_a2/bzip2 /mnt/HD_a2/bzcat
  2. mkdir /mnt/HD_a2/gentoo
  3. cd /mnt/HD_a2/gentoo
  4. /mnt/HD_a2/bzcat stage3-ppc-uclibc-2005.0.tar.bz2 | /mnt/HD_a2/tar -xvpf -
  5. cd /mnt/HD_a2/gentoo/usr
  6. /mnt/HD_a2/bzcat portage-latest.tar.bz2 | /mnt/HD_a2/tar -xvf -
  7. mount -o bind /dev /mnt/HD_a2/gentoo/dev
  8. mount -t proc none /mnt/HD_a2/gentoo/proc
  9. cp /etc/resolv.conf /mnt/HD_a2/gentoo/etc/
  10. /mnt/HD_a2/chroot /mnt/HD_a2/gentoo /bin/bash
  11. env-update && source /etc/profile
  12. rc-update add net.eth0 default
  13. rc-update add dropbear default
  14. passwd root

If you did choose to use 2005.0 stage then you must update e2fsprogs!

  1. emerge e2fsprogs

If you did choose to use 2006.1 stage then you must unemerge udev and emerge devfsd!

  1. emerge -C udev
  2. emerge devfsd

/etc/make.conf

CFLAGS="-Os -pipe -mcpu=603e -mtune=603e"
CHOST="powerpc-pc-linux-uclibc"
CXXFLAGS="-Os -pipe -mcpu=603e -mtune=603e"
LDFLAGS="-Wl,-z,relro"
USE="-*"
RSYNC_EXCLUDEFROM="/etc/portage/rsync_excludes"
SYNC="rsync://rsync1.ee.gentoo.org/gentoo-portage"
GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles ftp://ftp.linux.ee/pub/gentoo/distfiles"

/etc/fstab

/dev/sda3               /               ext3            noatime                 0 0
/dev/sda1               none            swap            sw                      0 0
none                    /proc           proc            defaults                0 0
none                    /dev/shm        tmpfs           defaults                0 0
none                    /dev/pts        devpts          gid=5,mode=620          0 0

/etc/conf.d/net

net is needed only if you are going to boot gentoo using loader.o or flashed custom kernel.

iface_eth0=( "192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0" )
routes_eth0=( "default via 192.168.1.1" )
dns_servers_eth0=( "192.168.1.1" )

/etc/conf.d/wireless

wireless is needed only if you are going to boot gentoo using loader.o or flashed custom kernel.
Get new (1.1.0 BETA4) rt2500.o from here.

iwpriv_yourssid=(
        "set AuthMode=WPAPSK"
        "set EncrypType=TKIP"
        "set WPAPSK=your-wpa-psk"
)
sleep_scan_ra0="5"
essid_ra0="yourssid"
channel_ra0="11"
prefarred_aps=( "yourssid" )
associate_order_ra0="forceprefarred"
dns_servers_yourssid=( "192.168.1.1" )
dns_domain_yourssid=( "you-domain" )
key_yourssid="s:your-wpa-psk enc open"
config_yourssid=( "192.168.1.3/24 brd 192.168.1.255" )
routes_yourssid=( "default via 192.168.1.1" )

/etc/portage/rsync_excludes

- app-accessibility/
- metadata/cache/app-accessibility/
- app-emulation/
- metadata/cache/app-emulation/
- app-laptop/
- metadata/cache/app-laptop/
- app-office/
- metadata/cache/app-office/
- app-pda/
- metadata/cache/app-pda/
- dev-games/
- metadata/cache/dev-games/
- games-*/
- metadata/cache/games-*/
- gnome-*/
- metadata/cache/gnome-*/
- kde-*/
- metadata/cache/kde-*/
- rox-*/
- metadata/cache/rox-*/
- media-tv/
- metadata/cache/media-tv/
- media-video/
- metadata/cache/media-video/
- sci-*/
- metadata/cache/sci-*/
- x11-*/
- metadata/cache/x11-*/
- xfce-*/
- metadata/cache/xfce-*/

Cleaning portage

  1. cd /usr/portage
  2. rm -r `gawk '{ printf(”%s ”,$2) }' /etc/portage/rsync_excludes`

Testing

  1. USE=unicode emerge links

chrooting

If you have exited from chroot environment after installing gentoo chroot or if you have rebooted your DSM-G600 then you need following commands to enter back in chroot environment.

  1. mount -o bind /dev /mnt/HD_a2/gentoo/dev
  2. mount -t proc none /mnt/HD_a2/gentoo/proc
  3. /mnt/HD_a2/chroot /mnt/HD_a2/gentoo /bin/bash

Links


Personal Tools