How can i make a .ubi file from a .tar.gz or folder if this is possible at all?
I looked at this (did not help me):
Creating UBI Image
To create the image from a rootfs you've built first you need to create the ubi.ini file, that describes your ubi image. Create a regular text file, ubi.ini, example contents, for more info run ubinize -h:
[ubi_rfs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=87349248
vol_type=dynamic
vol_name=ubi_rfs
vol_alignment=1
vol_flags=autoresize
Next you'll run the commands that actually build it. Here ubi.ini is the file you just created, ubifs.img is a temp file you can delete once you are done, and your_erootfs.ubi is the name of the rootfs image that will be created.
sudo /usr/sbin/mkfs.ubifs -m 2048 -e 129024 \
-c 677 -r /path/to/rootfs ubifs.img
sudo /usr/sbin/ubinize -o your_erootfs.ubi \
-p 131072 -m 2048 -s 512 -O 512 ubi.ini
Note the part in the
mkfs
command that saysUn-tar your tar.gz file and use the resulting directory as the destination for
-r
.