We have our file helper functions in several places. Move them
all to lib/libfile.c.
With this we no longer have file helpers in fs/fs.c which contains
the core fs functions and no functions in lib/libbb.c which are
not from busybox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will provide the image data and information via file
# ls -l /tmp/
-rwxrwxrwx 3 arch
-rwxrwxrwx 12 compression
-rwxrwxrwx 16 name
-rwxrwxrwx 5 os
-rwxrwxrwx 24 time
-rwxrwxrwx 12 type
-rwxrwxrwx 10 load_addr
-rwxrwxrwx 10 entry_point
-rwxrwxrwx 2199875 data0
-rwxrwxrwx 2199875 data
-rwxrwxrwx 10 data.crc
if it's multi image
# ls -l /tmp-multi/
-rwxrwxrwx 3 arch
-rwxrwxrwx 12 compression
-rwxrwxrwx 16 name
-rwxrwxrwx 5 os
-rwxrwxrwx 24 time
-rwxrwxrwx 16 type
-rwxrwxrwx 10 load_addr
-rwxrwxrwx 10 entry_point
-rwxrwxrwx 1292 data0
-rwxrwxrwx 983 data1
-rwxrwxrwx 2287 data
-rwxrwxrwx 10 data.crc
you can get the image header via an ioctl on any file
UIMAGEFS_METADATA
if you want to check the crc do
# crc32 -f /tmp-multi/data -V /tmp-multi/data.crc
CRC32 for /tmp-multi/data 0x00000000 ... 0x000008ee ==> 0x88d5a0db
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>