Differences

This shows you the differences between the selected revision and the current version of the page.

howto:chroot_gentoo 2007/06/02 16:35 howto:chroot_gentoo 2017/09/06 17:55 current
Line 3: Line 3:
===== Files needed ===== ===== Files needed =====
-  * [[http://download.dsmg600.info/bzip2-1.0.3.tar.bz2|bzip2]] +  * [[http://dns323.kood.org/downloads/bzip2-1.0.3.tar.bz2|bzip2]] 
-  * [[http://download.dsmg600.info/tar-1.15.92.tar.bz2|tar]] +  * [[http://dns323.kood.org/downloads/tar-1.15.92.tar.bz2|tar]] 
-  * [[http://download.dsmg600.info/chroot-5.97.tar.bz2|chroot]] +  * [[http://dns323.kood.org/downloads/chroot-5.97.tar.bz2|chroot]] 
-  * [[ftp://ftp.linux.ee/pub/gentoo/distfiles/experimental/ppc/embedded/stages/stage3-ppc-uclibc-2005.0.tar.bz2|stage3-ppc-uclibc-2005.0]] (recommended for gentoo chroot) or [[ftp://ftp.linux.ee/pub/gentoo/distfiles/experimental/ppc/embedded/stages/stage3-ppc-uclibc-2006.1.tar.bz2|stage3-ppc-uclibc-2006.1]] (recommended for gentoo boot). +  * [[http://ftp.eenet.ee/gentoo/experimental/ppc/embedded/stages/stage3-ppc-uclibc-2005.0.tar.bz2|stage3-ppc-uclibc-2005.0]] (recommended for gentoo chroot) or [[http://ftp.eenet.ee/gentoo/experimental/ppc/embedded/stages/stage3-ppc-uclibc-2006.1.tar.bz2|stage3-ppc-uclibc-2006.1]] (recommended for gentoo boot). Don't use 2008.0 stage because it is compiled against 2.6 kernel headers
-  * [[ftp://ftp.linux.ee/pub/gentoo/distfiles/snapshots/portage-latest.tar.bz2|portage]]+  * [[http://ftp.eenet.ee/gentoo/snapshots/portage-latest.tar.bz2|portage tree]]
===== Installing steps ===== ===== Installing steps =====
Line 14: Line 14:
  - ''mkdir /mnt/HD_a2/gentoo''   - ''mkdir /mnt/HD_a2/gentoo''
  - ''cd /mnt/HD_a2/gentoo''   - ''cd /mnt/HD_a2/gentoo''
-  - ''/mnt/HD_a2/bzcat stage3-ppc-uclibc-2005.0.tar.bz2 | /mnt/HD_a2/tar -xvpf -''+  - ''/mnt/HD_a2/bzcat /mnt/HD_a2/stage3-ppc-uclibc-2006.1.tar.bz2 | /mnt/HD_a2/tar -xvpf -''
  - ''cd /mnt/HD_a2/gentoo/usr''   - ''cd /mnt/HD_a2/gentoo/usr''
-  - ''/mnt/HD_a2/bzcat portage-latest.tar.bz2 | /mnt/HD_a2/tar -xvf -''+  - ''/mnt/HD_a2/bzcat /mnt/HD_a2/portage-latest.tar.bz2 | /mnt/HD_a2/tar -xvf -''
  - ''mount -o bind /dev /mnt/HD_a2/gentoo/dev''   - ''mount -o bind /dev /mnt/HD_a2/gentoo/dev''
  - ''mount -t proc none /mnt/HD_a2/gentoo/proc''   - ''mount -t proc none /mnt/HD_a2/gentoo/proc''
  - ''cp /etc/resolv.conf /mnt/HD_a2/gentoo/etc/''   - ''cp /etc/resolv.conf /mnt/HD_a2/gentoo/etc/''
  - ''/mnt/HD_a2/chroot /mnt/HD_a2/gentoo /bin/bash''   - ''/mnt/HD_a2/chroot /mnt/HD_a2/gentoo /bin/bash''
 +  - Update [[howto:chroot_gentoo#etc_make.conf|/etc/make.conf]]
 +  - Update [[howto:chroot_gentoo#etc_conf.d_net|/etc/conf.d/net]]
  - ''env-update && source /etc/profile''   - ''env-update && source /etc/profile''
  - ''rc-update add net.eth0 default''   - ''rc-update add net.eth0 default''
  - ''rc-update add dropbear default''   - ''rc-update add dropbear default''
  - ''passwd root''   - ''passwd root''
-**If you did choose to use 2005.0 stage then you must update e2fsprogs!** +  - **If you did choose to use 2005.0 stage then you must update e2fsprogs!** ''emerge e2fsprogs'' 
-  - ''emerge e2fsprogs'' + - **If you are going to hddboot, always make sure that devfsd is installed!** ''emerge -pv devfsd'' 
-**If you did choose to use 2006.1 stage then you must unemerge udev and emerge devfsd!** +  - **It is also recommended that you update sys-apps/baselayout package. Its needed by net configuration to change mac address.** However, by default, baselayout pulls in and builds module-init-tools with support only for 2.6 kernels. So, to allow the updated module-init-tools to be built with support for both 2.4 and 2.6 kernels: ''echo %%"sys-apps/module-init-tools      old-linux" >> %%/etc/portage/package.use'' 
-  - ''emerge -C udev'' +  - ''emerge sys-apps/baselayout'' 
-  - ''emerge devfsd''+
==== /etc/make.conf ==== ==== /etc/make.conf ====
<code> <code>
Line 37: Line 39:
LDFLAGS="-Wl,-z,relro" LDFLAGS="-Wl,-z,relro"
USE="-*" USE="-*"
-RSYNC_EXCLUDEFROM="/etc/portage/rsync_excludes"+PORTAGE_RSYNC_EXTRA_OPTS="—exclude-from=/etc/portage/rsync_excludes"
SYNC="rsync://rsync1.ee.gentoo.org/gentoo-portage" SYNC="rsync://rsync1.ee.gentoo.org/gentoo-portage"
GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles ftp://ftp.linux.ee/pub/gentoo/distfiles" GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles ftp://ftp.linux.ee/pub/gentoo/distfiles"
Line 54: Line 56:
net is needed only if you are going to boot gentoo using loader.o or flashed custom kernel. net is needed only if you are going to boot gentoo using loader.o or flashed custom kernel.
<code> <code>
-iface_eth0=( "192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0" ) +config_eth0=( "yourNASip netmask 255.255.255.0 broadcast yourBroadcastAddress" ) 
-routes_eth0=( "default via 192.168.1.1" ) +routes_eth0=( "default gw yourGatewayAddress" ) 
-dns_servers_eth0=( "192.168.1.1" )+mac_eth0="yourMACaddress" 
 +dns_servers_eth0=( "yourDNSserverAddress" ) 
 +</code> 
 + 
 +Example : 
 +<code> 
 +config_eth0=( "192.168.0.20 netmask 255.255.255.0 broadcast 192.168.0.255" ) 
 +routes_eth0=( "default gw 192.168.0.254" ) 
 +mac_eth0="00:15:E9:6D:22:11" 
 +dns_servers_eth0=( "212.20.30.40" )
</code> </code>
==== /etc/conf.d/wireless ==== ==== /etc/conf.d/wireless ====
wireless is needed only if you are going to boot gentoo using loader.o or flashed custom kernel.\\ 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 [[http://download.dsmg600.info/people/sala/rt2500.o|here]].+Get new (1.1.0 BETA4) rt2500.o from [[http://download.dsmg600.info/people/sala/rt2500.o|here]]. For more info look [[http://forum.dsmg600.info/p26074-Today-17%3A03%3A31.html#p26074|here]].
<code> <code>
Line 122: Line 133:
  - ''USE=unicode emerge links''   - ''USE=unicode emerge links''
 +==== Additional software ====
 +  * [[http://dns323.kood.org/forum/t788-ntpclient-gentoo-hdd-boot-chroot.html|NTPclient]]
 +  * [[http://dns323.kood.org/forum/t955-chkbutton-replacement.html|DSMG600 button and leds]]
===== chrooting ==== ===== chrooting ====
Line 129: Line 143:
  - ''mount -t proc none /mnt/HD_a2/gentoo/proc''   - ''mount -t proc none /mnt/HD_a2/gentoo/proc''
  - ''/mnt/HD_a2/chroot /mnt/HD_a2/gentoo /bin/bash''   - ''/mnt/HD_a2/chroot /mnt/HD_a2/gentoo /bin/bash''
 +
 +==== Chrooted DropBear ====
 +
 +will fail by default due to the default kernel not supporting uni98 ptys.
 +
 +Correct build:
 +<code>
 +EXTRA_ECONF=--disable-openpty emerge dropbear
 + </code>
 +
 +First time installation:
 +<code>
 +ln -s /dev/urandom /dev/random
 +mkdir /etc/dropbear/
 +/usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
 +/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
 +</code>
 +
 +Auto-start from fun_plug (assuming a working busybox):
 +<code>
 +ln -s /mnt/HD_a2/bin/busybox /bin/chroot
 +ln -s /mnt/HD_a2/bin/busybox /bin/makedevs
 +cd /dev
 +/bin/makedevs ptyp c 2 0 0 9
 +/bin/makedevs ttyp c 3 0 0 9
 +ln -s urandom random
 +
 +mount -o bind /dev /mnt/HD_a2/gentoo/dev
 +mount -t proc none /mnt/HD_a2/gentoo/proc
 +cp /etc/resolv.conf /mnt/HD_a2/gentoo/etc/
 +
 +/bin/chroot /mnt/HD_a2/gentoo /usr/sbin/dropbear
 +</code>
===== Successful Gentoo boot log ===== ===== Successful Gentoo boot log =====
Line 279: Line 326:
* Starting local ...                                                    [ ok ] * Starting local ...                                                    [ ok ]
INIT: no more processes left in this runlevel</code> INIT: no more processes left in this runlevel</code>
 +
 +===== Troubleshooting =====
 +  * If you can't get to the login then press ctrl+c right after /dev and sda3 is mounted.
 +  * If your root file system is read-only then use ''mount -t ext3 -o rw,remount /dev/sda3 /'' to get write access.
 +  * Current e2fsprogs 1.40.4 fails to build with following error: ''../../lib/libuuid.so: undefined reference to `___tls_get_addr' '' See http://bugs.gentoo.org/show_bug.cgi?id=204102 for more details. Workaround is to use version 1.40.3 by running ''echo '>=sys-fs/e2fsprogs-1.40.4' >> /etc/portage/package.mask'' before emerging.
 +==== Installing an older package ====
 +Current version gentoo packages may not work on DSM-G600.
 +If you gets Masked packages because of unsupported EAPI or package only support kernel 2.6,
 +try to install an older package by browsing to /usr/portage///category/application// or going to the CSV tree :
 +[[http://sources.gentoo.org/viewcvs.py/gentoo-x86/]]
 +and searching older version of the package.
 +Once the version found, install it with this command :
 +<code>
 +emerge -av =category/package-version
 +</code>
===== Links ===== ===== Links =====
-  * [[http://forum.dsmg600.info/t18-Gentoo-howto.html|Forum thread]]+  * [[http://dns323.kood.org/forum/t18-Gentoo-howto.html|Forum thread]]
  * [[http://www.gentoo.org/doc/en/handbook/handbook-ppc.xml?full=1|Gentoo handbook]]   * [[http://www.gentoo.org/doc/en/handbook/handbook-ppc.xml?full=1|Gentoo handbook]]

Personal Tools