DæmonNews: News and views for the BSD community

Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

Installing BSD on IBM Netvista S40 - Part 4: NetBSD Installation

By Micho Durdevich <micho@matem.unam.mx>

We present here a method based on creating a live NetBSD install CD, and using GRUB as the bootloader. A nice starting point is the live CD by Joerg Braun (it can be downloaded from the NetBSD distribution sites).

The CD should be a complete, working, text-mode NetBSD system. It should contain all NetBSD distribution sets, a complete GRUB install, and the full kernel sources. I used the following command to prepare the ISO-image:

mkisofs -U -R -iso-level 3 -max-iso-filenames -no-emul-boot -boot-load-size 30 \
  -boot-information-table -c boot/boot.catalog -b boot/grub/stage2_eltorito \
  -o $diskimage $cdsource

I recommend configuring the CD with bash as the default shell, and with at least two virtual terminals enabled. From now on it is assumed that we have successfully booted a CD-based NetBSD system.

fdisk -u /dev/wd0
disklabel -e -I /dev/wd0

Here is the relevant section of the initial disklabel (compare it with DragonFly labels):

7 partitions:
#    size      offset    fstype         [fsize     bsize     bsp/cpg]
a:    524288       63    4.2BSD           1024      8192        512
b:    524288   524351    swap
c:  39876417       63    unused              0         0
d:  39876480        0    unused              0         0
e:    524288  1048639    4.2BSD           2048     16384        512
f:   8388608  1572927    4.2BSD           2048     16384        512
g:  29914945  9961535    4.2BSD           2048     16384        512

We can operate within another virtual terminal to verify calculations involving large quantities of sectors:

#echo $((256*1024*2))
524288
#echo $((63+2*524288))
1048639
#echo $((63+3*524288))
1572927
#echo $((4096*1024*2))
8388608
#echo $((8388608+1572927))
9961535
#echo $((39876417-8388608-3*524288))
29914945

The following commands build the filesystems:

newfs /dev/wd0a
newfs -O2 /dev/wd0e
newfs -O2 /dev/wd0f
newfs -O2 /dev/wd0f

Now, we have to create mount points, and bring in the newly created partitions:

mount /dev/wd0a /mnt
mkdir /mnt/proc /mnt/kern /mnt/usr /mnt/var /mnt/home
mount /dev/wd0e /mnt/var
mount /dev/wd0f /mnt/usr

We are now ready to copy the software to the harddisk:

cd /i386/binary/sets
tar xvzpf $distname -C /mnt

where $distname is the appropriate distribution set. We have to at least include the base, etc and kernel source packs (or just a kernel binary, assuming we prepared the kernel with root file system information compiled-in). Next, create all device nodes.

cd /mnt/dev
./MAKEDEV all

The boot loader should be installed and configured for the appropriate kernel.

cp -r /boot/grub /mnt/boot
vi /mnt/boot/grub/menu.lst
grub
grub> root (hd0,0,a)
grub> setup (hd0)
grub> quit

Now comes the only really Netvista-specific step. We have to compile the appropriate kernel, including the root file system information. The compilation step is necessary because the NetBSD kernel exhibits trouble in accepting input from the USB keyboard at boot time. The keyboard appears to be locked in a loop if we have to specify the root file system and init data at the boot prompt.

chroot /mnt /bin/csh
cd /usr/src/sys/arch/i386/conf
cp GENERIC QVISTA
vi QVISTA

The following configuration line defines the root file system to the kernel:

config        netbsd    root on wd0a type ffs

The standard kernel compilation steps:

config QVISTA
cd /usr/src/sys/arch/i386/compile/QVISTA
make depend
make
cp netbsd /

The system is almost ready for the first hard-disk boot. We have to create the /etc/fstab file:

# Device       Mountpoint      Fstype  Options         Dump    Pass#

kernfs         /kern          kernfs    rw
procfs         /proc          procfs    rw
/dev/wd0b      none           swap      sw              0       0
/dev/wd0a      /              ffs       rw              1       1
/dev/wd0e      /var           ffs       rw,softdep      2       2
/dev/wd0f      /usr           ffs       rw,softdep      2       2
/dev/wd0g      /home          ffs       rw,softdep      2       2

Finally, we must define rc_configured="YES" in /etc/rc.conf. And optionally, adjust a couple of other basic configuration parameters.

Google
Web daemonnews.org

More Articles
  • Book Review: Open Source Pen Testers Toolkit
  • Daemon's Advocate
  • BSDCan 2006 Friday Photos
  • Installing BSD on IBM Netvista S40 - Part 3: DragonFly Installation
  • BSDCan 2006 Photos
  • AFS: network filesystem beyond NFS weaknesses
  • Mastering FreeBSD and OpenBSD Security
  • Installing BSD on IBM Netvista S40 - Part 2: FreeBSD Installation
  • Interview with Diego Petteno, Gentoo/*BSD developer
  • Installing BSD on IBM Netvista S40 - Part 1: FreeBSD Installation
  • Interview with Jan Schaumann
  • Interview with Theo de Raadt
  • Book Review: Virtualization with VMware ESX Server
  • Editorial: Not Quite Dead Yet
  • The Design of OpenBGPd

  • Advertisements




    Author maintains all copyrights on this article.
    Images and layout Copyright © 1998-2006 Dæmon News. All Rights Reserved.