ingmar-k / Pogoplug_V3_Emdebian_Debian

Scripts to create a bootable Emdebian/Debian USB-Stick for the Pogoplug V3 devices.
12 stars 6 forks source link

Emdebian rootfs in NAND - "available" or "reserved" PEBs? #8

Closed iegubkin closed 11 years ago

iegubkin commented 11 years ago

Thank you for promptly responding to my last question. I ordered the serial cables (2 different types, in fact) but they haven't arrived yet. So I vaguely remembered reading about sata booting and, having an unused 80gb drive around, tried it out. After a little pain getting it set up correctly, it booted into Arch. I then got the blparam script:

# premake the destination
mkdir -p /usr/local/cloudengines/bin
# make tmp mountpoint
mkdir /tmp/ce
# mount NAND fs.
mount -t ubifs -o ro ubi0:rootfs /tmp/ce
# copy what we need
cp /tmp/ce/usr/local/cloudengines/bin/blparam /usr/local/cloudengines/bin/
cp /tmp/ce/usr/local/cloudengines/bin/xce.ko /usr/local/cloudengines/bin/
cp /tmp/ce/usr/sbin/nandwrite /usr/local/cloudengines/bin/
cp /tmp/ce/usr/sbin/flash_erase /usr/local/cloudengines/bin/
# unmount
umount /tmp/ce

And flashed the new boot arguments to reflect the required ext4 filesystem:

cd /usr/local/cloudengines/bin
./blparam bootargs="root=/dev/sda1 ubi.mtd=2,512 rootfstype=ext4 console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes rootwait"

With this change your kernel and wheezy rootfs booted without problem :)

Now I would like to put the resulting emdebian rootfs system on nand. Your instruction are very clear but I came across one issue. Step 10. Check your boot log (or via dmesg) for the UBI entry called UBI: available PEBs: and memorize or write down the number ( should be something like '897' ). Should I be looking at the line that gives the "reserved" PEBs instead?

[    6.340000] UBI: attaching mtd2 to ubi0
[    6.350000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[    6.350000] UBI: logical eraseblock size:    129024 bytes
[    6.360000] UBI: smallest flash I/O unit:    2048
[    6.360000] UBI: sub-page size:              512
[    6.370000] UBI: VID header offset:          512 (aligned 512)
[    6.370000] UBI: data offset:                2048
[    6.780000] UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 9, need 27
[    6.790000] UBI: attached mtd2 to ubi0
[    6.800000] UBI: MTD device name:            "rootfs"
[    6.800000] UBI: MTD device size:            114 MiB
[    6.810000] UBI: number of good PEBs:        912
[    6.810000] UBI: number of bad PEBs:         0
[    6.810000] UBI: max. allowed volumes:       128
[    6.820000] UBI: wear-leveling threshold:    4096
[    6.820000] UBI: number of internal volumes: 1
[    6.830000] UBI: number of user volumes:     1
[    6.830000] UBI: available PEBs:             0
[    6.840000] UBI: total number of reserved PEBs: 912
[    6.840000] UBI: number of PEBs reserved for bad PEB handling: 9
[    6.850000] UBI: max/mean erase counter: 2/0
[    6.850000] UBI: image sequence number: 0
[    6.860000] UBI: background thread "ubi_bgt0d" started, PID 842

One last question. Would it be possible eventually to use Raspbian as the rootfs as the Pogoplug Pro shares the same hard-float ARMv6 platform as the Raspberry Pi? Thank you very much.

ingmar-k commented 11 years ago

OK, very good to hear that you got it working.

Now the reason why you see zero "available PEBs", is probbaly because the UBIfs is not reformatted yet. You might start to see the available PEBs, after erasing the "rootfs" NAND partition and reinitializing the UBIfs on it. That should do the trick. ;-)

And about the Raspbian question: Unfortunately this won't ever work. While both the RaspberryPi's and the Pogogplug V3's CPU are ARMv6 based, only the Raspberry does have a hardware floating point unit (VFP). That is the reason why Raspbian packages won't ever work on the Pogoplug V3. One could recompile all Debian/Emdebian packages with ARMv6 instructions and softfloat (see my compiler on github), but that would probably be too much hassle for too little return. Another, more valid option would be to use Gentoo Linux while using the right compiler and kernel.