Offtopic: ubifs and best practice for supporting browser based firmware upgrades

Jaya Kumar jayakumar.lkml at gmail.com
Wed Sep 26 08:38:44 EDT 2012


On Wed, Sep 26, 2012 at 7:13 PM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> From df2a498002498e52025acf51e0b43064d766aa0a Mon Sep 17 00:00:00 2001
> From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
> Date: Wed, 26 Sep 2012 14:12:28 +0300
> Subject: [PATCH] UBI: allow for delayed rename
>
> Just an experimental patch.

Thanks Artem. I gave it a quick try.

I applied the patch, flashed new kernel and then attempted to rename
the rootfs-reserve volume to rootfs while running from the rootfs
volume.

root at localhost:/# ubirename /dev/ubi0 rootfs-reserve rootfs
UBI error: ubi_open_volume: cannot open device 0, volume 1, error -16
UBI error: rename_volumes: cannot open volume "rootfs", error -16
ubirename: error!: cannot rename volumes
           error 16 (Device or resource busy)

UBI DBG (pid 1786): ubi_cdev_ioctl: re-name volumes
UBI DBG (pid 1786): rename_volumes: will rename volume 0 from
"rootfs-reserve" to "rootfs"
UBI error: ubi_open_volume: cannot open device 0, volume 1, error -16
UBI error: rename_volumes: cannot open volume "rootfs", error -16

I also tried the reverse, renaming the running rootfs volume to something else.

root at localhost:/# ubirename /dev/ubi0 rootfs rootfsold
UBI error: ubi_open_volume: cannot open device 0, volume 1, error -16
UBI error: rename_volumes: cannot open volume 1, error -16
ubirename: error!: cannot rename volumes
           error 16 (Device or resource busy)
UBI DBG (pid 2600): ubi_cdev_ioctl: re-name volumes
UBI error: ubi_open_volume: cannot open device 0, volume 1, error -16
UBI error: rename_volumes: cannot open volume 1, error -16

I'm guessing I also need to hack the following in rename_volumes:
desc = ubi_open_volume_nm(ubi->ubi_num, re->new_name, UBI_EXCLUSIVE);

I'll try looking at it further tomorrow.

Thanks,
jayakumar



More information about the linux-mtd mailing list