1.0.0 • Published 9 years ago

resin-image-config v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

resin-image-config

npm version dependencies Build Status Build status

Resin.io image FAT configuration.

Installation

Install resin-image-config by running:

$ npm install --save resin-image-config

Documentation

config.write(String image, Object files, Function callback)

Write files to an image FAT partitions.

The files object contains Partition Definitions properties, which contain the files and contents to write.

The callback gets passed one argument: (error).

Example:

inject.write 'path/to/rpi.img',
	'4:1':
		'config.json': JSON.stringify(hello: 'world')
	'1':
		'foo.bar': 'Foo bar'
, (error) ->
	throw error if error?

inject.read(String image, Object files, Function callback)

Read files from a image FAT partitions.

The files object contains Partition Definitions keys, which contain array of files to read.

The callback gets passed two arguments: (error, results).

Example:

inject.read 'path/to/rpi.img',
	'4:1': [ 'config.json' ]
, (error, results) ->
	throw error if error?
	console.log(JSON.parse(results['4:1']['config.json']))

Partition Definition

A partition definition is a number or string representing the primary partition number, or an extended partition number along with a logical partition number.

Notice that this definition is device dependent. Refer to specific device bundles for this information.

Examples:

  • 4 is the primary partition number four.
  • 3:1 is the first logical partition of the third primary extended partition.

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ gulp lint

Support

If you're having any problem, please raise an issue on GitHub.

License

The project is licensed under the MIT license.