tools/bmap-tools.git
12 years agoRelease version 0.1.1
Artem Bityutskiy [Wed, 7 Nov 2012 09:39:53 +0000 (11:39 +0200)]
Release version 0.1.1

Change-Id: I86c186f8a8ee99cde051fd626c9e8854ae90a9cf
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agopackaging: correct dependency
Artem Bityutskiy [Wed, 7 Nov 2012 09:26:49 +0000 (11:26 +0200)]
packaging: correct dependency

Although xml.etree is part of python, Fedora and OpenSuse provide this
module in separate packages. Add the corresponding packaging requirements.

Change-Id: I705fcb091eb7f977f2d564fe0d86ede1bad295f3
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: act on KeyboardInterrupt
Artem Bityutskiy [Wed, 7 Nov 2012 09:09:17 +0000 (11:09 +0200)]
bmap-flasher: act on KeyboardInterrupt

When one pressess Ctrl-C, the program hands for several minutes and does
not exit. The reason is that the kernel synchronized the block device on
the last close.

Let's at least print a message to the user and tell that there is no need
to worry.

Change-Id: I61368dddf697161c2a47012c5f9e2c96b74ef273
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: kill the --no-sync option
Artem Bityutskiy [Wed, 7 Nov 2012 08:52:34 +0000 (10:52 +0200)]
bmap-flasher: kill the --no-sync option

The kernel sychronizes block devices on close automatically (in case of
the last reference becomes 0), so --no-sync does not work anyway.

Change-Id: Ib4783b85363a74b8d92a09c9a1a7636999569f4c
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: improve flashing speed
Artem Bityutskiy [Tue, 6 Nov 2012 13:41:29 +0000 (15:41 +0200)]
BmapFlasher: improve flashing speed

Improve flashing speed by switching to the 'noop' I/O scheduler for the block
device we are flashing to. This gives ~20% write speed imporvement.

Also limit the write buffering in order make the flashing - we do not need that
and we better leave the memory for other applications.

Change-Id: Ideca1b4ee786c91606e91813d2ffe451380506d3
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: error out if the image does not fit the block device
Artem Bityutskiy [Tue, 6 Nov 2012 13:21:30 +0000 (15:21 +0200)]
BmapFlasher: error out if the image does not fit the block device

I've got a bug report that the flasher tries to flash even if the block device
is too small. Let's fix this.

Change-Id: I4e7742d362fca8b6a2885b318a60fbeeb5ef1a9d
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: provide a target_is_block_device attribute
Artem Bityutskiy [Tue, 6 Nov 2012 13:01:49 +0000 (15:01 +0200)]
BmapFlasher: provide a target_is_block_device attribute

Which is useful for bmap-flasher, because it does not have find this out
itslelf.

Note, this is rather bad approach, and later I'll introduce a base class
for flashing anywhere and a child class for flashing to block devices.

Change-Id: I1959359f357a70fa45d09cbad7b16104023070cd
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: check that the image file is a regular file
Artem Bityutskiy [Tue, 6 Nov 2012 12:47:31 +0000 (14:47 +0200)]
BmapFlasher: check that the image file is a regular file

Change-Id: Ic9ec219e212eed38c01c6d18dd38df934500674e
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: do not postpone size initialization for uncompressed images
Artem Bityutskiy [Tue, 6 Nov 2012 12:39:11 +0000 (14:39 +0200)]
BmapFlasher: do not postpone size initialization for uncompressed images

When we are flashing images without bmap, we cannot initialize various
size-related attributes until we flash the image if the image is compressed.
However, we can do this for uncompressed images.

Change-Id: I8b8e604e68f680acbd059c7a44f92c654a9b4755
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: separate sizes initialization to a function
Artem Bityutskiy [Tue, 6 Nov 2012 12:31:43 +0000 (14:31 +0200)]
BmapFlasher: separate sizes initialization to a function

We will need this function in the next patch, so this is just a preparation.

Change-Id: If2d8c1474dce3255f92da8ae7287c6f86d8bc204
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: open the block device in write-only mode
Artem Bityutskiy [Tue, 6 Nov 2012 11:47:46 +0000 (13:47 +0200)]
BmapFlasher: open the block device in write-only mode

... we do not need the read access.

Change-Id: I3cabe1ec9a6966981678f4d460edf848f6b0cd2a
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: fix a typo in the warning message
Artem Bityutskiy [Tue, 6 Nov 2012 08:05:52 +0000 (10:05 +0200)]
bmap-flasher: fix a typo in the warning message

Change-Id: Ie62c1bf5b66f78848da280ee59f5b2f84e44a846
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: change order of arguments
Artem Bityutskiy [Fri, 2 Nov 2012 12:33:20 +0000 (14:33 +0200)]
bmap-flasher: change order of arguments

bmap-flasher <src> <dest> is more intuitive than bmap-flasher <dst> <src>.

Change-Id: Ida87d73e538b7ec9f9b715d3fecd22e5e725461b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapHelpers: handle small sizes correctly
Artem Bityutskiy [Thu, 1 Nov 2012 14:25:11 +0000 (16:25 +0200)]
BmapHelpers: handle small sizes correctly

Make sure we provide sane human-readable size for small sizes like 1 byte or 10
bytes. With this change, for sizes less than 512 we'll print X bytes, while for
larger sized we'll print 0.YKiB.

Change-Id: I7a5a32ed3a9dc26fb754299c55d7dbffdf531a37
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-creator: print a warning if no holes found
Artem Bityutskiy [Thu, 1 Nov 2012 14:16:33 +0000 (16:16 +0200)]
bmap-creator: print a warning if no holes found

Probably this means that the image file was not handled correctly and holes
were expanded.

Change-Id: I602b52ee6471e0a15938e2100b29329a1b066b3f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoflasher: rename 'total_size'
Artem Bityutskiy [Thu, 1 Nov 2012 14:05:51 +0000 (16:05 +0200)]
flasher: rename 'total_size'

There is inconsistenty between the flasher and creator - we use 'total_size' in
flasher to describe the image size, while we use 'image_size' in the creator
for the same. Let's use the same terminology everywhere, so kill 'total_size'
and use 'image_size' everywhere.

Change-Id: I6bb826a8cdf36b9c89aea97c54d9ff6cb2431f46
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoTeach Creator and Flasher modules to provide human sizes
Artem Bityutskiy [Thu, 1 Nov 2012 14:01:50 +0000 (16:01 +0200)]
Teach Creator and Flasher modules to provide human sizes

Which we can use in the comman-line tools, which is quite handy.

Change-Id: I904d5895d9422b3bc6a54fdbfbd4e51b06996f95
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapCreator: implement FIEMAP support
Artem Bityutskiy [Thu, 1 Nov 2012 12:47:19 +0000 (14:47 +0200)]
BmapCreator: implement FIEMAP support

It does not require root, unlike FIBMAP.

Change-Id: I82010ca3e756a8ab895327d6e782981f5fc0b88d
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapCreator: synchronize the image file before generating bmap
Artem Bityutskiy [Thu, 1 Nov 2012 08:54:36 +0000 (10:54 +0200)]
BmapCreator: synchronize the image file before generating bmap

To make sure the block map is correct.

Change-Id: Ic486edf22b2d986117faf9f53997d78fc589b9fd
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agopackaging: make myself to be the maintainer
Artem Bityutskiy [Wed, 31 Oct 2012 09:43:04 +0000 (11:43 +0200)]
packaging: make myself to be the maintainer

I guess I am the package maintainer, not Ed, while I am happy to have
Ed as the maintainer of the packaging stuff :-). However, the contents
of the package is maintained by me.

Change-Id: I9e6bc1f50a271e5c8b3d3730b5f1effd84ad7289
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoAdd initial version of bmap-creator and BmapCreator
Artem Bityutskiy [Wed, 31 Oct 2012 15:50:53 +0000 (17:50 +0200)]
Add initial version of bmap-creator and BmapCreator

Change-Id: I3c27b8ba584b6ca4090bb9415a790c24e2b1c3cb
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoIntroduce BmapHelpers.py
Artem Bityutskiy [Thu, 1 Nov 2012 07:54:32 +0000 (09:54 +0200)]
Introduce BmapHelpers.py

This module will contain shared helper functions.

Change-Id: I7c0fe807f9587508bdfbacc22820edbcf970103d
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoRepackaged pythonic way
Ed Bartosh [Wed, 31 Oct 2012 14:19:50 +0000 (16:19 +0200)]
Repackaged pythonic way

As this package has been splitted to script and API it makes sense to
utilize proper Python packaging( so called Python Egg) using setuptools
functionality. This change does exactly that. All building and installation
is done using setup.py.

Debian and RPM packaging has been updated accordingly.

Artem: tweak package description and my e-mail address.

Change-Id: I46a6ad4e9c5b869190e4a001dc6fa274cae2ca7e
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: clean-up help text
Artem Bityutskiy [Wed, 31 Oct 2012 13:45:01 +0000 (15:45 +0200)]
bmap-flasher: clean-up help text

argparse starts help text with a small letter and does not put the dot at the
end (see -h and --version). Do the same for all the other options for
consistency.

Change-Id: Id4e39481e27690e47662181f1901abb6aebcf4d3
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoKeep modules in bmaptools sub-directory
Artem Bityutskiy [Wed, 31 Oct 2012 13:29:11 +0000 (15:29 +0200)]
Keep modules in bmaptools sub-directory

Change-Id: I6b1b9dc5999aa20b4f02ed318556be6313c7df27
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: imrove docs some more and have less duplication
Artem Bityutskiy [Wed, 31 Oct 2012 13:13:39 +0000 (15:13 +0200)]
bmap-flasher: imrove docs some more and have less duplication

Add some more documentation and use own docstring for 'bmap-flasher -h',
instead of duplicating the text.

Change-Id: I3afc50d72b661b2200307c3b275fbb15940d6f69
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: improve the documentation some more
Artem Bityutskiy [Wed, 31 Oct 2012 12:27:44 +0000 (14:27 +0200)]
BmapFlasher: improve the documentation some more

Change-Id: I442356bbe98cb8584eed0267fc228df430187b25
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: provide a list of supported image formats
Artem Bityutskiy [Wed, 31 Oct 2012 12:09:08 +0000 (14:09 +0200)]
BmapFlasher: provide a list of supported image formats

Change-Id: I45b8014c14dfe863190ce2967c151b269d2c9af9
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher: move constant to the module level
Artem Bityutskiy [Wed, 31 Oct 2012 12:05:31 +0000 (14:05 +0200)]
BmapFlasher: move constant to the module level

The maximum supported bmap version is actually a module-level attribute, not a
class-level attribute - move it to the module level.

Change-Id: Ie2911478048da4e9ed4c2747e72f5222cd22071b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: improve documentation a little bit
Artem Bityutskiy [Wed, 31 Oct 2012 12:01:03 +0000 (14:01 +0200)]
bmap-flasher: improve documentation a little bit

Change-Id: I28829fed8ec1a01cac38e58dd532b6b4bbd528e3
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoBmapFlasher.py: remove undefined variable
Artem Bityutskiy [Wed, 31 Oct 2012 09:47:39 +0000 (11:47 +0200)]
BmapFlasher.py: remove undefined variable

Kill the left-over from old dayse when all the code was in 'bmap-flasher' and
we had 'args' variable.

Change-Id: Icc36deedd8e38b6488bcd35da78bab6ba7df1e9b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: implement --version option
Artem Bityutskiy [Wed, 31 Oct 2012 08:58:17 +0000 (10:58 +0200)]
bmap-flasher: implement --version option

Change-Id: Iaea5577e387fb2a905231fef0dd5cd24c0a8e96c
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: print flashing speed
Artem Bityutskiy [Wed, 31 Oct 2012 08:08:17 +0000 (10:08 +0200)]
bmap-flasher: print flashing speed

Change-Id: I3c83f87deb458121590ebb8af2e06faceb7ea4c8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: move API to a separate module
Artem Bityutskiy [Tue, 30 Oct 2012 12:00:32 +0000 (14:00 +0200)]
bmap-flasher: move API to a separate module

Change-Id: I8540547449818523cec6e49699852b5b30268834
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: use logger instead of plain print
Artem Bityutskiy [Tue, 30 Oct 2012 07:36:16 +0000 (09:36 +0200)]
bmap-flasher: use logger instead of plain print

And implement the --quiet option at the same time.

Also, kill the 'fatal()' helper.

Change-Id: Ia25f7162275854501aa7f7d2af8303e1121c20a6
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: add another TODO entry
Artem Bityutskiy [Tue, 30 Oct 2012 07:04:11 +0000 (09:04 +0200)]
bmap-flasher: add another TODO entry

Change-Id: Ia9eda13492ea89230b708b931f6a42dd2c2ada55
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: add a several TODO entries
Artem Bityutskiy [Mon, 29 Oct 2012 15:25:46 +0000 (17:25 +0200)]
bmap-flasher: add a several TODO entries

Just in order to not forget to look at them.

Change-Id: I2a76725955116dcce9a300997593e66a2757245a
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: print time in human-readable form
Artem Bityutskiy [Mon, 29 Oct 2012 10:45:49 +0000 (12:45 +0200)]
bmap-flasher: print time in human-readable form

Change-Id: Ie8e9d0e259faa52222b460fba79e6f4c6bebc2f2
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agobmap-flasher: improve errors handling
Artem Bityutskiy [Mon, 29 Oct 2012 08:40:35 +0000 (10:40 +0200)]
bmap-flasher: improve errors handling

Print a nice error message when the the user by a mistake gives us a non-XML
file instead of a proper bmap XML file.

Change-Id: I1e65122b5c9fffb79c3b6855a74d075430669792
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
12 years agoPackaged for deb and rpm distros
Ed Bartosh [Sat, 27 Oct 2012 19:35:04 +0000 (22:35 +0300)]
Packaged for deb and rpm distros

Debian packaging is in debian/ directory, rpm packaging and Makefile to
use by otctools automatic testing system is in packaging/ directory.

Change-Id: I94b09e04ff6bce8cf231f8b1839a9b34f7faffe5
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
12 years agoInitial version of bmap-flasher
Artem Bityutskiy [Fri, 26 Oct 2012 06:45:52 +0000 (09:45 +0300)]
Initial version of bmap-flasher

Change-Id: I58d7079e61df47d22ea1292b14ed8ebab560e82b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
12 years agoInitial empty repository
Eduard Bartosh [Fri, 26 Oct 2012 06:32:29 +0000 (23:32 -0700)]
Initial empty repository