Guide to Hacking the OSD: NetBooting the OSD

From The Neuros Technology Wiki

Jump to: navigation, search
Previous Chapter Table of Contents Next Chapter


Contents

[edit] NetBooting the OSD

[edit] Prerequisites

You need to have followed the Serial, NFS and TFTP sections in the Workstation Setup page. Alternatively, if you're using the Virtual Machine Development Environment, you need to have followed the instructions in there for netbooting setup.

[edit] Entering in uboot console

The first step is to get into uBoot.

  1. Start up minicom
  2. Power up the OSD
  3. When it says "hit any key to stop autoboot", hit the spacebar before the countdown expires.

Now that you're in uBoot, proceed to the correct type of configuration

  • DHCP — IP address assigned by a DHCP server
    • DHCP Method 1 — TFTP server and path as well as NFS server and path assigned by DHCP server, too. Appropriate for full DHCP servers running on Linux, xBSD, etc. (See also the DHCP server setup instructions).
    • DHCP Method 2 — Only IP address, network, and gateway assigned by DHCP server. Appropriate for SoHo routers. NOTE: This is probably what most people using DHCP need
  • Static IP Addressing — IP address, network, gateway, TFTP & NFS servers and paths are all configured staticly and stored in the OSD's flash.

[edit] DHCP

[edit] Method 1

You must perform the optional DHCP server setup in order to use this method. This is the preferred method, but is generally only available if you're using a full DHCP server, not a SoHo router. It's not the most common situation.

This method is very easy, as nearly all the configuration information is stored on the DHCP server. The alternative is to store it all on the OSD as in Method 2 below.

setenv bootargs $(console) root=/dev/nfs rw ip=dhcp $(mem_reserve)
setenv bootcmd dhcp\; bootm
saveenv

[edit] Method 2

This method is for use with your average SoHo router which provides DHCP, but doesn't allow you to configure things like TFTP server, NFS root, etc. If you're using a Linux machine for DHCP, you probably want Method 1.

setenv nfs_serverip your-workstation's-ip  # step 1
setenv nfs_root /path/to/neuros-bsp/rootfs/fs     #      2 
setenv serverip your-workstations-ip       #      3
setenv tftp_root /images                          #      4
setenv bootcmd dhcp\; run devkernel               #      5
run update-locs                                   #      6
run update-ipdhcp                                 #      7

[edit] Static IP Addressing

This is nearly the same as DHCP Method 2. Use those steps, except replace step #5 with these two:

setenv ipaddr the-osd's-ip-address
setenv bootcmd run devkernel

Also, replace step #7 with:

run update-ipstatic

[edit] The Boot

Type boot to boot the OSD or reset and let the coundown expire. Hey, at least some things are simple, right?

[edit] Reverting to booting from flash

If you want to revert to booting from flash, you can just do

  setenv bootcmd run cramfs_boot
  saveenv
  boot

Or you can just boot from flash once by doing

  run cramfs_boot

[edit] Known Errors

[edit] During boot, networking dies

Symptom: "nfs: RPC call returned error 101"

Problem: After the Linux kernel autoconfigures itself with an IP address, osdmain starts udhcpc which removes the IP address from the interface just long enough to confuse the NFS mount.

Solution: A patch is available; see bug 1873.

Old way: Boot from the firmware inside your OSD flash (see section above), then from OSD GUI configure the network for static addressing. Next time you reboot with NetBoot, this will prevent udhcpc from starting and causing the problem above by trying to get an address dynamically.

[edit] Unable to open an initial console

Symptom: "warning unable to open an initial console."

Symptom: "Kernel panic - not syncing: No init found. Try passing init= option to kernel."

Problem: By default, Neuros' supplied vm image comes with wrong permisions on /srv/neuros-osd-rootfs/dev/. RC scripts cannot create an initial console if /dev/ttyS0 is not setup properly.

Solution: run "sudo apt-get update && sudo apt-get dist-upgrade" to fix /srv/neuros-osd-rootfs/dev/ permisions.

[edit] TFTP timesout

Symptom: As the OSD is netbooting, it first tries to fetch /srv/tftp/neuros-osd/uImage from the VMware machine using tftp, but continually times out.

Solution: I found that the TFTP daemon (atftpd) isn't being called when incoming tftp requests are recieved (inetd/xinetd should look after this). I found it easiest simply to run atftpd as a standalone daemon, which you can do by re-running the command "sudo dpkg-reconfigure --plow atftpd", and when it asks you whether the server should be started by initd, say no. Accept the defaults (make sure /srv/tftp is shared) from there on. Now atftpd should be running. --Greyback 06:52, 19 July 2007 (CDT)--

[edit] I want to recover my flash (cramfs) with TFTP and netbooting without CF-card reader on computer

Symptom: As the OSD is netbooting, you can ask it to write the r3.upk package on the card, at the next reboot it will automatically recover from there (don't forget to run cramfs_boot after updating).

Solution: Put a CF-card in the OSD. Save the .upk you want to use as /srv/neuros-osd-rootfs/root/r3.upk. In /srv/neuros-osd-rootfs/etc/rc5.d/S99_osdmain add under "#!/bin/sh" the following line: " mkdir /media/CF-card1/newpackage ; cd /media/CF-card1/newpackage ; echo 1 > disable_upk_version_check ; rm r3.upk ; cp /root/r3.upk . ; rm /root/r3.upk ; reboot " . After the unit reboots, just unplug the ethernet to ensure you are no netbooting anymore. Wait while flashing.


Previous Chapter Table of Contents Next Chapter
Personal tools