Making Picostation m2HP work

hiren panchasara hiren.panchasara at gmail.com
Mon Aug 26 21:24:51 UTC 2013


On Thu, Aug 22, 2013 at 12:20 AM, hiren panchasara <
hiren.panchasara at gmail.com> wrote:

>
>
>
> On Wed, Aug 21, 2013 at 10:02 PM, Adrian Chadd <adrian at freebsd.org> wrote:
>
>> Right! Nice work!
>>
>> So that tells me that whatever image you've stuffed into the ubiquiti
>> firmware isn't setup right. Did you lzma compress the kernel, then wrap
>> that in mkimage or whatever the u-boot command is, and then pass _that_
>> output to the ubiquiti firmware builder?
>>
>
> Alright, so as Adrian suggested, I tried to create uboot'ed kernel by
> running:
>
>  "# ../build/build/bin/build ap91 uboot"
>
> which basically runs build_uboot which does following:
>
> /usr/local/bin/lzma e ${X_KERNEL} /tftpboot/kernel.${KERNCONF}.lzma ||
> exit 1
>
> # Create the firmware
> mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C lzma \
>   -a ${UBOOT_KERN_LOADADDR} -e ${UBOOT_KERN_STARTADDR} \
>   -n "FreeBSD" -d /tftpboot/kernel.${KERNCONF}.lzma \
>   /tftpboot/kernel.${KERNCONF}.lzma.uImage \
>   || exit 1
>
> Now, I had to install /usr/ports/devel/uboot-mkimage/ port to get
> "mkimage" binary referenced above.
>
> But as soon as I run "# ../build/build/bin/build ap91 uboot", the laptop
> deadlocks. I have to hard reboot the laptop. I tried it 2 times and it
> stops right when its trying to execute mkimage command listed above.
>
> I am not sure what is the reason behind that. And I see ray@ is the
> maintainer of that port so I am cc'ing him to get some insights too.
>

That was some issue on my laptop. Trying on another laptop worked.

I generated final image with kernel.AP91.lzma.uImage inside it instead of
plain kernel.gz

This is what I am getting now (instead of "bad magic number"):


U-Boot 1.1.4.2-s594 (Dec  5 2012 - 15:23:07)

Board: Ubiquiti Networks XM board (rev 1.0 e302)
DRAM:  32 MB
Flash:  8 MB
PCIe WLAN Module found (#1).
Net:   eth0, eth1
Hit any key to stop autoboot:  0
## Booting image at 9f050000 ...
   Image Name:   FreeBSD
   Created:      2013-08-24  15:28:06 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    131085 Bytes = 128 kB
   Load Address: 80050000
   Entry Point:  80050100
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... ERROR, LzmaDecode.c, 332

Decoding error = 1
LZMA ERROR 1 - must RESET board to recover

Resetting...

Trying to figure out what this means.

I _think_ we are real close in making this work :-)

cheers,
Hiren


More information about the freebsd-embedded mailing list