This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to nandboot using ubifs

Hello Sir:  

I want toi boot from NAND flash using ubifs file system

I added device and ubifs setting information from before question

cpu : am3359evm

sdk : ti-sdk-am335x-evm-06.00.00.00-Linux-x86-Install

u-boot : U-Boot 2013.01.01 (Feb 17 2014 - 14:15:26)  

nand part num : MT 29F2G08AAC

goal :  using NAND boot (NAND only - stand alone)

 

Was conducted as follows:

1> setting UART Boot (u-boot-spl.bin, u-boot.img)

2> write image to NAND

 

   U-Boot# tftp MLO

   U-Boot# nand erase 0x0 0x20000  

   U-Boot# nand write ${loadaddr} 0x0 0x20000  

   U-Boot# tftp u-boot.img  

   U-Boot# nand erase 0x80000 0x1e0000  

   U-Boot# nand write ${loadaddr} 0x80000 0x1e0000

 

3> kernel configuration at linux host (built-in)  

<*> Memory Technology Device (MTD) support  ---> 

 [*]   Command line partition table parsing  

<*>   Direct char device access to MTD devices

 <*>   Caching block device access to MTD devices

 <*>   NAND Device Support  --->   

<*>   NAND Flash device on OMAP2, OMAP3 and OMAP4

 <*>   Enable UBI - Unsorted block images  --->

File systems  --->

 [*] Miscellaneous filesystems  --->  

<*>   UBIFS file system support 

 

4> check mtdparts

device nand0 <omap2-nand.0>, # parts = 8  #: name  size  offset  mask_flags

 0: SPL                 0x00020000 0x00000000 0  

1: SPL.backup1         0x00020000 0x00020000 0  

2: SPL.backup2         0x00020000 0x00040000 0

 3: SPL.backup3         0x00020000 0x00060000 0

 4: u-boot              0x001e0000 0x00080000 0

 5: u-boot-env          0x00020000 0x00260000 0  

6: kernel              0x00500000 0x00280000 0  

7: rootfs              0x0f880000 0x00780000 0

active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000

defaults: mtdids  : nand0=omap2-nand.0 mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),12 8k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)

5> kernel image write to NAND  

U-boot # tftp uImage  

U-boot # nand erase 0x280000 0x500000  

U-boot # nand write 0x80200000 0x280000 0x500000

6> ready to ubifs image & write to NAND 

#make_fs.sh

mkfs.ubifs -q -r /rootfs_base/. -m 2048 -e 129024 -c 2047 -o ubifs.img
ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg  

#ubinize.cfg

[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
# vol_size : 450MiB for 512MB
# vol_size : 200MiB for 256MB
vol_size=200MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

U-boot # tftp 0x82000000 ubi.img  

U-boot # nand erase.part kernel

U-boot # nand write 0x82000000 0x780000 0x1960000

7> edit bootargs

 #printenv (already edited)

arch=arm baudrate=115200

board=am335x

board_name=A335_SDC

board_rev=1.0C

bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p2 rootdelay=2

bootargs_defaults=setenv bootargs console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 noinitrd rootfstype=ubifs mem=256M rootdelay=2 init=/init

bootcmd=run nandboot

bootdelay=1

bootfile=uImage

console=ttyO0,115200n8

cpu=armv7

ethact=cpsw

ethaddr=88:33:14:f6:e2:a6

fileaddr=82000000

filesize=1960000

ip_method=none

ipaddr=192.168.2.94

loadaddr=0x80200000

mmcboot=echo Booting from mmc ...; run bootargs_defaults; fatload mmc ${mmcdev} ${loadaddr} ${bootfile}; bootm ${loadaddr}

mmcdev=1

mtddevname=SPL

mtddevnum=0

mtdids=nand0=omap2-nand.0

mtdparts=mtdparts=omap2-nand.0:128k@0x0(SPL),128k@0x20000(SPL.backup1),128k@0x40000(SPL.backup2),128k@0x60000(SPL.backup3),1920k@0x80000(u-boot),128k@0x260000(u-boot-env),5m@0x280000(kernel),-@0x780000(rootfs)

nandboot=echo Booting from nand ...; run bootargs_defaults; mtdparts ; nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; bootm ${loadaddr}

nandimgsize=0x500000

nandsrcaddr=0x280000

netboot=echo Booting from net ...; run bootargs_defaults; dhcp; tftp ${loadaddr} ${bootfile}; bootm ${loadaddr}

netmask=255.255.255.0

partition=nand0,0

root=ubi:rootfs

serverip=192.168.2.90

soc=am33xx

spiboot=echo Booting from spi ...; run bootargs_defaults; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootm ${loadaddr}

spibusno=0

spiimgsize=0x362000

spisrcaddr=0xe0000

stderr=serial

stdin=serial

stdout=serial

usbboot=echo Booting from usb ...; run bootargs_defaults; usb start; fatload usb ${usbdev} ${loadaddr} ${bootfile}; bootm ${loadaddr}

usbdev=0

usbnet_devaddr=88:33:14:f6:e2:a6

vendor=ti

ver=U-Boot 2013.01.01 (Feb 17 2014 - 14:15:26)

Environment size: 1869/131068 bytes

 

8> error log

 

musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)

musb-hdrc: MHDRC RTL version 2.0

musb-hdrc: setup fifo_mode 4

musb-hdrc: 28/31 max ep, 16384/16384 memory

USB Peripheral mode controller at 47401000 using PIO, IRQ 0

musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO

Rx, HB-ISO Tx, SoftConn)

musb-hdrc: MHDRC RTL version 2.0

musb-hdrc: setup fifo_mode 4

musb-hdrc: 28/31 max ep, 16384/16384 memory

USB Host mode controller at 47401800 using PIO, IRQ 0

Net:   cpsw, usb_ether

Hit any key to stop autoboot:  1  0

Booting from nand ...

 

device nand0 <omap2-nand.0>, # parts = 8  #: namesizeoffsetmask_flags

 0: SPL                 0x000200000x000000000

 1: SPL.backup1         0x000200000x000200000

 2: SPL.backup2         0x000200000x000400000

 3: SPL.backup3         0x000200000x000600000

 4: u-boot              0x001e00000x000800000

 5: u-boot-env          0x000200000x002600000

 6: kernel              0x005000000x002800000

 7: rootfs              0x0f8800000x007800000

 

active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000

 

defaults:

mtdids  : nand0=omap2-nand.0

mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),12

8k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)

 

NAND read: device 0 offset 0x280000, size 0x500000

 5242880 bytes read: OK

## Booting kernel from Legacy Image at 80200000 ...

   Image Name:   Linux-3.2.0

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    3423352 Bytes = 3.3 MiB

   Load Address: 80008000

   Entry Point:  80008000

   Verifying Checksum ... OK

   Loading Kernel Image ... OK

OK

 

Starting kernel ...

 

Uncompressing Linux... done, booting the kernel.

[    0.000000] Linux version 3.2.0 (root@ubuntu) (gcc version 4.7.3 20130226 (pr

erelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03)

 ) #6 Fri Mar 28 16:03:05 KST 2014

[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d

[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instructio

n cache

[    0.000000] Machine: am335xevm

[    0.000000] Memory policy: ECC disabled, Data cache writeback

[    0.000000] AM335X ES2.1 (sgx neon )

[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024

[    0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 noinitrd rootfstype=ubifs mem=256M rootdelay=2 init=/init

[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

[    0.000000] Memory: 256MB = 256MB total

[    0.000000] Memory: 252748k/252748k available, 9396k reserved, 0K highmem

[    0.000000] Virtual kernel memory layout:

[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

[    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)

[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)

[    0.000000]       .text : 0xc0008000 - 0xc0601000   (6116 kB)

[    0.000000]       .init : 0xc0601000 - 0xc0645000   ( 272 kB)

[    0.000000]       .data : 0xc0646000 - 0xc06c1308   ( 493 kB)

[    0.000000]        .bss : 0xc06c132c - 0xc06f0530   ( 189 kB)

[    0.000000] NR_IRQS:396

[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts

[    0.000000] Total of 128 interrupts on 1 active controller

[    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz

[    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz

[    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms

[    0.000000] Console: colour dummy device 80x30

[    0.000091] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)

[    0.089050] pid_max: default: 32768 minimum: 301

[    0.089263] Security Framework initialized

[    0.089416] Mount-cache hash table entries: 512

[    0.089843] CPU: Testing write buffer coherency: ok

[    0.109832] omap_hwmod: pruss: failed to hardreset

[    0.110931] print_constraints: dummy:

[    0.111328] NET: Registered protocol family 16

[    0.113372] OMAP GPIO hardware version 0.1

[    0.115814] omap_mux_init: Add partition: #1: core, flags: 0

[    0.117645]  omap_i2c.1: alias fck already exists

[    0.118530]  omap2_mcspi.1: alias fck already exists

[    0.118743]  omap2_mcspi.2: alias fck already exists

[    0.119689]  edma.0: alias fck already exists

[    0.119689]  edma.0: alias fck already exists

[    0.119720]  edma.0: alias fck already exists

[    0.145355] bio: create slab <bio-0> at 0

[    0.147674] SCSI subsystem initialized

[    0.149291] usbcore: registered new interface driver usbfs

[    0.149597] usbcore: registered new interface driver hub

[    0.149780] usbcore: registered new device driver usb

[    0.150115] registerd cppi-dma Intr @ IRQ 17

[    0.150115] Cppi41 Init Done Qmgr-base(d087a000) dma-base(d0878000)

[    0.150115] Cppi41 Init Done

[    0.150146] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3

[    0.150421] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1

[    0.169067] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz

[    0.170837] tps65910 1-002d: JTAGREVNUM 0x0

[    0.173187] print_constraints: VRTC:

[    0.174591] print_constraints: VIO: at 1800 mV

[    0.176879] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal

[    0.179138] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal

[    0.180145] print_constraints: VDD3: 5000 mV

[    0.181518] print_constraints: VDIG1: at 1800 mV

[    0.182922] print_constraints: VDIG2: at 1800 mV

[    0.184326] print_constraints: VPLL: at 1800 mV

[    0.185729] print_constraints: VDAC: at 1800 mV

[    0.187103] print_constraints: VAUX1: at 1800 mV

[    0.188537] print_constraints: VAUX2: at 3300 mV

[    0.189910] print_constraints: VAUX33: at 3300 mV

[    0.191314] print_constraints: VMMC: at 3300 mV

[    0.191802] tps65910 1-002d: No interrupt support, no core IRQ

[    0.193267] Advanced Linux Sound Architecture Driver Version 1.0.24.

[    0.194366] Switching to clocksource gp timer

[    0.208526] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)

[    0.208709] musb-hdrc musb-hdrc.0: dma type: dma-cppi41

[    0.209014] MUSB0 controller's USBSS revision = 4ea20800

[    0.209045] musb0: Enabled SW babble control

[    0.209960] musb-hdrc musb-hdrc.0: USB OTG mode controller at d083c000 using DMA, IRQ 18

[    0.210113] musb-hdrc musb-hdrc.1: dma type: dma-cppi41

[    0.210418] MUSB1 controller's USBSS revision = 4ea20800

[    0.210449] musb1: Enabled SW babble control

[    0.210876] musb-hdrc musb-hdrc.1: MUSB HDRC host driver

[    0.210968] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1

[    0.211090] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

[    0.211090] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    0.211120] usb usb1: Product: MUSB HDRC host driver

[    0.211120] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd

[    0.211120] usb usb1: SerialNumber: musb-hdrc.1

[    0.211883] hub 1-0:1.0: USB hub found

[    0.211914] hub 1-0:1.0: 1 port detected

[    0.212402] musb-hdrc musb-hdrc.1: USB Host mode controller at d083e800 using DMA, IRQ 19

[    0.212921] NET: Registered protocol family 2

[    0.213165] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)

[    0.213531] TCP established hash table entries: 8192 (order: 4, 65536 bytes)

[    0.213684] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)

[    0.213775] TCP: Hash tables configured (established 8192 bind 8192)

[    0.213806] TCP reno registered

[    0.213806] UDP hash table entries: 256 (order: 0, 4096 bytes)

[    0.213836] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

[    0.214080] NET: Registered protocol family 1

[    0.214385] RPC: Registered named UNIX socket transport module.

[    0.214477] RPC: Registered udp transport module.

[    0.214508] RPC: Registered tcp transport module.

[    0.214508] RPC: Registered tcp NFSv4.1 backchannel transport module.

[    0.214752] NetWinder Floating Point Emulator V0.97 (double precision)

[    0.226623] VFS: Disk quotas dquot_6.5.2

[    0.226715] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

[    0.227569] JFFS2 version 2.2. (NAND) (SUMMARY)  짤 2001-2006 Red Hat, Inc.

[    0.228149] msgmni has been set to 493

[    0.231262] alg: No test for stdrng (krng)

[    0.231994] io scheduler noop registered

[    0.232025] io scheduler deadline registered

[    0.232147] io scheduler cfq registered (default)

[    0.233276] Could not set LED4 to fully on

[    0.245483] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0

[    0.905334] console [ttyO0] enabled

[    0.909576] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1

[    0.917388] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2

[    0.925170] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3

[    0.932891] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4

[    0.940673] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5

[    0.948883] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00

[    0.964538] brd: module loaded

[    0.972259] loop: module loaded

[    0.975769] i2c-core: driver [tsl2550] using legacy suspend method

[    0.982238] i2c-core: driver [tsl2550] using legacy resume method

[    0.988677] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write

[    1.055145] No daughter card found

[    1.058715] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write

[    1.073913] Board name: A335_SDC

[    1.077301] Board version: □□

[    1.080566] The board is a AM335x Smart Data Concentrator.

[    1.087738]  omap_hsmmc.1: alias fck already exists

[    1.096710] registered am33xx_sr device

[    1.102661] mtdoops: mtd device (mtddev=name/number) must be supplied

[    1.109863] omap2-nand driver initializing

[    1.114288] OneNAND driver initializing

[    1.119232] UBI error: ubi_init: UBI error: cannot initialize UBI, error -19

[    1.127227] CAN device driver interface

[    1.131256] CAN bus driver for Bosch D_CAN controller 1.0

[    1.185028] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6

[    1.191467] davinci_mdio davinci_mdio.0: detected phy mask fffffffc

[    1.199676] davinci_mdio.0: probed

[    1.203216] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown

[    1.210601] davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown

[    1.218261] usbcore: registered new interface driver zd1201

[    1.224273] usbcore: registered new interface driver cdc_ether

[    1.230529] usbcore: registered new interface driver cdc_eem

[    1.236602] usbcore: registered new interface driver dm9601

[    1.242462] cdc_ncm: 04-Aug-2011

[    1.246002] usbcore: registered new interface driver cdc_ncm

[    1.251922] Initializing USB Mass Storage driver...

[    1.257232] usbcore: registered new interface driver usb-storage

[    1.263519] USB Mass Storage support registered.

[    1.268768] mousedev: PS/2 mouse device common for all mice

[    1.275695] omap_rtc am33xx-rtc: rtc core: registered am33xx-rtc as rtc0

[    1.282897] i2c /dev entries driver

[    1.286987] Linux video capture interface: v2.00

[    1.292114] usbcore: registered new interface driver uvcvideo

[    1.298156] USB Video Class driver (1.1.1)

[    1.303283] lm75 1-004f: hwmon0: sensor 'tmp275'

[    1.385864] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec

[    1.394287] cpuidle: using governor ladder

[    1.399047] cpuidle: using governor menu

[    1.406158] omap4_aes_mod_init: loading AM33X AES driver

[    1.411804] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02

[    1.418548] omap4_aes_probe: probe() done

[    1.422973] omap4_sham_mod_init: loading AM33X SHA/MD5 driver

[    1.429138] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03

[    1.445068] omap4_sham_probe: probe() done

[    1.451721] usbcore: registered new interface driver usbhid

[    1.457580] usbhid: USB HID core driver

[    1.462371] usbcore: registered new interface driver snd-usb-audio

[    1.470367] ALSA device list:

[    1.473480]   No soundcards found.

[    1.477081] oprofile: hardware counters not available

[    1.482330] oprofile: using timer interrupt.

[    1.486846] Netfilter messages via NETLINK v0.30.

[    1.491821] nf_conntrack version 0.5.0 (3949 buckets, 15796 max)

[    1.498626] ip_tables: (C) 2000-2006 Netfilter Core Team

[    1.504333] TCP cubic registered

[    1.507720] NET: Registered protocol family 17

[    1.512512] Bridge firewalling registered

[    1.516723] can: controller area network core (rev 20090105 abi 8)

[    1.523284] NET: Registered protocol family 29

[    1.527954] can: raw protocol (rev 20090105)

[    1.532409] can: broadcast manager protocol (rev 20090105 t)

[    1.538360] Registering the dns_resolver key type

[    1.543304] VFP support v0.3: implementor 41 architecture 3 part 30 variant crev 3

[    1.551330] ThumbEE CPU extension supported.

[    1.555877] mux: Failed to setup hwmod io irq -22

[    1.561431] Power Management for AM33XX family

[    1.566314] Trying to load am335x-pm-firmware.bin (60 secs timeout)

[    1.572967] Copied the M3 firmware to UMEM

[    1.577362] Cortex M3 Firmware Version = 0x181

[    1.583740] create_regulator: VDD1: Failed to create debugfs directory

[    1.592102] smartreflex smartreflex: am33xx_sr_probe: Driver initialized

[    1.606842] clock: disabling unused clocks to save power

[    1.624603] Detected MACID=88:33:14:f6:e2:a6

[    1.630218] cpsw: Detected MACID = 88:33:14:f6:e2:a8

[    1.636474] omap_rtc am33xx-rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)

[    1.645660] Waiting 2sec before mounting root device...

[    3.655761] UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:rootfs", error -19

[    3.663665] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

[    3.671051] Please append a correct "root=" boot option; here are the available partitions:

[    3.679809] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

[    3.688446] Backtrace:

[    3.691040] [<c00180dc>] (dump_backtrace+0x0/0x10c) from [<c046323c>] (dump_stack+0x18/0x1c)

[    3.699859]  r6:00008000 r5:c054edd0 r4:c06c40c8 r3:c0677e8c

[    3.705780] [<c0463224>] (dump_stack+0x0/0x1c) from [<c04634a8>] (panic+0x64/0x190)

[    3.713775] [<c0463444>] (panic+0x0/0x190) from [<c0601c8c>] (mount_block_root+0x174/0x228)

[    3.722503]  r3:00000000 r2:00000000 r1:cf01df68 r0:c054edd0

[    3.728424]  r7:c0632f98

[    3.731079] [<c0601b18>] (mount_block_root+0x0/0x228) from [<c0601fbc>] (prepare_namespace+0x94/0x1c0)

[    3.740814] [<c0601f28>] (prepare_namespace+0x0/0x1c0) from [<c06018fc>] (kernel_init+0xf8/0x124)

[    3.750091]  r5:c0644204 r4:c0644204

[    3.753845] [<c0601804>] (kernel_init+0x0/0x124) from [<c0045a78>] (do_exit+0x0/0x680)

[    3.762084]  r5:c0601804 r4:00000000

 

want to boot from nand, what should I do?  

I think, The kernel does not seem to set the MTD partitions.
What do you think?

  • Hi,

    Please try to make the ubifs image using the -F flag. For more information: http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup

    Best regards,
    Miroslav

  • Thank you for answer.

     

    already tested -F flag, but cannot apply this option.

    I installed zlib1g-dev, zlib1g-dev, liblzo2-dev and uuid-dev packages, and mtd-utils too.

    How can I use -F flag?

     

    Best regards.

    Hwang.

  • Hwang, please provide more information. What happens when you try to use the -F flag? Any error message?

    Best regards,
    Miroslav

  • mkfs.ubifs: invalid option -- 'F' Usage: mkfs.ubifs [OPTIONS] target Make a UBIFS file system image from an existing directory tree

    Examples: Build file system from directory /opt/img, writting the result in the ubifs.img file  mkfs.ubifs -m 512 -e 128KiB -c 100 -r /opt/img ubifs.img The same, but writting directly to an UBI volume  mkfs.ubifs -r /opt/img /dev/ubi0_0 Creating an empty UBIFS filesystem on an UBI volume  mkfs.ubifs /dev/ubi0_0

    Options: -r, -d, --root=DIR       build file system from directory DIR -m, --min-io-size=SIZE   minimum I/O unit size -e, --leb-size=SIZE      logical erase block size -c, --max-leb-cnt=COUNT  maximum logical erase block count -o, --output=FILE        output to FILE -j, --jrn-size=SIZE      journal size -R, --reserved=SIZE      how much space should be reserved for the super-user -x, --compr=TYPE         compression type - "lzo", "favor_lzo", "zlib" or                          "none" (default: "lzo") -X, --favor-percent      may only be used with favor LZO compression and defines                          how many percent better zlib should compress to make                          mkfs.ubifs use zlib instead of LZO (default 20%) -f, --fanout=NUM         fanout NUM (default: 8) -k, --keyhash=TYPE       key hash type - "r5" or "test" (default: "r5") -p, --orph-lebs=COUNT    count of erase blocks for orphans (default: 1) -D, --devtable=FILE      use device table FILE -U, --squash-uids        squash owners making all files owned by root -l, --log-lebs=COUNT     count of erase blocks for the log (used only for                          debugging) -v, --verbose            verbose operation -V, --version            display version information -g, --debug=LEVEL        display debug information (0 - none, 1 - statistics,                          2 - files, 3 - more details) -Q, --squash-rino-perm   ignore permissions of the FS image directory (the one                          specified with --root) and make the UBIFS root inode                          permissions to be {uid=gid=root, u+rwx,go+rx}; this is                          a legacy compatibility option and it will be removed                          at some point, do not use it -q, --nosquash-rino-perm for the UBIFS root inode use permissions of the FS                          image directory (the one specified with --root); this                          is the default behavior; this option will be removed                          at some point, do not use it, see clarifications below; -h, --help               display this help text

    Note, SIZE is specified in bytes, but it may also be specified in Kilobytes, Megabytes, and Gigabytes if a KiB, MiB, or GiB suffix is used.

    If you specify "lzo" or "zlib" compressors, mkfs.ubifs will use this compressor for all data. The "none" disables any data compression. The "favor_lzo" is not really a separate compressor. It is just a method of combining "lzo" and "zlib" compressors. Namely, mkfs.ubifs tries to compress data with both "lzo" and "zlib" compressors, then it compares which compressor is better. If "zlib" compresses 20 or more percent better than "lzo", mkfs.ubifs chooses "lzo", otherwise it chooses "zlib". The "--favor-percent" may specify arbitrary threshold instead of the default 20%.

    The -R parameter specifies amount of bytes reserved for the super-user.

    Some clarifications about --squash-rino-perm and --nosquash-rino-perm options. Originally, mkfs.ubifs did not have them, and it always set permissions for the UBIFS root inode to be {uid=gid=root, u+rwx,go+rx}. This was a bug which was found too late, when mkfs.ubifs had already been used in production. To fix this bug, 2 new options were introduced: --squash-rino-perm which preserves the old behavior and --nosquash-rino-perm which makes mkfs.ubifs use the right permissions for the root inode. Now these options are considered depricated and they will be removed later, so do not use them.

  • Hwang, most probably your version of mkfs.ubifs is old and doesn't support the -F option. Please use a newer version. I'm using version 1.5.0 and it works fine.

    To check the mkfs.ubifs version type:

    mkfs.ubifs -V

    Best regards,
    Miroslav

  • root@ubuntu:/# mkfs.ubifs -V
    Version 1.5

    but can't use -F

  • Hwang, please follow these instructions in order to build the mtd-utils tools with the "-F" option available: http://processors.wiki.ti.com/index.php/MTD_Utilities#MTD-Utils_Compilation

    After you are done, the version will be shown as 1.5.0 and the -F option will be available.

    Best regards,
    Miroslav

  • I used 'apt-get' > installed zlib1g-dev, zlib1g-dev, liblzo2-dev, uuid-dev packages

    and, mtd-utils 1.5.0 intalled too.

     

    diff > (using apt-get) cannot use -F flag

            so, I downloaded mtd-utils 1.5.0 and install package manually.(then export directory)

             (using manually compile) can use -F flag

     

     I make ubi image(use mkfs.ubifs -F), and ubinize to ubi.img

    ubi.img write to nand device(0x780000) but error message is same result

     

    Do you think that other package also manually install?

     

    Best regards

    Hwang