OpenWrt Forum Archive

Topic: RedBoot config open and write error

The content of this topic has been archived on 10 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Does anybody updated "RedBoot config" from within linux using fconfig package of OpenWRT ?

I am getting the following error while updating config 

Read Redboot config to temp config file
root@OpenWrt:~#cat /dev/mtd3 > /tmp/redbootconfig

Write temp config file back to RedBoot config
root@OpenWrt:~#mtd write /tmp/redbootconfig "RedBoot config"
Could not open mtd device: RedBoot config
Can't open device for writing!
root@OpenWrt:~# mtd unlock mtd3
Could not open mtd device: mtd3
Could not open mtd device: mtd3
root@OpenWrt:~#

dmesg shows
....
0x00fc0000-0x00fc1000 : "RedBoot config"
mtd: partition "RedBoot config" doesn't end on an erase block -- force read-only
0x00fe0000-0x01000000 : "FIS directory"

I have the following MTD config setup

CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_CONCAT is not set
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_ROOTFS_ROOT_DEV=y
CONFIG_MTD_ROOTFS_SPLIT=y
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_AR7_PARTS is not set

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

any idea to update RedBoot config using fconfig ???

Thanks

The kernel treats the 'FIS directory' and 'RedBoot config' partitions as read-only if they share the same sector regardless of the setting in .config. You'll need to rebuild redboot to put them in different sectors.

The discussion might have continued from here.