Mounting an image or image backup - SimonCapewell/enigma2 GitHub Wiki
Use Ubuntu
Images and image backups are stored in the ubifs format. There is no program for ubifs to extract the files directly, but you can mount it with the mtdblock dummy driver to get the files out.
unzip and get the following files in the Image subdirectory:
kernel.bin
noforce
rootfs.bin
rootfs.bin contains the image filesystem
We should work as root user, so if necessary, enter su and enter the rootpassword.
mkdir ubi
Then we load the required drivers on our Linux PC:
modprobe mtdblock
modprobe ubi
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15
Check whether the drivers have created the corresponding devices:
cat /proc/mtd
dev: size erasesize name mtd0: 10000000 00020000 "NAND simulator partition 0"
ls /dev/mtd*
/dev/mtd0/dev/mtd0ro/dev/mtdblock0
Then copy the ubifs image to the block device with dd
dd if=rootfs.bin of=/dev/mtdblock0 bs=2048
24384 + 0 records 24384 + 0 records 49938432 bytes (50 MB) copied, 2.8963 s, 17.2 MB / s
Then comes the real exciting moment to make this now filled simulated block device known as ubifs:
ubiattach /dev/ubi_ctrl -m 0 -O 2048
UBI device number 0, total 2048 LEBs (260046848 bytes, 248.0 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
If this worked, you check whether the corresponding device has been created:
ls /dev/ubi*
/dev/ubi0/dev/ubi0_0/dev/ubi_ctrl
Now you can mount this device:
mount -t ubifs ubi0_0 ./ubi
There you should already see the ubif's root filesystem:
ls ubi
autofs bin boot dev etc hdd home lib media mnt proc sbin share sys tmp usr var