Sorry that status updates took some time - been really busy here lately..
First of all, some changes:
- now both Linaro-gcc compilers, 4.6 and 4.8 are currently supported. Choose one for your toolchain, and if you build a package for native gcc, it will be using the same version.
I would recommend personally 4.8 version, because it solves some problems, for example, it doesn't warn you all the time causing for example, compiling cairo with mutex support to fail (actually it's configure that fails) -
although, 4.8 is quite a lot bigger than 4.6.
- Some more updates to rpi-update script are necessary; need to take in account that system's multi user features are enabled and restrict usage for only root, also, instead of static tmp directory, I should use mktemp..
And then why the delay? Well, I've got quite a lot of stuff here, meaning lots of files.. And I noticed something. Failures with filesystem. Even though, I have increased inode count of rootfs, with lot of files I start to notice following:
- filesystem corruption: files that were supposed to be on image have gone missing.
- filesystem corruption: inode's modes getting corrupted. Files are loosing their attributes (for e.g. chmod a+x file no longer executable)
- filesystem corruption: reported free space is enough for writing on disk - but when trying, disk is reported to be full.
- filesystem corruption: disk goes read only. Permanently. fsck does not help.
- filesystem corruption: lot's of errors popping up when doing fsck.
Oops. They were all filesystem corruptions ;)
Reason for this? It is openwrt specific problem and I have narrowed down cause of it after studying other distributions available for rpi. OpenWRT uses genext2fs and tune2fs to generate ext4 image. This is the most propable reason
for all the problems mentioned. This way, you for example cannot set fs features, as tune2fs supports only few features.
Is there a fix? Oh yes. Well.. Not yet.
ext2fsprogs now ships with a script, populate-extfs.sh that should be a tool replacing genext2fs - but it's not quite there.. Most other distributions (for e.g. yocto) already use this script. Or slightly modified version.
There although was a small problem. OpenWRT's rootfs should contain /dev/console. genext2fs used to generate this to image from filespec and this could be added with populate-extfs.sh as well, if directory holding
contents of rootfs contains dev/console created properly with mknod. And this causes a problem, as mknod, both as executable program and as c function, require root priviledges. OpenWRT should be compilable
without root priviledges. I first started to change populate-extfs.sh to have support for filespec as well, but when I noticed that there were some changes in it between different distributions I came to conclusion that
it isn't quite yet perfect. Problems might cause system specific settings, arch specific settings, environment specific settings and even.. shell specific settings (and there are numerous; bash, sh, zsh..)
Therefore, I have written a new populatefs utility, which - well mostly does the same as populate-extfs.sh script, but is coded in C - it needs ext2fsprogs libraries and kernel of host needs support for debugfs.
So what is better than in script:
- support for setting all ownerships to root:root
- support for larger scale of filetypes
- support for combining multiple rootfs directories
- support for filespec, meaning adding for e.g. /dev/console properly (but this feature is not yet done, just finished other features)
So does this then fix other problems as well than just filesystem corruption? Glad you asked; yes it does!
Common rpi distributions come with images that don't have a lot of free space on rootfs. This is because people might be having different sizes of SD cards and 8gb cards aren't being used always. Someone might be using even 256mb from old days.
Then there's a trick; with use of fdisk/parted/etc and resize2fs - one can grow rootfs, let's say, to fill in the whole rest of card. This wasn't possible before, as when using genext2fs and tune2fs, some ext4 features couldn't be set. One of these features
is resize_inode which allows operation mentioned. After using a new way to generate "proper" ext4 image, user should overcome this problem.
Some rpi distributions ship with rpi-config utility that does the job for them. I am not planning on porting rpi-config to these packages, or building a simpler version of it. Atleast now. Busy with populatefs currently.