Commit bab1510
authored
Disable small sector erase size for UBIFS on flash (sonic-net#382)
UBIFS does not work on NOR Flash with small sector erasesize.
https://cateee.net/lkddb/web-lkddb/MTD_SPI_NOR_USE_4K_SECTORS.html
* Disabling small sector erase size to enabled UBIFS on flash
* Disable small sector erase size for UBIFS on flash
UBIFS does not work on NOR Flash with small sector erasesize.
Ubiattach commands fails with the following error messages:
[ 145.820167] ubi0 error: validate_vid_hdr [ubi]: bad data_size
[ 145.826621] ubi0 error: validate_vid_hdr [ubi]: bad VID header
[ 145.833163] Volume identifier header dump:
[ 145.837752] magic 55424921
[ 145.841270] version 1
[ 145.844109] vol_type 1
[ 145.846934] copy_flag 1
[ 145.849775] compat 5
[ 145.852609] vol_id 2147479551
[ 145.856318] lnum 0
[ 145.859146] data_size 22016
[ 145.862370] used_ebs 0
[ 145.865207] data_pad 0
[ 145.868044] sqnum 1
[ 145.870869] hdr_crc 11f8b00c
[ 145.874390] Volume identifier header hexdump:
[ 145.879362] ubi0 error: ubi_io_read_vid_hdr [ubi]: validation failed for PEB 2064
[ 145.891655] ubi0 error: ubi_attach_mtd_dev [ubi]: failed to attach mtd4, error -22
From the description of CONFIG_MTD_SPI_NOR_USE_4K_SECTORS:
Please note that some tools/drivers/filesystems may not work with 4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum).
The kernel config CONFIG_MTD_SPI_NOR_USE_4K_SECTORS, which is enabled by default is removed.
Unit Test:
cisco@sonic:~$ grep CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /boot/config-5.10.0-18-2-amd64
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
cisco@sonic:~$ findmnt -n /mnt/obfl
/mnt/obfl ubi0 ubifs rw,relatime,assert=read-only,ubi=0,vol=0
* Addressed PR comments.
* Removed the config from amd64 arch.1 parent 45295bf commit bab1510
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
0 commit comments