Subject: Re: [Fwd: NSLU2 builds and boots, but seems to disappear when running
To: rtos <rtos@rogers.com>
From: Donald T Hayford <don@donhayford.com>
List: port-arm
Date: 01/25/2008 14:30:49
rtos wrote:
> This is not the right kernel. I lost my partition and I will have to
> reproduce the steps on my machine before I can provide the details.  
> To give you and idea, you have to copy what is being done for targets
> like ADI_BRH. Take a look at files like
> distrib/evbarm/instkernel/instkernel/Makefile
> and /usr/src/sys/arch/evbarm/conf/ADI_BRH_INSTALL and do the same for
> NSLU2. Just grep for ADI_BRH. 
>
> I would start by doing a build release and looking at what files are
> generated for ADI_BRH. Then try and make the slug look the same. My
> kernel refused to work (couldn't find the filesystem) until I enabled:
> options        FFS_EI          # FFS Endian Independant support
Following rtos' suggestion, I created one new file: 
~/usr/src/sys/arch/evbarm/conf/NSLU2_INSTALL

#    $NetBSD: NSLU2_INSTALL
#    based on ADI_BRH_INSTALL,v 1.1 2003/04/08 20:49:01 thorpej Exp $
#
#    NSLU2_INSTALL -- NSLU2 kernel with installation-sized
#    ramdisk
#

include "arch/evbarm/conf/NSLU2"
include "arch/evbarm/conf/INSTALL"

and patched two others:

--- distrib/evbarm/instkernel/instkernel/Makefile.orig  2006-11-08 
22:03:15.000000000 -0500
+++ distrib/evbarm/instkernel/instkernel/Makefile       2008-01-25 
10:27:44.000000000 -0500
@@ -18,7 +18,8 @@
                        TEAMASA_NPWR_INSTALL    ${RAMDISK}      -
 .else
 # Big endian platforms.
-MDSETTARGETS=          ADI_BRH_INSTALL         ${RAMDISK}      -
+MDSETTARGETS=          ADI_BRH_INSTALL         ${RAMDISK}      -   \
+                                       NSLU2_INSTALL           
${RAMDISK}  -
 .endif
 MDSET_RELEASEDIR=      installation/instkernel


--- etc/etc.evbarm/Makefile.inc.orig    2007-07-25 23:13:52.000000000 -0400
+++ etc/etc.evbarm/Makefile.inc 2008-01-25 11:57:49.000000000 -0500
@@ -13,7 +13,7 @@
                        TEAMASA_NPWR TS7200 TWINTAIL
 .else
 # Big endian platforms
-EVBARM_BOARDS=         ADI_BRH
+EVBARM_BOARDS=         ADI_BRH NSLU2
 .endif

 .for board in ${EVBARM_BOARDS}

I also changed the NSLU2 configuration file to include the FFS_EI option 
and rebuilt the kernel, build, and release targets.  I loaded the file 
"netbsd-NSLU2_INSTALL.bin" onto the tftp server, and lo and behold:

RedBoot> load -r -b 0x200000 netbsd-NSLU2_INSTALL.bin
Using default protocol (TFTP)
Raw file loaded 0x00200000-0x007b36b3, assumed entry at 0x00200000
RedBoot> g
[ Kernel symbol table missing! ]
pmap_postinit: Allocated 9 static L1 descriptor tables
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 4.99.49 (NSLU2_INSTALL) #0: Fri Jan 25 12:19:11 EST 2008
        
hayford@debian:/home/hayford/usr/src/sys/arch/evbarm/compile/obj/NSLU2_INSTALL
total memory = 32768 KB
avail memory = 24028 KB
mainbus0 (root)
[...snip...]
Welcome to sysinst, the NetBSD-4.99.49 system installation tool.  This
 menu-driven tool is designed to help you install NetBSD to a hard disk, or
 upgrade an existing NetBSD system, with a minimum of work.
 In the following menus type the reference letter (a, b, c, ...) to 
select an
 item, or type CTRL+N/CTRL+P to select the next/previous item.
 The arrow keys and Page-up/Page-down may also work.
 Activate the current selection from the menu by typing the enter key.

 If you booted from a floppy, you may now remove the disk.

 Thank you for using NetBSD!

               lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
               x NetBSD-4.99.49 Install System                 x
               x                                               x
               x>a: Install NetBSD to hard disk                x
               x b: Upgrade NetBSD on a hard disk              x
               x c: Re-install sets or install additional sets x
               x d: Reboot the computer                        x
               x e: Utility menu                               x
               x x: Exit Install System                        x
               mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
[...snip...]

The installation option got as far as trying to partition/label the 
thumb drive, but failed with the message:

     Status: Command failed
    Command: disklabel -w -r -f /tmp/disktab sd0 'NETBSD-NSLU2'
     Hit enter to continue
--------------------------------------------------------------------------------
disklabel: partition b: partition extends past end of unit

But, I've been having problems with disklabel even when booting from 
NFS, so I'm not sure that means anything.  It would appear that rtos' 
method does work.

The saga continues...

Thanks for the help, Don