Diff for /wikisrc/tutorials/how_to_install_netbsd_on_hpcarm.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/20 20:55:21 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 This how-to describes how to install NetBSD/hpcarm on a Jornada 720. We will be using a 1 GB compact flash card and will configure swap on the card.  This how-to describes how to install NetBSD/hpcarm on a Jornada 720. We will be using a 1 GB compact flash card and will configure swap on the card.
   
 **Contents**  **Contents**
   
 [[!toc]]  [[!toc]]
   
 #Disklabel the disk  #Disklabel the disk 
   
 We are going to create our partitions in such a way that disklabel will do all the work of calculating the sizes for us. Hook your flash card up to the computer and check where it attaches. On my machine it shows up as sd1, so that's what I will use.  We are going to create our partitions in such a way that disklabel will do all the work of calculating the sizes for us. Hook your flash card up to the computer and check where it attaches. On my machine it shows up as sd1, so that's what I will use.
   
 Open up a terminal and lets begin. Use the -I to create first partition on disk.  Open up a terminal and lets begin. Use the -I to create first partition on disk.
   
     # disklabel -i -I sd1      # disklabel -i -I sd1
     partition>      partition>
   
 First we will create a DOS partition to store the kernel and the boot program. This partition is going to be at the beginning of the disk so it MUST have an offset of 63. That little gap is where the disklabel is stored, if you don't leave the offset, your disklabel will be overwritten when you try to format the disk.  First we will create a DOS partition to store the kernel and the boot program. This partition is going to be at the beginning of the disk so it MUST have an offset of 63. That little gap is where the disklabel is stored, if you don't leave the offset, your disklabel will be overwritten when you try to format the disk.
   
     partition> e      partition> e
     Filesystem type [?] [MSDOS]:      Filesystem type [?] [MSDOS]:
     Start offset ('x' to start after partition 'x') [0.0307617c, 63s, 0.0307617M]:      Start offset ('x' to start after partition 'x') [0.0307617c, 63s, 0.0307617M]:
     Partition size ('$' for all remaining) : 6MB      Partition size ('$' for all remaining) : 6MB
     partition>      partition>
   
 We give it 6 MB as that is enough room for the boot program and 2 kernels.  We give it 6 MB as that is enough room for the boot program and 2 kernels.
   
 Next we set up the swap partition, which is partition b by convention.  Next we set up the swap partition, which is partition b by convention.
   
     partition> b      partition> b
     Filesystem type [?] : swap      Filesystem type [?] : swap
     Start offset ('x' to start after partition 'x') : e      Start offset ('x' to start after partition 'x') : e
     Partition size ('$' for all remaining) : 64MB      Partition size ('$' for all remaining) : 64MB
      b:    131072     12351       swap                     # (Cyl.      6*-     70*)       b:    131072     12351       swap                     # (Cyl.      6*-     70*)
     partition>      partition>
   
 We have told disklabel to start the swap partition after the DOS partition so we don't have to do any calculations.  We have told disklabel to start the swap partition after the DOS partition so we don't have to do any calculations.
   
 Next is the main NetBSD partition a.  Next is the main NetBSD partition a.
   
     partition> a      partition> a
     Filesystem type [?] : 4.2BSD      Filesystem type [?] : 4.2BSD
     Start offset ('x' to start after partition 'x') : b      Start offset ('x' to start after partition 'x') : b
     Partition size ('$' for all remaining) : $      Partition size ('$' for all remaining) : $
      a:   1859473    143423     4.2BSD   1024  8192 45488  # (Cyl.     70*-    977*)       a:   1859473    143423     4.2BSD   1024  8192 45488  # (Cyl.     70*-    977*)
     partition>      partition>
   
 The last partition to set up is c. This partition represents the whole NetBSD portion of the disk, in our case that's partitions a and b.  The last partition to set up is c. This partition represents the whole NetBSD portion of the disk, in our case that's partitions a and b.
   
     partition> c      partition> c
     Filesystem type [?] : unused      Filesystem type [?] : unused
     Start offset ('x' to start after partition 'x') : e      Start offset ('x' to start after partition 'x') : e
     Partition size ('$' for all remaining) : $      Partition size ('$' for all remaining) : $
      c:   1990545     12351     unused      0     0        # (Cyl.      6*-    977*)       c:   1990545     12351     unused      0     0        # (Cyl.      6*-    977*)
     partition>      partition>
   
 You should now have:  You should now have:
   
     partition> P      partition> P
     5 partitions:      5 partitions:
     #        size    offset     fstype [fsize bsize cpg/sgs]      #        size    offset     fstype [fsize bsize cpg/sgs]
      a:   1859473    143423     4.2BSD      0     0        # (Cyl.     70*-    977*)       a:   1859473    143423     4.2BSD      0     0        # (Cyl.     70*-    977*)
      b:    131072     12351       swap                     # (Cyl.      6*-     70*)       b:    131072     12351       swap                     # (Cyl.      6*-     70*)
      c:   1990545     12351     unused      0     0        # (Cyl.      6*-    977*)       c:   1990545     12351     unused      0     0        # (Cyl.      6*-    977*)
      d:   2002896         0     unused      0     0        # (Cyl.      0 -    977*)       d:   2002896         0     unused      0     0        # (Cyl.      0 -    977*)
      e:     12288        63      MSDOS                     # (Cyl.      0*-      6*)       e:     12288        63      MSDOS                     # (Cyl.      0*-      6*)
     partition>      partition>
   
 If you're happy with the partition table then write it:  If you're happy with the partition table then write it:
   
     partition> W      partition> W
     Label disk [n]? y      Label disk [n]? y
     Label written      Label written
     partition>      partition>
   
 Now you have labeled the disk, on to the next step.  Now you have labeled the disk, on to the next step. 
   
 #Format the partitions  #Format the partitions
   
 First, format the DOS partition:  First, format the DOS partition:
   
     # newfs_msdos sd1e      # newfs_msdos sd1e
     /dev/rsd1e: 12240 sectors in 1530 FAT12 clusters (4096 bytes/cluster)      /dev/rsd1e: 12240 sectors in 1530 FAT12 clusters (4096 bytes/cluster)
     MBR type: 1      MBR type: 1
     bps=512 spc=8 res=1 nft=2 rde=512 sec=12288 mid=0xf8 spf=5 spt=32 hds=64 hid=63      bps=512 spc=8 res=1 nft=2 rde=512 sec=12288 mid=0xf8 spf=5 spt=32 hds=64 hid=63
   
 Secondly, the NetBSD partition:  Secondly, the NetBSD partition:
   
     # newfs sd1a      # newfs sd1a
     /dev/rsd1a: 907.9MB (1859472 sectors) block size 8192, fragment size 1024      /dev/rsd1a: 907.9MB (1859472 sectors) block size 8192, fragment size 1024
             using 20 cylinder groups of 45.40MB, 5811 blks, 11264 inodes.              using 20 cylinder groups of 45.40MB, 5811 blks, 11264 inodes.
     super-block backups (for fsck -b #) at:      super-block backups (for fsck -b #) at:
           32,   93008,  185984,  278960,  371936,  464912,  557888,  650864,            32,   93008,  185984,  278960,  371936,  464912,  557888,  650864,
       743840,  836816,  929792, 1022768, 1115744, 1208720, 1301696, 1394672,        743840,  836816,  929792, 1022768, 1115744, 1208720, 1301696, 1394672,
      1487648, 1580624, 1673600, 1766576, ...       1487648, 1580624, 1673600, 1766576, ...
   
 #Cross building hpcarm  #Cross building hpcarm
   
 Because of NetBSD's superb build framework, crosscompiling a [[Hardware/hpcarm]] release is very easy.  Because of NetBSD's superb build framework, crosscompiling a [[Hardware/hpcarm]] release is very easy.
   
 First we need some where to store the [[Hardware/hpcarm]] distribution and release. I use /usr/hpcarm/distribution and /usr/hpcarm/release, but anywhere will do.  First we need some where to store the [[Hardware/hpcarm]] distribution and release. I use /usr/hpcarm/distribution and /usr/hpcarm/release, but anywhere will do.
   
 Now tell build.sh where to store its build:  Now tell build.sh where to store its build:
   
     # export DESTDIR=/usr/hpcarm/distribution      # export DESTDIR=/usr/hpcarm/distribution
     # export RELEASEDIR=/usr/hpcarm/release      # export RELEASEDIR=/usr/hpcarm/release
   
 Start the build with:  Start the build with:
   
     # cd /usr/src      # cd /usr/src
     # ./build.sh -x -m hpcarm release      # ./build.sh -x -m hpcarm release
   
 If you don't want X built drop the -x option.  If you don't want X built drop the -x option.
   
 Wait until it's finished and there should be a nice shiny new release in your release dir.  Wait until it's finished and there should be a nice shiny new release in your release dir.
   
 Now to install it on your flash card...  Now to install it on your flash card... 
   
 #Install the release  #Install the release
   
 Mount your flash card:  Mount your flash card:
   
     # mount -o softdep /dev/sd1a /mnt/jornada      # mount -o softdep /dev/sd1a /mnt/jornada
   
 Create a mount point for the DOS partition:  Create a mount point for the DOS partition:
   
     # mkdir /mnt/jornada/dos      # mkdir /mnt/jornada/dos
   
 Mount the DOS partition (*IMPORTANT*: use the -l option, see BUGS in mount_msdos(8)):  Mount the DOS partition (*IMPORTANT*: use the -l option, see BUGS in mount_msdos(8)):
   
     # mount -o -l /dev/sd1e /mnt/jornada/dos      # mount -o -l /dev/sd1e /mnt/jornada/dos
   
 Now we are ready to start installing.  Now we are ready to start installing.
   
 Install the boot program:  Install the boot program:
   
     # cp /usr/hpcarm/release/hpcarm/installation/hpcboot.exe /mnt/jornada/dos      # cp /usr/hpcarm/release/hpcarm/installation/hpcboot.exe /mnt/jornada/dos
   
 Install the kernel:  Install the kernel:
   
     # tar -x -p -z -f /usr/hpcarm/release/hpcarm/binary/sets/kern-JORNADA720.tgz -C /mnt/jornada/dos      # tar -x -p -z -f /usr/hpcarm/release/hpcarm/binary/sets/kern-JORNADA720.tgz -C /mnt/jornada/dos
   
 Now extract the sets. This will extract all sets except the kernels.  Now extract the sets. This will extract all sets except the kernels.
   
     # for f in /usr/hpcarm/release/hpcarm/binary/sets/[^k]*.tgz; do      # for f in /usr/hpcarm/release/hpcarm/binary/sets/[^k]*.tgz; do
     >   tar -x -p -z -f $f -C /mnt/jornada      >   tar -x -p -z -f $f -C /mnt/jornada
     > done      > done
   
 If you dont want the X sets, then just add x to the regular expression.  If you dont want the X sets, then just add x to the regular expression. 
   
 #Configure the system  #Configure the system
   
 We are on the home straight, we just need to configure a few files and we are done.  We are on the home straight, we just need to configure a few files and we are done.
   
 Create the devices:  Create the devices:
   
     # cd /mnt/jornada/dev      # cd /mnt/jornada/dev
     # ./MAKEDEV all      # ./MAKEDEV all
   
 Create a symlink to the kernel:  Create a symlink to the kernel:
   
     # cd /mnt/jornada      # cd /mnt/jornada
     # ln -s dos/netbsd      # ln -s dos/netbsd
   
 Set up your fstab file:  Set up your fstab file:
   
     # vi /mnt/jornada/etc/fstab      # vi /mnt/jornada/etc/fstab
   
     # cat /mnt/jornada/etc/fstab      # cat /mnt/jornada/etc/fstab
     /dev/wd0a /   ffs   rw,noatime,nodevmtime 1 1      /dev/wd0a /   ffs   rw,noatime,nodevmtime 1 1
     /dev/wd0b none swap sw 0 0      /dev/wd0b none swap sw 0 0
     /dev/wd0e /dos msdos -l,rw                 0 0      /dev/wd0e /dos msdos -l,rw                 0 0
   
 Last but not least is to configure rc.conf.  Last but not least is to configure rc.conf.
   
 Mine looks like:  Mine looks like:
 <pre><code>  <pre><code>
 # cat /mnt/jornada/etc/rc.conf  # cat /mnt/jornada/etc/rc.conf
 #       $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $  #       $NetBSD: how_to_install_netbsd_on_hpcarm.mdwn,v 1.1 2011/11/20 20:55:21 mspo Exp $
 #  #
 # see rc.conf(5) for more information.  # see rc.conf(5) for more information.
 #  #
 # Use program=YES to enable program, NO to disable it. program_flags are  # Use program=YES to enable program, NO to disable it. program_flags are
 # passed to the program on the command line.  # passed to the program on the command line.
 #  #
 # Load the defaults in from /etc/defaults/rc.conf (if it's readable).  # Load the defaults in from /etc/defaults/rc.conf (if it's readable).
 # These can be overridden below.  # These can be overridden below.
 #  #
 if [ -r /etc/defaults/rc.conf ]; then  if [ -r /etc/defaults/rc.conf ]; then
         . /etc/defaults/rc.conf          . /etc/defaults/rc.conf
 fi  fi
 # If this is not set to YES, the system will drop into single-user mode.  # If this is not set to YES, the system will drop into single-user mode.
 #  #
 rc_configured=YES  rc_configured=YES
 wscons=YES  wscons=YES
 defaultroute="1.1.1.1"  defaultroute="1.1.1.1"
 hostname=someone.somwhere.co.uk  hostname=someone.somwhere.co.uk
 sshd=YES  sshd=YES
 rpcbind=YES  rpcbind=YES
 nfs_client=YES  nfs_client=YES
 lockd=YES  lockd=YES
 statd=YES  statd=YES
 cron=NO  cron=NO
 # Add local overrides below  # Add local overrides below
 #  #
 </code></pre>  </code></pre>
   
 If you are using DHCP, add **dhclient=YES** instead of the defaultroute and hostname.  If you are using DHCP, add **dhclient=YES** instead of the defaultroute and hostname.
   
 Now you're ready to boot it up.  Now you're ready to boot it up. 
   
 #Boot it up  #Boot it up
   
 Unmount your partitions and put the card in the Jornada. Go to **My Documents** then up one level and into **Storage Card**. Run the hpcboot program. On the boot tab select HP Jornada 720 (Japanese), select \Storage Card\ as the path and netbsd as the kernel to boot. Set the root file system to wd. Press boot and enjoy.  Unmount your partitions and put the card in the Jornada. Go to **My Documents** then up one level and into **Storage Card**. Run the hpcboot program. On the boot tab select HP Jornada 720 (Japanese), select \Storage Card\ as the path and netbsd as the kernel to boot. Set the root file system to wd. Press boot and enjoy.
   
 After you've set up hpcboot and verified the settings by successfully booting NetBSD, you may skip all the WinCE setup while booting by hitting Win+E and using only return, space and arrow keys to navigate to hpcboot and start booting NetBSD.   After you've set up hpcboot and verified the settings by successfully booting NetBSD, you may skip all the WinCE setup while booting by hitting Win+E and using only return, space and arrow keys to navigate to hpcboot and start booting NetBSD. 
   

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb