Succesfully booting debian on NanoNote

David Reyes Samblas Martinez david at tuxbrain.com
Mon May 10 16:28:11 EDT 2010


After some trial and error, and  conecting the serial cable to read
the kernel messages I can find an *almost sure* way to flash debian on
BNN:
uboot:
latest:
# wget http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND/latest/openwrt-xburst-u-boot.bin

or if you want to have TP4 TP5 as UART until the patch is applied to
(this is the one I'm actually using)
# wget http://downloads.qi-hardware.com/people/xiangfu/tmp/openwrt-xburst-qi_lb60-u-boot.bin

kernel:
# wget http://pyneo.org/downloads/nano/openwrt-xburst-qi_lb60-uImage.bin

rootfs:
# wget http://mister-muffin.de/nanonote/debian-sid.ubi

Put your nano in USBboot mode and and as root
# usbboot -c "boot"
# usbboot -c "nerase 0 4096 0 0"
# usbboot -c "nprog 0 openwrt-xburst-qi_lb60-u-boot.bin 0 0 -n"
# usbboot -c "nprog 1024 openwrt-xburst-qi_lb60-uImage.bin 0 0 -n"
# usbboot -c "nprog 2048 debian-sid.ubi 0 0 -n"

Thinks you have to have in mind, once flashed when booting, try to
avoid to have an SD card inserted due if for watever reason there are
some corruption on a filesystem on any partition, system waits you
enter in mantenaince mode to do fckdsk and fix the error.
The serial output give me this
-----------------------------------------------------------------------------------------------
Checking file systems...fsck from util-linux-ng 2.16.2
/dev/mmcblk0p2: Superblock last mount time (Tue Jan  6 04:28:04 1970,
	now = Thu Jan  1 00:22:26 1970) is in the future.


/dev/mmcblk0p2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
	(i.e., without -a or -p options)
fsck died with exit status 4
failed (code 4).
File system check failed. A log is being saved in
/var/log/fsck/checkfs if that location is writable. Please repair the
file system manually. ... failed!
A maintenance shell will now be started. CONTROL-D will terminate this
shell and resume system boot. ... (warning).
Give root password for maintenance
(or type Control-D to continue):
-----------------------------------------------------------------------------------------------------
But in the BNN screen is a pretty empty black or the last Kernel
messages, not this text so without the serial you just think it hangs,
booting again without the sd inserted boots fine, inserting the card
after booting also works (mounting manually of course)

Also don't waste you time in the big debian rootfs[1] if not is to try
to know why it doesn't load,
here you have a pic with the error it gives (is the same as in the serial)
http://www.tuxbrain.com/sites/default/files/debiankernelpanic.jpg
after it there are not more signs of live from BNN an yes I have
tryied in all ways posible, with different uboots, erasing all nand,
doing it first, doing it last, with battery, without, dancing,
singing, happy, sad, even with sweet words but no way it just don't
load.

following is the full serial output with the combination tp4-5 enabled
uboot+pyneo kernel+josch rootfs from begining to end due I find there
are some errors/warnings while booting but HEY IT BOOTS!!!
-----------------------------------------------------------------------------------------------------------
NAND Secondary Program Loader

Starting U-Boot ...


U-Boot 2009.11 (Apr 27 2010 - 13:22:26)

Board: Qi LB60 (Ingenic XBurst Jz4740 SoC, Speed 336 MHz)
DRAM:  32 MB
NAND:  2048 MiB
*** Warning - bad CRC or NAND, using default environment

[    0.000000] Linux version 2.6.32.10 (mdt at marple) (gcc version 4.3.3
(GCC) ) #1 PREEMPT Sat Apr 24 13:09:47 CEST 2010
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0ad0024f (Ingenic JZRISC)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 8128
[    0.000000] Kernel command line: mem=32M console=tty0
console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw
rootwait
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases,
linesize 32 bytes
[    0.000000] Memory: 28384k/32768k available (2817k kernel code,
4384k reserved, 955k data, 148k init, 0k highmem)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:184
[    0.000000] Console: colour dummy device 80x25
[    0.000000] Linux version 2.6.32.10 (mdt at marple) (gcc version 4.3.3
(GCC) ) #1 PREEMPT Sat Apr 24 13:09:47 CEST 2010
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0ad0024f (Ingenic JZRISC)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 8128
[    0.000000] Kernel command line: mem=32M console=tty0
console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw
rootwait
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases,
linesize 32 bytes
[    0.000000] Memory: 28384k/32768k available (2817k kernel code,
4384k reserved, 955k data, 148k init, 0k highmem)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:184
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [ttyS0] enabled, bootconsole disabled
[    0.000000] console [ttyS0] enabled, bootconsole disabled
[    0.040000] Calibrating delay loop... 335.05 BogoMIPS (lpj=1675264)
[    0.280000] Mount-cache hash table entries: 512
[    0.300000] NET: Registered protocol family 16
[    0.320000] Qi Hardware JZ4740 QI_LB60 setup
[    0.330000] JZ GPIO initalized
[    0.390000] bio: create slab <bio-0> at 0
[    0.410000] Switching to clocksource jz4740-timer
[    0.440000] NET: Registered protocol family 2
[    0.450000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.460000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.470000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.480000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.490000] TCP reno registered
[    0.500000] NET: Registered protocol family 1
[    0.520000] JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.530000] msgmni has been set to 55
[    0.550000] io scheduler noop registered
[    0.550000] io scheduler anticipatory registered (default)
[    0.560000] io scheduler deadline registered
[    0.560000] io scheduler cfq registered
[    0.590000] Console: switching to colour frame buffer device 40x15
[    0.710000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
�+$HH��.720000] serial8250: ttyS0 at MMIO 0x0 (irq = 17) is a 16550A
[    0.730000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xd5
(Samsung NAND 2GiB 3,3V 8-bit)
[    0.740000] Scanning device for bad blocks
[    1.020000] Creating 3 MTD partitions on "jz4740-nand":
[    1.030000] 0x000000000000-0x000000400000 : "NAND BOOT partition"
[    1.050000] 0x000000400000-0x000000800000 : "NAND KERNEL partition"
[    1.070000] 0x000000800000-0x000080000000 : "NAND ROOTFS partition"
[    1.080000] jz4740-nand jz4740-nand.0: Successfully registered
JZ4740 NAND driver
[    1.090000] UBI: attaching mtd2 to ubi0
[    1.100000] UBI: physical eraseblock size:   524288 bytes (512 KiB)
[    1.110000] UBI: logical eraseblock size:    516096 bytes
[    1.120000] UBI: smallest flash I/O unit:    4096
[    1.130000] UBI: VID header offset:          4096 (aligned 4096)
[    1.140000] UBI: data offset:                8192
[    9.850000] UBI: attached mtd2 to ubi0
[    9.860000] UBI: MTD device name:            "NAND ROOTFS partition"
[    9.870000] UBI: MTD device size:            2040 MiB
[    9.880000] UBI: number of good PEBs:        4080
[    9.890000] UBI: number of bad PEBs:         0
[    9.900000] UBI: max. allowed volumes:       128
[    9.910000] UBI: wear-leveling threshold:    4096
[    9.920000] UBI: number of internal volumes: 1
[    9.930000] UBI: number of user volumes:     1
[    9.940000] UBI: available PEBs:             0
[    9.950000] UBI: total number of reserved PEBs: 4080
[    9.960000] UBI: number of PEBs reserved for bad PEB handling: 40
[    9.970000] UBI: max/mean erase counter: 1/0
[    9.980000] UBI: image sequence number: 0
[    9.990000] UBI: background thread "ubi_bgt0d" started, PID 201
[   10.010000] g_ether gadget: using random self ethernet address
[   10.020000] g_ether gadget: using random host ethernet address
[   10.030000] usb0: MAC 56:45:0f:2f:f4:ac
[   10.040000] usb0: HOST MAC d6:37:72:3e:86:79
[   10.050000] g_ether gadget: controller 'jz-udc' not recognized;
trying CDC Ethernet (ECM)
[   10.060000] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[   10.070000] g_ether gadget: g_ether ready
[   10.080000] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[   10.090000] input: matrix-keypad as
/devices/platform/matrix-keypad/input/input1
[   10.110000] jz4740-rtc jz4740-rtc: rtc core: registered jz4740-rtc as rtc0
[   10.130000] JZ SD/MMC card driver registered
[   10.140000] TCP cubic registered
[   10.150000] NET: Registered protocol family 17
[   10.180000] jz4740-rtc jz4740-rtc: setting system clock to
1970-01-01 00:23:46 UTC (1426)
[   10.350000] g_ether gadget: high speed config #1: CDC Ethernet (ECM)
[   10.520000] UBIFS: recovery needed
[   11.480000] UBIFS: recovery completed
[   11.490000] UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[   11.500000] UBIFS: file system size:   2077802496 bytes (2029104
KiB, 1981 MiB, 4026 LEBs)
[   11.510000] UBIFS: journal size:       10452992 bytes (10208 KiB, 9
MiB, 21 LEBs)
[   11.520000] UBIFS: media format:       w4/r0 (latest is w4/r0)
[   11.540000] UBIFS: default compressor: zlib
[   11.550000] UBIFS: reserved for root:  0 bytes (0 KiB)
[   11.560000] VFS: Mounted root (ubifs filesystem) on device 0:11.
[   11.580000] Freeing unused kernel memory: 148k freed
[   11.720000] Algorithmics/MIPS FPU Emulator v1.5
INIT: version 2.86 booting
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...done.
Setting preliminary keymap...done.
hostname: the specified hostname is invalid
Activating swap...done.
Checking root file system...fsck from util-linux-ng 2.16.2
modprobe: FATAL: Could not load /lib/modules/2.6.32.10/modules.dep: No
such file or directory

modprobe: FATAL: Could not load /lib/modules/2.6.32.10/modules.dep: No
such file or directory

fsck: fsck.auto: not found
fsck: Error 2 while executing fsck.auto for /lib/init/rw/rootdev
done.
Cleaning up ifupdown....
Loading kernel modules...done.
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux-ng 2.16.2
done.
Setting up networking....
Mounting local filesystems...mount: you must specify the filesystem type
failed.
Activating swapfile swap...done.
Cleaning up temporary files....
Configuring network interfaces...neo: Host name lookup failure
ifconfig: `--help' gives usage information.
Failed to bring up usb0.
done.
Setting kernel variables ...error: "net.ipv6.bindv6only" is an unknown key
failed.
Cleaning up temporary files....
Setting console screen modes and fonts.
cannot (un)set powersave mode
[9;30][14;30]Setting up console font and keymap...done.
INIT: Entering runlevel: 2
Starting system log daemon....
Starting kernel log daemon....
Starting OpenBSD Secure Shell server: sshdCould not load host key:
/etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
-----------------------------------------------------------------------------------------------
And then a pretty login prompt appear in the BNN :)

I hope this can be usefull to any one willing to start hacking on debian,

Regards
PD.- Due I guess the josch image is still a draft  I have not put this
page in to the wiki or in my blog, once the pyneos guys gives me an ok
on the rootfs I will do so.

Regards(again)


-- 
David Reyes Samblas Martinez
http://www.tuxbrain.com
Open ultraportable & embedded solutions
Ben NanoNote, Arduino, Openmoko
Hey, watch out!!! There's a linux in your pocket!!!




More information about the discussion mailing list


interactive