Search:  
Gentoo Wiki

Build_NetBSD_on_Gentoo

Contents

why build NetBSD on Gentoo Linux ?

It is easy to do.

It could be very practical - in daily use or just for evaluating NetBSD. .

build netbsd easy

This script is a easy way to take a look into the latest NetBSD for peoples wich are new to netbsd.

But a lot of peoples run a gentoo host within their network to provide and distribute many different open source distributions and builds for different machines.

If you plan to use netbsd too this script is a easy way to get a current NetBSD installation CD (iso image), install sets for different installation types (by DOS, PXE network boot, floppies etc) and a full distribution tree for your target machine(s).

netbsd in XEN

In a Xen environment this distribution includes a specialized NetBSD kernel (XEN3_DOMU_NIELS) - optimized for high load servers and many users. The official XEN_DOMU build from NetBSD is not suitable for bigger server installations - but NetBSD is a very perfect server operating system.

customize netbsd XEN DOMU kernel

You can customize your XEN DOMU kernel if you wont.

For this just uncomment these two lines before you run the script netbsd-build.sh:

## uncomment the following two lines in case you will make your own kernel config
nano ~/netbsd/XEN3_DOMU_NIELS
nano ~/netbsd/XEN2_DOMU_NIELS


i want no i386 netbsd?

No prob, just change the ./build.sh machine option "-m i386" to your target arch or machine as required.


running the script

You should be on a shell as a normal user (root is not necessary).

Download netbsd-build.sh and / or Copy this script "netbsd-build.sh" - i.e. to somewhere within your home directory.

The script creates a directory netbsd within your current home directory.

The whole build would be done under this directory.

#####################################################
## netbsd-build.s## v0.3
## this script builds a complete current netbsd
## distribution and a ready to use install CD/DVD 
## image (iso image)
##
## features:
## - includes GENERIC netbsd kernel
## - includes a customized XEN DOMU kernel
## - optimized XEN DOMU for high load internet servers
## - includes or excludes X11
##
## (should be usable under each linux distribution
## and most unixes)
##
## by Niels Dettenbach <nd@syndicat.com>
## http://dettenbach.de
## licensed under the GPL

cd ~
mkdir ./netbsd
cd ./netbsd
mkdir kernel obj release src tools xsrc

## get extra kernel config for XEN DOMU internet servers
cd ~/netbsd/kernel
wget http://www.syndicat.com/pub/netbsd/kernel/XEN3_DOMU_NIELS
wget http://www.syndicat.com/pub/netbsd/kernel/XEN2_DOMU_NIELS

## uncomment the following two lines in case you will make your own kernel config
#nano ~/netbsd/XEN3_DOMU_NIELS
#nano ~/netbsd/XEN2_DOMU_NIELS

## cvs checkpout the current cvs sources
cd ~/netbsd/
export CVSROOT=anoncvs@anoncvs.netbsd.org:/cvsroot
export CVS_RSH=ssh
cvs co -P src
cvs co -P xsrc


## build run
## see ~/netbsd/src/BUILDING for details about all the nice build.sh options
cd ~/netbsd/src
sh build.sh -m i386 -O ../obj -T ../tools -X ../xsrc/ -R ../release -j3 -U -u -r tools kernel=XEN3_DOMU_NIELS release releasekernel=XEN3_DOMU_NIELS iso-image  

## show all generated kernels:
ls -alh ~/netbsd/release/i386/binary/kernel/

## go to and show the install CD image (iso)
cd ~/netbsd/release/iso/
ls -alh

If the script does his job you should see something like:

-r--r--r-- 1 niels users 165M 23. Sep 13:13 i386cd.iso

This is your NetBSD installation ISO image - burn it to a CD or use it within virtualisation (Xen, VMware, Virtualbox etc.) or mount it locally (as a virtual cdrom) by:

mount -o loop /home/'your username'/netbsd/release/iso/i386cd.iso /mnt/cdrom

links

weblinks

Retrieved from "http://www.gentoo-wiki.info/Build_NetBSD_on_Gentoo"

Last modified: Thu, 25 Sep 2008 23:43:00 +0000 Hits: 65