slackware arm 14.1 and ubifs
This morning I had a go at using ubifs on my dockstar. The journey was far from smooth.
I followed examples from the official ubifs documentation and faq (where possible), supplemanting with some bits and pieces here and there as the official documentation does not guide you trough the whole process step by step (very usefull if you're doing it for the first time).
I've the tree I want to create the image from in /root_image
I've decided to use custom mtd layout:
ubiattach -p /dev/mtd1
ubimkvol /dev/ubi0 -N rootfs -m
I then create the ubifs image with mkfs.ubifs:
mkfs.ubifs -r /root_image -o /tmp/rootfs.img -R 1MiB -e 128KiB -m 512 -c 1500
I then update the volune with the image:
ubiupdatevol /dev/ubi0_0 /tmp/rootfs.img
But when I mount it I get this error:
root@printserver:/# mount -t ubifs ubi0_0 /mnt/floppy/
mount: wrong fs type, bad option, bad superblock on ubi0_0,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
Ok upon better look at dmesg it was lamenting that I issued incorrect parameters during image creation. Well I don't have any idea what would be sensible so I used stuff from examples, erroneously thinking that at worse I'd have bad performance.
After several attempts, each time correcting one option at a time, this created something I was able to write to volume and mount:
mkfs.ubifs -r /root_image -o /tmp/rootfs.img -R 2MiB -e 129024 -m 2048 -c 1500
but I still cannot boot because the initrd incorrectly parses cmdline ignoring the ubi root device spefification, replacing it with the content of rootdev in the initrd resulting in this error:
I mounted the volume manually and hoped that it would then boot but when rc.S is executed I started getting errors dew to not correctly remounting root rw and fsck.ufifs missing.
To make a dirty quick workaround I sckipped fsck on root alltogether and changed the remounting lines as follows :
# /sbin/mount -n -o remount,ro /
/sbin/mount -n -o remount,ro /dev/ubi0_0 /
# /sbin/mount -w -v -n -o remount /
/sbin/mount -w -v -n -o remount /dev/ubi0_0 /
and this got the thing booting right.
To workaround the initrd parsing problem I just recreated the initrd with "-r /dev/ubi0_0" amongst the options so that even if it's not parsed at least the content of rootdev is right.
Can you see if you can get it working properly by specifying the root=/dev/ kernel cmdline? Then I'll have a look at seeing how to exclude fsck on ubifs in -current.
Worked around that part by just recreating an initrd with a specific root device via -r flag.
Yeah .. I made changes to my rc.S to get the system to come up right. It appearts at that time that the remount with no devive specification fails, I hadto rewrite that part with something like this:
mount -o remount,rw /dev/ubi0_0 /
This is actually odd because once the system is up I can use "mount -o remount,ro /" and "mount -o remount,rw /" without issues.
maybe that got fixed after having the device specificatuon in fstab with the /dev/ubi0_0 format too.
I'll check this out better asap, but for sure now that it's working it's in the /dev/... format:
I did a bit more testing and things seem to work as expected if the cmdline and fstab specifies the ubi device in the /dev/ubi0_0 format.
Not sure anymore if it makes sense to have the initrd init script parse the other format if it introduces other issues.
|All times are GMT -5. The time now is 07:17 PM.|