Welcome! Log In Create A New Profile

Advanced

Inspect or change a rootfs UBI Image file

Posted by balanga 
Inspect or change a rootfs UBI Image file
March 13, 2019 08:57PM
I came across an interesting article -

http://goflexhome.blogspot.com/2019/02/inspect-or-change-rootfs-ubi-image-file.html

and wondered if I could do this under Debian on my GoFlex Home unit....

Any ideas?...



Edited 1 time(s). Last edit at 03/13/2019 08:58PM by balanga.
Re: Inspect or change a rootfs UBI Image file
March 13, 2019 09:13PM
The only steps that you should follow are:


Quote

(attach the device mtd2 to the ubi device)
ubiattach /dev/ubi_ctrl -m 2 -O 2048

UBI device number 0, total 1992 LEBs (252936192 bytes, 241.2 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)

(mount the ubi filesystem - if the mountpoint doesn't already exist create it first with mkdir /mnt/ubifs)
mount -t ubifs /dev/ubi0_0 /mnt/ubifs


The other steps are either not needed or will damage your stock OS or OpenWrt OS on NAND.

When you run my released rootfs and kernel, the UBIFS file system was already baked into the system. So it is always availble in Debian. You only need to attach and mount he UBI partition to a mount point. And then you can browse or update files in the volume(s) inside that partition.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Inspect or change a rootfs UBI Image file
March 13, 2019 09:22PM
bodhi Wrote:
-------------------------------------------------------
> The only steps that you should follow are:
>
>
>
Quote

(attach the device mtd2 to the ubi device)
> ubiattach /dev/ubi_ctrl -m 2 -O 2048

root@debian:/mnt# ubiattach /dev/ubi_ctrl -m 2 -O 2048 
ubiattach: error!: cannot attach mtd2
           error 19 (No such device)

Re: Inspect or change a rootfs UBI Image file
March 13, 2019 09:48PM
balanga,


That was me loosely speaking. Basically, I said you should only attach the UBI volume and browse it. Change the files inside is OK too since you are running a modern u-boot.

ubiattach /dev/ubi_ctrl -m 2 -O 2048

ubiattach: error!: cannot attach mtd2
>            error 19 (No such device)

Think about this.

The stock GoFlex Home FW defines 4 mtd partititions (the Pogo E02, Dockstar, or GoFlex Net stock FW does too). And so we followed that precedence and use the same mtds definition.

After you've installed OpenWrt in NAND, you have redefined the mtd partititons. Now you have u-boot and ubi partition (which houses the rootfs).

So you only have mtd0 and mtd1. No mtd2 or mtd3 as in stock GF Home FW.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: