When booting from DVD we fallback to using fs_of functions to read the
from the DVD. In the case where we need to boot a kernel and initrd
we may run into a situation where we start loading the initrd below
'real-base' and as we grow the buffer 1MB at a time we eventually hit
real-base and get a claim fail.
If we could detect in advance the size of the initrd (as we can for ext*
and netboot) we wouldn't have tis issue as we'd claim the buffer in one
chunk.
So implement an ino_size() method for fs_of.
There is a small complication. OF doesn't correctly support 'seek' so
we cannot just seek to the end of the file and get the size, then seek
to the begining. So we need to read the file to determine it's size.
Ideally we'd then seek to the begining of the file ready to read it
again. ... See previous comment about seek :(
So we have to close and re-open the file to get the fp back to 0.
In order to make this a little less disturbing, move the ino_size()
checks so that if the re-open() fails (it /really/ shouldn't) we can at
least handle the failure somewhat gracefully.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>