summaryrefslogtreecommitdiffstats
path: root/image-vfat.c
Commit message (Collapse)AuthorAgeFilesLines
* image-vfat: use new helper to initialize the imageMichael Olbrich2022-03-251-2/+1
| | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* image-vfat: drop '-b' from mcopyMichael Olbrich2021-04-101-2/+2
| | | | | | | | | | | | It enables the 'Batch mode'. It is optimized for huge recursive copies. This is not really needed here and fsck.vfat complains about the resulting filesystem. So drop the option and expand the existing test. Fail if fsck.vfat modifies the filesystem. Fixes #142 Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* Make sparse cleanUwe Kleine-König2020-10-071-1/+1
| | | | | | | | | | | | | This fixes the following warnings when compiling with CC=cgcc: config.c:197:46: warning: Using plain integer as NULL pointer image-ext2.c:208:9: warning: Using plain integer as NULL pointer image-ext2.c:212:9: warning: Using plain integer as NULL pointer image-ext2.c:213:9: warning: Using plain integer as NULL pointer image-hd.c:663:11: warning: symbol 'hdimage_opts' was not declared. Should it be static? image-iso.c:52:9: warning: Using plain integer as NULL pointer image-rauc.c:191:9: warning: Using plain integer as NULL pointer image-vfat.c:130:9: warning: Using plain integer as NULL pointer
* image-vfat: Add label option to set volume name.Florent Viard2019-10-301-2/+16
| | | | Signed-off-by: Florent Viard <fviard@cxignited.com>
* make it easier to create empty filesystemsMichael Olbrich2019-09-221-2/+3
| | | | | | | | This is useful when creating multiple images with on config and some of them should be empty. Also, vfat filesystems cannot be empty right now, so this makes it possible. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* image-vfat.c: disable mtools C-H-S adressing checkPeter Korsgaard2018-05-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mtools by default refuses to work with filesystems not fitting the legacy C-H-S adressing, E.G. bigger than 511MB or with "odd" sizes. mkdosfs writes a BIOS parameter block containing (among others) the number of sectors per track and heads. This parameter block is what mtools reads and validates that total sectors is a multiple of sectors/track times heads. For small(<512MB) filesystems, mkdosfs uses sectors/track = 32 and heads = 64, allowing filesystems of multiples of 1MB to validate. For bigger filesystems it instead uses sectors/track = 63 and heads = 255 to signify LBA addressing. 63 * 255 * 512 bytes is not a multiple of 1MB, so the validation in mtools fails for filesystems of multiples of 1MB, E.G: image test.fat { vfat { files = { "test.txt" } } size = 512M } Errors out with: Total number of sectors (10444800) not a multiple of sectors per track (63)! Add mtools_skip_check=1 to your .mtoolsrc file to skip this test This legacy check can be disabled by the MTOOLS_SKIP_CHECK environment variable (or editing the .mtoolsrc as described by the error message), so pass MTOOLS_SKIP_CHECK=1 to each mcopy/mmd invocation. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* image-*: Fix pathes with whitespacesSascha Hauer2018-03-191-4/+4
| | | | | | | | | | The different image handlers do not work with pathes containing whitespaces whenever an external command is invoked. Escape all pathes with quotation marks to make that work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [mol: fix more image types] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* systemp: Print command output on demandSascha Hauer2018-03-191-1/+1
| | | | | | | | | | | | | The output of invoked commands can be very useful for debugging, but also annoying or confusing. Print stderr of invoked commands on debug loglevel and and stdout of invoked commands on verbose debug loglevel, but redirect to /dev/null on lower loglevels. This makes the manual > /dev/null redirection in some commands unnecessary which is removed with this patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [mol: fix error handling, change output loglevel, log stdout in the tests] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* cleanup loggingSascha Hauer2018-03-191-1/+1
| | | | | | | | | | | | | | We have image_error, image_log, error and logmsg which all do the actual printing themselves. Create a set of error(), info() and debug() functions which all do the actual printing in the same function. Also add the same set of functions with a image_ prefix to do image specific logging. All messages now get a [type] prefix to make it easier to distinguish them from the stdout/stderr from invoked commands (see next patch). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [mol: don't change the loglevel numbers] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* vfat, ext2: print error message when size is zeroGaël PORTAY2017-11-171-0/+11
| | | | | | | | | | | | | | | | | The `size' property is mandatory and cannot be 0 for vfat and ext file systems. Print a message that is more helpful than: genext2fs: too few blocks. Note: options have changed, see --help or the man page. ext2(test.ext2): failed to generate test.ext2 and mkdosfs: unable to discover size of images/test.vfat vfat(test.vfat): failed to generate test.vfat Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
* add license file and remove old FSF address from the source filesMichael Olbrich2016-01-121-2/+1
| | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* vfat: print source if target is empty on copyVivien Didelot2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With a config like this: image foo { vfat { file "foo/bar/A" { image = "a" } files = { "b", "c", "d" } } size = 1M } genimage actually prints the following output: vfat(foo): adding file 'a' as 'foo/bar/A' ... vfat(foo): adding file 'b' as '' ... vfat(foo): adding file 'c' as '' ... vfat(foo): adding file 'd' as '' ... If the target is empty (which ends up copying in the image output file root directory anyway), use the source filename instead. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image-vfat: cleanup loggingMichael Olbrich2014-08-121-2/+4
| | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* image-vfat: create leading directories for individual filesMichael Olbrich2014-08-111-0/+11
| | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* add vfat handlerMichael Olbrich2012-06-301-0/+103
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>