Gentoo: Emulating on FreeBSD 6.2-Stable

Today I decided to install the gentoo-stage3 (linux_dist-gentoo-stage3) emulation port on FreeBSD system. To my amazement it went quit well!

Note:

The use of this port as a linux_base

port is very discouraged

# pwd
/usr/ports/emulators/linux_dist-gentoo-stage3
# make install clean

Make sure Linux compatibility mode is enabled by loading “linux.ko” or adding to /etc/rc.conf:

linux_enable=”YES”

Additionally, make sure linprocfs is mounted in addition to linsysfs and devfs. My /etc/fstab looks like this:

linproc /usr/local/gentoo-stage3/proc linprocfs rw 0 0
linsysfs /usr/local/gentoo-stage3/sys linsysfs rw 0 0
devfs /usr/local/gentoo-stage3/dev devfs rw 0 0

Having the above is very important.

Add to /etc/make.conf

GENTOO_OPTIMIZED=i686

Setting up Gentoo:

1) Edit: /usr/local/gentoo-stage3/etc/make.conf

CFLAGS=”-O2 -march=i686 -pipe”
CHOST=”i686-pc-linux-gnu”
CXXFLAGS=”${CFLAGS}”

2) Download Portage

# chroot /usr/local/gentoo-stage3/ emerge sync

2) Update Portage

# chroot /usr/local/gentoo-stage3/ emerge portage

The update resulted in the following error, but a fix was found on: fourms.gentoo.org.

>>> md5 src_uri 😉 ca-certificates_20070303_all.deb
>>> Unpacking source…
>>> Unpacking ca-certificates_20070303_all.deb to /var/tmp/portage/ca-certificates-20070303-r1/work
unpack ca-certificates_20070303_all.deb: file format not recognized. Ignoring.
>>> Unpacking ./data.tar.gz to /var/tmp/portage/ca-certificates-20070303-r1/work

!!! ERROR: app-misc/ca-certificates-20070303-r1 failed.
!!! Function unpack, Line 362, Exitcode 0
!!! ./data.tar.gz does not exist
!!! If you need support, post the topmost build error, NOT this status message.

To fix simply do:

# emerge –resume –skipfirst

checking if mknod creates FIFOs…

# revdep-rebuild

Advertisements
This entry was posted in *Nix. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s