# How to boot FreeBSD from USB on Sheeva Plug?



## sergeig (Aug 23, 2013)

Please note that I may not know what appears obvious to you.

I custom compiled FreeBSD 9.1 for a SheevaPlug. I then loaded the kernel into a FAT 16 (<= 32 MB) slice on my USB stick. I also loaded world on a 2second slice configured for FreeBSD. I succeeded in booting the FreeBSD kernel, but then it is looking for BOOTP forever. My guess is that I have to point the kernel to the location of the root file system. So, I have built a custom kernel based on the SheevaPlug. I simply enabled the root option:

```
# Root fs on USB device
    options         ROOTDEVNAME=\"ufs:/dev/da0s2\"
```
It did not help. So, I don't know how to proceed. Perhaps I did not guess the device name properly. I don't know how to pass the root device name through the u-boot loader. So, my only option is to recompile the kernel.

Here is the log of the FreeBSD boot sequence:

```
usb start

(Re)start USB...
USB:   scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Marvell>> fatload usb 0:1 0x80  900000 /kernel-my.bin

reading /kernel-my.bin
................................................................................................................................................................................................................................................................................................................................................

3441016 bytes read
Marvell>> go 0x  900000

## Starting application at 0x00900000 ...
 dtbp = 0xc0c236d8
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.1-RELEASE #0: Fri Aug 23 04:01:50 PDT 2013
    sergei@fbsd:/home/sergei/obj/arm.arm/usr/src/sys/MYSHEEVA arm
CPU: Feroceon 88FR131 rev 1 (Marvell core)
  DC enabled IC enabled WB enabled EABT branch prediction enabled
  16KB/32B 4-way Instruction cache
  16KB/32B 4-way write-back-locking-C Data cache
real memory  = 536870912 (512 MB)
avail memory = 519770112 (495 MB)
SOC: Marvell 88F6281 rev A1, TClock 200MHz
simplebus0: <Flattened device tree simple bus> on fdtbus0
ic0: <Marvell Integrated Interrupt Controller> mem 0xf1020200-0xf102023b on simplebus0
timer0: <Marvell CPU Timer> mem 0xf1020300-0xf102032f irq 1 on simplebus0
Event timer "CPUTimer0" frequency 200000000 Hz quality 1000
Timecounter "CPUTimer1" frequency 200000000 Hz quality 1000
gpio0: <Marvell Integrated GPIO Controller> mem 0xf1010100-0xf101011f irq 35,36,37,38,39,40,41 on simplebus0
rtc0: <Marvell Integrated RTC> mem 0xf1010300-0xf1010307 on simplebus0
mge0: <Marvell Gigabit Ethernet controller> mem 0xf1072000-0xf1073fff irq 12,13,14,11,46 on simplebus0
mge0: Ethernet address: f0:ad:4e:02:0e:ff
miibus0: <MII bus> on mge0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
uart0: <16550 or compatible> mem 0xf1012000-0xf101201f irq 33 on simplebus0
uart0: console (1066,n,8,1)
uart1: <16550 or compatible> mem 0xf1012100-0xf101211f irq 34 on simplebus0
cesa0: <Marvell Cryptographic Engine and Security Accelerator> mem 0xf1030000-0xf103ffff irq 22 on simplebus0
ehci0: <Marvell Integrated USB 2.0 controller> mem 0xf1050000-0xf1050fff irq 48,19 on simplebus0
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0 on ehci0
cryptosoft0: <software crypto> on motherboard
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
bootpc_init: wired to interface 'mge0'
mge0: Timeout on link-up
mge0: Timeout on link-up
Sending DHCP Discover packet from interface mge0 (f0:ad:4e:02:0e:ff)
ugen0.1: <Marvell> at usbus0
uhub0: <Marvell EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
mge0: link state changed to DOWN
uhub0: 1 port with 1 removable, self powered
ugen0.2: <Prolific Technology Inc.> at usbus0
uhub1: <Prolific Technology Inc. USB Embedded Hub, class 9/0, rev 2.00/1.00, addr 2> on usbus0
uhub1: 1 port with 0 removable, self powered
ugen0.3: <Prolific Technology Inc.> at usbus0
umass0: <Prolific Technology Inc. USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 3> on usbus0
umass0:  8070i (ATAPI) over Bulk-Only; quirks = 0x4100
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <Corsair Flash Voyager 1.00> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 1956MB (4005888 512 byte sectors: 255H 63S/T 249C)
mge0: watchdog timeout
mge0: Timeout on link-up
DHCP/BOOTP timeout for server 255.255.255.255
mge0: watchdog timeout
mge0: Timeout on link-up
DHCP/BOOTP timeout for server 255.255.255.255
mge0: watchdog timeout
mge0: Timeout on link-up
```


----------



## mmoll (Aug 23, 2013)

You probably need to delete some kernel options regarding diskless booting. Here is my kernel configuration file as reference:


```
include SHEEVAPLUG
ident SHEEVA

options GEOM_PART_BSD
options GEOM_PART_GPT
options GEOM_PART_MBR
options GEOM_LABEL
options ROOTDEVNAME=\"ufs:/dev/ufs/sheevaroot\"

options TMPFS
options MSDOSFS

options GEOM_ELI
options GEOM_ZERO

nooptions NFS_ROOT                #NFS usable as /, requires NFSCL
nooptions BOOTP
nooptions BOOTP_NFSROOT
nooptions BOOTP_NFSV3
nooptions BOOTP_WIRED_TO
```


----------

