tools/mic.git
11 years agoraw.py: implement booting by partition UUID
Artem Bityutskiy [Tue, 8 Jan 2013 13:53:24 +0000 (15:53 +0200)]
raw.py: implement booting by partition UUID

If the partition typ is "gpt", specify the rootfs by partition UUID instead of
the device node. This will allow to be device-node-independent.

Change-Id: I534036d2a38a072a73ac2994f5753425d60ab8a1
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: implement 'get_partuuid()' method
Artem Bityutskiy [Tue, 8 Jan 2013 13:49:56 +0000 (15:49 +0200)]
partitionedfs: implement 'get_partuuid()' method

Implement a method for getting the partition UUID for a mapped partition.
We will use it for mounting by partition UUID a bit later.

Change-Id: Iaf497c34eaf84e8e25dd5019a99d76f3674744cd
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw.py: kill rootdev and prefix
Artem Bityutskiy [Tue, 8 Jan 2013 13:11:30 +0000 (15:11 +0200)]
raw.py: kill rootdev and prefix

Similarly, kill the 'rootdev' and 'prefix' values returned by
'_get_syslinux_boot_config()' - they are not used. This cleans up things a bit
further.

Change-Id: I164c46d5a17ebdd2404f5da1ff883ec9d79cfffc
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw.py: kill bootdevnum
Artem Bityutskiy [Tue, 8 Jan 2013 13:07:47 +0000 (15:07 +0200)]
raw.py: kill bootdevnum

The _get_syslinux_boot_config() function returns bootdevnum which is not really
needed, because it is not used. There is only one usage - an exception error
string, but this usage is incorrect anywere, because it prints incorrect
loopback name anyway.

So kill it, and make the code a little bit cleaner. We have enough mess there.

Change-Id: Ia6fff77205389e77ce1dac55ab044f7410bcf347
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw.py: detect the boot partition properly
Artem Bityutskiy [Tue, 8 Jan 2013 12:43:21 +0000 (14:43 +0200)]
raw.py: detect the boot partition properly

Remove a hack of detecting the boot partition by mount point. We have a special
key for marking the boot partition.

Change-Id: I05f62cc33a72cc87ad95f45cdb79a8a611cf53de

11 years agoraw.py: fix strange "bug"
Artem Bityutskiy [Tue, 8 Jan 2013 12:50:43 +0000 (14:50 +0200)]
raw.py: fix strange "bug"

The entire file kind of assumes that there may be several disks. And this is
why we have a lot of complexity in raw.py and partitionedfs.py.

But if we look at _install_syslinux(), we have a nonesense loop at the
beginning. Obviously, the entire function has to be in this loop, otherwise it
makes zero sense, right?

Change-Id: I2e6825ca475b4e1c34128361b9c4cc97159379da
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: enable GPT support
Artem Bityutskiy [Mon, 7 Jan 2013 10:12:41 +0000 (12:12 +0200)]
partitionedfs: enable GPT support

This adds finally GPT support. It works, and Tizen IVI images with GPT
partition table boot fine.

We now need is to use 'root=PARTUUID=<uuid>' in syslinux.conf to boot by
UUID - will be added later as well.

Change-Id: Icfe938e72b96c4092131039a120d6095b3acbbd4
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agokickstart: add --ptable option
Artem Bityutskiy [Thu, 10 Jan 2013 11:41:41 +0000 (13:41 +0200)]
kickstart: add --ptable option

This patch adds a --ptable option to the 'bootloader' command of the KS file,
as suggested by Guy Chen. The default partition table format is "msdos". We are
going to support the "gpt" format soon. Usage:

bootloader --timeout=blah --append=blah --ptable=blah

Change-Id: I02772df92a8e883ac3450b5b947789bca19be037
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw.py: remove redundant code
Artem Bityutskiy [Mon, 7 Jan 2013 11:16:59 +0000 (13:16 +0200)]
raw.py: remove redundant code

Remove code from raw.py which sets the 'bootable' flag to the boot partition,
because it is redundant.

partitionedfs.py it the file where everything concerning partitions has to be
done. And there is code which sets the 'boot' flag to the boot partition. We
just need to use the '--active' option for that partition in the ks file.

Change-Id: I17fd4e6e8785b8c6b1a48a7af1a2335a056b4d98
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: a preparation and nicification
Artem Bityutskiy [Fri, 4 Jan 2013 14:25:15 +0000 (16:25 +0200)]
partitionedfs: a preparation and nicification

Prepare for further changes and refactor the code a bit: separate the parted
running functionality to the '__run_parted()' function.

Do some nicifications in '__create_partition()' to improve readability.

Move the '__create_partition()' and '__run_parted()' functions down so that
they go just before 'format_disk()', which is more logical.

Remove a lot of redundant code by moving the error checking to
'__run_parted()'.

Change-Id: If9697cd2ede6f8b3f07289aa8e8ac391ea882cf2
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: rename self.__create_part_to_image
Artem Bityutskiy [Fri, 4 Jan 2013 14:17:21 +0000 (16:17 +0200)]
partitionedfs: rename self.__create_part_to_image

The 'self.__create_part_to_image()' is too long and not too descriptive either.
Let's name it '__create_partition()' instead.

Change-Id: I556c8dd872b1fd79d8c44fac0ca5130ae1521bc8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: add partial GPT support
Artem Bityutskiy [Fri, 4 Jan 2013 13:53:10 +0000 (15:53 +0200)]
partitionedfs: add partial GPT support

This commit partially adds GPT partitions support. Further patches will add
full support. I split them to make the patches more reviewable.

This patch basically implements most of the things except of actually asking
parted to use GPT partitioning.

This patch introduces another 'layout_partitions()' parameter which defines the
partition table format. It now may be 'msdos' or 'gpt'.

Change-Id: I210bacc629b938d307a1e4d209c90d4400a42daa
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: make the interface a bit saner
Artem Bityutskiy [Fri, 4 Jan 2013 13:41:08 +0000 (15:41 +0200)]
partitionedfs: make the interface a bit saner

We have 'add_partition()' call to add one partion, but we have 'add_disks()'
method to add all disks at once. This is inconsistent and makes the code more
difficult to understand. Fix this by changind 'add_disks()' into 'add_disk()'
which adds a single disk. This makes things look a lot nicer.

Change-Id: I8a4f4249b1f8fa02486d4cbb3fbc4226ca2e65b8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs.py: improve readability some more
Artem Bityutskiy [Fri, 4 Jan 2013 13:32:46 +0000 (15:32 +0200)]
partitionedfs.py: improve readability some more

Add a comment to 'add_partition()'. Also convert all the non-docstring comments
to the normal '#' style to make the code consistent.

Change-Id: I772d08f20d434b7bb4f4725410622da5ac9d2fb6
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: rename MBR_SECTOR_LEN
Artem Bityutskiy [Fri, 4 Jan 2013 13:10:49 +0000 (15:10 +0200)]
partitionedfs: rename MBR_SECTOR_LEN

The 'MBR_SECTOR_LEN' name becomes not very appropriate when we add GPT
partitions, which have a lot larger overhead comparing to MBR partitions. We'll
need to introduce another constant. Let's use the 'MBR_OVERHEAD' instead, and
later we'll introduce a 'GPT_OVERHEAD' variable.

Change-Id: Iedf9338b58eed3b4b4b149ba9f30acf5369500c7
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoparitionedfs: improve readability
Artem Bityutskiy [Fri, 4 Jan 2013 13:01:52 +0000 (15:01 +0200)]
paritionedfs: improve readability

Rename the 'disk' key in parition and subvolume dictionaries into 'disk_name',
because it is really a disk name string. Old name is very confusing because
the disks dictionary also has a 'disk' key which points to a real disk object.
I was many times confused by this when I was trying to understand the code, and
now it is time to clean the mess up a bit.

Change-Id: I58526ce719f831051924498550df5de9b3ebd737
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: fix the mbr_sector_skipped hack
Artem Bityutskiy [Fri, 4 Jan 2013 12:35:25 +0000 (14:35 +0200)]
partitionedfs: fix the mbr_sector_skipped hack

The entire PartitionedMount class assumes there may be more than one disk. And
the 'mbr_sector_skipped' hack is wrong because it assumes there is only one
disk and we need to skip only once, which is incorrect.

This patch fixes the issue. And it actually makes things nicer as well.

Change-Id: Icb399cfa488786ce6668ffaa21146f01a3e15a08
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: clean-up some mess
Artem Bityutskiy [Fri, 4 Jan 2013 12:26:18 +0000 (14:26 +0200)]
partitionedfs: clean-up some mess

This is a clean-up patch. It cleans up the code around alignment and makes it
both shorter and more readable. No functinal changes, just using better
constructs and removing useless operations.

Change-Id: I9655239168101ca491ac60b3a16798dedef12841
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw.py: kill get_diskinfo()
Artem Bityutskiy [Fri, 4 Jan 2013 12:04:20 +0000 (14:04 +0200)]
raw.py: kill get_diskinfo()

We do not need this function anymore. The only thing we need is to get disk
names. So instead, introduce a 'get_disk_names()' method which simply returns a
list of disk names.

This is a clean-up.

Change-Id: I5145ab0fe3f36c9ac5fef6bb82b53a29f51eb5b0
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw: fix image size with --align
Artem Bityutskiy [Fri, 4 Jan 2013 11:41:15 +0000 (13:41 +0200)]
raw: fix image size with --align

Finally, with the preparation patches we did, we can fix the --align problem
and fix bug #624.

The issue is: with --align the image size becomes too large and there are
unused blocks at the end.

Now we can use correct image size calculated by partitionedfs.py.

Change-Id: I59e19281934b9557cdb960a7228d81f463f37786
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: calculate minimum disk sizes
Artem Bityutskiy [Fri, 4 Jan 2013 10:54:36 +0000 (12:54 +0200)]
partitionedfs: calculate minimum disk sizes

Now we can calculate minimum disk sizes in layout_partitions(). Introduce
'min_size' key to the disks dictionary for this.

Change-Id: I23161ff2461111f323dcd30ef6d1cb744098a6a7
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: separate out partitions placing
Artem Bityutskiy [Fri, 4 Jan 2013 10:29:16 +0000 (12:29 +0200)]
partitionedfs: separate out partitions placing

Create a new method which lays out (or places) partitions to the disks. It will
make it possible to find out disk size before creating a disk. Indeed, this
function places all partitions, so the end of the last partition is the size of
the disk. So the user will have to be able to do this:

1. Add all partitions
2. Layout partitions
3. Get the disk size
4. Create the disk
5. Add the disk and format/mount it

And no more buggy heuristics for disk size are needed.

Change-Id: Ib6edf5e57d3d03f4a84d3f46eefad7d25bc793ec
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: add disks while adding partitions
Artem Bityutskiy [Fri, 4 Jan 2013 09:02:16 +0000 (11:02 +0200)]
partitionedfs: add disks while adding partitions

The PartitionedMount class used to work as follows:

1. The user adds all partitions using 'add_partition()'. We create an internal
   list of partitions.
2. User adds all disks using 'add_disks()'. We create an internal list of
   disks. Additionally, 'add_disks()' provides the real disk object.

The problem with this is that in order to create the real disk object, we need
to know its size. But it is difficult to calculate it when complex options like
--align are used.

The real calculations happen in the '__format_disks()' method of
PartitionedMount.

What I want to do is to make things work this way:

1. The user adds all the partitions.
2. The user asks what disk size is required.
3. The user creates disk objects of the right size and adds them.

In order to achieve it, I need to separate out the partitions positioning from
the '_format_disks()' function, and do this before the user adds the disks.

However, the positioning code assumes we already have the internal disks
dictionaries (self.disks). But current code creates those dictionaries only in
'add_disks()', which is too late for our purposes.

This patch basically makes the inderal disks dictionaries while adding the
partitions, because the partition already contains the disk name (internal
target physical name). So we can create the disk dictionaries right away.

The only missing thing will be the host disk objects, which are added by
'add_disks()' later on.

Change-Id: Ie8245c8b61c941165aea3a583826a2896f4c85d9
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: introduce add_disks() method
Artem Bityutskiy [Thu, 3 Jan 2013 11:15:22 +0000 (13:15 +0200)]
partitionedfs: introduce add_disks() method

The 'PartitionedMount()' class has an 'add_partition()' method for adding a
partition. Introduce a simialr 'add_disks()' method of adding disks.

Currently the disks are added by the constructor and this is very inflexible.
Indeed, to add a disk, wee need know first create it. To create it - we need to
know its size. To find out its size, we need to sum up all the partition sizes,
take into account the alignment, the MBR size and so on. IOW, do complex
calculations.

This is a preparation for further changes where the disk size calculation will
be done by 'PartitionedMount()' instead. It will tell us the disk size, and
we'll add the disk after adding partitions.

The final goal is to fix the --align bug - when --align is used, the generated
raw disk size is larger than needed - it has unused space at the end.

In this patch we also amend all the users of PartitionedMount to comply to
the new interface.

Change-Id: I0cacfb64410c7b2da634642fbf57d5b4be28acad
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoMerge "baseimager.py: rename MANIFEST to MD5SUMS" into devel
Gui Chen [Thu, 10 Jan 2013 11:12:13 +0000 (03:12 -0800)]
Merge "baseimager.py: rename MANIFEST to MD5SUMS" into devel

11 years agoraw.py: switch to the BmapCreate module
Artem Bityutskiy [Thu, 22 Nov 2012 15:41:39 +0000 (17:41 +0200)]
raw.py: switch to the BmapCreate module

The bmaptools project now has a nice 'BmapCreate' API module, which contains
all the bmap creation functionality, gets improved and bug-fixed, as well as
tested.

Already now it is better then the old mic implementation because it uses the
FIEMAP ioctl instead of FIBMAP, and FIEMAP does not require root.

In order to get all the goodies of the library and avoid code duplication
and double maintanace efforts - switch to the BmapCreate library and kill
own bmap implementation.

Change-Id: Ie5b591fd1125dcff3fb82118a6e3604961e9c301
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agomake syslinux sel menu color usable
Anas Nashif [Fri, 21 Dec 2012 05:53:57 +0000 (21:53 -0800)]
make syslinux sel menu color usable

The selection color is the same as the background, which makes it
invisible, this sets the color to the inverse

11 years agobaseimager.py: rename MANIFEST to MD5SUMS
Artem Bityutskiy [Fri, 28 Dec 2012 08:28:22 +0000 (10:28 +0200)]
baseimager.py: rename MANIFEST to MD5SUMS

The name "MANIFEST" is not very good for multiple reasons:

1. It is not user-friendly - mere users do cannot tell what this file is from
   its name.
2. Tizen is currently the most important user of MIC, and in Tizen we use word
   "manifest" for a different thing - every package has a security manifest
   file which declares the needs of the package.
3. MIC stores checksums in the MANIFEST, and this file is compatible with the
   'md5sum' tool. If we decide to provide sha1 checksums in the future, we'll
   have to add another file with a different name. What will that name be?

Anyway, it is nicer and cleaner to use the same naming scheme as OpenSuse and
Ubuntu use. They have MD5SUMS and SHA1SUMS files.

Let's make things more aligned and cleaner and rename MANIFEST into MD5SUMS.

This may break some scripts some people use. But I think it is anyway a low
risk thing, and it is better to rename now, when Tizen has few users. It may be
more difficult to do later.

Change-Id: I79f968066aa27bd211622f477b27a1973b3775ad
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoupdate dist files and tests to enable unittest
Gui Chen [Sun, 6 Jan 2013 02:36:53 +0000 (10:36 +0800)]
update dist files and tests to enable unittest

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agokeep only unittest
Gui Chen [Thu, 20 Dec 2012 07:25:04 +0000 (15:25 +0800)]
keep only unittest

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate documentation
Gui Chen [Thu, 20 Dec 2012 06:00:43 +0000 (14:00 +0800)]
update documentation

11 years agoput arch compatible into pkg comparison
Gui Chen [Tue, 18 Dec 2012 06:55:18 +0000 (14:55 +0800)]
put arch compatible into pkg comparison

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoMerge branch 'release-0.15' into devel
Gui Chen [Wed, 19 Dec 2012 06:42:48 +0000 (14:42 +0800)]
Merge branch 'release-0.15' into devel

Conflicts:
etc/bootstrap.conf
mic/bootstrap.py
mic/creator.py
mic/imager/raw.py
mic/msger.py
mic/utils/misc.py
setup.py

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix type error when calling mknod
lihuanhuan [Mon, 17 Dec 2012 20:34:28 +0000 (15:34 -0500)]
fix type error when calling mknod

subprocess requires string only for command args

Change-Id: I32442ea6a0d28a40fea55a2ffcf9d43579d1c6da

11 years agobump up to release 0.15 0.15
Gui Chen [Wed, 12 Dec 2012 08:08:19 +0000 (16:08 +0800)]
bump up to release 0.15

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoSparseLoopbackDisk: fix sparse file creation
Artem Bityutskiy [Wed, 14 Nov 2012 12:46:30 +0000 (14:46 +0200)]
SparseLoopbackDisk: fix sparse file creation

The SparseLoopbackDisk class created sparse file a bit incorrecly.

First of all, it created a sparse file of wrong size - one byte more than
asked.  Indeed, look at Tizen images, they are of size '2717908993', which is
2.5GiB + 1 byte.

Second of all, the file was not as sparse as it could be - because of the write
to the end, the last block was mapped.

Change this to just use 'ftruncate()' to the right size, which does the trick.

Change-Id: If76d27515d5483e29a76a15f128ff8737872d57b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoremove rpmdb files before install packages
Gui Chen [Tue, 11 Dec 2012 07:50:32 +0000 (15:50 +0800)]
remove rpmdb files before install packages

this rpmdb files will avoid the installing

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to 0.15-rc5
Gui Chen [Sun, 9 Dec 2012 07:36:49 +0000 (15:36 +0800)]
bump up to 0.15-rc5

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix uuid lost in some case which raise traceback
Gui Chen [Mon, 10 Dec 2012 07:30:54 +0000 (15:30 +0800)]
fix uuid lost in some case which raise traceback

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agorequire python-m2crypto when needed sslverify
Gui Chen [Sun, 9 Dec 2012 07:30:30 +0000 (15:30 +0800)]
require python-m2crypto when needed sslverify

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agomore compatible way to pass ext options
Gui Chen [Sun, 9 Dec 2012 07:13:33 +0000 (15:13 +0800)]
more compatible way to pass ext options

and also catch mkfs error

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agocorrect checking order for assigning folder to logfile
Gui Chen [Sun, 9 Dec 2012 05:57:13 +0000 (13:57 +0800)]
correct checking order for assigning folder to logfile

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix showing incorrect total install number in some case
Gui Chen [Sun, 9 Dec 2012 05:49:38 +0000 (13:49 +0800)]
fix showing incorrect total install number in some case

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to 0.15-rc4
Gui Chen [Tue, 4 Dec 2012 08:39:18 +0000 (16:39 +0800)]
bump up to 0.15-rc4

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoshow dumpe2fs when debug
Gui Chen [Tue, 4 Dec 2012 08:20:44 +0000 (16:20 +0800)]
show dumpe2fs when debug

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix logfile specified a directory
Huanhuan Li [Thu, 8 Nov 2012 20:13:27 +0000 (15:13 -0500)]
fix logfile specified a directory

when run mic with options '--logfile=dir', traceback shows

11 years agofix lost variable in warning msg
Huanhuan Li [Thu, 8 Nov 2012 19:43:25 +0000 (14:43 -0500)]
fix lost variable in warning msg

Signed-off-by: Huanhuan Li <huanhuanx.li@intel.com>
11 years agoupdate doc/RELEASE_NOTES
Gui Chen [Mon, 3 Dec 2012 07:56:57 +0000 (15:56 +0800)]
update doc/RELEASE_NOTES

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agotypo fix
Gui Chen [Mon, 3 Dec 2012 07:56:27 +0000 (15:56 +0800)]
typo fix

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix local repo metadata override issue
Gui Chen [Mon, 3 Dec 2012 07:54:27 +0000 (15:54 +0800)]
fix local repo metadata override issue

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to 0.15pre3
Gui Chen [Thu, 29 Nov 2012 06:44:35 +0000 (14:44 +0800)]
bump up to 0.15pre3

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd RELEASE_NOTES
Gui Chen [Thu, 29 Nov 2012 06:52:34 +0000 (14:52 +0800)]
add RELEASE_NOTES

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoimproved loop creation
jobol [Mon, 19 Nov 2012 07:49:59 +0000 (08:49 +0100)]
improved loop creation

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agosync time and zone setting to bootstrap env
Gui Chen [Thu, 29 Nov 2012 06:21:48 +0000 (14:21 +0800)]
sync time and zone setting to bootstrap env

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix timestamp in logfile uncorrected with 'EDT'
Huanhuan Li [Mon, 22 Oct 2012 19:06:58 +0000 (15:06 -0400)]
fix timestamp in logfile uncorrected with 'EDT'

11 years agoupdate README.rst
lhh [Tue, 9 Oct 2012 19:18:46 +0000 (15:18 -0400)]
update README.rst

Signed-off-by: lhh <huanhuanx.li@intel.com>
11 years agosome case don't need to mount parent folder
Gui Chen [Fri, 30 Nov 2012 03:21:35 +0000 (11:21 +0800)]
some case don't need to mount parent folder

bind mounting parent folder has potential issue in some case, make it optinal

some dirs like 'outdir' 'logfile' which will be created by mic is not existed
before chroot, create them to avoid left them inside chroot

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agodon't drop when failed to unmap kpartx device
Gui Chen [Wed, 28 Nov 2012 06:29:04 +0000 (14:29 +0800)]
don't drop when failed to unmap kpartx device

just warn the failure, no need to drop here

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agouse 'mknod' instead to create loop device
Gui Chen [Wed, 28 Nov 2012 05:51:14 +0000 (13:51 +0800)]
use 'mknod' instead to create loop device

in some distros, if loop device is not created by 'mknod',
losetup can't use them correctly

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to 0.15pre2
Gui Chen [Fri, 30 Nov 2012 02:34:51 +0000 (10:34 +0800)]
bump up to 0.15pre2

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobackport bmap patch from devel
Gui Chen [Wed, 28 Nov 2012 06:07:41 +0000 (14:07 +0800)]
backport bmap patch from devel

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoAdd dracut support to livecd/liveusb images
Anas Nashif [Fri, 9 Nov 2012 18:03:38 +0000 (10:03 -0800)]
Add dracut support to livecd/liveusb images

This adds support to initrd images using dracut and enables systemd
and udev and other plugins that will be used to boot pc-style systems.

The previous initrd method was last used in MeeGo and is currently not
supported in in Tizen, so it is obsolete and does work with new udev
and systemd booting.

11 years agoDo not show password in debug messages
Anas Nashif [Tue, 2 Oct 2012 20:54:17 +0000 (13:54 -0700)]
Do not show password in debug messages

11 years agopoint to tizen repo, not meego
Anas Nashif [Tue, 2 Oct 2012 20:23:25 +0000 (13:23 -0700)]
point to tizen repo, not meego

Change-Id: I50e62f957dbdbfbc178558598881e041fe0f1643

11 years agobump to 0.15pre1
Gui Chen [Fri, 30 Nov 2012 02:32:09 +0000 (10:32 +0800)]
bump to 0.15pre1

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix local repo unavailable in bootstrap
Gui Chen [Mon, 26 Nov 2012 08:05:16 +0000 (16:05 +0800)]
fix local repo unavailable in bootstrap

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoreturn filename directly if local repo specified
Gui Chen [Mon, 26 Nov 2012 08:04:03 +0000 (16:04 +0800)]
return filename directly if local repo specified

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoRevert "decide uniq arch when one repo only has one uniq arch"
Gui Chen [Mon, 26 Nov 2012 07:15:21 +0000 (15:15 +0800)]
Revert "decide uniq arch when one repo only has one uniq arch"

This reverts commit 55e3c24997204f0c6ad2bb29701f2e5de0b79266.

11 years agoappend filesystem parameter for ext[2/3/4] filesystem
Gui Chen [Mon, 26 Nov 2012 06:59:28 +0000 (14:59 +0800)]
append filesystem parameter for ext[2/3/4] filesystem

in ks file, specify --extoptions can pass ext filesystem parameter to mkfs:
part / --size 1000 --ondisk sda --fstype=ext3 --extoptions="-I 256 -E nodiscard"
other filesystem will ignore this option

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agodefault to no scriptlets trigger
Gui Chen [Mon, 26 Nov 2012 03:23:56 +0000 (11:23 +0800)]
default to no scriptlets trigger

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoraise when creating bootstrap failed
Gui Chen [Fri, 23 Nov 2012 03:17:08 +0000 (11:17 +0800)]
raise when creating bootstrap failed

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoneed not to check 'passwd'
Gui Chen [Fri, 23 Nov 2012 03:15:46 +0000 (11:15 +0800)]
need not to check 'passwd'

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix minor bug
Gui Chen [Thu, 22 Nov 2012 02:57:48 +0000 (10:57 +0800)]
fix minor bug

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agomultiple bootstrap path to support multi-instance mic
Gui Chen [Thu, 22 Nov 2012 02:52:01 +0000 (10:52 +0800)]
multiple bootstrap path to support multi-instance mic

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadapt for new mechanism of bootstrap
Gui Chen [Mon, 19 Nov 2012 11:20:39 +0000 (19:20 +0800)]
adapt for new mechanism of bootstrap

also fix arm image creation performance issue

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agodecide uniq arch when one repo only has one uniq arch
Gui Chen [Sat, 22 Sep 2012 15:00:40 +0000 (23:00 +0800)]
decide uniq arch when one repo only has one uniq arch

the arch detection is changed: when one uniq arch is found in a repo,
this arch should be detected arch now.

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix version comparison for bootstrap
Gui Chen [Sat, 22 Sep 2012 10:41:13 +0000 (18:41 +0800)]
fix version comparison for bootstrap

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix extlinux not found issue
Gui Chen [Sat, 22 Sep 2012 10:39:58 +0000 (18:39 +0800)]
fix extlinux not found issue

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix syntax warning for USAGE.rst
Gui Chen [Fri, 21 Sep 2012 13:17:49 +0000 (21:17 +0800)]
fix syntax warning for USAGE.rst

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoIntegrated mic with "OTC Tools Tester" Jenkins machinery
Ed Bartosh [Thu, 4 Oct 2012 14:42:09 +0000 (17:42 +0300)]
Integrated mic with "OTC Tools Tester" Jenkins machinery

OTC Tester expects that cd packaging/ && make all produces all needed
packaging files. This change makes it happen.

Beside of that tests/mic-test.py was fixed, because Tools Tester job
runs nose if tests/ directory presents in the source tree and expects
some tests results. Results were not generated, so fake test has been
added there.

Change-Id: I08f7b5c6012fbefef640177bce13c301fcf826c0
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
11 years agoMerge "Add dracut support to livecd/liveusb images" into devel
Gui Chen [Tue, 13 Nov 2012 08:08:00 +0000 (00:08 -0800)]
Merge "Add dracut support to livecd/liveusb images" into devel

11 years agoAdd dracut support to livecd/liveusb images
Anas Nashif [Fri, 9 Nov 2012 18:03:38 +0000 (10:03 -0800)]
Add dracut support to livecd/liveusb images

This adds support to initrd images using dracut and enables systemd
and udev and other plugins that will be used to boot pc-style systems.

The previous initrd method was last used in MeeGo and is currently not
supported in in Tizen, so it is obsolete and does work with new udev
and systemd booting.

11 years agofix lost variable in warning msg
Huanhuan Li [Thu, 8 Nov 2012 19:43:25 +0000 (14:43 -0500)]
fix lost variable in warning msg

Signed-off-by: Huanhuan Li <huanhuanx.li@intel.com>
11 years agoRawImageCreator: do not use double with statement
Artem Bityutskiy [Mon, 29 Oct 2012 13:34:47 +0000 (15:34 +0200)]
RawImageCreator: do not use double with statement

Double with statements are only supported starting from python-2.7, while
mic is 2.5-compatible. Turn the double with statement in the bmap generation
code to 2 single with statements.

Change-Id: I2ce186b4a9be8b7746c88bb96c98f4af470fa7d8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agomisc.py: make 'calc_hashes()' generic
Artem Bityutskiy [Wed, 24 Oct 2012 07:44:18 +0000 (10:44 +0300)]
misc.py: make 'calc_hashes()' generic

The 'calc_hashes()' function is generic so it does not make much sense
to hide it in the 'RawImageCreator' class. Move it to 'misc.py' where
miscellaneous stuff like this is kept.

While moving, also rename the 'file_name' argument to 'file_path'.

Also change the interface so that we pass a list of hash names to calculate,
not a list of hash objects.

Also do not import 'md5' from hashlib to the current name-spaces.

Note, originally I have these things as a set of separate patches, but
merged to satisfy review comments.

Change-Id: I31d8ac35cf55447ddb5c56cfafa319a6fef85373
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoMerge "misc.py: remove few unnecessary checks" into devel
Jian-feng Ding [Mon, 5 Nov 2012 11:39:51 +0000 (03:39 -0800)]
Merge "misc.py: remove few unnecessary checks" into devel

11 years agomisc.py: remove few unnecessary checks
Artem Bityutskiy [Wed, 24 Oct 2012 07:32:46 +0000 (10:32 +0300)]
misc.py: remove few unnecessary checks

We use python 2.5 features in several places and we have the
'Requires:   python >= 2.5' in our RPM spec file. This means that
we do not have to check whether hashlib and xml.etree exist, we can
just use them instead, because they are part of python 2.5.

Similarly, remove the 'with_statement' importing, because 'with'
was added in 2.5.

Change-Id: I14cc9741f66f8d397744b1b37f9a55dc47877a9c
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoclean up unused code in raw image
Gui Chen [Wed, 24 Oct 2012 08:05:38 +0000 (16:05 +0800)]
clean up unused code in raw image

Change-Id: Ic047ff24c1c7728147f4a990236644b92cce32e8

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix mic chroot failure caused by unmatching parameters
Gui Chen [Wed, 24 Oct 2012 07:34:50 +0000 (15:34 +0800)]
fix mic chroot failure caused by unmatching parameters

in do_chroot, cmd should have default value,
otherwise the caller in former code will be failed

Change-Id: Iaeb605f744083e23d9745dde4338137033e4c1b3

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix timestamp in logfile uncorrected with 'EDT'
Huanhuan Li [Mon, 22 Oct 2012 19:06:58 +0000 (15:06 -0400)]
fix timestamp in logfile uncorrected with 'EDT'

11 years agoDo not show password in debug messages
Anas Nashif [Tue, 2 Oct 2012 20:54:17 +0000 (13:54 -0700)]
Do not show password in debug messages

11 years agofix logfile specified a directory
Huanhuan Li [Thu, 8 Nov 2012 20:13:27 +0000 (15:13 -0500)]
fix logfile specified a directory

when run mic with options '--logfile=dir', traceback shows

11 years agofix help command
Huanhuan Li [Thu, 8 Nov 2012 19:51:45 +0000 (14:51 -0500)]
fix help command

'mic cr ?' will output differently with 'mic cr -h'

Signed-off-by: Huanhuan Li <huanhuanx.li@intel.com>
11 years agobmap: increase minor version number
Artem Bityutskiy [Thu, 18 Oct 2012 08:37:38 +0000 (11:37 +0300)]
bmap: increase minor version number

We've done some compatible changes and it is a good idea to incread the
minor bmap version number now.

Also, add some XML comments explaining the versioning.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agobmap: support sha1 checksums
Artem Bityutskiy [Thu, 18 Oct 2012 08:20:50 +0000 (11:20 +0300)]
bmap: support sha1 checksums

This patch addresses another complaint from Henning Schroeder and adds
SHA1 checksum for each block range.

Change-Id: Ib1835ce2ca26d4e8ebe46a1e83c083822c47ce21
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoRawImageCreator: introduce a function for hash calculation
Artem Bityutskiy [Thu, 18 Oct 2012 15:17:06 +0000 (18:17 +0300)]
RawImageCreator: introduce a function for hash calculation

Introduce a separate function for hash calculations. I will need
hash in bmap code, so it is nice to have a common helper for this.

Change-Id: I859450803a0c6cfa9bb6db738a6931508572374f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoRawImageCreator: remove meter for hash calculation
Artem Bityutskiy [Thu, 18 Oct 2012 14:48:49 +0000 (17:48 +0300)]
RawImageCreator: remove meter for hash calculation

We currently use the progress meter when calculating hash functions
of the raw image file. Well, there is nothing bad with this, but this
is not really necessary. I am removing this because I am going to
introduce a helper function for calculating hashes, and I do not want
to complicate it with a meter.

So, remove the meter. We can add it back if we find this necessary
in the future.

This makes the code a bit less complex as well.

Change-Id: I7da651f82dcbb14e16e1dccbbc4ee73cc1aa7e0b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoRawImageCreator: use hashlib unconditionally
Artem Bityutskiy [Thu, 18 Oct 2012 11:50:23 +0000 (14:50 +0300)]
RawImageCreator: use hashlib unconditionally

mic does not work with python < 2.5 (see distfiles/mic.spec, for example), so
we can use hashlib without falling-back to 'import sha1'. This patch cleans-up
the code a bit and removes the fall-back to 'import sha1' stuff.

I move 'import hashlib' to the top level because it is cleaner and because I
will need hashlib very soon in the next patch.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agobmap: move human-readable stuff to comments
Artem Bityutskiy [Wed, 17 Oct 2012 14:48:30 +0000 (17:48 +0300)]
bmap: move human-readable stuff to comments

I've got feed-back from Henning Schroeder that it is bad idea to provide
human-only information in machine-parsible parts of the XML, simply because
someone may be tempted to use it.

And he is right. This patch moves all the human-only date to XML comments.

It also amends the BMAP xml header comment by adding more information.

Change-Id: If5c62c2277686dfd3c889ae6f59a9d1caa94b026
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agobmap: fix the image file open mode
Artem Bityutskiy [Thu, 18 Oct 2012 15:31:29 +0000 (18:31 +0300)]
bmap: fix the image file open mode

Open the image file in R/O binary mode instead of the default
R/O mode.

Change-Id: Ibc8b69fdf0b920c716e7cc9c23017747206e5500
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>