summaryrefslogtreecommitdiffstats
path: root/fs/bpkfs.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename struct fs_driver_d to fs_driverSascha Hauer2023-01-101-1/+1
| | | | | | | | | Remove the meaningless '_d' suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct fs_device_d to fs_deviceSascha Hauer2023-01-101-1/+1
| | | | | | | | | Remove the meaningless '_d' suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-10/+12
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: replace errno_str() with %m printf format specifierAhmad Fatoum2022-10-111-3/+3
| | | | | | | | | | | Both errno_str() and printf("%m" end up calling strerror(). %m is more convenient to use, so switch over all instances to it. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/warnings'Sascha Hauer2019-04-091-1/+1
|\
| * treewide: Make locally used functions staticSascha Hauer2019-03-181-1/+1
| | | | | | | | | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bpkfs: Fix lseek error check in bpkfs_probe()Andrey Smirnov2019-03-111-2/+2
|/ | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: devfs: Change .lseek callbacks to return 'int'Andrey Smirnov2019-02-041-2/+2
| | | | | | | | | | | Returning requested offset from .lseek() callback doesn't really give us any new information while bringing unnecessary complications. Change all .lseek() types (both in struct struct cdev_operations and in struct fs_driver_d) to return 'int' and adjust the rest of the codebase accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-3/+3
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: move crc specific stuff to crc.hSascha Hauer2016-04-151-0/+1
| | | | | | | We have a crc.h, so move our crc function prototypes there to further cleanup common.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: rename inode member of struct filep to privSascha Hauer2015-03-091-4/+4
| | | | | | | Because that's what it is. 'inode' will become confusing once we support real inodes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bpkfs: fix compiler warningAlexander Aring2014-02-101-1/+1
| | | | | | | | | | | | Correct formatstring of size_t is %zu otherwise we get: fs/bpkfs.c: In function ‘bpkfs_probe’: fs/bpkfs.c:440:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat=] dev_dbg(dev, "%d: offset = %d\n", i, d->offset); Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bpkfs: remove twice include of fs.hAlexander Aring2014-02-101-1/+0
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: add BPKFS supportJean-Christophe PLAGNIOL-VILLARD2013-10-061-0/+514
Simple update file format developed for Somfy, tools and library are available under LGPLv2 (https://www.gitorious.org/libbpk). This format in the v1.0 allow you to store 6 types a binary stream for a unique hardware id: - bootloader - bootloader_version - description.gz - kernel - rootfs - firmware_version and you can easly add more binary stream type. The fs will display you in a directory per hw id and if a binary stream type is unknown will be display as unknown_%08x # mount image.bpk /tmp # ls -l /tmp/hw_id_0/ -rwxrwxrwx 10 firmware_version -rwxrwxrwx 8 firmware_version.crc -rwxrwxrwx 1845968 kernel -rwxrwxrwx 8 kernel.crc -rwxrwxrwx 5062656 rootfs -rwxrwxrwx 8 rootfs.crc -rwxrwxrwx 248 bootloader -rwxrwxrwx 8 bootloader.crc -rwxrwxrwx 248925 description.gz -rwxrwxrwx 8 description.gz.crc -rwxrwxrwx 4 bootloader_version -rwxrwxrwx 8 bootloader_version.crc -rwxrwxrwx 4 unknown_1234567g -rwxrwxrwx 8 unknown_1234567g.crc Why BPK and not CPIO or uImage 1) CPIO cpio does not handle > 4GiB image and does not have any crc checksum 2) uImage uImage only provide one crc32 for the all data part and only a list of binary stream with no information about what is what (in multi-image format) 3) BPK BPK provide a crc32 for the header part and one crc32 per binary stream so if you does not care of some data you are not force to check them And you known exactly the binary stream type and for which hw to use it. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Fargier Sylvain <sylvain.fargier@somfy.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>