LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-28-2015, 06:31 AM   #1
mr.simo
Member
 
Registered: Feb 2010
Posts: 78

Rep: Reputation: 0
Problem installing a custom uibi image on NAND


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.

Last edited by mr.simo; 09-28-2015 at 06:32 AM.
 
Old 09-29-2015, 09:47 PM   #2
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
You'll need to fix this problem first:

Quote:
Error reading superblock on volume 'ubi0:rootfs' errno=-19!
Can you mount the rootfs.img and make sure it's good? Did you make it or download it? If you downloaded it did you do a checksum on the download?

I don't know the flags to mkfs.ubi but I'd double check them.
 
1 members found this post helpful.
Old 09-30-2015, 04:28 AM   #3
mr.simo
Member
 
Registered: Feb 2010
Posts: 78

Original Poster
Rep: Reputation: 0
Hi Rinndalir,

Quote:
Originally Posted by Rinndalir View Post
Can you mount the rootfs.img and make sure it's good? Did you make it or download it?.
No, I cannot mount it from the u-boot environment. I just can write it on the partition and no more.

However, I solved installing a newer prebuild ubi image for my board and now it's working. Well, I am working to make it work as better as possible.

Thank you.
Simon
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 11 on a laptop (problems and problems and problems) kizersouzay Slackware 20 02-08-2007 10:52 AM
Marvell Yukon Network driver problems, Lilo Windows boot Problems mellowdog Slackware - Installation 7 01-25-2006 02:18 AM
cisco 350 wireless problems and suse x-server problems incognito9 Linux - Wireless Networking 5 10-14-2004 07:53 AM
Problems, problems, problems. Lets start with the soundcard Kre8ive Linux - Newbie 5 08-07-2003 01:20 AM
Problems, problems, problems. Lets start with the ES 1868 AudioDrive Kre8ive Linux - Newbie 1 08-06-2003 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration