Gentoo/DragonFly

Table of Contents

1 Project Description

Gentoo/DragonFly is aim to create a DragonFly based Gentoo system like Gentoo/FreeBSD dose on FreeBSD base.

This project is first developed as a project for Google Summer of Code 2010.

2 Installation Guide

2.1 About the Gentoo Linux Installation

Most process is similar to Gentoo/Linux installation. If you don't know how it would be done, you can read "How is the Installation Structured?" section of this page.

2.2 Get the Installation Medium

Get "dfly-i386-2.6.3_REL.iso.bz2" from DragonFly official site, or you can use mirror sites instead.

$ wget http://.../dfly-i386-2.6.3_REL.iso.bz2
$ bunzip2 dfly-i386-2.6.3_REL.iso.bz2

Boot with the iso and login as root.

2.3 Configuring your Network

First, determine your ethernet device name with "ifconfig".

Here, "em0" is the device name. Now, you can use "dhclient" to automatically config your device.

2.4 Preparing the Disks

2.4.1 Partition your Disk

First determine your disk status.

OK. I'll setup DragonFly partition on /dev/ad0

# gpt create ad0
(you may warn or find error here. 
check your disk twice and try "gpt create -f" or "gpt destroy")
# gpt boot ad0
# gpt add ad0
ad0s1 added
# gpt show ad0
(...)

Edit disk label.

# disklabel -B -r -w ad0s0 auto
# disklable -e ad0s0 # vi is invoked, edit like below

# disklabel -r -w ad0s1 auto
# disklabel -e ad0s1 # vi is invoked, edit like below

Use first 1GB(1g) for swap.

2.4.2 Creating Filesystems

deviceFilesystemmount point
/dev/ad0s0aUFS/boot
/dev/ad0s1bHAMMER/
# newfs /dev/ad0s0a
# newfs_hammer -L ROOT /dev/ad0s1b

UFS for /boot

and HAMMER for / (labeled as "ROOT")

HAMMER is designed for use on storage media greater than 50G. if your disk is less than it, you should use UFS instead (like above).

and don't forget to enable swap :)

# swapon /dev/ad0s1a

2.4.3 Mounting

Now your partitions are ready. Use "mount" command to mount them.

# mkdir -p /var/mnt/gentoo
# mount_hammer /dev/ad0s1b /var/mnt/gentoo
# mkdir /var/mnt/gentoo/boot
# mount /dev/ad0s0a /var/mnt/gentoo/boot

2.5 Installing the Gentoo Installation Files

2.5.1 Installing a Stage Tarball

First check your date/time and update it with "date".

# date 201010211254
(or just specify HHMM)
# date 1254

Go to Gentoo mount point.

# cd /var/mnt/gentoo
# curl -O http://elisp.net/gentoo-dragonfly/files/stage3-x86-20101010.tar.bz2
# tar xvjpf stage3-x86-20101010.tar.bz2

2.5.2 Installing Portage

See Installing Portage section of Gentoo Handbook to fetch and unpack official portage tree.

# curl -O http://.../portage-latest.tar.bz2
# cd /var/mnt/gentoo/usr
# tar xvjf ../portage-latest.tar.bz2

2.5.3 Chrooting

As descibed in the Handbook, let's chroot inside Gentoo environment.

# cp -L /etc/resolve.conf /var/mnt/gentoo/etc/
# mount_null /dev /var/mnt/gentoo/dev
# mount_procfs none /var/mnt/gentoo/proc
# chroot /var/mnt/gentoo/ /bin/bash
# env-update
# source /etc/profile

2.6 Configuring Portage

2.6.1 Updating Portage tree

# emerge --sync

Then you need to setup dragonfly overlay.

# wget http://elisp.net/gentoo-dragonfly/files/dragonfly-overlay-20101021.tar.bz2
# mkdir -p /usr/local/portage
# cd /usr/local/portage
# tar xvjf /dragonfly-overlay-20101021.tar.bz2
# chown -R portage:portage /usr/local/portage
# cd /etc
# ln -sf ../usr/local/portage/dragonfly/profiles/default/bsd/dfbsd/x86/2.6 make.profile

and edit "/etc/make.conf" and add "PORTDIR_OVERLAY='/usr/local/portage/dragonfly'". You may need to "emerge -­-metadata" to speed up your emerge.

2.7 Configuring the Kernel

2.7.1 Timezone

Check and fix your timezone

See the Handbook for detail

2.7.2 Installing and Building the Souces

You have only one choice on Gentoo/DragonFly. emerge it :D.

dfbsd-sources need git. so the emerge process would take some minutes.

# emerge dfbsd-sources
# cd /usr/src/sys/config
# config GENERIC
# cd ../compile/GENERIC
# make cleandepend && make depend && make && make install

2.8 Configuring your System

2.8.1 Filesystem

Setup /etc/fstab to mount filesystems automatically or easily.

Don't forget to add daily cron job "hammer cleanup" if you use HAMMER.

2.8.2 Networking Information

Don't forge to emerge dhcpcd if you use it.

2.9 Configuring the Bootloader

# boot0cfg -s 2 ad0  (2 is partition number of /)
# echo 'vfs.root.mountfrom="hammer:ad0s1b"' >> /boot/loader.conf

2.10 Finish!

unmount everything and try reboot!

3 Development

Portage Overlay Repository

If you are interesting in developing Gentoo/DragonFly, please e-mail me. <naota@elisp.net>

4 Developers

DeveloperNick
Naohiro Aotanaota

Author: Naohiro Aota

Date: 2010-10-21 Thu

HTML generated by org-mode 7.01 in emacs 24