summaryrefslogtreecommitdiffstats
path: root/lib/bootstrap
Commit message (Collapse)AuthorAgeFilesLines
* bootstrap: Warn if image size in BB header is zeroAndrey Smirnov2015-05-071-1/+5
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Remove all partitions upon function completionAndrey Smirnov2015-05-071-2/+10
| | | | | | | | | | Bootstrap_read_devfs does not remove the devices it creates during the course of its execution which might be considered as a resource leak. Remedy that by adding the code to remove those devices upon function completion. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Check for errors from dev_add_bb_dev()Andrey Smirnov2015-05-071-2/+9
| | | | | | | | Check for errors returned by dev_add_bb_dev() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Fix potential memory leakAndrey Smirnov2015-05-071-6/+11
| | | | | | | | | | In case of a failure in one of the cdev_* functions original version of bootstrap_read_devfs would not release memory allocated for barebox header or memory allocated for the image. This commit fixes this by adding resource deallocation code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Close file after we are done with itAndrey Smirnov2015-05-071-0/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Check for errors from devfs_add_partition()Andrey Smirnov2015-05-071-2/+9
| | | | | | | | Check for errors returned by devfs_add_partition() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap: Fix potential memory leak in 'read_image_head'Andrey Smirnov2015-05-071-2/+6
| | | | | | | | | Original version of 'read_image_head' would not free the memory allocated for barebox header in cases of any failure. Fix this by adding a dedicated resourse de-allocation code path. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-082-2/+2
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move file helper functions to separate fileSascha Hauer2014-08-071-0/+1
| | | | | | | | | | 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>
* mount: support filesystem options passed via -oUwe Kleine-König2014-02-101-1/+1
| | | | | | | | | | | Similar to mount(8) the barebox command mount now supports passing a string to the file system driver via -o. This is used in the next commit to let the user specify port numbers for nfs mounts. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Cleanup Kconfig filesAlexander Shiyan2013-08-121-1/+1
| | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce common bootstrap codeJean-Christophe PLAGNIOL-VILLARD2013-01-225-0/+195
This will allow to have a generic code to create different bootstrap As example Barebox as TI Xloader Barebox as AT91 Bootstrap Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>