Jump to content

    
Sign in to follow this  
Dmil

переход с jffs2 на ubifs

Recommended Posts

что значит "переход"?

Были данные в jffs, и надо чтобы они стали в ubifs на том-же носителе?

Или же ваше устройство использовало jffs, а теперь вы хотите использовать ubifs?

 

Если вариант 2 то вот вам "последовательность действий":

1. добавить в ядро поддержку ubifs

2. создать на устройстве файловую систему.

3. примонтировать её.

 

вот и все.

Share this post


Link to post
Share on other sites

есть файловая система jffs2, работает.

включаю поддержку Ubifs в ядре.

строка запуска:

CONFIG_CMDLINE="console=ttyS0,115200 ubi.mtd=1,512 root=ubi0:rootfs rootfstype=ubifs rootflags=bulk_read,chk_data_crc rw"

 

собираю файловую систему командами (используется k9k8g08u0a):

mkfs.ubifs -e 0x1F000 -c 8192 -m 2048 -x lzo -r FileSystem -o rootfs.ubifs

ubinize -p 128KiB -m 2048 -s 2048 -o rootfs.ubi ubifs.cfg

[ubifs]

mode=ubi

image=rootfs.ubifs

vol_id=0

vol_size=1000MiB

vol_type=dynamic

vol_name=rootfs

vol_flags=autoresize

 

заливаю rootfs.ubi по адресу 0x400000.

получаю:

Linux version 2.6.27.37 (user@tech-ubuntuvm) (gcc version 4.2.0 20070413 (prerel

ease) (CodeSourcery Sourcery G++ Lite 2007q1-21)) #1 Mon Oct 19 18:02:26 MSD 200

9

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

Machine: Atmel AT91SAM9260-EK

Memory policy: ECC disabled, Data cache writeback

Clocks: CPU 200 MHz, master 100 MHz, main 12.000 MHz

CPU0: D VIVT write-back cache

CPU0: I cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets

CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256

Kernel command line: console=ttyS0,115200 ubi.mtd=1,512 root=ubi0:rootfs rootfst

ype=ubifs rootflags=bulk_read,chk_data_crc rw

AT91: 96 gpio irqs in 3 banks

PID hash table entries: 256 (order: 8, 1024 bytes)

Console: colour dummy device 80x30

console [ttyS0] enabled

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 64MB = 64MB total

Memory: 62340KB available (2252K code, 161K data, 108K init)

Calibrating delay loop... 99.73 BogoMIPS (lpj=498688)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

net_namespace: 288 bytes

NET: Registered protocol family 16

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

NET: Registered protocol family 1

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

msgmni has been set to 121

io scheduler noop registered

io scheduler anticipatory registered (default)

atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL

brd: module loaded

loop: module loaded

ssc ssc.0: Atmel SSC device at 0xc4850000 (irq 14)

MACB_mii_bus: probed

eth0: Atmel MACB at 0xfffc4000 irq 21 (00:1f:f2:00:00:00)

eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01, irq=-1)

Driver 'sd' needs updating - please use bus_type methods

NAND device: Manufacturer ID: 0xec, Chip ID: 0xd3 (Samsung NAND 1GiB 3,3V 8-bit)

 

AT91 NAND: 8-bit, Software ECC

Scanning device for bad blocks

Bad eraseblock 650 at 0x05140000

Bad eraseblock 3850 at 0x1e140000

Creating 2 MTD partitions on "atmel_nand":

0x00000000-0x00400000 : "Bootstrap"

ftl_cs: FTL header not found.

0x00400000-0x40000000 : "rootfs"

ftl_cs: FTL header not found.

UBI: attaching mtd1 to ubi0

UBI: physical eraseblock size: 131072 bytes (128 KiB)

UBI: logical eraseblock size: 129024 bytes

UBI: smallest flash I/O unit: 2048

UBI: sub-page size: 512

UBI: VID header offset: 512 (aligned 512)

UBI: data offset: 2048

UBI error: validate_ec_hdr: bad VID header offset 2048, expected 512

UBI error: validate_ec_hdr: bad EC header

UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0

UBI error: ubi_init: cannot attach mtd1

UBI error: ubi_init: UBI error: cannot initialize UBI, error -22

atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)

atmel_spi atmel_spi.1: Atmel SPI Controller at 0xfffcc000 (irq 13)

at91_ohci at91_ohci: AT91 OHCI

at91_ohci at91_ohci: new USB bus registered, assigned bus number 1

at91_ohci at91_ohci: irq 20, io mem 0x00500000

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

mice: PS/2 mouse device common for all mice

rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0

rtc-at91sam9 at91_rtt.0: rtc0: SET TIME!

TCP cubic registered

NET: Registered protocol family 17

rtc-at91sam9 at91_rtt.0: hctosys: unable to read the hardware clock

UBIFS error (pid 1): ubifs_get_sb: cannot open "ubi0:rootfs", error -19

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

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

1f00 4096 mtdblock0 (driver?)

1f01 1044480 mtdblock1 (driver?)

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

Edited by VDV

Share this post


Link to post
Share on other sites

Почему Вы пишите так:

root=ubi0:rootfs

надо писать помоему точно также как и для JFFS2, root=/dev/mtdblock1 или

просто root=mtdblock1, в обоих случаях под файловой системой у Вас MTD,

которая предоставляет сервис доступа к памяти. Строка должна быть одинаковой,

а в нормальной ситуации тип файловой системы автоматически определяется.

Share this post


Link to post
Share on other sites

не силён в линуксе...

основываюсь на этом сообщении:

http://www.at91.com/index.php?option=com_j...amp;hilit=ubifs

 

и этой информации:

[url="http://www.linux-mtd.infradead.org/faq/ubi.html#L_attachmtd"http://www.linux-mtd.infradead.org/faq/ubi.html#L_attachmtd[/url]

Edited by VDV

Share this post


Link to post
Share on other sites

ну собственно, у меня заработало...

уж не знаю, что стало верным, сделал 3 действия:

- пропатчил драйвер nand flash

- собрал FS через параметры

mkfs.ubifs -e 0x1F800 -c 8192 -m 2048 -x lzo -r FileSystem -o rootfs.ubifs

ubinize -p 128KiB -m 2048 -s 512 -o rootfs.ubi ubifs.cfg

- строка запуска

CONFIG_CMDLINE="console=ttyS0,115200 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs rootflags=bulk_read,chk_data_crc rw"

 

светится только непонятный варнинг:

UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling,

reserved 27, need 81

UBI: volume 0 ("rootfs") re-sized from 8127 to 8127 LEBs

 

собственно, видимо, вот:

UBI: physical eraseblock size: 131072 bytes (128 KiB)

UBI: logical eraseblock size: 129024 bytes

UBI: smallest flash I/O unit: 2048

UBI: sub-page size: 512

 

эти параметры и надо прописывать при сборке файловой системы

Edited by VDV

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this