Hi,
I have a
rootfs directory which contains all the file system directory structure (
bin boot dev etc home ...
var) to be installed on a gumstix overo board.
What I would like to accomplish, is to make a ubi image of the entire rootfs content, and then install this ubi image with
u-boot on my embedded board, but I am experiencing problems in doing so.
I started writing the following ubi.ini file:
Code:
[ubi_rfs]
mode=ubi
image=rootfs.img
vol_id=0
vol_size=7763992576
vol_type=dynamic
vol_name=rootfs
vol_alignment=1
vol_flags=autoresize
Then, I use these two commands to create the rootfs.ubi image (into the same folder of ubi.ini, of course:
Quote:
sudo mkfs.ubifs -m 2048 -e 131072 -c 852 -r $PWD/rootfs/ rootfs.img
sudo ubinize -o rootfs.ubi -p 131072 -m 2048 -s 512 -O 512 ubi.ini
|
And it creates the ubi image correctly (or at least it seems it) becuase no error neither warnings appear, so I can put this ubi image on my uSD card.
Then comes the troubles.
From u-boot (version 2014.10 (Feb 25 2015)) environment installaed on my gumstix overo board, this is the output of mtd command:
Code:
U-Boot 2014.10 (Feb 25 2015 - 07:02:26)
arm-poky-linux-gnueabi-gcc (GCC) 4.9.1
GNU ld (GNU Binutils) 2.24
Overo # mtd
device nand0 <omap2-nand.0>, # parts = 5
#: name size offset mask_flags
0: xloader 0x00080000 0x00000000 0
1: u-boot 0x001c0000 0x00080000 0
2: environ 0x00040000 0x00240000 0
3: linux 0x00800000 0x00280000 0
4: rootfs 0x3f580000 0x00a80000 0
active partition: nand0,0 - (xloader) 0x00080000 @ 0x00000000
defaults:
mtdids : nand0=omap2-nand.0
mtdparts: mtdparts=omap2-nand.0:512k(xloader),1792k(u-boot),256k(environ),8m(linux),-(rootfs)
So I want to install the ubi image
rootfs.ubi on
rootfs partition.
So I firstly erase
rootfs partition, get the ubi imaage from uSD and then writo it to
rootfs:
Code:
nand erase.part rootfs
load mmc 0:2 ${loadaddr} /rootfs.ubi
nand write ${loadaddr} rootfs ${filesize}
This sequence works fine for the gumstix-console-image-overo.ubi (with kernel image
3.17.8 armv71) that can be downloaded from
https://www.gumstix.com/software/software-downloads/ for yocto project, but does not work for my custom
rootfs.ubi image, and the boot error is:
Code:
Booting from nand with DTS...
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=4", size 1013 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
UBI: VID header offset: 512 (aligned 512), data offset: 2048
UBI: good PEBs: 8108, bad PEBs: 0, corrupted PEBs: 0
UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 1/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 7944, total reserved PEBs: 164, PEBs reserved for bad PEB handling: 160
Error reading superblock on volume 'ubi0:rootfs' errno=-19!
ubifsmount - mount UBIFS volume
Usage:
ubifsmount <volume-name>
- mount 'volume-name' volume
UBIFS not mounted, use ubifs mount to mount volume first!
ubifsload - load file froman UBIFS filesystem
Usage:
ubifsload <addr> <filename> [bytes]
- load file 'filename' to address 'addr'
UBIFS not mounted, use ubifs mount to mount volume first!
ubifsload - load file from an UBIFS filesystem
Usage:
ubifsload <addr> <filename> [bytes]
- load file 'filename' to address 'addr'
Bad Linux ARM zImage magic!
the zImage path into my rootfs.ubi filesystem is
/boot/zImage, and the kernel I would like to install is a
2.6.34 armv71.
But I don't know where I am wrong.
Could you help me to fix this problem ?
Thank you in advance.