<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30139374804075673</id><updated>2011-08-21T08:48:21.749+02:00</updated><category term='embedded'/><category term='BSD disklabel'/><category term='METALOG'/><category term='NFS'/><category term='grub'/><category term='git'/><category term='Debian'/><category term='dual-boot'/><category term='Linux'/><category term='Xorg'/><category term='kernel'/><category term='rc.conf'/><category term='Guruplug'/><category term='dhcp'/><category term='grub2'/><category term='Virtualbox'/><category term='build.sh'/><category term='NetBSD'/><category term='ntp'/><category term='fdisk'/><category term='mtree'/><category term='current'/><category term='U-boot'/><title type='text'>NetBSD Journey</title><subtitle type='html'>Logging my quest into the NetBSD universe.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://netbsdjourney.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-108465197392315670</id><published>2011-08-13T14:35:00.000+02:00</published><updated>2011-08-13T14:35:52.615+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rc.conf'/><category scheme='http://www.blogger.com/atom/ns#' term='ntp'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><title type='text'>Guruplug meets NetBSD step 5: IPv4 configuration and daemon startup.</title><content type='html'>At this point we have a Guruplug which boots NetBSD from a USB stick and which is more-or-less in order. We're still stuck with the serial line so let's just add some basic ip configuration to it so the unit will boot up, configure its ip address (in this case a static one) and launch an SSH daemon.&lt;br /&gt;&lt;br /&gt;We will also take this opportunity to shut some of the services which we don't need and will only use scarce resources (and slow down booting). &lt;br /&gt;&lt;br /&gt;The currently (by default running processes are, minus the login, ps and csh that is):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;GURUPLUGGER# ps -aux&lt;br /&gt;USER    PID %CPU %MEM  VSZ  RSS TTY   STAT STARTED    TIME COMMAND&lt;br /&gt;root      0  3.0  1.4    0 7188 ?     DKl   1:00PM 0:38.74 [system]&lt;br /&gt;root      1  0.0  0.2 3448  892 ?     Ss    1:00PM 0:00.04 init &lt;br /&gt;root    182  0.0  0.3 5596 1348 ?     Is    1:00PM 0:00.06 /usr/sbin/syslogd -s&lt;br /&gt;postfix 412  0.0  0.4 7644 2220 ?     I     1:00PM 0:00.09 pickup -l -t fifo -u&lt;br /&gt;root    418  0.0  0.4 7652 2220 ?     Is    1:00PM 0:00.12 /usr/libexec/postfix&lt;br /&gt;root    454  0.0  0.2 3488  952 ?     Is    1:00PM 0:00.02 /usr/sbin/cron &lt;br /&gt;postfix 477  0.0  0.4 7644 2260 ?     I     1:00PM 0:00.08 qmgr -l -t unix -u &lt;br /&gt;root    484  0.0  0.2 3528  804 ?     Is    1:00PM 0:00.01 /usr/sbin/inetd -l &lt;br /&gt;root    113  0.0  0.2 3524  852 tty00 O+    1:36PM 0:00.01 ps -aux &lt;br /&gt;root    491  0.0  0.4 7228 2172 tty00 Is    1:00PM 0:00.52 login &lt;br /&gt;root    517  0.2  0.2 3288 1024 tty00 S     1:20PM 0:00.07 -csh &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So we will remove cron, postfix and inetd from the startup, only allowing syslog to start up and we will also add an sshd to that list. &lt;br /&gt;&lt;br /&gt;This is done through editing &lt;i&gt;/etc/rc.conf&lt;/i&gt; and we can look in &lt;i&gt;/etc/defaults/rc.conf&lt;/i&gt; for some inspiration. &lt;br /&gt;&lt;br /&gt;I've seen some kernel warnings in the past, which result in myself not trusting the RTC for timekeeping when the unit is off hence I'll add an &lt;a href="http://netbsd.gw.com/cgi-bin/man-cgi?ntpdate"&gt;ntpdate(8)&lt;/a&gt; to execute just once at boottime followed by the startup of an &lt;a href="http://netbsd.gw.com/cgi-bin/man-cgi?ntpd"&gt;ntpd(8)&lt;/a&gt;. Meaning rc.conf looks as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;# Load the defaults in from /etc/defaults/rc.conf (if it's readable).&lt;br /&gt;# These can be overridden below.&lt;br /&gt;#&lt;br /&gt;if [ -r /etc/defaults/rc.conf ]; then&lt;br /&gt;        . /etc/defaults/rc.conf&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# If this is not set to YES, the system will drop into single-user mode.&lt;br /&gt;#&lt;br /&gt;rc_configured=YES&lt;br /&gt;&lt;br /&gt;# Add local overrides below&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;hostname="GURUPLUGGER"&lt;br /&gt;&lt;br /&gt;# Do not start some default daemons&lt;br /&gt;cron=NO&lt;br /&gt;inetd=NO&lt;br /&gt;postfix=NO&lt;br /&gt;&lt;br /&gt;# Do start SSH&lt;br /&gt;sshd=YES&lt;br /&gt;&lt;br /&gt;# Launch an ntpdate at boottime prior to starting the ntpd&lt;br /&gt;ntpdate=YES&lt;br /&gt;ntpdate_flags="-b -s pool.ntp.org"&lt;br /&gt;ntpd=YES&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If we would want to launch a dhclient at boottime on the first gigabit device we would add, the following line to rc.conf:&lt;br /&gt;&lt;pre class="brush:plain"&gt;dhclient=YES&lt;br /&gt;&lt;/pre&gt;However, since this is a standalone box, I really want this box to have a static configuration. &lt;br /&gt;&lt;br /&gt;Hence configuring the network will be done by adding the following lines to &lt;i&gt;rc.conf&lt;/i&gt;:&lt;br /&gt;&lt;pre class="brush:plain"&gt;auto_ifconfig=yes&lt;br /&gt;ifconfig_mvgbe0="inet 192.168.10.2 netmask 0xffffff00" &lt;br /&gt;defaultroute="192.168.10.1"&lt;br /&gt;&lt;/pre&gt;Here &lt;i&gt;mvgbe0&lt;/i&gt; is the interface on which the configuration should be applied. Alternatively we could also have written the route to &lt;i&gt;/etc/mygate&lt;/i&gt; and the interface specific things to &lt;i&gt;/etc/ifconfig.mvgbe0&lt;/i&gt; (&lt;a href="http://netbsd.gw.com/cgi-bin/man-cgi?ifconfig.if"&gt;ifconfig.if(5)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Next we add the nameservers to &lt;a href="http://netbsd.gw.com/cgi-bin/man-cgi?resolv.conf"&gt;resolv.conf(5)&lt;/a&gt;:&lt;br /&gt;&lt;pre class="brush:plain"&gt;GURUPLUGGER# cat /etc/resolv.conf&lt;br /&gt;nameserver 195.130.130.5&lt;br /&gt;nameserver 195.130.131.5&lt;br /&gt;&lt;/pre&gt;And setup a default route, we can either write this in &lt;i&gt;/etc/mygate&lt;/i&gt; or append the following to rc.conf:&lt;br /&gt;&lt;pre class="brush:plain"&gt;defaultroute="192.168.10.1"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If we're adding an sshd, we also need to add a user (unless we modify the sshd config to permit root logins which is not a good idea). This can be done as follows:&lt;br /&gt;&lt;pre class="brush: plain"&gt;GURUPLUGGER# useradd -m edb&lt;br /&gt;GURUPLUGGER# passwd edb&lt;br /&gt;Changing password for edb.&lt;br /&gt;New Password:&lt;br /&gt;Retype New Password:&lt;br /&gt;GURUPLUGGER# usermod -G wheel edb&lt;br /&gt;&lt;/pre&gt;In the last step we added edb to the wheel group, this is required for the &lt;a href="http://netbsd.gw.com/cgi-bin/man-cgi?su"&gt;su(1)&lt;/a&gt; command to function. &lt;br /&gt;&lt;br /&gt;And after a reboot we see that our mission has been accomplished, the network is propery configured, only the daemons we requested are running:&lt;br /&gt;&lt;pre class="brush:plain"&gt;GURUPLUGGER# ifconfig mvgbe0                                            &lt;br /&gt;mvgbe0: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; mtu 1500&lt;br /&gt;	capabilities=3700&amp;lt;IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,UDP4CSUM_Rx,UDP4CSUM_Tx&amp;gt;&lt;br /&gt;	enabled=0&lt;br /&gt;	address: f0:ad:4e:ff:11:d5&lt;br /&gt;	media: Ethernet autoselect (100baseTX full-duplex)&lt;br /&gt;	status: active&lt;br /&gt;	inet 192.168.10.2 netmask 0xffffff00 broadcast 192.168.10.255&lt;br /&gt;	inet6 fe80::f2ad:4eff:feff:11d5%mvgbe0 prefixlen 64 scopeid 0x1&lt;br /&gt;GURUPLUGGER# netstat -rn -f inet&lt;br /&gt;Routing tables&lt;br /&gt;&lt;br /&gt;Internet:&lt;br /&gt;Destination        Gateway            Flags    Refs      Use    Mtu Interface&lt;br /&gt;default            192.168.10.1       UGS         1       73      -  mvgbe0&lt;br /&gt;127/8              127.0.0.1          UGRS        0        0  33192  lo0&lt;br /&gt;127.0.0.1          127.0.0.1          UH          1        0  33192  lo0&lt;br /&gt;192.168.10/24      link#1             UC          2        0      -  mvgbe0&lt;br /&gt;192.168.10.1       00:14:bf:8a:1b:c1  UHLc        1        0      -  mvgbe0&lt;br /&gt;192.168.10.103     00:1d:e0:6f:b6:cf  UHLc        0       98      -  mvgbe0&lt;br /&gt;GURUPLUGGER# ps -aux                     &lt;br /&gt;USER PID %CPU %MEM  VSZ  RSS TTY   STAT STARTED    TIME COMMAND&lt;br /&gt;root   0  0.0  1.4    0 7288 ?     DKl  12:27PM 0:00.40 [system]&lt;br /&gt;root   1  0.0  0.2 3448  968 ?     Is   12:27PM 0:00.04 init &lt;br /&gt;root 195  0.0  0.3 5596 1356 ?     Ss   12:27PM 0:00.06 /usr/sbin/syslogd -s &lt;br /&gt;root 324  0.0  1.0 5340 5224 ?     Ss   12:28PM 0:00.33 /usr/sbin/ntpd &lt;br /&gt;root 344  0.0  0.4 8196 1996 ?     Is   12:28PM 0:00.02 /usr/sbin/sshd &lt;br /&gt;root 108  0.0  0.2 3524  976 tty00 O+   12:33PM 0:00.01 ps -aux &lt;br /&gt;root 326  0.0  0.5 7228 2432 tty00 Is   12:28PM 0:00.51 login &lt;br /&gt;root 398  0.0  0.2 3288 1176 tty00 S    12:29PM 0:00.05 -csh &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;ul&gt;  &lt;li&gt;&lt;a href="http://www.netbsd.org/docs/guide/en/chap-net-practice.html"&gt;Chapter 24. Setting up TCP/IP on NetBSD in practice&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-108465197392315670?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/108465197392315670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/108465197392315670'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2011/08/guruplug-meets-netbsd-step-5-ipv4.html' title='Guruplug meets NetBSD step 5: IPv4 configuration and daemon startup.'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-8964895046942323005</id><published>2011-08-07T13:20:00.000+02:00</published><updated>2011-08-07T13:20:35.096+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='mtree'/><category scheme='http://www.blogger.com/atom/ns#' term='METALOG'/><category scheme='http://www.blogger.com/atom/ns#' term='Guruplug'/><category scheme='http://www.blogger.com/atom/ns#' term='build.sh'/><title type='text'>Guruplug meets NetBSD step 4: A closer look at our rootfs creation</title><content type='html'>In the second step I started from a distribution build in build.sh this was an unprivileged build and I used this build to populate my rootfs by passing through a tarball. Initially this has worked but it exhibited some fundamental problems which are side-effects of my hackish approach there.&lt;br /&gt;&lt;br /&gt;An unprivileged build creates the rootfs in desdir (&lt;i&gt;obj/destdir.evbarm&lt;/i&gt;) and stores the permissions in a file called &lt;i&gt;METALOG&lt;/i&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;edb@lapedb:~/netbsd/src$ head -n 10 obj/destdir.evbarm/METALOG&lt;br /&gt;. type=dir uname=root gname=wheel mode=0755&lt;br /&gt;./.cshrc type=file uname=root gname=wheel mode=0555 size=1297 sha256=0f09961bfa5543fa7da2cf8836935d6459d3ae3180795b33e2d04c81536c10a9&lt;br /&gt;./.profile type=file uname=root gname=wheel mode=0555 size=849 sha256=55bacdbebf6e16e4cebd76e48ead3875615fb9236f622dfded41843a2a4d8b14&lt;br /&gt;./altroot type=dir uname=root gname=wheel mode=0755&lt;br /&gt;./bin type=dir uname=root gname=wheel mode=0755&lt;br /&gt;./bin/[ type=file uname=root gname=wheel mode=0555 size=12902 sha256=8af5ca258dbc6ff97b586ce0b9c7fae5f692d35e45db01b97844e123ccc649b3&lt;br /&gt;./bin/cat type=file uname=root gname=wheel mode=0555 size=12546 time=1312632230.0 sha256=ad8ec94d65ca37c69aeeeddf88aa99e4cb2e318bfc23ef7b0d42417df9f29d53&lt;br /&gt;./bin/chgrp type=link mode=0755 link=/sbin/chown&lt;br /&gt;./bin/chio type=file uname=root gname=wheel mode=0555 size=16052 time=1312632230.0 sha256=579bf34f922708e10b2196edfa77f666e865748b41662b380d19c2ba64f51d5d&lt;br /&gt;./bin/chmod type=file uname=root gname=wheel mode=0555 size=9906 time=1312632231.0 sha256=76aacc5979b482c04796b0c844b74d40d9f9d475f178e90871f0e783c1df63b8&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In order to create a proper rootfilesystem the information stored in METALOG should also be applied otherwise just copying destdir over will look funny, (permission wise that is).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For some local testing I generated the binary installation sets (which will also contains the faulty permissions), to get to know which ones are there:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ ./build.sh -j 2 -m evbarm -U -u sets &lt;br /&gt;...&lt;br /&gt;edb@lapedb:~/netbsd/src$ ls -hal obj/releasedir/evbarm/binary/sets/&lt;br /&gt;total 128M&lt;br /&gt;drwxr-xr-x 2 edb edb 4.0K Aug  7 11:39 .&lt;br /&gt;drwxr-xr-x 3 edb edb 4.0K Aug  7 11:37 ..&lt;br /&gt;-rw-r--r-- 1 edb edb  453 Aug  7 11:39 MD5&lt;br /&gt;-rw-r--r-- 1 edb edb 1.4K Aug  7 11:39 SHA512&lt;br /&gt;-rw-r--r-- 1 edb edb  35M Aug  7 11:38 base.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb  56M Aug  7 11:39 comp.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb 396K Aug  7 11:38 etc.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb 3.2M Aug  7 11:38 games.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb  13M Aug  7 11:39 man.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb 3.4M Aug  7 11:39 misc.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb 1.2M Aug  7 11:39 modules.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb  13M Aug  7 11:39 tests.tgz&lt;br /&gt;-rw-r--r-- 1 edb edb 3.4M Aug  7 11:39 text.tgz&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then I installed the rootfs to a local directory:&lt;br /&gt;&lt;pre class="brush:plain"&gt;edb@lapedb:~/netbsd/src$ export DESTDIR=/home/edb/netbsd/src/obj/destdir.evbarm &lt;br /&gt;edb@lapedb:~/netbsd/src$ export RELEASEDIR=/home/edb/netbsd/src/obj/releasedir &lt;br /&gt;edb@lapedb:~/netbsd/src$ export INSTALLSETS="base comp etc games man misc modules tests text"  ./build.sh -j 2 -m evbarm -E  -U -u install=/tmp/blah&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here I repeat the DESTDIR and RELEASEDIR variables, since the -E (expert) flag of build.sh somehow removes these and then an UNPRIVED installation will take place in &lt;i&gt;/tmp/blah&lt;/i&gt;, this will typically be a copy of DESTDIR (with the permissions set to a wrong value), but later on we can omit certain installation sets (games, modules, tests come to mind). But a next step is actually applying the permissions stored in the METALOG file, this can be done by using the &lt;a href="http://www.daemon-systems.org/man/mtree.8.html"&gt;mtree(8)&lt;/a&gt; command. On my host system &lt;br /&gt;(Linux) it is not available, but it is luckily/obviously part of the toolchain:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;edb@lapedb:~/netbsd/src$ sudo obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmtree -f obj/destdir.evbarm/METALOG -p /tmp/blah -N /tmp/blah/etc/ -u&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Some comments:&lt;br /&gt;&lt;ul&gt;   &lt;li&gt; sudo: since some binaries will need to end up with setuid privileges etc this needs to be done with elevated privileges.&lt;/li&gt;   &lt;li&gt; -f: Reference to the METALOG file &lt;/li&gt;   &lt;li&gt; -p: Path containing the root directory&lt;/li&gt;   &lt;li&gt; -N: Use the user databases (passwd and friends) from this location, obviously from out target, this because my host does not per see need to have all users/groups referenced (e.g. wheel group isn't available on Linux, this while the METALOG references users and groups by name instead of by id&lt;/li&gt;   &lt;li&gt; -u: Update the fields&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Okay, so this would allow us to repopulate the partition on the USB stick we are using, however nothing forbids us to apply these settings on our running filesystem (post-mortem that is).  So let's just give that a try.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;GURUPLUGGER# mtree -f /METALOG -p / -u&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And you will see it will fix the permissions of all files. (Along with all other anomalies in the filesystem, e.g. in the previous step we touched rc.conf and mtree will show that the hash has changed).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-8964895046942323005?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/8964895046942323005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/8964895046942323005'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2011/08/guruplug-meets-netbsd-step-4-closer.html' title='Guruplug meets NetBSD step 4: A closer look at our rootfs creation'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-4006139737093030770</id><published>2011-08-06T18:42:00.011+02:00</published><updated>2011-08-13T14:38:02.906+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rc.conf'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='Guruplug'/><category scheme='http://www.blogger.com/atom/ns#' term='U-boot'/><title type='text'>Guruplug meets NetBSD step 3: Some cleaning up</title><content type='html'>So to summarize where we are at this point or the step of actions that are still required at this point to get the Guruplug booted to a shell prompt.&lt;br /&gt;&lt;ul&gt;&lt;li&gt; In U-boot we need to enter some magical commands&lt;/li&gt;&lt;li&gt; We needed to answer some of NetBSD's initial questions&lt;/li&gt;&lt;li&gt; At this point the  rootfs is still unconfigured&lt;/li&gt;&lt;/ul&gt;And at this point we have a system which does something bit is not yet that close to the real stuff as we'd want it to be.&lt;br /&gt;&lt;br /&gt;The first step we will do is not NetBSD specific but it just consists out of updating the U-boot environment variables so that the bootloader will automatically attempt loading NetBSD. &lt;br /&gt;&lt;br /&gt;The printenv command will show you what the current U-boot environment variables are:&lt;br /&gt;&lt;pre class="brush: plain"&gt;Marvell&gt;&gt; printenv&lt;br /&gt;bootcmd=${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;&lt;br /&gt;bootdelay=3&lt;br /&gt;baudrate=115200&lt;br /&gt;x_bootcmd_ethernet=ping 192.168.2.1&lt;br /&gt;x_bootcmd_usb=usb start&lt;br /&gt;x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000&lt;br /&gt;x_bootargs=console=ttyS0,115200&lt;br /&gt;ethact=egiga0&lt;br /&gt;ethaddr=F0:AD:4E:FF:11:D5&lt;br /&gt;x_bootargs_root=root=/dev/sda1 rootdelay=10&lt;br /&gt;stdin=serial&lt;br /&gt;stdout=serial&lt;br /&gt;stderr=serial&lt;br /&gt;&lt;br /&gt;Environment size: 439/131068 bytes&lt;br /&gt;&lt;/pre&gt;Which variables are important here ? &lt;br /&gt;&lt;ul&gt;&lt;li&gt;bootcmd: This is the actual command U-boot will executed when it will start booting. And these rely on several sub-commands (the length of a U-boot command is limited, and making small changes over a serial line with limited text editing capabilities is not that great either, this is why it's split up in several subcommands).&lt;/li&gt;&lt;li&gt;bootdelay: The amount of time U-boot will wait for user input to start executing bootcmd&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Hence I will just leave bootdelay at 3, giving me three seconds to do some manual override. But I will replace the entire bootcmd by my own (not using the x_... commands). This can be done as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;Marvell&gt;&gt; setenv bootcmd ping 1.2.3.4\; usb start\; fatload usb 0:1 0x100000 uImage \; bootm 0x100000&lt;br /&gt;Marvell&gt;&gt; printenv&lt;br /&gt;bootdelay=3&lt;br /&gt;baudrate=115200&lt;br /&gt;x_bootcmd_ethernet=ping 192.168.2.1&lt;br /&gt;x_bootcmd_usb=usb start&lt;br /&gt;x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000&lt;br /&gt;x_bootargs=console=ttyS0,115200&lt;br /&gt;ethact=egiga0&lt;br /&gt;ethaddr=F0:AD:4E:FF:11:D5&lt;br /&gt;x_bootargs_root=root=/dev/sda1 rootdelay=10&lt;br /&gt;stdin=serial&lt;br /&gt;stdout=serial&lt;br /&gt;stderr=serial&lt;br /&gt;bootcmd=usb start; fatload usb 0:1 0x100000 uImage ; bootm 0x100000&lt;br /&gt;&lt;br /&gt;Environment size: 370/131068 bytes&lt;br /&gt;Marvell&gt;&gt; saveenv&lt;br /&gt;Saving Environment to NAND...&lt;br /&gt;Erasing Nand...&lt;br /&gt;Erasing at 0x40000 -- 100% complete.&lt;br /&gt;Writing to Nand... done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With &lt;br /&gt;&lt;ul&gt;&lt;li&gt; setenv &lt;variable&gt; &lt;value&gt;: You set variable to value, do keep in mind to escape the ; or U-boot will interpret this as a sequence of commands instead of a value containing a sequence. Put value to an empty string to unset the variable.&lt;/li&gt;&lt;li&gt; saveenv: Save the entire U-boot environment to a designated sector in Flash (NAND flash in the case of the Guruplug, this is just a name value list protected with a CRC, the CRC is used at boottime to figure out if the environment is a valid one). &lt;/li&gt;&lt;li&gt; printenv: Shows the current environment variables. Keep in mind that variables are only written to flash after a saveenv, this means that a printenv will show the current state of the variables in memory, not that of the variables stored in flash.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;IMPORTANT NOTE:&lt;/b&gt; The bootcommand starts with a ping 1.2.3.4, just a ping of a bogus IP address, if this is omitted then NetBSD will not be able detect the PHY and you will have no ethernet connectivity whatsoever.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;Without ping U-boot:&lt;br /&gt;mvgbec0 at mvsoc0 unit 0 offset 0x70000-0x73fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe at mvgbec0 port 0 not configured&lt;br /&gt;mvgbec1 at mvsoc0 unit 1 offset 0x74000-0x77fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe at mvgbec1 port 0 not configured&lt;br /&gt;&lt;br /&gt;With ping in U-boot:&lt;br /&gt;mvgbec0 at mvsoc0 unit 0 offset 0x70000-0x73fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe0 at mvgbec0 port 0 irq 11&lt;br /&gt;mvgbe0: Ethernet address f0:ad:4e:ff:11:d5&lt;br /&gt;makphy0 at mvgbe0 phy 0: Marvell 88E1149 Gigabit PHY, rev. 3&lt;br /&gt;makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto&lt;br /&gt;mvgbec1 at mvsoc0 unit 1 offset 0x74000-0x77fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe at mvgbec1 port 0 not configured&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If we powercycle the unit now, then we will see it boot to the point where the NetBSD kernel starts prompting us for input:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;Marvell&gt;&gt; reset&lt;br /&gt;resetting ...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;U-Boot 2009.11-rc1-00602-g8e6db3d (Dec 24 2009 - 03:11:17)&lt;br /&gt;Marvell-Plug2&lt;br /&gt;&lt;br /&gt;SoC:   Kirkwood 88F6281_A0&lt;br /&gt;DRAM:  512 MB&lt;br /&gt;NAND:  512 MiB&lt;br /&gt;In:    serial&lt;br /&gt;Out:   serial&lt;br /&gt;Err:   serial&lt;br /&gt;Net:   egiga0&lt;br /&gt;88E1121 Initialized on egiga0&lt;br /&gt;Hit any key to stop autoboot:  0 &lt;br /&gt;(Re)start USB...&lt;br /&gt;USB:   Register 10011 NbrPorts 1&lt;br /&gt;USB EHCI 1.00&lt;br /&gt;scanning bus for devices... 3 USB Device(s) found&lt;br /&gt;       scanning bus for storage devices... 1 Storage Device(s) found&lt;br /&gt;reading uImage&lt;br /&gt;......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................&lt;br /&gt;&lt;br /&gt;4980889 bytes read&lt;br /&gt;## Booting kernel from Legacy Image at 00100000 ...&lt;br /&gt;   Image Name:   netbsd&lt;br /&gt;   Image Type:   ARM NetBSD Kernel Image (uncompressed)&lt;br /&gt;   Data Size:    4980825 Bytes =  4.8 MB&lt;br /&gt;   Load Address: 00000000&lt;br /&gt;   Entry Point:  00000000&lt;br /&gt;   Verifying Checksum ... OK&lt;br /&gt;   Loading Kernel Image ... OK&lt;br /&gt;OK&lt;br /&gt;## Transferring control to NetBSD stage-2 loader (at address 00000000) ...&lt;br /&gt;&lt;br /&gt;NetBSD/evbarm (sheevaplug) booting ...&lt;br /&gt;Loaded initial symtab at 0xc0388ec8, strtab at 0xc03bf1e4, # entries 13786&lt;br /&gt;pmap_postinit: Allocated 35 static L1 descriptor tables&lt;br /&gt;Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,&lt;br /&gt;    2006, 2007, 2008, 2009, 2010, 2011&lt;br /&gt;    The NetBSD Foundation, Inc.  All rights reserved.&lt;br /&gt;Copyright (c) 1982, 1986, 1989, 1991, 1993&lt;br /&gt;    The Regents of the University of California.  All rights reserved.&lt;br /&gt;&lt;br /&gt;NetBSD 5.99.55 (SHEEVAPLUG) #0: Wed Jul 13 17:57:19 CEST 2011&lt;br /&gt; edb@lapedb:/home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This actually solves the first goal, and brings us to our second goal. The NetBSD kernel is now asking us the following questions:&lt;br /&gt;&lt;pre class="brush:plain"&gt;boot device: &amp;lt;unknown&amp;gt;&lt;br /&gt;root device: sd0a&lt;br /&gt;dump device (default sd0b): none&lt;br /&gt;file system (default generic): ext2fs&lt;br /&gt;root on sd0a&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;warning: no /dev/console&lt;br /&gt;init path (default /sbin/init): &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After this it knows where to find init, and what remains is part of our third goal. But the question remains, how are we able to tell NetBSD that it is fairly good idea to attempt to mount an ext2 formatted rootfs which we hid as /dev/sd0a and from that point starts executing /sbin/init ? &lt;br /&gt;&lt;br /&gt;In the Linux world, the kernel would learn that information from the bootargs U-boot environment variable (see also the U-boot printenv output shown earlier).&lt;br /&gt;&lt;br /&gt;The SHEEVAPLUG kernel configuration &lt;i&gt;src/sys/arch/evbarm/conf/SHEEVAPLUG&lt;/i&gt; contains the following line:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;config  netbsd  root on ? type ?&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let's change this into:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;config  netbsd  root on sd0a type ext2fs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which should already get us a bit further.  Next we recompile it, and put the u-boot image on the USB stick and retry.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;edb@lapedb:~/netbsd/src$ ./build.sh -j 2 -u -m evbarm kernel=SHEEVAPLUG&lt;br /&gt;...&lt;br /&gt;/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmkubootimage -A arm -T kernel -a 0x00008000 -n NetBSD/sheevaplug 5.99.55 -C none netbsd.bin netbsd.ub&lt;br /&gt; magic:       0x27051956&lt;br /&gt; time:        Sat Aug  6 17:14:25 2011&lt;br /&gt; size:        4415424&lt;br /&gt; load addr:   0x00008000&lt;br /&gt; entry point: 0x00008000&lt;br /&gt; data crc:    0x128165e8&lt;br /&gt; os:          2 (netbsd)&lt;br /&gt; arch:        2 (arm)&lt;br /&gt; type:        2 (kernel)&lt;br /&gt; comp:        0 (none)&lt;br /&gt; name:        NetBSD/sheevaplug 5.99.55&lt;br /&gt; header crc:  0xa6c200d2&lt;br /&gt;/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmkubootimage -A arm -T kernel -a 0x00008000 -e 0x00800000 -n NetBSD/sheevaplug 5.99.55 -C none netbsd.bin netbsd-old.ub&lt;br /&gt; magic:       0x27051956&lt;br /&gt; time:        Sat Aug  6 17:14:25 2011&lt;br /&gt; size:        4415424&lt;br /&gt; load addr:   0x00008000&lt;br /&gt; entry point: 0x00800000&lt;br /&gt; data crc:    0x128165e8&lt;br /&gt; os:          2 (netbsd)&lt;br /&gt; arch:        2 (arm)&lt;br /&gt; type:        2 (kernel)&lt;br /&gt; comp:        0 (none)&lt;br /&gt; name:        NetBSD/sheevaplug 5.99.55&lt;br /&gt; header crc:  0xa14b2f1b&lt;br /&gt;===&gt; Kernels built from SHEEVAPLUG:&lt;br /&gt;  /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd&lt;br /&gt;===&gt; build.sh ended:      Sat Aug  6 17:14:26 CEST 2011&lt;br /&gt;===&gt; Summary of results:&lt;br /&gt;  build.sh command:    ./build.sh -j 2 -u -m evbarm kernel=SHEEVAPLUG&lt;br /&gt;  build.sh started:    Sat Aug  6 17:14:05 CEST 2011&lt;br /&gt;  NetBSD version:      5.99.55&lt;br /&gt;  MACHINE:             evbarm&lt;br /&gt;  MACHINE_ARCH:        arm&lt;br /&gt;  Build platform:      Linux 2.6.39-2-686-pae i686&lt;br /&gt;  HOST_SH:             /bin/sh&lt;br /&gt;  TOOLDIR path:        /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686&lt;br /&gt;  DESTDIR path:        /home/edb/netbsd/src/obj/destdir.evbarm&lt;br /&gt;  RELEASEDIR path:     /home/edb/netbsd/src/obj/releasedir&lt;br /&gt;  Updated makewrapper: /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake-evbarm&lt;br /&gt;  Building kernel without building new tools&lt;br /&gt;  Building kernel:     SHEEVAPLUG&lt;br /&gt;  Build directory:     /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG&lt;br /&gt;  Kernels built from SHEEVAPLUG:&lt;br /&gt;   /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd&lt;br /&gt;  build.sh ended:      Sat Aug  6 17:14:26 CEST 2011&lt;br /&gt;===&gt; .&lt;br /&gt;edb@lapedb:~/netbsd/src$ mount /dev/sdb1 /mnt/&lt;br /&gt;edb@lapedb:~/netbsd/src$ sudo cp /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd     &lt;br /&gt;netbsd         netbsd-old.ub  netbsd.bin     netbsd.bin.gz  netbsd.gdb     netbsd.gz.ub   netbsd.map     netbsd.ub      &lt;br /&gt;edb@lapedb:~/netbsd/src$ sudo cp /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd.ub /mnt/uImage&lt;br /&gt;edb@lapedb:~/netbsd/src$ umount /mnt/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And when we use this image, the startup gets a bit further again:&lt;br /&gt;&lt;pre class="brush:plain"&gt;...&lt;br /&gt;sd0 at scsibus0 target 0 lun 0: &amp;lt;USB, USB 2.0 Flash, 8.07&amp;gt; disk removable&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;sd0: 1003 MB, 1003 cyl, 64 head, 32 sec, 512 bytes/sect x 2055680 sectors&lt;br /&gt;boot device: &amp;lt;unknown&amp;gt;&lt;br /&gt;root on sd0a dumps on sd0b&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;warning: no /dev/console&lt;br /&gt;init: copying out path `/sbin/init' 11&lt;br /&gt;/etc/rc.conf is not configured.  Multiuser boot aborted.&lt;br /&gt;Enter pathname of shell or RETURN for /bin/sh: &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This means that our first two goals are already completed, the bootloader and the kernel are already cooperating. At this point we lack some userland configuration, these a probably the files which get generated during a regular installation (rc.conf and passwd, shadow and friends come immediately to mind).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now how do we prepare the filesystem ? Well I could start guessing and fixing things as we go (I actually started this way), but a more sensible approach is to just steal the flow from somewhere. And this somewhere is actually the installer, the installer (sysinst) is located in &lt;i&gt;src/distrib/utils/sysinst&lt;/i&gt; and there is a file install.c which contains the function do_install() which will setup the partitioning but after that it gets interesting:&lt;br /&gt;&lt;pre class="brush: plain"&gt;if (make_filesystems())&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; if (make_fstab() != 0)&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; if (md_post_newfs() != 0)&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; /* Unpack the distribution. */&lt;br /&gt; if (get_and_unpack_sets(0, MSG_disksetupdone,&lt;br /&gt;     MSG_extractcomplete, MSG_abortinst) != 0)&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; if (md_post_extract() != 0)&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; set_timezone();&lt;br /&gt;&lt;br /&gt; set_root_password();&lt;br /&gt; set_root_shell();&lt;br /&gt;&lt;br /&gt; sanity_check();&lt;br /&gt;&lt;br /&gt; md_cleanup_install();&lt;br /&gt;&lt;br /&gt; msg_display(MSG_instcomplete);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Deducing from this we will need to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Create an fstab&lt;/li&gt;&lt;li&gt; Set the timezone, but when no timezone is set, the box will default to UTC, which sounds sensible enough to me.&lt;/li&gt;&lt;li&gt; Setup the root user (password and shell)&lt;/li&gt;&lt;li&gt; And sanity_check() actually calls enable_rc_conf() hence, cleanup rc.conf&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;So the first setup will consist out of setting up fstab, to make sure the partitions can be found. First we make sure our rootfs is mounted read-writeable&lt;br /&gt;&lt;pre class="brush:plain"&gt;# mount /dev/sd0a /&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And we create an &lt;i&gt;/etc/fstab&lt;/i&gt; (inspired by &lt;i&gt;src/distrib/utils/sysinst/disks.c&lt;/i&gt; and the files in &lt;i&gt;src/share/examples/fstab&lt;/i&gt;).&lt;br /&gt;&lt;pre class="brush: plain"&gt;# cat /etc/fstab&lt;br /&gt;/dev/sd0a /  ext2fs rw  1 1&lt;br /&gt;/dev/sd0b none  swap sw  0 0&lt;br /&gt;/kern  /kern  kernfs rw  0 0&lt;br /&gt;/proc  /proc  procfs rw  0 0&lt;br /&gt;ptyfs  /dev/pts ptyfs rw  0 0&lt;br /&gt;# mkdir /kern /proc &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After this (and after a reboot) the following is sufficient to setup mounts properly (this will be done automagically once rc.conf is configured):&lt;br /&gt;&lt;pre class="brush: plain"&gt;# mount -a  &lt;br /&gt;/dev/sd0a: file system not clean; please fsck(8)&lt;br /&gt;# mount&lt;br /&gt;/dev/sd0a on / type ext2fs (local)&lt;br /&gt;tmpfs on /dev type tmpfs (union, local)&lt;br /&gt;kernfs on /kern type kernfs (local)&lt;br /&gt;procfs on /proc type procfs (local)&lt;br /&gt;ptyfs on /dev/pts type ptyfs (local)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next is setting up a password for root:&lt;br /&gt;&lt;pre class="brush:plain"&gt;# passwd -l root&lt;br /&gt;New password:&lt;br /&gt;Retype new password:&lt;br /&gt;&lt;/pre&gt;If you would want to change the shell for root (the default in /etc/passwd is csh for root) you can use &lt;i&gt;chpass -s /path/to/shell root&lt;/i&gt; where &lt;i&gt;/etc/shells&lt;/i&gt; contains supported shells.&lt;br /&gt;&lt;br /&gt;And last but not least we mark rc.conf and being properly set up, this is what keeping us away from booting properly into a multiuser system. For now it contains:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;# cat /etc/rc.conf&lt;br /&gt;#       $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $&lt;br /&gt;#&lt;br /&gt;# see rc.conf(5) for more information.&lt;br /&gt;#&lt;br /&gt;# Use program=YES to enable program, NO to disable it. program_flags are&lt;br /&gt;# passed to the program on the command line.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;# Load the defaults in from /etc/defaults/rc.conf (if it's readable).&lt;br /&gt;# These can be overridden below.&lt;br /&gt;#&lt;br /&gt;if [ -r /etc/defaults/rc.conf ]; then&lt;br /&gt;        . /etc/defaults/rc.conf&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# If this is not set to YES, the system will drop into single-user mode.&lt;br /&gt;#&lt;br /&gt;rc_configured=NO&lt;br /&gt;&lt;br /&gt;# Add local overrides below&lt;br /&gt;#&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And we update this the following way:&lt;br /&gt;&lt;pre class="brush:plain"&gt;# sed 's/rc_configured=NO/rc_configured=YES/' /etc/rc.conf &gt; /tmp/rc.conf ; mv /tmp/rc.conf /etc/rc.conf &lt;br /&gt;# echo 'hostname="GURUPLUGGER"'&gt;&gt; /etc/rc.conf&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(Note that at the end we also added the hostname, otherwise some additional warnings will appear while rebooting).&lt;br /&gt;&lt;br /&gt;And now we reboot. And we see that now init really kicks in ! Starting from the detection of the rootfilesystem the output looks as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;root on sd0a dumps on sd0b&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;WARNING: clock lost 2536 days&lt;br /&gt;WARNING: using filesystem time&lt;br /&gt;WARNING: CHECK AND RESET THE DATE!&lt;br /&gt;warning: no /dev/console&lt;br /&gt;init: copying out path `/sbin/init' 11&lt;br /&gt;Sun Jul 24 10:01:46 UTC 2011&lt;br /&gt;Starting root file system check:&lt;br /&gt;/dev/rsd0a: file system is clean; not checking&lt;br /&gt;swapctl: adding /dev/sd0b as swap device at priority 0&lt;br /&gt;Starting file system checks:&lt;br /&gt;Setting tty flags.&lt;br /&gt;Setting sysctl variables:&lt;br /&gt;ddb.onpanic: 1 -&gt; 0&lt;br /&gt;Starting network.&lt;br /&gt;Hostname: GURUPLUGGER&lt;br /&gt;IPv6 mode: host&lt;br /&gt;Configuring network interfaces:.&lt;br /&gt;Adding interface aliases:.&lt;br /&gt;Building databases: dev, utmp, utmpx, services done&lt;br /&gt;Starting syslogd.&lt;br /&gt;Mounting all filesystems...&lt;br /&gt;Clearing temporary files.&lt;br /&gt;Creating a.out runtime link editor directory cache.&lt;br /&gt;Checking quotas: done.&lt;br /&gt;Setting securelevel: kern.securelevel: 0 -&gt; 1&lt;br /&gt;Starting virecover.&lt;br /&gt;Checking for core dump...&lt;br /&gt;savecore: no core dump&lt;br /&gt;Starting local daemons:.&lt;br /&gt;Updating motd.&lt;br /&gt;postfix: rebuilding /etc/mail/aliases (missing /etc/mail/aliases.db)&lt;br /&gt;Jul 24 10:02:02 GURUPLUGGER postfix/master[578]: fatal: open lock file /var/db/postfix/master.lock: cannot create file exclusively: Permission denied&lt;br /&gt;Starting inetd.&lt;br /&gt;Starting cron.&lt;br /&gt;Sun Jul 24 10:02:02 UTC 2011&lt;br /&gt;&lt;br /&gt;NetBSD/evbarm (GURUPLUGGER) (console)&lt;br /&gt;&lt;br /&gt;login: root&lt;br /&gt;Password:&lt;br /&gt;Jul 24 10:02:14 GURUPLUGGER syslogd[182]: last message repeated 5 times&lt;br /&gt;Jul 24 10:02:14 GURUPLUGGER login: ROOT LOGIN (root) on tty console&lt;br /&gt;Jul 24 10:02:14 GURUPLUGGER login: /etc/login.conf: not owned by root&lt;br /&gt;Last login: Sun Jul 24 09:56:11 2011 on console&lt;br /&gt;Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,&lt;br /&gt;    2006, 2007, 2008, 2009, 2010, 2011&lt;br /&gt;    The NetBSD Foundation, Inc.  All rights reserved.&lt;br /&gt;Copyright (c) 1982, 1986, 1989, 1991, 1993&lt;br /&gt;    The Regents of the University of California.  All rights reserved.&lt;br /&gt;&lt;br /&gt;NetBSD 5.99.55 (SHEEVAPLUG) #6: Sat Aug 6 17:14:12 CEST 2011&lt;br /&gt;&lt;br /&gt;Welcome to NetBSD!&lt;br /&gt;&lt;br /&gt;This system is running a development snapshot of the NetBSD operating system,&lt;br /&gt;also known as NetBSD-current.  It is very possible that it has serious bugs,&lt;br /&gt;regressions, broken features or other problems.  Please bear this in mind&lt;br /&gt;and use the system with care.&lt;br /&gt;&lt;br /&gt;You are encouraged to test this version as thoroughly as possible.  Should you&lt;br /&gt;encounter any problem, please report it back to the development team using the&lt;br /&gt;send-pr(1) utility (requires a working MTA).  If yours is not properly set up,&lt;br /&gt;use the web interface at: http://www.NetBSD.org/support/send-pr.html&lt;br /&gt;&lt;br /&gt;Thank you for helping us test and improve NetBSD.&lt;br /&gt;&lt;br /&gt;Terminal type is vt100.                                                 &lt;br /&gt;We recommend that you create a non-root account and use su(1) for root access.&lt;br /&gt;GURUPLUGGER# &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In order to set the time we should use the date command (which apparently syncs the RTC as well, there doesn't seem to be a hwclock variant on NetBSD)&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;GURUPLUGGER# date 201108061940.15&lt;br /&gt;Aug  6 19:40:15  date: date set by root&lt;br /&gt;Sat Aug  6 19:40:15 UTC 2011&lt;br /&gt;GURUPLUGGER# date&lt;br /&gt;Sat Aug  6 19:40:18 UTC 2011&lt;br /&gt;GURUPLUGGER# reboot &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will remove the time warnings shown in the boot log.&lt;br /&gt;&lt;br /&gt;But we achieved the from zero to login prompt without the need to do any typing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-4006139737093030770?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/4006139737093030770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/4006139737093030770'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2011/08/guruplug-meets-netbsd-step-3-some.html' title='Guruplug meets NetBSD step 3: Some cleaning up'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-1772867506123580415</id><published>2011-08-04T20:57:00.001+02:00</published><updated>2011-08-13T14:38:26.879+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><title type='text'>NetBSD goes git</title><content type='html'>According to &lt;a href="http://blog.netbsd.org/tnf/entry/fossil_and_git_mirrors_of"&gt;The NetBSD Blog&lt;/a&gt; somebody has set up an automatic synchronization between the NetBSD CVS repositories and a git repository hosted at github. What interests me the most is the git copy of the src repository which can be found at: &lt;a href="https://github.com/jsonn/src"&gt;https://github.com/jsonn/src&lt;/a&gt;. Why prefer this over CVS ? Simple, just clone the repository and you can use git locally to commit your local changes and you'll have version control/history/diffs for your local work in the NetBSD tree. &lt;br /&gt;&lt;br /&gt;Now how do we set this up locally ? &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/git$ git clone http://github.com/jsonn/src.git&lt;br /&gt;Cloning into src...&lt;br /&gt;remote: Counting objects: 2913258, done.&lt;br /&gt;remote: Compressing objects: 100% (826840/826840), done.&lt;br /&gt;remote: Total 2913258 (delta 2353085), reused 2609790 (delta 2049617)&lt;br /&gt;Receiving objects: 100% (2913258/2913258), 837.73 MiB | 2.02 MiB/s, done.&lt;br /&gt;Resolving deltas: 100% (2353085/2353085), done.&lt;br /&gt;edb@lapedb:~/netbsd/git$ cd src/&lt;br /&gt;edb@lapedb:~/netbsd/git/src$ ls&lt;br /&gt;BUILDING  Makefile.inc  bin       common  crypto  distrib  etc       extsrc  gnu      lib      regress  sbin   sys    tools    usr.sbin&lt;br /&gt;Makefile  UPDATING      build.sh  compat  dist    doc      external  games   include  libexec  rescue   share  tests  usr.bin  x11&lt;br /&gt;edb@lapedb:~/netbsd/git/src$ git status&lt;br /&gt;# On branch trunk&lt;br /&gt;nothing to commit (working directory clean)&lt;br /&gt;edb@lapedb:~/netbsd/git/src$ git log | head &lt;br /&gt;commit 67570f9afcde1a61861eb4f26091764e41faf7b5&lt;br /&gt;Author: mrg &amp;lt;mrg&amp;gt;&lt;br /&gt;Date:   Thu Aug 4 00:52:49 2011 +0000&lt;br /&gt;&lt;br /&gt;    switch sparc64 to GCC 4.5.3.&lt;br /&gt;&lt;br /&gt;commit 62473a1fb983afc22917dc08f6b6a5a6bd692d1e&lt;br /&gt;Author: he &amp;lt;he&amp;gt;&lt;br /&gt;Date:   Wed Aug 3 22:19:31 2011 +0000&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And we're good to go ! We can now perform local changes, import changes through github, put our local changes on a branch etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-1772867506123580415?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/1772867506123580415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/1772867506123580415'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2011/08/netbsd-goes-git.html' title='NetBSD goes git'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-4696351412743919615</id><published>2011-07-24T11:18:00.001+02:00</published><updated>2011-08-13T14:40:12.865+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='fdisk'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Guruplug'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD disklabel'/><category scheme='http://www.blogger.com/atom/ns#' term='U-boot'/><category scheme='http://www.blogger.com/atom/ns#' term='build.sh'/><title type='text'>Guruplug meets NetBSD part two: Temporary userland</title><content type='html'>In my previous post I illustrated how to go from zero to booting a kernel on a Guruplug server, my first post ended with what Linux users would call a kernel &lt;i&gt;kernel panic, cannot open root device&lt;/i&gt; or which was in the case of NetBSD a more polite enter root device query. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;At this point I want to take the entire system one step further. This means that at this point I will extend the Guruplug with a USB stick of 1 gigabyte. But my main point here is that I will not yet make use of any MTD-alike device (more specifically the internal NAND flash) nor will I make use of an NFS rootfs, at the end of this post I want something which can be booted standalone and which can later on be improved.&lt;br /&gt;&lt;br /&gt;So continuing where I left the last time, first we start with bringing our CVS tree up to date, and rebuild the kernel (for more details on this last step, see my last blog post):&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ cvs update &lt;br /&gt;edb@lapedb:~/netbsd/src$ export HOST_CC=/usr/bin/gcc-4.5&lt;br /&gt;edb@lapedb:~/netbsd/src$ export HOST_CXX=/usr/bin/g++-4.5&lt;br /&gt;edb@lapedb:~/netbsd/src$ ./build.sh -j 2 -u -m evbarm kernel=SHEEVAPLUG&lt;br /&gt;&lt;/pre&gt;In my specific case the kernel version did not change, so I will simply reuse the kernel uImage which I created last time. &lt;br /&gt;&lt;br /&gt;And in the next step the so-called distribution build will be triggered:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ time ./build.sh -j 2 -U -u -m evbarm distribution &lt;br /&gt;===&gt; build.sh command:    ./build.sh -j 2 -U -u -m evbarm distribution&lt;br /&gt;===&gt; build.sh started:    Sat Jul 23 10:20:34 CEST 2011&lt;br /&gt;===&gt; NetBSD version:      5.99.55&lt;br /&gt;===&gt; MACHINE:             evbarm&lt;br /&gt;===&gt; MACHINE_ARCH:        arm&lt;br /&gt;===&gt; Build platform:      Linux 2.6.39-2-686-pae i686&lt;br /&gt;===&gt; HOST_SH:             /bin/sh&lt;br /&gt;===&gt; TOOLDIR path:        /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686&lt;br /&gt;===&gt; DESTDIR path:        /home/edb/netbsd/src/obj/destdir.evbarm&lt;br /&gt;===&gt; RELEASEDIR path:     /home/edb/netbsd/src/obj/releasedir&lt;br /&gt;===&gt; Updated makewrapper: /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake-evbarm&lt;br /&gt;--- distribution ---&lt;br /&gt;...&lt;br /&gt;--- check_DESTDIR ---&lt;br /&gt;--- checkflist ---&lt;br /&gt;cd /home/edb/netbsd/src/distrib/sets &amp;&amp;  DESTDIR=/home/edb/netbsd/src/obj/destdir.evbarm  MACHINE=evbarm  MACHINE_ARCH=arm  AWK=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbawk  CKSUM=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbcksum  DB=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbdb  HOST_SH=/bin/sh  MAKE=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake  MKTEMP=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmktemp  MTREE=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmtree  PAX=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbpax  COMPRESS_PROGRAM=gzip  PKG_CREATE=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbpkg_create  SED=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbsed  TSORT=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbtsort\ -q  /bin/sh /home/edb/netbsd/src/distrib/sets/checkflist  -L base  -M /home/edb/netbsd/src/obj/destdir.evbarm/METALOG.sanitised&lt;br /&gt;make distribution started at:  Sat Jul 23 10:20:35 CEST 2011&lt;br /&gt;make distribution finished at: Sat Jul 23 11:18:27 CEST 2011&lt;br /&gt;===&gt; Successful make distribution&lt;br /&gt;===&gt; build.sh ended:      Sat Jul 23 11:18:27 CEST 2011&lt;br /&gt;===&gt; Summary of results:&lt;br /&gt;  build.sh command:    ./build.sh -j 2 -U -u -m evbarm distribution&lt;br /&gt;  build.sh started:    Sat Jul 23 10:20:34 CEST 2011&lt;br /&gt;  NetBSD version:      5.99.55&lt;br /&gt;  MACHINE:             evbarm&lt;br /&gt;  MACHINE_ARCH:        arm&lt;br /&gt;  Build platform:      Linux 2.6.39-2-686-pae i686&lt;br /&gt;  HOST_SH:             /bin/sh&lt;br /&gt;  TOOLDIR path:        /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686&lt;br /&gt;  DESTDIR path:        /home/edb/netbsd/src/obj/destdir.evbarm&lt;br /&gt;  RELEASEDIR path:     /home/edb/netbsd/src/obj/releasedir&lt;br /&gt;  Updated makewrapper: /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake-evbarm&lt;br /&gt;  Successful make distribution&lt;br /&gt;  build.sh ended:      Sat Jul 23 11:18:27 CEST 2011&lt;br /&gt;===&gt; .&lt;br /&gt;edb@lapedb:~/netbsd/src$ cd obj/&lt;br /&gt;edb@lapedb:~/netbsd/src/obj$ ls&lt;br /&gt;destdir.evbarm  tooldir.Linux-2.6.39-2-686-pae-i686&lt;br /&gt;edb@lapedb:~/netbsd/src/obj$ du -sh destdir.evbarm &lt;br /&gt;459M destdir.evbarm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here I instructed build.sh to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; -j 2: Use my two cores when building.&lt;/li&gt;&lt;li&gt; -U: Run an unpriviliged build (as a normal user, you don't want build.sh to upgrade your host too eagerly.&lt;/li&gt;&lt;li&gt;-u: Do an update, do not rebuild the toolchain and others just-for-fun.&lt;/li&gt;&lt;li&gt;-m evbarm: We are still crosscompiling the evaluation board ARM type.&lt;/li&gt;&lt;li&gt;distribution: We want to see build.sh create a distribution in $DESTDIR (&lt;i&gt;-D dest     Set DESTDIR to dest.  [Default: destdir.MACHINE]&lt;/i&gt;, this last expression means we can expect our rootfs in obj/destdir.evbarm relative to the src directory.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The &lt;i&gt;BUILDING&lt;/i&gt; (located next to build.sh) describes the distribution target as follows:&lt;br /&gt;&lt;pre&gt;distribution  Do a ``make build'', and then install a full distribution&lt;br /&gt;                   (which does not include a kernel) into DESTDIR, including&lt;br /&gt;                   files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and&lt;br /&gt;                   DESTDIR/var.&lt;br /&gt;&lt;/pre&gt;Which is good since we have our kernel image already.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A next step is preparing our storage, remember I'm still running this all from my Debian-testing host. My initial attempt consisted out of creating a NetBSD disklabel on the stick and adding a  UFS partitions there. Along that way I encountered some problems (a bug in ufsutils, the fact that I had to recompile the Linux UFS module with write support, ...) which resulted in an intermediary solution, I will in this scenario make use of an ext2 partition for my rootfilesystem (and not an UFS2). The fact that ext2 support is present in the kernel can be learned from the SHEEVAPLUG config file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ cat sys/arch/evbarm/conf/SHEEVAPLUG  | grep file-system&lt;br /&gt;file-system  FFS  # UFS&lt;br /&gt;file-system  EXT2FS  # second extended file system (linux)&lt;br /&gt;#file-system  LFS  # log-structured file system&lt;br /&gt;#file-system  MFS  # memory file system&lt;br /&gt;file-system  NFS  # Network File System client&lt;br /&gt;#file-system  NTFS  # Windows/NT file system (experimental)&lt;br /&gt;#file-system  CD9660  # ISO 9660 + Rock Ridge file system&lt;br /&gt;file-system  MSDOSFS  # MS-DOS file system&lt;br /&gt;file-system  FDESC  # /dev/fd&lt;br /&gt;file-system  KERNFS  # /kern&lt;br /&gt;#file-system  NULLFS  # loopback file system&lt;br /&gt;#file-system  OVERLAY  # overlay file system&lt;br /&gt;#file-system  PORTAL  # portal filesystem (still experimental)&lt;br /&gt;file-system  PROCFS  # /proc&lt;br /&gt;#file-system  UMAPFS  # NULLFS + uid and gid remapping&lt;br /&gt;#file-system  UNION  # union file system&lt;br /&gt;#file-system  CODA  # Coda File System; also needs vcoda (below)&lt;br /&gt;#file-system  SMBFS  # experimental - CIFS; also needs nsmb (below)&lt;br /&gt;file-system  PTYFS  # /dev/ptm support&lt;br /&gt;file-system  TMPFS  # Efficient memory file-system&lt;br /&gt;#file-system  UDF  # experimental - OSTA UDF CD/DVD file-system&lt;br /&gt;#file-system  HFS  # experimental - Apple HFS+ (read-only)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;First I start with partitioning my USB stick, I will split the stick in two, first a small VFAT partition to contain the uImage, this for the simple reason that the bootloader on the Guruplug has support for FAT filesystems (and not for ext2) and also for the same reason, this partition will be outside the NetBSD disklabel. &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;lapedb:~# fdisk /dev/sdb &lt;br /&gt;&lt;br /&gt;WARNING: DOS-compatible mode is deprecated. It's strongly recommended to&lt;br /&gt;         switch off the mode (command 'c') and change display units to&lt;br /&gt;         sectors (command 'u').&lt;br /&gt;&lt;br /&gt;Command (m for help): n&lt;br /&gt;Command action&lt;br /&gt;   e   extended&lt;br /&gt;   p   primary partition (1-4)&lt;br /&gt;p&lt;br /&gt;Partition number (1-4): 1&lt;br /&gt;First cylinder (1-1021, default 1): 1&lt;br /&gt;Last cylinder, +cylinders or +size{K,M,G} (1-1021, default 1021): +100M&lt;br /&gt;&lt;br /&gt;Command (m for help): n&lt;br /&gt;Command action&lt;br /&gt;   e   extended&lt;br /&gt;   p   primary partition (1-4)&lt;br /&gt;p&lt;br /&gt;Partition number (1-4): 2&lt;br /&gt;First cylinder (104-1021, default 104): &lt;br /&gt;Using default value 104&lt;br /&gt;Last cylinder, +cylinders or +size{K,M,G} (104-1021, default 1021): &lt;br /&gt;Using default value 1021&lt;br /&gt;&lt;br /&gt;Command (m for help): t&lt;br /&gt;Partition number (1-4): 2&lt;br /&gt;Hex code (type L to list codes): a9&lt;br /&gt;Changed system type of partition 2 to a9 (NetBSD)&lt;br /&gt;&lt;br /&gt;Command (m for help): t&lt;br /&gt;Partition number (1-4): 1&lt;br /&gt;Hex code (type L to list codes): b&lt;br /&gt;Changed system type of partition 1 to b (W95 FAT32)&lt;br /&gt;&lt;br /&gt;Command (m for help): p&lt;br /&gt;&lt;br /&gt;Disk /dev/sdb: 1052 MB, 1052508160 bytes&lt;br /&gt;33 heads, 61 sectors/track, 1021 cylinders&lt;br /&gt;Units = cylinders of 2013 * 512 = 1030656 bytes&lt;br /&gt;Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;Disk identifier: 0xa02121e3&lt;br /&gt;&lt;br /&gt;   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sdb1               1         103      103639    b  W95 FAT32&lt;br /&gt;/dev/sdb2             104        1021      923967   a9  NetBSD&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Command (m for help): w&lt;br /&gt;The partition table has been altered!&lt;br /&gt;&lt;br /&gt;Calling ioctl() to re-read partition table.&lt;br /&gt;&lt;br /&gt;WARNING: If you have created or modified any DOS 6.x&lt;br /&gt;partitions, please see the fdisk manual page for additional&lt;br /&gt;information.&lt;br /&gt;Syncing disks.&lt;br /&gt;lapedb:~# fdisk /dev/sdb &lt;br /&gt;&lt;br /&gt;WARNING: DOS-compatible mode is deprecated. It's strongly recommended to&lt;br /&gt;         switch off the mode (command 'c') and change display units to&lt;br /&gt;         sectors (command 'u').&lt;br /&gt;&lt;br /&gt;Command (m for help): b&lt;br /&gt;Reading disklabel of /dev/sdb2  at sector 207340.&lt;br /&gt;/dev/sdb2  contains no disklabel.&lt;br /&gt;Do you want to create a disklabel? (y/n) y&lt;br /&gt;# /dev/sdb2 :&lt;br /&gt;type: SCSI&lt;br /&gt;disk: &lt;br /&gt;label: &lt;br /&gt;flags:&lt;br /&gt;bytes/sector: 512&lt;br /&gt;sectors/track: 61&lt;br /&gt;tracks/cylinder: 33&lt;br /&gt;sectors/cylinder: 2013&lt;br /&gt;cylinders: 1021&lt;br /&gt;rpm: 3600&lt;br /&gt;interleave: 1&lt;br /&gt;trackskew: 0&lt;br /&gt;cylinderskew: 0&lt;br /&gt;headswitch: 0  # milliseconds&lt;br /&gt;track-to-track seek: 0 # milliseconds&lt;br /&gt;drivedata: 0 &lt;br /&gt;4 partitions:&lt;br /&gt;#       start       end      size     fstype   [fsize bsize   cpg]&lt;br /&gt;  c:      104      1021       918     unused        0     0       &lt;br /&gt;  d:        1      1021      1021     unused        0     0       &lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): n&lt;br /&gt;Partition (a-p): a&lt;br /&gt;First cylinder (104-1021, default 104): 110&lt;br /&gt;Last cylinder or +size or +sizeM or +sizeK (110-1021, default 1021): 1000&lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): t&lt;br /&gt;Partition (a-d): a&lt;br /&gt;Hex code (type L to list codes): L&lt;br /&gt;&lt;br /&gt; 0  unused           5  4.1BSD           9  4.4LFS           d  boot           &lt;br /&gt; 1  swap             6  Eighth Edition   a  unknown          e  ADOS           &lt;br /&gt; 2  Version 6        7  4.2BSD           b  HPFS             f  HFS            &lt;br /&gt; 3  Version 7        8  MS-DOS           c  ISO-9660        10  AdvFS          &lt;br /&gt; 4  System V       &lt;br /&gt;Hex code (type L to list codes): 7&lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): n&lt;br /&gt;Partition (a-p): b&lt;br /&gt;First cylinder (104-1021, default 104): 1000&lt;br /&gt;Last cylinder or +size or +sizeM or +sizeK (1000-1021, default 1021): &lt;br /&gt;Using default value 1021&lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): t&lt;br /&gt;Partition (a-d): b&lt;br /&gt;Hex code (type L to list codes): 1&lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): w&lt;br /&gt;Writing disklabel to /dev/sdb2 .&lt;br /&gt;&lt;br /&gt;Syncing disks.&lt;br /&gt;Calling ioctl() to re-read partition table.&lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): p&lt;br /&gt;&lt;br /&gt;4 partitions:&lt;br /&gt;#       start       end      size     fstype   [fsize bsize   cpg]&lt;br /&gt;  a:      110      1000       891     4.2BSD        0     0     0 &lt;br /&gt;  b:     1000      1021        22       swap                      &lt;br /&gt;  c:      104      1021       918     unused        0     0       &lt;br /&gt;  d:        1      1021      1021     unused        0     0       &lt;br /&gt;&lt;br /&gt;BSD disklabel command (m for help): &lt;br /&gt;&lt;br /&gt;lapedb:~# dmesg | tail -n 3&lt;br /&gt;[ 2358.300068] sd 7:0:0:0: [sdb] Assuming drive cache: write through&lt;br /&gt;[ 2358.304145]  sdb: sdb1 sdb2&lt;br /&gt;[ 2358.304146]  sdb2: &amp;lt;netbsd: sdb5 sdb6 &amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Important note:&lt;/b&gt; Why did I create a swap partition ? (Remember this is a flash medium, the last thing you want to do there is use it as swap ...) To be honest I don't know (yet), when I just created the &lt;i&gt;a&lt;/i&gt; partition covering cylinders 15 to 1020 the Linux kernel failed to detect the disklabel and my dmesg output was:&lt;br /&gt;&lt;pre class="brush: plain"&gt;[10031.190078] sd 6:0:0:0: [sdb] Assuming drive cache: write through&lt;br /&gt;[10031.191935]  sdb: sdb1 sdb2&lt;br /&gt;[10031.191938]  sdb2: &amp;lt;netbsd: &amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this point we can access the VFAT partition through /dev/sdb1 and the NetBSD partition through /dev/sdb5. At this point we need to create the filesystems and populate them.&lt;br /&gt;&lt;br /&gt;We start with the FAT partition which only needs to have the U-boot kernel image, which I still had from last time, I reuse the one which I used during the TFTP boot in my previous post:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;lapedb:~# mkfs.vfat /dev/sdb1 &lt;br /&gt;mkfs.vfat 3.0.9 (31 Jan 2010)&lt;br /&gt;lapedb:~# mount /dev/sdb1 /tmp/target/&lt;br /&gt;lapedb:~# cp /srv/tftp/uImage  /tmp/target&lt;br /&gt;lapedb:~# umount /tmp/target&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And the nexst step is creating an ext2 partition on /dev/sdb5, after this I create a tarball of the NetBSD distribution build and extract it on this partition:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;lapedb:~# mkfs.ext2  /dev/sdb5&lt;br /&gt;mke2fs 1.42-WIP (02-Jul-2011)&lt;br /&gt;Filesystem label=&lt;br /&gt;OS type: Linux&lt;br /&gt;Block size=4096 (log=2)&lt;br /&gt;Fragment size=4096 (log=2)&lt;br /&gt;Stride=0 blocks, Stripe width=0 blocks&lt;br /&gt;56112 inodes, 224197 blocks&lt;br /&gt;11209 blocks (5.00%) reserved for the super user&lt;br /&gt;First data block=0&lt;br /&gt;Maximum filesystem blocks=230686720&lt;br /&gt;7 block groups&lt;br /&gt;32768 blocks per group, 32768 fragments per group&lt;br /&gt;8016 inodes per group&lt;br /&gt;Superblock backups stored on blocks: &lt;br /&gt; 32768, 98304, 163840&lt;br /&gt;&lt;br /&gt;Allocating group tables: done                            &lt;br /&gt;Writing inode tables: done                            &lt;br /&gt;Writing superblocks and filesystem accounting information: done&lt;br /&gt;&lt;br /&gt;This filesystem will be automatically checked every 0 mounts or&lt;br /&gt;0 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;lapedb:~# mount /dev/sdb5 /tmp/target&lt;br /&gt;lapedb:~# cd /tmp/target&lt;br /&gt;lapedb:/tmp/target# tar -xf /tmp/rootfs.tar &lt;br /&gt;lapedb:/tmp/target# cd ..&lt;br /&gt;lapedb:/tmp/# umount /tmp/target &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this point my USB stick is ready. And I clan plug it in into the Guruplug. Looking that the serial connection we can then instruct U-boot to obtain the kernel from the USB stick as follows (this could just as well be done using the TFTP image, but I want to end up in a situation where I can boot the Guruplug standalone):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;Marvell&gt;&gt; usb start&lt;br /&gt;(Re)start USB...&lt;br /&gt;USB:   Register 10011 NbrPorts 1&lt;br /&gt;USB EHCI 1.00&lt;br /&gt;scanning bus for devices... 3 USB Device(s) found&lt;br /&gt;       scanning bus for storage devices... 1 Storage Device(s) found&lt;br /&gt;Marvell&gt;&gt; fatls usb 0:1 /&lt;br /&gt;  4980889   uimage &lt;br /&gt;&lt;br /&gt;1 file(s), 0 dir(s)&lt;br /&gt;&lt;br /&gt;Marvell&gt;&gt; fatload usb 0:1 0x100000 uImage&lt;br /&gt;reading uImage&lt;br /&gt;........................................................................&lt;br /&gt;........................................................................&lt;br /&gt;........................................................................&lt;br /&gt;........................................................................&lt;br /&gt;........................................................................&lt;br /&gt;........................................................................&lt;br /&gt;......................................................&lt;br /&gt;&lt;br /&gt;4980889 bytes read&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this point my kernel image is loaded in DDR (at offset 0x100000) and I can instruct U-boot to start booting that image. Then I get the kernel messages again, but I can do something useful when NetBSD is asking me for a root filesystem:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;Marvell&gt;&gt; bootm 0x100000&lt;br /&gt;## Booting kernel from Legacy Image at 00100000 ...&lt;br /&gt;   Image Name:   netbsd&lt;br /&gt;   Image Type:   ARM NetBSD Kernel Image (uncompressed)&lt;br /&gt;   Data Size:    4980825 Bytes =  4.8 MB&lt;br /&gt;   Load Address: 00000000&lt;br /&gt;   Entry Point:  00000000&lt;br /&gt;   Verifying Checksum ... OK&lt;br /&gt;   Loading Kernel Image ... OK&lt;br /&gt;OK&lt;br /&gt;## Transferring control to NetBSD stage-2 loader (at address 00000000) ...&lt;br /&gt;&lt;br /&gt;NetBSD/evbarm (sheevaplug) booting ...&lt;br /&gt;Loaded initial symtab at 0xc0388ec8, strtab at 0xc03bf1e4, # entries 13786&lt;br /&gt;pmap_postinit: Allocated 35 static L1 descriptor tables&lt;br /&gt;Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,&lt;br /&gt;    2006, 2007, 2008, 2009, 2010, 2011&lt;br /&gt;    The NetBSD Foundation, Inc.  All rights reserved.&lt;br /&gt;Copyright (c) 1982, 1986, 1989, 1991, 1993&lt;br /&gt;    The Regents of the University of California.  All rights reserved.&lt;br /&gt;&lt;br /&gt;NetBSD 5.99.55 (SHEEVAPLUG) #0: Wed Jul 13 17:57:19 CEST 2011&lt;br /&gt; edb@lapedb:/home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG&lt;br /&gt;total memory = 512 MB&lt;br /&gt;avail memory = 497 MB&lt;br /&gt;mainbus0 (root)&lt;br /&gt;cpu0 at mainbus0: Sheeva 88SV131 rev 1 (ARM9E-S core)&lt;br /&gt;cpu0: DC enabled IC enabled WB enabled EABT branch prediction enabled&lt;br /&gt;cpu0: 16KB/32B 4-way Instruction cache&lt;br /&gt;cpu0: 16KB/32B 4-way write-back-locking-C Data cache&lt;br /&gt;mvsoc0 at mainbus0: Marvell 88F6281 Rev. A1  Kirkwood&lt;br /&gt;mvsoc0: CPU Clock 1200.000 MHz  SysClock 400.000 MHz  TClock 200.000 MHz&lt;br /&gt;mvsoctmr0 at mvsoc0 unit 0 offset 0x20300-0x203ff: Marvell SoC Timer&lt;br /&gt;mvsocgpp at mvsoc0 unit 0 not configured&lt;br /&gt;mvsocrtc0 at mvsoc0 unit 0 offset 0x10300-0x10317: Marvell SoC Real Time Clock&lt;br /&gt;com0 at mvsoc0 unit 0 offset 0x12000-0x1201f irq 33: ns16550a, working fifo&lt;br /&gt;com0: console&lt;br /&gt;com1 at mvsoc0 unit 1 offset 0x12100-0x1211f irq 34: ns16550a, working fifo&lt;br /&gt;ehci0 at mvsoc0 unit 0 offset 0x50000-0x51fff irq 19: Marvell USB 2.0 Interface&lt;br /&gt;usb0 at ehci0: USB revision 2.0&lt;br /&gt;gttwsi0 at mvsoc0 unit 0 offset 0x11000-0x11fff irq 29: Marvell TWSI controller&lt;br /&gt;iic0 at gttwsi0: I2C bus&lt;br /&gt;mvcesa at mvsoc0 unit 0 not configured&lt;br /&gt;mvgbec0 at mvsoc0 unit 0 offset 0x70000-0x73fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe at mvgbec0 port 0 not configured&lt;br /&gt;mvgbec1 at mvsoc0 unit 1 offset 0x74000-0x77fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe at mvgbec1 port 0 not configured&lt;br /&gt;mvpex at mvsoc0 unit 0 not configured&lt;br /&gt;mvsata at mvsoc0 unit 0 not configured&lt;br /&gt;mvsdio0 at mvsoc0 unit 0 offset 0x90000-0x9ffff irq 28: Marvell Secure Digital Input/Output Interface&lt;br /&gt;sdmmc0 at mvsdio0&lt;br /&gt;uhub0 at usb0: Marvell EHCI root hub, class 9/0, rev 2.00/1.00, addr 1&lt;br /&gt;sdmmc0: bad CIS ptr 0&lt;br /&gt;sdmmc0: couldn't read CIS&lt;br /&gt;sdmmc0: i/o init failed&lt;br /&gt;sdmmc0: bad CIS ptr 0&lt;br /&gt;sdmmc0: couldn't read CIS&lt;br /&gt;sdmmc0: i/o init failed&lt;br /&gt;"Marvell, 802.11 SDIO ID: 10, " (manufacturer 0x2df, product 0x9103) at sdmmc0 function 1 not configured&lt;br /&gt;"Marvell, 802.11 SDIO ID: 10, " (manufacturer 0x2df, product 0x9103) at sdmmc0 function 2 not configured&lt;br /&gt;uhub1 at uhub0 port 1: Genesys Logic USB2.0 Hub, class 9/0, rev 2.00/77.63, addr 2&lt;br /&gt;uhub1: single transaction translator&lt;br /&gt;umass0 at uhub1 port 3 configuration 1 interface 0&lt;br /&gt;umass0: USB Mass Storage, rev 2.00/1.07, addr 3&lt;br /&gt;scsibus0 at umass0: 2 targets, 1 lun per target&lt;br /&gt;sd0 at scsibus0 target 0 lun 0: &lt;USB, USB 2.0 Flash, 8.07&gt; disk removable&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;sd0: 1003 MB, 1003 cyl, 64 head, 32 sec, 512 bytes/sect x 2055680 sectors&lt;br /&gt;boot device: &amp;lt;unknown&amp;gt;&lt;br /&gt;root device: sd0a&lt;br /&gt;dump device (default sd0b): none&lt;br /&gt;file system (default generic): ext2fs&lt;br /&gt;root on sd0a&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;warning: no /dev/console&lt;br /&gt;init path (default /sbin/init): &lt;br /&gt;init: copying out path `/sbin/init' 11&lt;br /&gt;/etc/rc.conf is not configured.  Multiuser boot aborted.&lt;br /&gt;Enter pathname of shell or RETURN for /bin/sh: &lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;See that ?  That's a shell crying for my commands ! Let's try something.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;# uname -a&lt;br /&gt;NetBSD  5.99.55 NetBSD 5.99.55 (SHEEVAPLUG) #0: Wed Jul 13 17:57:19 CEST 2011  edb@lapedb:/home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG evbarm&lt;br /&gt;# mount&lt;br /&gt;root_device on / type ext2fs (read-only, local)&lt;br /&gt;tmpfs on /dev type tmpfs (union, local)&lt;br /&gt;# mount /dev/sd0a /&lt;br /&gt;# mount&lt;br /&gt;/dev/sd0a on / type ext2fs (local)&lt;br /&gt;tmpfs on /dev type tmpfs (union, local)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Apparently the ext2fs was mounted read-only so we corrected this. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Some closing comments:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Although I managed to get away with just an ext2 filesystem, I did not manage to boot it without the NetBSD disklabel present on the USB stick&lt;/li&gt;&lt;li&gt; At this point by setting the U-boot bootcmd environment variables I could have the Guruplug auto-boot until the point where it queries for the rootfs. This will be fixed in the nexst post.&lt;/li&gt;&lt;li&gt; The rootfs is at this point clearly not configured properly, no rc.conf, no user authentication, ... no nothing.&lt;/li&gt;&lt;li&gt; A rootfs of half a gigabyte is rather large for an embedded box isn't it ? &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;These subjects will be tackled in coming posts. &lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.mewburn.net/luke/papers/build.sh.pdf"&gt;build.sh: Cross-building NetBSD&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-4696351412743919615?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/4696351412743919615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/4696351412743919615'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2011/07/guruplug-meets-netbsd-part-two.html' title='Guruplug meets NetBSD part two: Temporary userland'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-5881957969144737681</id><published>2011-07-13T18:30:00.006+02:00</published><updated>2011-08-13T14:39:27.796+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='Guruplug'/><category scheme='http://www.blogger.com/atom/ns#' term='U-boot'/><title type='text'>Guruplug meets NetBSD: The first steps</title><content type='html'>I have at this point a Guruplug Server &lt;a href="http://www.globalscaletechnologies.com"&gt;by globalscale technologies&lt;/a&gt; at my possession and also a JTAG/UART board which connects to the serial connector. There is a large enough community around these devices out there so I will not go into much detail there. It is sufficient to  say it's the standard edition with just one gigabit ethernet connection and some USB ports (not the one with the embedded SD slot and the eSATA port). I will assume that the Guruplug is already equipped with a bootloader (u-boot in this case) and I do not have the intention to play around with u-boot if it does not appear to be necessary.&lt;br /&gt;&lt;br /&gt;A block diagram of the GuruPlug standard edition is shown in the image below:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;img src="http://www.de-brauwer.be/images/gpss_blockdiagram.jpg" /&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Since my NetBSD blog is also in suspended mode for a year (due to lack of time/toys), I'm hoping that this new toy will bring it back alive. This first step consists out of obtaining some source:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~$ mkdir netbsd &lt;br /&gt;edb@lapedb:~$ cd netbsd/&lt;br /&gt;edb@lapedb:~/netbsd$ export CVS_RSH="ssh"&lt;br /&gt;edb@lapedb:~/netbsd$ export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"&lt;br /&gt;edb@lapedb:~/netbsd$ cvs co -P src&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And then we need to use the NetBSD build system to build up a toolchain (the crosscompiler capable of cross-compiling the NetBSD kernel for the ARM architecture which runs on my standard Linux/x86 laptop) for the &lt;a href="http://www.netbsd.org/ports/evbarm/"&gt;NetBSD/evbarm port.&lt;/a&gt; This we can do by executing:&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd$ cd src/&lt;br /&gt;edb@lapedb:~/netbsd/src$ time ./build.sh -u -m evbarm tools&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;One sidenote, my Debian gave me a GCC 4.6.1 which can check for several new warnings, warnings which NetBSD's 5.99.22 external binutils cannot cope with, requiring me to use an older gcc. This can be accomplished with prefixing the build with:&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ export HOST_CC=/usr/bin/gcc-4.5&lt;br /&gt;edb@lapedb:~/netbsd/src$ export HOST_CXX=/usr/bin/g++-4.5&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Update 6 August 2011: &lt;/b&gt;, I created a ticket for the problem described above, and in the meantime the CVS repository of NetBSD contains a fix for this issue. You can track this at &lt;a href="http://gnats.netbsd.org/45140"&gt;NetBSD ticket #45140&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This gives use a nice cross-compiler as a result:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ obj/tooldir.Linux-2.6.39-2-686-pae-i686/arm--netbsdelf/bin/gcc -v&lt;br /&gt;Using built-in specs.&lt;br /&gt;Target: arm--netbsdelf&lt;br /&gt;Configured with: /home/edb/netbsd/src/tools/gcc/../../gnu/dist/gcc4/configure --target=arm--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion=NetBSD nb1 20110620 --enable-__cxa_atexit --disable-nls --disable-multilib --program-transform-name=s,^,arm--netbsdelf-, --enable-languages=c c++ objc --prefix=/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686&lt;br /&gt;Thread model: posix&lt;br /&gt;gcc version 4.1.3 20080704 (prerelease) (NetBSD nb2 20081120)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A next step is building a kernel. First try is trying to steal a default configuration file and &lt;i&gt;src/sys/arch/evbarm/conf&lt;/i&gt; contains a configuration file called &lt;i&gt;SHEEVAPLUG&lt;/i&gt; which was the name of the predecessor of the Guruplug, which means this one should be worth the shot. &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src$ ./build.sh -j 2 -u -m evbarm kernel=SHEEVAPLUG&lt;br /&gt;...&lt;br /&gt;===&gt; Summary of results:&lt;br /&gt;  build.sh command:    ./build.sh -j 2 -u -m evbarm kernel=SHEEVAPLUG&lt;br /&gt;  build.sh started:    Wed Jul 13 17:55:38 CEST 2011&lt;br /&gt;  NetBSD version:      5.99.55&lt;br /&gt;  MACHINE:             evbarm&lt;br /&gt;  MACHINE_ARCH:        arm&lt;br /&gt;  Build platform:      Linux 2.6.39-2-686-pae i686&lt;br /&gt;  HOST_SH:             /bin/sh&lt;br /&gt;  TOOLDIR path:        /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686&lt;br /&gt;  DESTDIR path:        /home/edb/netbsd/src/obj/destdir.evbarm&lt;br /&gt;  RELEASEDIR path:     /home/edb/netbsd/src/obj/releasedir&lt;br /&gt;  Updated makewrapper: /home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmake-evbarm&lt;br /&gt;  Building kernel without building new tools&lt;br /&gt;  Building kernel:     SHEEVAPLUG&lt;br /&gt;  Build directory:     /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG&lt;br /&gt;  Kernels built from SHEEVAPLUG:&lt;br /&gt;   /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd&lt;br /&gt;  build.sh ended:      Wed Jul 13 17:57:21 CEST 2011&lt;br /&gt;===&gt; .&lt;br /&gt;edb@lapedb:~/netbsd/src$ file /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd&lt;br /&gt;/home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd: ELF 32-bit LSB executable, ARM, version 1, statically linked, for NetBSD 5.99.55, not stripped&lt;br /&gt;edb@lapedb:~/netbsd/src$ ls -hal /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd&lt;br /&gt;-rwxr-xr-x 1 edb edb 4.8M Jul 13 17:57 /home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG/netbsd&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this point I am already a proud owner of a tftp service operating on 10.0.0.1, connect a UTP cable between my laptop and the Guruplug, so I just need to wrap the netbsd file in a u-boot compatible format (using u-boots mkimage tool) copy the netbsd kernel which is now inside the u-boot image  to my tftp root: &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG$ mkimage -A arm -O netbsd -T kernel -C none -a 0 -e 0 -n netbsd -d netbsd /srv/tftp/uImage&lt;br /&gt;Image Name:   netbsd&lt;br /&gt;Created:      Wed Jul 13 18:17:52 2011&lt;br /&gt;Image Type:   ARM NetBSD Kernel Image (uncompressed)&lt;br /&gt;Data Size:    4980825 Bytes = 4864.09 kB = 4.75 MB&lt;br /&gt;Load Address: 00000000&lt;br /&gt;Entry Point:  00000000&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Update August 6, 2011:&lt;/b&gt; Actually mkimage, or at least the NetBSD variant of this tool mkubootimage are part of the toolchain, and if you build the kernel, build.sh will already create a proper image for you. This will be called netbsd.ub and you can see how it gets created just before the summary of the build, this will look as follows:&lt;br /&gt;&lt;pre class="brush:plain"&gt;/home/edb/netbsd/src/obj/tooldir.Linux-2.6.39-2-686-pae-i686/bin/nbmkubootimage -A arm -T kernel -a 0x00008000 -n NetBSD/sheevaplug 5.99.55 -C none netbsd.bin netbsd.ub&lt;br /&gt; magic:       0x27051956&lt;br /&gt; time:        Sat Aug  6 17:14:25 2011&lt;br /&gt; size:        4415424&lt;br /&gt; load addr:   0x00008000&lt;br /&gt; entry point: 0x00008000&lt;br /&gt; data crc:    0x128165e8&lt;br /&gt; os:          2 (netbsd)&lt;br /&gt; arch:        2 (arm)&lt;br /&gt; type:        2 (kernel)&lt;br /&gt; comp:        0 (none)&lt;br /&gt; name:        NetBSD/sheevaplug 5.99.55&lt;br /&gt; header crc:  0xa6c200d2&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next on the serial connection with the Guruplug from the U-boot prompt I attempt the following:&lt;br /&gt;&lt;pre class="brush: plain"&gt;U-Boot 2009.11-rc1-00602-g8e6db3d (Dec 24 2009 - 03:11:17)&lt;br /&gt;Marvell-Plug2&lt;br /&gt;&lt;br /&gt;SoC:   Kirkwood 88F6281_A0&lt;br /&gt;DRAM:  512 MB&lt;br /&gt;NAND:  512 MiB&lt;br /&gt;In:    serial&lt;br /&gt;Out:   serial&lt;br /&gt;Err:   serial&lt;br /&gt;Net:   egiga0&lt;br /&gt;88E1121 Initialized on egiga0&lt;br /&gt;Hit any key to stop autoboot:  0 &lt;br /&gt;Marvell&gt;&gt; setenv serverip 10.0.0.1&lt;br /&gt;Marvell&gt;&gt; setenv ipaddr 10.0.0.2&lt;br /&gt;Marvell&gt;&gt; tftpboot 0x100000 uImage&lt;br /&gt;Using egiga0 device&lt;br /&gt;TFTP from server 10.0.0.1; our IP address is 10.0.0.2&lt;br /&gt;Filename 'uImage'.&lt;br /&gt;Load address: 0x100000&lt;br /&gt;Loading: #################################################################&lt;br /&gt;  #################################################################&lt;br /&gt;  #################################################################&lt;br /&gt;  #################################################################&lt;br /&gt;  #################################################################&lt;br /&gt;  ###############&lt;br /&gt;done&lt;br /&gt;Bytes transferred = 4980889 (4c0099 hex)&lt;br /&gt;Marvell&gt;&gt; bootm 0x100000&lt;br /&gt;## Booting kernel from Legacy Image at 00100000 ...&lt;br /&gt;   Image Name:   netbsd&lt;br /&gt;   Image Type:   ARM NetBSD Kernel Image (uncompressed)&lt;br /&gt;   Data Size:    4980825 Bytes =  4.8 MB&lt;br /&gt;   Load Address: 00000000&lt;br /&gt;   Entry Point:  00000000&lt;br /&gt;   Verifying Checksum ... OK&lt;br /&gt;   Loading Kernel Image ... OK&lt;br /&gt;OK&lt;br /&gt;## Transferring control to NetBSD stage-2 loader (at address 00000000) ...&lt;br /&gt;&lt;br /&gt;NetBSD/evbarm (sheevaplug) booting ...&lt;br /&gt;Loaded initial symtab at 0xc0388ec8, strtab at 0xc03bf1e4, # entries 13786&lt;br /&gt;pmap_postinit: Allocated 35 static L1 descriptor tables&lt;br /&gt;Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,&lt;br /&gt;    2006, 2007, 2008, 2009, 2010, 2011&lt;br /&gt;    The NetBSD Foundation, Inc.  All rights reserved.&lt;br /&gt;Copyright (c) 1982, 1986, 1989, 1991, 1993&lt;br /&gt;    The Regents of the University of California.  All rights reserved.&lt;br /&gt;&lt;br /&gt;NetBSD 5.99.55 (SHEEVAPLUG) #0: Wed Jul 13 17:57:19 CEST 2011&lt;br /&gt; edb@lapedb:/home/edb/netbsd/src/sys/arch/evbarm/compile/obj/SHEEVAPLUG&lt;br /&gt;total memory = 512 MB&lt;br /&gt;avail memory = 497 MB&lt;br /&gt;mainbus0 (root)&lt;br /&gt;cpu0 at mainbus0: Sheeva 88SV131 rev 1 (ARM9E-S core)&lt;br /&gt;cpu0: DC enabled IC enabled WB enabled EABT branch prediction enabled&lt;br /&gt;cpu0: 16KB/32B 4-way Instruction cache&lt;br /&gt;cpu0: 16KB/32B 4-way write-back-locking-C Data cache&lt;br /&gt;mvsoc0 at mainbus0: Marvell 88F6281 Rev. A1  Kirkwood&lt;br /&gt;mvsoc0: CPU Clock 1200.000 MHz  SysClock 400.000 MHz  TClock 200.000 MHz&lt;br /&gt;mvsoctmr0 at mvsoc0 unit 0 offset 0x20300-0x203ff: Marvell SoC Timer&lt;br /&gt;mvsocgpp at mvsoc0 unit 0 not configured&lt;br /&gt;mvsocrtc0 at mvsoc0 unit 0 offset 0x10300-0x10317: Marvell SoC Real Time Clock&lt;br /&gt;com0 at mvsoc0 unit 0 offset 0x12000-0x1201f irq 33: ns16550a, working fifo&lt;br /&gt;com0: console&lt;br /&gt;com1 at mvsoc0 unit 1 offset 0x12100-0x1211f irq 34: ns16550a, working fifo&lt;br /&gt;ehci0 at mvsoc0 unit 0 offset 0x50000-0x51fff irq 19: Marvell USB 2.0 Interface&lt;br /&gt;usb0 at ehci0: USB revision 2.0&lt;br /&gt;gttwsi0 at mvsoc0 unit 0 offset 0x11000-0x11fff irq 29: Marvell TWSI controller&lt;br /&gt;iic0 at gttwsi0: I2C bus&lt;br /&gt;mvcesa at mvsoc0 unit 0 not configured&lt;br /&gt;mvgbec0 at mvsoc0 unit 0 offset 0x70000-0x73fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe0 at mvgbec0 port 0 irq 11&lt;br /&gt;mvgbe0: Ethernet address f0:ad:4e:ff:11:d5&lt;br /&gt;OUI 0x784a7a model 0x0014 rev 9 at mvgbe0 phy 0 not configured&lt;br /&gt;mvgbe0: no PHY found!&lt;br /&gt;mvgbec1 at mvsoc0 unit 1 offset 0x74000-0x77fff: Marvell Gigabit Ethernet Controller&lt;br /&gt;mvgbe at mvgbec1 port 0 not configured&lt;br /&gt;mvpex at mvsoc0 unit 0 not configured&lt;br /&gt;mvsata at mvsoc0 unit 0 not configured&lt;br /&gt;mvsdio0 at mvsoc0 unit 0 offset 0x90000-0x9ffff irq 28: Marvell Secure Digital Input/Output Interface&lt;br /&gt;sdmmc0 at mvsdio0&lt;br /&gt;uhub0 at usb0: Marvell EHCI root hub, class 9/0, rev 2.00/1.00, addr 1&lt;br /&gt;sdmmc0: bad CIS ptr 0&lt;br /&gt;sdmmc0: couldn't read CIS&lt;br /&gt;sdmmc0: i/o init failed&lt;br /&gt;sdmmc0: bad CIS ptr 0&lt;br /&gt;sdmmc0: couldn't read CIS&lt;br /&gt;sdmmc0: i/o init failed&lt;br /&gt;"Marvell, 802.11 SDIO ID: 10, " (manufacturer 0x2df, product 0x9103) at sdmmc0 function 1 not configured&lt;br /&gt;"Marvell, 802.11 SDIO ID: 10, " (manufacturer 0x2df, product 0x9103) at sdmmc0 function 2 not configured&lt;br /&gt;uhub1 at uhub0 port 1: Genesys Logic USB2.0 Hub, class 9/0, rev 2.00/77.63, addr 2&lt;br /&gt;uhub1: single transaction translator&lt;br /&gt;umass0 at uhub1 port 3 configuration 1 interface 0&lt;br /&gt;umass0: Hama SD Card Reader, rev 2.00/94.04, addr 3&lt;br /&gt;scsibus0 at umass0: 2 targets, 1 lun per target&lt;br /&gt;sd0 at scsibus0 target 0 lun 0: &lt;Hama, SD Card Reader, 9404&gt; disk removable&lt;br /&gt;sd0: fabricating a geometry&lt;br /&gt;sd0: 7600 MB, 7600 cyl, 64 head, 32 sec, 512 bytes/sect x 15564800 sectors&lt;br /&gt;boot device: &amp;lt;unknown&amp;gt;&lt;br /&gt;root device: &lt;br /&gt;use one of: mvgbe0 sd0[a-h] ddb halt reboot&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So far, so good, so we set the ip address for the guruplug to use, the ip address of the tftp server, we loaded the image (uImage) which we put in our tftp root into DDR memory (at offset 0x100000) and we asked the bootloader (U-boot) to boot the image which we put at memory address 0x100000. And then we see the NetBSD kernel messages appearing on our serial line.  After loading the kernel it stops and prompts us for a root device to use (but we are not yet at that phase). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Some preliminary comments on this output:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;My unit has a USB to SD convertor attached to the USB port, one which was detected, this will in the future be the first host for a root filesystem, since this is easier to deal with than internal NAND flash.&lt;/li&gt;&lt;li&gt;Some guruplug/sheevaplugs have an onboard microSD slot, here an attempt to probe it is done which fails. &lt;/li&gt;&lt;li&gt;The Guruplug I'm using is known to have some problems with its ethernet phy, it looses the link every now and then, hence some oddities can be expected there. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;External sources:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.netbsd.org/docs/kernel/porting_netbsd_arm_soc.html"&gt;NetBSD Documentation: Porting NetBSD to a new ARM SoC&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-5881957969144737681?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/5881957969144737681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/5881957969144737681'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2011/07/guruplug-meets-netbsd-first-steps.html' title='Guruplug meets NetBSD: The first steps'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-3053187888944456962</id><published>2010-08-03T20:01:00.002+02:00</published><updated>2010-08-04T07:55:16.130+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grub'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='dual-boot'/><category scheme='http://www.blogger.com/atom/ns#' term='grub2'/><title type='text'>Dual booting NetBSD with Linux using Grub</title><content type='html'>So far I've been playing with NetBSD and virtualbox, this is nice as a starting point, but next to this I also like something running on the bare metal.So I picked a desktop of mine which had a Debian stable installed and turned this into a dual boot system. Doing this is something very simple.&lt;br /&gt;&lt;br /&gt;The first thing you need to do is make sure you start off the right foot, this means that in this case when I partitioned the disk and installed Debian on it, I already foresaw that I would install NetBSD on it, so I left some spare space in an empty partition. In the NetBSD installer I let NetBSD do its thing (create the BSD disklabel) in that partition.&lt;br /&gt;&lt;br /&gt;And once you're at this point you're already at one third of the effort. When NetBSD prompts you that it did not find a valid bootloader in the MBR and asks you to install one for you, just say &lt;b&gt;no&lt;/b&gt; in this case GRUB (which _is_ a valid bootloader) is already installed and we will use GRUB to boot into NetBSD.&lt;br /&gt;&lt;br /&gt;So far so good, the installer will complete and when the system is done and reboots you should see GRUB and at this point you should see no trace of NetBSD whatsoever, don't panic, this is what we expect and what we will repair now.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For &lt;b&gt;grub 0.9x&lt;/b&gt; you can access a command line by pressing 'c', from there you can enter some commands at the "grub&amp;gt;" prompt. If you type here&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;grub&amp;gt; rootnoverify (hd0,1)&lt;br /&gt;grub&amp;gt; chainloader +1&lt;br /&gt;grub&amp;gt; boot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Et voila, you should see the NetBSD loader appearing. Note that this change is not permanent and you will need to type this each time you want to boot into NetBSD (which is not part of &lt;i&gt;the plan&lt;/i&gt;) hence we will edit the grub configuration file, typically this lives in &lt;i&gt;/boot/grub/menu.lst&lt;/i&gt;&amp;nbsp; (but your experience may vary, sometimes this is called grub.conf as well), and also beware that at least a part of this file is typically auto generated by your distribution (typically when the kernel is upgraded, e.g. based upon rules in &lt;i&gt;/etc/grub.d/* &lt;/i&gt;), but in this file you can add (append at the bottom is typically a good idea) something like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;title NetBSD&lt;br /&gt;rootnoverify (hd0,1)&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And the next time grub will show you to option to boot NetBSD from the list of GRUB options. For those not familiar with GRUB's notation of disks and partition (hd0,1) means the second partition of the first hard disk (all grown up people start counting at zero ;-) ).&lt;br /&gt;&lt;br /&gt;For &lt;b&gt;grub 2 (or 1.xx)&lt;/b&gt; the steps are almost similar, one important difference however is that they start counting disks at 0 (as with the old one) but partitions start to count at 1. Meaning that my earlier example from the commandline would look like:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;grub&amp;gt; set root=(hd0,2)&lt;br /&gt;grub&amp;gt; chainloader +1&lt;br /&gt;grub&amp;gt; boot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Or you can extend the configuration file (by editing &lt;i&gt;/boot/grub/grub.cfg&lt;/i&gt; directly, or by editing &lt;i&gt;/etc/grub.d/40_custom&lt;/i&gt; and running something like update-grub2, the latter probably being the recommended way). In my case this last file contains:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;#!/bin/sh&lt;br /&gt;exec tail -n +3 $0&lt;br /&gt;# This file is an example on how to add custom entries&lt;br /&gt;menuentry "NetBSD" {&lt;br /&gt;     set root=(hd0,2)&lt;br /&gt;     chainloader +1&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Or just add the last three lines to the grub.cfg file directly if you don't want to use the upgrade-grub2 mechanism.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-3053187888944456962?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/3053187888944456962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/3053187888944456962'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2010/08/dual-booting-netbsd-with-linux-using.html' title='Dual booting NetBSD with Linux using Grub'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-4143089580364664915</id><published>2010-06-23T21:57:00.001+02:00</published><updated>2010-07-09T19:53:27.679+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virtualbox'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='NFS'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel'/><category scheme='http://www.blogger.com/atom/ns#' term='current'/><category scheme='http://www.blogger.com/atom/ns#' term='build.sh'/><title type='text'>From 5.1 RC2 to current (part I: the kernel)</title><content type='html'>The first post showed how NetBSD 5.1 RC2 could be installed, this week an announcement was made that NetBSD 5.1 RC3 is available which turns my installation into something outdated. Nevertheless this also gives me the ideal excuse (or forces me to, depends on which sentence you like best) to upgrade my installation to &lt;i&gt;current&lt;/i&gt;. In this context is nothing more than a fancy for CVS head, or tracking the most current developments, this way (in conjunction to subscribing to several of the netbsd&amp;nbsp; &lt;a href="http://www.netbsd.org/mailinglists/"&gt;mailing lists&lt;/a&gt; ) I hope to get a bit familiar with the source code and the NetBSD development process, and this obviously opens the door for some contributions by myself (the last one being a long term and idealistic goal, and I don't have a clue if I will ever reach that point). &lt;br /&gt;&lt;br /&gt;An advantage of playing around with Virtualbox, as I'm doing now, is that one can easily export the appliance (read: make a full backup) and import an appliance (read: make a full restore), or even run multiple versions in parallel. So before you start doing this, just make a full backup, this will allow you to play around and to break things, and falling back to a stable situation is just a couple of clicks (and some patience) away.&lt;br /&gt;&lt;br /&gt;This blog post is just something I'm writing up for my own reference, I'm not reinventing the wheel myself, so I'm also just following the &lt;a href="http://www.netbsd.org/docs/current/index.html"&gt;documentation&lt;/a&gt; a first suggested way to make use of the binary images which the NetBSD project provides (accessible at &lt;a href="http://nyftp.netbsd.org/pub/NetBSD-daily/"&gt;http://nyftp.netbsd.org/pub/NetBSD-daily/&lt;/a&gt; ), this is a solution, but I call this the easy way out, thus I will not follow this path, if I want to modify code, I need to be able to have these images build myself.&amp;nbsp; For this reason I also choose to host the CVS sources on my Linux host OS, this way I can mount the CVS sources in several NetBSD guests (over NFS). Thus on my local system I obtain a CVS copy:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:~$ mkdir netbsd &lt;br /&gt;edb@lapedb:~$ cd netbsd/&lt;br /&gt;edb@lapedb:~/netbsd$ export CVS_RSH="ssh&lt;br /&gt;edb@lapedb:~/netbsd$ export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"&lt;br /&gt;edb@lapedb:~/netbsd$ cvs co -P src&lt;br /&gt;...&lt;br /&gt;edb@lapedb:~/netbsd$ du -sh src&lt;br /&gt;1.4G src&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next I set up NFS locally (note: lapedb is my Linux host os, flying_spaghetti_monster is my NetBSD guest):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;edb@lapedb:/etc$ apt-get install nfs-common nfs-kernel-server&lt;br /&gt;edb@lapedb:/etc$ cat /etc/exports  | tail -n 1&lt;br /&gt;/home/edb/netbsd/src 192.168.10.0/24(rw,sync,no_subtree_check,no_root_squash)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And on the guest I can run&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;flying_spaghetti_monster# mount -t nfs 192.168.10.100:/home/edb/netbsd/src /mnt/nfs/&lt;br /&gt;flying_spaghetti_monster# cd /mnt/nfs/&lt;br /&gt;flying_spaghetti_monster# cvs update &lt;br /&gt;Warning: Permanently added the RSA host key for IP address '204.152.190.16' to the list of known hosts.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This also gives me the opportunity to do a little benchmarking, I compared the delay in time between a cvs update running native on the Linux host, and a cvs update from the NetBSD guest mounted over NFS (with the options set to sync and async). This while the repository is up to date:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;native on Linux host: &lt;br /&gt;real 1m19.054s&lt;br /&gt;user 0m1.400s&lt;br /&gt;sys 0m1.396s&lt;br /&gt;&lt;br /&gt;nfs sync on NetBSD guest&lt;br /&gt;      117.33 real         0.80 user        57.79 sys&lt;br /&gt;nfs async on NetBSD guest&lt;br /&gt;      111.22 real         0.66 user        55.75 sys&lt;br /&gt;&lt;/pre&gt;So this means that by adding the NFS/Virtualization I loose about 38 seconds on a CVS update. Okay, a bit higher than my expectations, but still very workable. Okay, the story so far, we have the CVS sources available in our sandbox so we can start playing.&lt;br /&gt;&lt;br /&gt;We start by following the crosscompilation chapter in the&amp;nbsp;&lt;a href="http://www.netbsd.org/docs/guide/en/chap-build.html"&gt;NetBSD guide&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;flying_spaghetti_monster# cd /mnt/nfs/&lt;br /&gt;flying_spaghetti_monster# ./build.sh -m i386 tools&lt;br /&gt;===&amp;gt; build.sh command: ./build.sh -m i386 tools&lt;br /&gt;===&amp;gt; build.sh started: Sat Jun 19 15:35:20 CEST 2010&lt;br /&gt;===&amp;gt; NetBSD version:   5.99.31&lt;br /&gt;===&amp;gt; MACHINE:          i386&lt;br /&gt;===&amp;gt; MACHINE_ARCH:     i386&lt;br /&gt;===&amp;gt; Build platform:   NetBSD 5.1_RC2 i386&lt;br /&gt;===&amp;gt; HOST_SH:          /bin/sh&lt;br /&gt;===&amp;gt; No $TOOLDIR/bin/nbmake, needs building.&lt;br /&gt;===&amp;gt; Bootstrapping nbmake&lt;br /&gt;...&lt;br /&gt;===&amp;gt; Tools built to /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386&lt;br /&gt;===&amp;gt; build.sh ended:   Sat Jun 19 15:55:51 CEST 2010&lt;br /&gt;===&amp;gt; Summary of results:&lt;br /&gt;         build.sh command: ./build.sh -m i386 tools&lt;br /&gt;         build.sh started: Sat Jun 19 15:35:20 CEST 2010&lt;br /&gt;         NetBSD version:   5.99.31&lt;br /&gt;         MACHINE:          i386&lt;br /&gt;         MACHINE_ARCH:     i386&lt;br /&gt;         Build platform:   NetBSD 5.1_RC2 i386&lt;br /&gt;         HOST_SH:          /bin/sh&lt;br /&gt;         No $TOOLDIR/bin/nbmake, needs building.&lt;br /&gt;         Bootstrapping nbmake&lt;br /&gt;         TOOLDIR path:     /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386&lt;br /&gt;         DESTDIR path:     /mnt/nfs/obj/destdir.i386&lt;br /&gt;         RELEASEDIR path:     /mnt/nfs/obj/releasedir&lt;br /&gt;         Created /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake&lt;br /&gt;         makewrapper:      /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake-i386&lt;br /&gt;         Updated /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake-i386&lt;br /&gt;         Tools built to /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386&lt;br /&gt;         build.sh ended:   Sat Jun 19 15:55:51 CEST 2010&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This build.sh is actually a really nice system, it has just build a crosscompiler which runs on NetBSD 5.1_RC2, and will compile for i386. But I could actually run the same script on my native Linux box and use build.sh to construct a toolchain to build NetBSD for any architecture.&lt;br /&gt;&lt;br /&gt;Now that we have the tools in place, let's start with compiling our kernel. But first we collect some proof, tihs is our current kernel:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;flying_spaghetti_monster# uname -a &lt;br /&gt;NetBSD flying_spaghetti_monster 5.1_RC2 NetBSD 5.1_RC2 (GENERIC) #0: Fri May 21 04:32:33 UTC 2010  builds@b8.netbsd.org:/home/builds/ab/netbsd-5-1-RC2/i386/201005210534Z-obj/home/builds/ab/netbsd-5-1-RC2/src/sys/arch/i386/compile/GENERIC i386&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The kernel configurations are located in sys/arch/i386/conf/ and we will now build the GENERIC kernel.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;flying_spaghetti_monster# ls -hal ./sys/arch/i386/conf/GENERIC&lt;br /&gt;-rw-r--r--  1 1000  1000   56K Jun  1 04:40 ./sys/arch/i386/conf/GENERIC&lt;br /&gt;flying_spaghetti_monster# ./build.sh -u -m i386 kernel=GENERIC&lt;br /&gt;===&amp;gt; build.sh command: ./build.sh -u -m i386 kernel=GENERIC&lt;br /&gt;===&amp;gt; build.sh started: Mon Jun 21 22:23:48 CEST 2010&lt;br /&gt;===&amp;gt; NetBSD version:   5.99.31&lt;br /&gt;===&amp;gt; MACHINE:          i386&lt;br /&gt;===&amp;gt; MACHINE_ARCH:     i386&lt;br /&gt;===&amp;gt; Build platform:   NetBSD 5.1_RC2 i386&lt;br /&gt;===&amp;gt; HOST_SH:          /bin/sh&lt;br /&gt;===&amp;gt; TOOLDIR path:     /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386&lt;br /&gt;===&amp;gt; DESTDIR path:     /mnt/nfs/obj/destdir.i386&lt;br /&gt;===&amp;gt; RELEASEDIR path:     /mnt/nfs/obj/releasedir&lt;br /&gt;===&amp;gt; makewrapper:      /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake-i386&lt;br /&gt;===&amp;gt; Updated /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake-i386&lt;br /&gt;===&amp;gt; Building kernel without building new tools&lt;br /&gt;#    objdir  /mnt/nfs/sys/arch/i386/compile/obj&lt;br /&gt;===&amp;gt; Building kernel:  GENERIC&lt;br /&gt;===&amp;gt; Build directory:  /mnt/nfs/sys/arch/i386/compile/obj/GENERIC&lt;br /&gt;Build directory is /mnt/nfs/sys/arch/i386/compile/obj/GENERIC&lt;br /&gt;Don't forget to run "make depend"&lt;br /&gt;depending the kern library objects&lt;br /&gt;#    create  kern/__cmsg_alignbytes.d&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;#    link  GENERIC/netbsd&lt;br /&gt;/mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/i486--netbsdelf-ld -Map netbsd.map --cref -T /mnt/nfs/sys/arch/i386/conf/kern.ldscript -Ttext c0100000 -e start -X -o netbsd ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o&lt;br /&gt;NetBSD 5.99.31 (GENERIC) #0: Mon Jun 21 23:06:06 CEST 2010&lt;br /&gt;   text    data     bss     dec     hex filename&lt;br /&gt;9684860  541396  554716 10780972         a4812c netbsd&lt;br /&gt;&lt;br /&gt;===&amp;gt; Kernels built from GENERIC:&lt;br /&gt;  /mnt/nfs/sys/arch/i386/compile/obj/GENERIC/netbsd&lt;br /&gt;===&amp;gt; build.sh ended:   Mon Jun 21 23:06:27 CEST 2010&lt;br /&gt;===&amp;gt; Summary of results:&lt;br /&gt;         build.sh command: ./build.sh -u -m i386 kernel=GENERIC&lt;br /&gt;         build.sh started: Mon Jun 21 22:23:48 CEST 2010&lt;br /&gt;         NetBSD version:   5.99.31&lt;br /&gt;         MACHINE:          i386&lt;br /&gt;         MACHINE_ARCH:     i386&lt;br /&gt;         Build platform:   NetBSD 5.1_RC2 i386&lt;br /&gt;         HOST_SH:          /bin/sh&lt;br /&gt;         TOOLDIR path:     /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386&lt;br /&gt;         DESTDIR path:     /mnt/nfs/obj/destdir.i386&lt;br /&gt;         RELEASEDIR path:     /mnt/nfs/obj/releasedir&lt;br /&gt;         makewrapper:      /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake-i386&lt;br /&gt;         Updated /mnt/nfs/obj/tooldir.NetBSD-5.1_RC2-i386/bin/nbmake-i386&lt;br /&gt;         Building kernel without building new tools&lt;br /&gt;         Building kernel:  GENERIC&lt;br /&gt;         Build directory:  /mnt/nfs/sys/arch/i386/compile/obj/GENERIC&lt;br /&gt;         Kernels built from GENERIC:&lt;br /&gt;          /mnt/nfs/sys/arch/i386/compile/obj/GENERIC/netbsd&lt;br /&gt;         build.sh ended:   Mon Jun 21 23:06:27 CEST 2010&lt;br /&gt;===&amp;gt; .&lt;br /&gt;flying_spaghetti_monster# file /mnt/nfs/sys/arch/i386/compile/obj/GENERIC/netbsd&lt;br /&gt;/mnt/nfs/sys/arch/i386/compile/obj/GENERIC/netbsd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for NetBSD 5.99.31, not stripped&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Jay, this means we have a kernel image available. Now we will need to boot from it, so we copy it over the original kernel (after creating a backup):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;flying_spaghetti_monster# mv /netbsd /netbsd.old&lt;br /&gt;flying_spaghetti_monster# cp /mnt/nfs/sys/arch/i386/compile/obj/GENERIC/netbsd /netbsd&lt;br /&gt;flying_spaghetti_monster# ls -hal /netbsd*&lt;br /&gt;-rwxr-xr-x  1 root  wheel   11M Jun 21 23:14 /netbsd&lt;br /&gt;-rwxr-xr-x  1 root  wheel   11M May 21 06:32 /netbsd.old&amp;nbsp;&lt;br /&gt;flying_spaghetti_monster# shutdown -r now &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And we cross our fingers. If things fail, we can fall back to the original kernel by following the following steps:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/recover.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="205" src="http://www.de-brauwer.be/images/virtual_box/recover.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;However after a reboot this fallback mechanism was already necessary (boot the old kernel, and copy netbsd.old to netbsd because the GENERIC kernel has loadable module support by default and the filesystems are compiled in (out) as modules, hence just booting the GENERIC results in a kernel which can't mount its root filesystem. The workaround is to either put the proper modules there or to build the kernel with the MONOLITHIC config, this config should not rely on modules. If we take a look at the config file for the MONOLITHIC kernel:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;# $NetBSD: MONOLITHIC,v 1.11 2010/04/09 14:02:05 ahoka Exp $&lt;br /&gt;#&lt;br /&gt;# Non MODULAR, used mostly as a reference as to what we modularized.&lt;br /&gt;#&lt;br /&gt;include "arch/i386/conf/GENERIC"&lt;br /&gt;&lt;br /&gt;no options MODULAR&lt;br /&gt;&lt;br /&gt;options  EXEC_AOUT # exec a.out binaries&lt;br /&gt;options  EXEC_ELF32 # exec ELF binaries&lt;br /&gt;options  EXEC_SCRIPT # exec #! scripts&lt;br /&gt;options  COREDUMP&lt;br /&gt;&lt;br /&gt;options  P1003_1B_SEMAPHORE # p1003.1b semaphore support&lt;br /&gt;options  AIO  # POSIX asynchronous I/O, built as a module&lt;br /&gt;options  MQUEUE  # POSIX messsage queues, built as a module&lt;br /&gt;&lt;br /&gt;options  COMPAT_OSSAUDIO # OSS (Voxware) audio driver compatibility&lt;br /&gt;options  COMPAT_SVR4 # binary compatibility with SVR4&lt;br /&gt;options  COMPAT_IBCS2 # binary compatibility with SCO and ISC&lt;br /&gt;options  COMPAT_LINUX # binary compatibility with Linux&lt;br /&gt;options  COMPAT_FREEBSD # binary compatibility with FreeBSD&lt;br /&gt;&lt;br /&gt;# File systems&lt;br /&gt;file-system  FFS  # UFS&lt;br /&gt;file-system  EXT2FS  # second extended file system (linux)&lt;br /&gt;file-system  LFS  # log-structured file system&lt;br /&gt;file-system  MFS  # memory file system&lt;br /&gt;file-system  NFS  # Network File System client&lt;br /&gt;file-system  NTFS  # Windows/NT file system (experimental)&lt;br /&gt;file-system  CD9660  # ISO 9660 + Rock Ridge file system&lt;br /&gt;file-system  MSDOSFS  # MS-DOS file system&lt;br /&gt;file-system  FDESC  # /dev/fd&lt;br /&gt;file-system  KERNFS  # /kern&lt;br /&gt;file-system  NULLFS  # loopback file system&lt;br /&gt;file-system  OVERLAY  # overlay file system&lt;br /&gt;file-system  PROCFS  # /proc&lt;br /&gt;file-system  UMAPFS  # NULLFS + uid and gid remapping&lt;br /&gt;file-system  UNION  # union file system&lt;br /&gt;file-system  CODA  # Coda File System; also needs vcoda (below)&lt;br /&gt;file-system  SMBFS  # experimental - CIFS; also needs nsmb (below)&lt;br /&gt;file-system  PTYFS  # /dev/ptm support&lt;br /&gt;file-system  TMPFS  # Efficient memory file-system&lt;br /&gt;file-system PUFFS  # Userspace file systems (e.g. ntfs-3g &amp;amp; sshfs)&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;We see that it just extends the GENERIC configuration and adds the file system support. However after building the monolithic kernel &lt;br /&gt;&lt;pre class="brush:plain"&gt;flying_spaghetti_monster# ./build.sh -u -m i386 kernel=GENERIC&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And following the same steps (copying it to /netbsd) and rebooting we are now running our own-rolled kernel:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;flying_spaghetti_monster# uname -a&lt;br /&gt;NetBSD flying_spaghetti_monster 5.99.31 NetBSD 5.99.31 (MONOLITHIC) #0: Wed Jun 23 23:49:20 CEST 2010  root@flying_spaghetti_monster:/mnt/nfs/sys/arch/i386/compile/obj/MONOLITHIC i386&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next step, building userland and using a generic kernel with module support.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Post scriptum:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Later experimentations showed that the NFS mount turned out to be rather painful and it did not fulfill my needs (mainly talking about performance here). So&amp;nbsp;&lt;/span&gt;&lt;/span&gt;in a later phase I started using build.sh to build on my Linux host (when I set up the NFS I was not aware that build.sh was powerful enough to do this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-4143089580364664915?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/4143089580364664915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/4143089580364664915'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2010/06/from-51-rc2-to-current-part-i-kernel.html' title='From 5.1 RC2 to current (part I: the kernel)'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-6118662483595747817</id><published>2010-06-15T20:30:00.000+02:00</published><updated>2010-06-15T20:30:06.189+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virtualbox'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Xorg'/><title type='text'>NetBSD meets Xorg meets Virtualbox</title><content type='html'>Personally I'm a console lover, which makes me belong to a group of people which is becoming a smaller and smaller part of the population. Thus the goal of this post is to explain how to get the X-server (in this case Xorg) functioning properly within Virtualbox. Configuring the X server is something which has been causing people troubles for years and years, even though things have evolved a lot the past decade. Thus we start by asking Xorg to create us a configuration file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;flying_spaghetti_monster# Xorg -configure &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As a result a new configuration file gets created which gets located in &lt;i&gt;/root/xorg.conf.new &lt;/i&gt;at this point we can give the X server a testrun by calling:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;flying_spaghetti_monster# X -config /root/xorg.conf.new&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Et voila, we have an operational X-server: &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/xorg1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://www.de-brauwer.be/images/virtual_box/xorg1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;To terminate this and to go back to the console press CTRL+ALT+BACKSPACE. As a next step we will copy this configuration file (which we tested) to a location where it can easily be found by scripts such a &lt;i&gt;startx&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;flying_spaghetti_monster# cp /root/xorg.conf.new /etc/X11/xorg.conf&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you now start the xserver using startx it will automatically use this configuration file and this time it will launch the&lt;i&gt; twm&lt;/i&gt; window manager, xclock and two xterms.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;flying_spaghetti_monster# startx&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which looks like this:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/xorg2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://www.de-brauwer.be/images/virtual_box/xorg2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Okay, from the 70s look which the screenshots of the first post gave us, we now officially entered the 80s. At this point the maximum resolution however is only 800x600 for the simple reason that no guest additions are already available for NetBSD :(, which means the Xorg server can only use the vesa video driver and not the commonly used vboxvideo driver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-6118662483595747817?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/6118662483595747817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/6118662483595747817'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2010/06/netbsd-meets-xorg-meets-virtualbox.html' title='NetBSD meets Xorg meets Virtualbox'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-7920227623464197837</id><published>2010-06-11T15:04:00.014+02:00</published><updated>2010-07-09T19:49:49.458+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rc.conf'/><category scheme='http://www.blogger.com/atom/ns#' term='Virtualbox'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><category scheme='http://www.blogger.com/atom/ns#' term='dhcp'/><title type='text'>Poor men's NetBSD part II (aka configuring NetBSD for usage in virtualbox)</title><content type='html'>In my previous &lt;a href="http://netbsdjourney.blogspot.com/2010/06/poor-mens-netbsd-aka-installing-netbsd.html"&gt;post&lt;/a&gt; I documented the installation of NetBSD using virtualbox, the result was that at the end we had a virtual instance running which booted to a prompt. While this is already a good starting point, we're still virtually nowhere.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;The first thing we will need however is access to the network, the default installation of virtualbox gave me a pseudo Intel E1000 ethernet adapter which is NAT'ed by default. When the virtual instance boots there is not attempt made to configure the network but after running &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;dhclient wm0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;manually I get an ip address and a connection to my host operating system (and the Internet is possible).&amp;nbsp; However for my purposes what I really need is the ability to access the guest OS (being NetBSD) from the host OS. (The main reason to do this is because then I can just copy/paste snippets from the console, without the need to keep taking screenshots. In order to accomplish this we need to edit the virtual machine settings:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/ethernet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/ethernet.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And here we change the type from NAT to Bridged and we create a bridge with whatever real device your are using on your host system (in this case I'm using my wlan) and then we say we will bridge this with the Intel PRO/1000 which will be visible in the guest (just don't expect gigabit speeds ;-) ). Running a &lt;br /&gt;&lt;pre class="brush: plain"&gt;dhclient wm0&lt;/pre&gt;will give you a DHCP lease in your 'regular' domain (in this case a lease handed out by my wireless access point instead of one handed out in a private range by virtualbox itself), the good news is that this ip address is accessible from the host os as well. This implies that I can now connect to it and start copy pasting. And a first copy paste is perhaps the output of &lt;i&gt;ifconfig -a&lt;/i&gt; which shows a configured ethernet adapter and the loopback device:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;# ifconfig -a&lt;br /&gt;wm0: flags=8843&lt;up,broadcast,running,simplex,multicast&gt; mtu 1500&lt;br /&gt;        capabilities=2bf80&amp;lt;TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Tx,UDP6CSUM_Tx&amp;gt;&lt;br /&gt;        enabled=0&lt;br /&gt;        address: 08:00:27:4c:94:06&lt;br /&gt;        media: Ethernet autoselect (1000baseT full-duplex)&lt;br /&gt;        status: active&lt;br /&gt;        inet 192.168.10.104 netmask 0xffffff00 broadcast 192.168.10.255&lt;br /&gt;        inet6 fe80::a00:27ff:fe4c:9406%wm0 prefixlen 64 scopeid 0x1&lt;br /&gt;lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 33192&lt;br /&gt;        inet 127.0.0.1 netmask 0xff000000&lt;br /&gt;        inet6 ::1 prefixlen 128&lt;br /&gt;        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2&lt;br /&gt;&lt;/up,broadcast,running,simplex,multicast&gt;&lt;/pre&gt;&lt;br /&gt;Now in order to connect to the system it is advised to start the sshd daemon by issuing&lt;br /&gt;&lt;pre class="brush: plain"&gt;# /etc/rc.d/sshd start&lt;br /&gt;&lt;/pre&gt;Instead of using start you can also use start, stop, restart and status as parameters:&lt;br /&gt;&lt;pre class="brush: plain"&gt;# /etc/rc.d/sshd status&lt;br /&gt;sshd is running as pid 357.&lt;/pre&gt;At this point we've done all these tings manually, while we really want the system to do this by default at startup. For this the files &lt;i&gt;/etc/rc.conf&amp;nbsp; &lt;/i&gt;and &lt;i&gt;/etc/defaults/rc.conf&lt;/i&gt; come into play. The file &lt;i&gt;/etc/rc.conf&lt;/i&gt; is sourced by rc, meaning that rc.conf should contains valid sh-compatible statements (read: setting variables).&amp;nbsp; &lt;i&gt;man 5 rc.conf&amp;nbsp; &lt;/i&gt;will give you a full description of the known variables, but take also a look in &lt;i&gt;/etc/defaults/rc.conf &lt;/i&gt;since this file is sourced by rc.conf:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: bash"&gt;# Load the defaults in from /etc/defaults/rc.conf (if it's readable).&lt;br /&gt;# These can be overridden below.&lt;br /&gt;#&lt;br /&gt;if [ -r /etc/defaults/rc.conf ]; then&lt;br /&gt;        . /etc/defaults/rc.conf&lt;br /&gt;fi&lt;/pre&gt;&lt;br /&gt;In the case of sshd, the defaults file states it should not be started:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;# cat ./defaults/rc.conf | grep -i ssh&lt;br /&gt;sshd=NO                 sshd_flags=""&lt;br /&gt;ssh_keygen_flags="-b 1024"      # generate 1024 bit keys if host keys missing&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;So by adding &lt;i&gt;sshd=YES&lt;/i&gt; to &lt;i&gt;/etc/rc.conf &lt;/i&gt;we can have the rc system start the ssh daemon at startup. Sometimes you want to know which rc.conf variables can help you to influence the behavior of an initscript. For this you can call an rc.d script with the &lt;i&gt;rcvar&lt;/i&gt;&amp;nbsp; parameter.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;# /etc/rc.d/sshd rcvar&lt;br /&gt;# sshd&lt;br /&gt;$sshd=YES&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now all we need after this is proper network configuration, in this case we extend &lt;i&gt;rc.conf &lt;/i&gt;with:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;dhclient=YES&lt;br /&gt;hostname=flying_spaghetti_monster&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Setting the hostname is optional, after a reboot the dhcp client will start and it will be accessible through ssh.&lt;br /&gt;&lt;br /&gt;An interesting paper to get a better understanding of the NetBSD rc system can be found at &lt;a href="http://www.mewburn.net/luke/papers/rc.d.pdf"&gt;http://www.mewburn.net/luke/papers/rc.d.pdf&lt;/a&gt; and there is also the rc chapter in the NetBSD guide at &lt;a href="http://www.netbsd.org/docs/guide/en/chap-rc.html"&gt;http://www.netbsd.org/docs/guide/en/chap-rc.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Post scriptum:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;In the setup above I suggested the use of a bridged adapter, this however is not without risks, later on I used this setup in combination with an NFS share (NFS share between host and guest), this however resulted in a lot of NFS related packets going over the ether, which caused my poor wireless router to suffocate.&lt;/span&gt;&amp;nbsp;&lt;/span&gt; A better solution is to used the 'host-only adapter' option, this will create a virtual interface on your host in a private subnet with your guest, this way (given that your NAT is configured properly) the same requirements as above can be met.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-7920227623464197837?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/7920227623464197837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/7920227623464197837'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2010/06/poor-mens-netbsd-part-ii-aka.html' title='Poor men&apos;s NetBSD part II (aka configuring NetBSD for usage in virtualbox)'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-30139374804075673.post-1907827940881363836</id><published>2010-06-05T15:41:00.000+02:00</published><updated>2010-06-05T15:41:48.467+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virtualbox'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBSD'/><title type='text'>Poor men's NetBSD (aka installing NetBSD 5.1 RC2 in virtualbox)</title><content type='html'>A week ago I did a NetBSD installation in a virtualbox, which is running under Debian unstable, at this point I use Debian for work and the goal is to start playing with NetBSD for fun. This blog is here mainly to track some of the steps/experiments I'm doing, it could be that this grows, it could be that this dies silently in the future ....&lt;br /&gt;&lt;br /&gt;However, as a first step I read NetBSD 5.1 RC2 is available (e.g. see &lt;a href="http://blog.netbsd.org/tnf/entry/netbsd_5_1_rc2"&gt;here on the NetBSD blog&lt;/a&gt;), so I will start doing a writeup on how to install this NetBSD 5.1 RC2 under virtualbox (like probably a lot of people have already done before me, but one's got to start somewhere). And at least that brings the test count of the 5.1 RC2 up by one. &lt;br /&gt;&lt;br /&gt;So we start with downloading the iso image which can be found at the following location &lt;a href="http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.1_RC2/iso/"&gt;http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.1_RC2/iso/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There download the i386 iso (this applies to each other version of NetBSD as well), next I assume you already have virtualbox installed (and operational). Next we start virtualboxroot and we click the 'New' button in the toolbar, the 'New Virtual Machine Wizard' appears, here we click next to get started.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Next we need to tell it what the name and type of our virtual machine should be, here we name it NetBSD.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;We start with assigning it some memory. Here I choose half a gigabyte (but we can change it later on if we would need more.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;We specify a new virtual hard disk should be created.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This launches the new virtual disk wizard.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual5.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is my favorite virtualbox feature, instead of assigning (and thus loosing) a lot of storage by sacrificing it upfront, we let virtualbox dynamically expand the storage as the demand grows.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual6.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;We need to specify an upper limit, but we don't loose it immediately (when I look at the NetBSD.vdi file after the installation which you can typically find in ~/.Virtualbox/HardDisks it consumes about 700 megabyte of space).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual7.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Virtual Disk was created.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual8.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the virtual machine is ready as well.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual9.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Next we select File -&amp;gt; Virtual Media Manager and we go to the known CD/DVD Image tab.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual10.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There we add the NetBSD ISO which we downloaded at the beginning.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual11.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Next we go the settings of the Virtual machine (right mouse) select storage and attach the CD/DVD image which was just made as secondary master device.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual12.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And now we power on the Virtual Machine, it will boot from CD.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual13.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The welcome message, and we all speak English:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual14.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;We use a sensible keyboard lay-out:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual15.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we want to install NetBSD:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual16.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Confirm.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual17.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There is only one disk, this makes it easy.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual18.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we have enough room for a full install.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual19.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is the 10 GB disk we created, simply use it.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual20.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The disk is only there to contain NetBSD, so we dedicate it entirely.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual21.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we need a bootloader.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual22.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Let NetBSD do whatever it thinks is best.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual23.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Confirm the suggestion.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual24.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;What's in a name ?&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual25.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Setting up is done, start the installation.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual26.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Creating the filesystems.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual27.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Output should appear on VGA, not on a serial connection.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual28.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Show some test scrolling on the screen during the installation.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual29.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Everything is on the iso image, so let's use that.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual31.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Accept the defaults.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual32.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Then it starts unpacking the packages onto the target.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual33.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Packages are installed.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual34.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;We select a timezone, your answers may differ ;).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual35.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual35.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Pick a choice, even though this is just a local plaything I can't force myself to make use of the weak DES.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual36.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Then we set the root password.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual37.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual37.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;A shell.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual38.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual38.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we're done !&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual39.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Now we select reboot, when you see it booting from the CD again, simply power off (close) the virtual box window (it is already installed, we don't want to do it again).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual40.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In the virtual machine settings (right mouse) we disconnect the CD image.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual41.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual41.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we power the virtual machine again (press start, oh and don't mind my sin in that list, it's there for work :()&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual42.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is the NetBSD bootcode.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual43.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And after boot we can log in (with the password we specified) and this shows the NetBSD 5.1 RC2 is running. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.de-brauwer.be/images/virtual_box/virtual44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.de-brauwer.be/images/virtual_box/virtual44.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Et voila, we have NetBSD running inside a Virtualbox. You could typer poweroff now, or do a shutdown, or close the window to terminate it. You could even export your virtual machine (File-&amp;gt;Export Appliance) to share it with your friends.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30139374804075673-1907827940881363836?l=netbsdjourney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/1907827940881363836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30139374804075673/posts/default/1907827940881363836'/><link rel='alternate' type='text/html' href='http://netbsdjourney.blogspot.com/2010/06/poor-mens-netbsd-aka-installing-netbsd.html' title='Poor men&apos;s NetBSD (aka installing NetBSD 5.1 RC2 in virtualbox)'/><author><name>ElieDeBrauwer</name><uri>http://www.blogger.com/profile/14827823269344247161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
