tools/mic.git
11 years agomount tmpdir as tmpfs to accelerate performance
Gui Chen [Mon, 25 Mar 2013 03:19:21 +0000 (11:19 +0800)]
mount tmpdir as tmpfs to accelerate performance

use --tmpfs to enable this experimental feature

Change-Id: I5fb8e60a24236f7e6cab624a137c3ddb3d03f7d9
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agostrip slash after release option
Gui Chen [Mon, 25 Mar 2013 01:56:41 +0000 (09:56 +0800)]
strip slash after release option

Change-Id: I8746aaafb9d130a514ee623e62432bc0a3a6d343
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agogenerate bmap file outside __imgdir
Gui Chen [Sun, 24 Mar 2013 06:59:09 +0000 (14:59 +0800)]
generate bmap file outside __imgdir

Change-Id: I8d2759a861619f3767f95c6be73fba0c8e457638
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agochange naming for release option
Gui Chen [Sun, 24 Mar 2013 06:58:03 +0000 (14:58 +0800)]
change naming for release option

move snapshot id forward

Change-Id: I537c938c562dd4933e422698bdc84b94cacb8fb5
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate AUTHORS
Gui Chen [Thu, 21 Mar 2013 06:44:30 +0000 (14:44 +0800)]
update AUTHORS

Change-Id: Iadf5be8daf386c777e7b73b2ff317cacd44ab0b8
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix debuginfo rpm swig attr lost
Gui Chen [Tue, 19 Mar 2013 09:03:11 +0000 (17:03 +0800)]
fix debuginfo rpm swig attr lost

when adding debuginfo rpm, the PoolItem doesn't
convert to Solvable

Change-Id: I221760667217421235849536def6bbcfd94199c2
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoPrint warning when failed to temp ks in normalize_ksfile().
Huang Hao [Mon, 11 Mar 2013 05:48:33 +0000 (13:48 +0800)]
Print warning when failed to temp ks in normalize_ksfile().

* print waring message in try/except block
* add doc string
* remove dir argument to tempfile.mkstemp, since its default
strategy is better than hardcode "/tmp"
* rename _clrtempks to remove_temp_ks and move it behind
* remove the code that check file existence, since it will be
always checked by confmgr.__set_ksconf

Change-Id: Ic4c6125f18eb9e9dda8faa7bc687f97b178b1cea

11 years agoRemove useless try and reraise blocks.
Huang Hao [Mon, 11 Mar 2013 10:42:25 +0000 (18:42 +0800)]
Remove useless try and reraise blocks.

These code catch all exceptions and simply reraise them, which is
equivalent to not writing the try block. So just remove them to
cleanup.

Change-Id: I965356746a5b349458205de9c5a1d6bf97bf8d93

11 years agoChange default mutable arguments of Mic_RepoData.__init__.
Huang Hao [Wed, 6 Mar 2013 04:06:07 +0000 (12:06 +0800)]
Change default mutable arguments of Mic_RepoData.__init__.

Only pass arguments includepkgs, excludepkgs, baseurl,
mirrorlist, name to super __init__ if they are not false.
If they are not present the super __init__ will choose proper
default values for those arguments.

W0102: 26,4:Mic_RepoData.__init__: Dangerous default value [] as argument
W0102: 26,4:Mic_RepoData.__init__: Dangerous default value [] as argument

Change-Id: I56db875ee3d42213726a147a46f9d2e998025cce

11 years agoChange default parameters from mutable type into immutable.
Huang Hao [Wed, 6 Mar 2013 05:35:24 +0000 (13:35 +0800)]
Change default parameters from mutable type into immutable.

Get ride of these pylint warnings:

W0102:190,0:cleanup_chrootenv: Dangerous default value [] as argument
W0102: 47,4:ImagerPlugin.check_image_exists: Dangerous default value [] as argument
W0102:109,8:read_kickstart.KSHandlers.__init__: Dangerous default value {} as argument
W0102:708,0:get_repos: Dangerous default value {} as argument
W0102:772,0:get_attachment: Dangerous default value [] as argument
W0102:775,0:get_pre_packages: Dangerous default value [] as argument
W0102:778,0:get_packages: Dangerous default value [] as argument
W0102:781,0:get_groups: Dangerous default value [] as argument
W0102:784,0:get_excluded: Dangerous default value [] as argument
W0102:787,0:get_partitions: Dangerous default value [] as argument
W0102:877,4:BaseImageCreator.install: Dangerous default value {} as argument
W0102:210,4:Bootstrap.create: Dangerous default value [] as argument

Change-Id: Icc04896829ecfb0e2542f4d4755f4adb07b01319

11 years agoFix an issue with building the man page
Patrick McCarty [Mon, 11 Mar 2013 20:18:05 +0000 (13:18 -0700)]
Fix an issue with building the man page

If the python-docutils package is available in a distro, then make sure
a BuildRequires is added for it.

Change-Id: Ic404fe4ed94bd40aa63139bec3c12b1bcdd59640

11 years agoRefactor function safecopy().
Huang Hao [Wed, 6 Mar 2013 03:04:37 +0000 (11:04 +0800)]
Refactor function safecopy().

* Change ignore_ptns from [] to (). A mutable default value isn't
as expected when invoke in the second time.
>>> def safecopy(ignore_ptns=[]):
...     ignore_ptns += ['*.pyc']
...     print ignore_ptns
...
>>> safecopy()
['*.pyc']
>>> safecopy()
['*.pyc', '*.pyc']

* Add a list into ignore_ptns rather than a string
>>> l = []
>>> l += os.path.basename('/usr/bin')
>>> l
['b', 'i', 'n']

* Include all exception classes by (), otherwise it will catch
OSError and assign this exception instance to a local variable
named IOError.
* Move shutil.ignore_patterns() out of try block since it can
never throw OSError nor IOError.
* Remove useless try/except/raise block which catches every
error but reraise it. It's the same as without this try block.

Change-Id: I8837169bbf4acbadf4a2cfd8ac999d371831d86a

11 years agoReraise exception in bootstrap_mic() but keep original traceback.
Huang Hao [Thu, 28 Feb 2013 12:51:44 +0000 (20:51 +0800)]
Reraise exception in bootstrap_mic() but keep original traceback.

When exception occurs, we could add additional information but
should keep the original traceback. Otherwise traceback shows up
in console will be the second one, which hide the true exception.

A bare "raise" statement is a special syntax to reraise the
original exception, which will also keep its traceback.

Please Refer PEP3134 for more details.

Change-Id: I420399061de89b911cecd5da60fde0023f1893ac

11 years agoRefactor get_mic_binpath() to avoid catch all exceptions.
Huang Hao [Wed, 6 Mar 2013 06:05:20 +0000 (14:05 +0800)]
Refactor get_mic_binpath() to avoid catch all exceptions.

Catch the specific exceptions it cares about, and reduce "try"
block to minimal, otherwise some other errors will be hidden.

Change-Id: Icbef03eef1591ba44466d5634943db5b8c86bdc4

11 years agoUniform import statements to absolute import.
Huang Hao [Thu, 28 Feb 2013 06:22:33 +0000 (14:22 +0800)]
Uniform import statements to absolute import.

Change all relative imports into absolute since mixing them is bad.
Refer PEP8 for more details.

Change-Id: I39fdbe056cb0d76c5ed5812c4f69e74ce8837924

11 years agoMerge branch 'release-0.17' into devel
Gui Chen [Mon, 4 Mar 2013 02:21:53 +0000 (10:21 +0800)]
Merge branch 'release-0.17' into devel

11 years agobe compatible with python-zypp built with swig 2.0
Gui Chen [Sun, 3 Mar 2013 07:18:09 +0000 (15:18 +0800)]
be compatible with python-zypp built with swig 2.0

differences in python-zypp between swig 1.3 and swig 2.0 built
make the original code not work, this patch trys to fix this
compatiblity issue

Change-Id: Ie0a16182463886e9cf89f6fa1c63756e4d50c02d
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoFix import error of kickstart.custom_commands
Huang Hao [Thu, 28 Feb 2013 06:06:02 +0000 (14:06 +0800)]
Fix import error of kickstart.custom_commands

Names listed in __all__ don't exist.

>>> from mic.kickstart.custom_commands import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Mic_Desktop'

Change-Id: Ie9ea1cccacb5fb9faaabc1951c513425c377d549

11 years agobump up to release 0.17 0.17
Gui Chen [Thu, 28 Feb 2013 06:26:36 +0000 (14:26 +0800)]
bump up to release 0.17

Change-Id: I172034cdb2397059331e741f4aea8e1776b1f636
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoKeep error info from exception URLGrabError.
Huang Hao [Thu, 28 Feb 2013 03:37:19 +0000 (11:37 +0800)]
Keep error info from exception URLGrabError.

The origianl URLGrabError exception contains useful information
describing detail of the error, such as errno and http error
code.

However in some situation it doesn't include url address. So append
it if not appear.

Examples of console output before:
    Error <creator>: URLGrabber error: https://xxxx
    Error <creator>: URLGrabber error: https://xxxx

We can't find out difference from those two message.
After:
    Error <creator>: [Errno 14] HTTP Error 401 : https://xxxx
    Error <creator>: [Errno 14] problem making ssl connection on https://xxxx

Change-Id: I3f153e4caf8bbfcbac56ca22118733de7c5a3e66

11 years agoGive reason when failed to load plugin module.
Huang Hao [Thu, 28 Feb 2013 05:41:35 +0000 (13:41 +0800)]
Give reason when failed to load plugin module.

It will be helpful to solve problems.

Change-Id: I02f36706c67cfb9fedc9029ea5a177aa85c2ac61

11 years agobump up to 0.17-rc1
Gui Chen [Wed, 27 Feb 2013 07:31:15 +0000 (15:31 +0800)]
bump up to 0.17-rc1

Change-Id: I1caaf24953b5f6650e02dca2a44dcf53106b79b2
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate changelog files
Gui Chen [Wed, 27 Feb 2013 06:59:00 +0000 (14:59 +0800)]
update changelog files

correct indent and update date

Change-Id: I76d193ddbb4a2556181ac40699138df8d0ef1867
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoFix bad indentations.
Huang Hao [Wed, 27 Feb 2013 07:10:35 +0000 (15:10 +0800)]
Fix bad indentations.

Change-Id: I6a1b15a130576c87a85db864ec3997b7c3005f05

11 years agoupdate depends for ubuntu
Gui Chen [Wed, 27 Feb 2013 05:58:42 +0000 (13:58 +0800)]
update depends for ubuntu

Change-Id: I7c213ffbb8d04f7c7dfac6d0c27be21e8e060908
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoimager.livecd: cleanup anaconda related code
Gui Chen [Sun, 24 Feb 2013 05:26:07 +0000 (13:26 +0800)]
imager.livecd: cleanup anaconda related code

Change-Id: I6539572adf9cd03d2b524db7f76f3bcfa7ba46df
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoimager.loop: fix undefined 'part'
Gui Chen [Sun, 24 Feb 2013 05:14:44 +0000 (13:14 +0800)]
imager.loop: fix undefined 'part'

Change-Id: Ibf16cf33ece80a6d0d400978dd8d3f6d949b8da0
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoutils.fs_related: fix undefined 'out'
Gui Chen [Sun, 24 Feb 2013 05:09:57 +0000 (13:09 +0800)]
utils.fs_related: fix undefined 'out'

Change-Id: I78737c26c3fc9ed3acbd8ed71b51f40e17191bda
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoFix bug that "disk" is undefined.
Huang Hao [Fri, 22 Feb 2013 10:57:49 +0000 (18:57 +0800)]
Fix bug that "disk" is undefined.

Change-Id: I35f43b560c8e2176d8baa9cc873c4994b0105b27

11 years agoRemove import warnings of utils.runner module
Huang Hao [Fri, 22 Feb 2013 10:46:36 +0000 (18:46 +0800)]
Remove import warnings of utils.runner module

Avoid to import * from subprocess

Change-Id: Ib41c3a8716694d8acddf925b500fc89334a6e6f4

11 years agoRemove import warnings of imager.fs module
Huang Hao [Fri, 22 Feb 2013 10:42:39 +0000 (18:42 +0800)]
Remove import warnings of imager.fs module

* sys and subprocess are useless
* avoid to import * from utils.fs_related
* import baseimager in absolute way

Change-Id: I44c970402f06da32a576c68d4650dd7dd010fa1c

11 years agoRemove warnings of import statements of module util.misc
Huang Hao [Fri, 22 Feb 2013 10:29:59 +0000 (18:29 +0800)]
Remove warnings of import statements of module util.misc

* sys is useless
* hashlib, sqlite are duplicated
* avoid to import * of error and fs_related

Change-Id: I926a906939f4f8f12acab6707df992a06f74061b

11 years agobump up to version 0.17-rc0
Gui Chen [Thu, 21 Feb 2013 08:01:02 +0000 (16:01 +0800)]
bump up to version 0.17-rc0

Change-Id: If2844a047f672887c82d37996a0eb507d27693d6
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate mic.spec to enable centos and tizen
Gui Chen [Thu, 21 Feb 2013 08:38:40 +0000 (16:38 +0800)]
update mic.spec to enable centos and tizen

Change-Id: Iaf8436686dc2aa2feccdcaafc134a09ed968fd40
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate AUTHORS
Gui Chen [Thu, 21 Feb 2013 07:01:16 +0000 (15:01 +0800)]
update AUTHORS

Change-Id: I78c44023828d2bacffca5e4fbcf50f6e4f24d8f7
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd ChangeLog to track history of release notes
Gui Chen [Thu, 21 Feb 2013 06:59:39 +0000 (14:59 +0800)]
add ChangeLog to track history of release notes

Change-Id: I9ffc25a5354cb937c48494e6e74ecb5204540370
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agorewrite REALSE_NOTES to include more info about mic
Gui Chen [Thu, 21 Feb 2013 06:49:57 +0000 (14:49 +0800)]
rewrite REALSE_NOTES to include more info about mic

the REALSE_NOTES is seen to public, it will be good
to make it looks like a real release notes by
containing more info about mic

Change-Id: Ibf839b21f73056b32364ccb723b1a447fe83e186
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agomove vcs info from .vcs file to .packages file
Gui Chen [Thu, 21 Feb 2013 03:54:35 +0000 (11:54 +0800)]
move vcs info from .vcs file to .packages file

now vcs info will recorded in .packages by default
not in a seprated .vcs file

Change-Id: I0e37ba1e8cfbbe5b67a2b32e530dc702e3ea992d
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd vcs field to recording_pkgs for 'release' option
Gui Chen [Thu, 21 Feb 2013 03:52:52 +0000 (11:52 +0800)]
add vcs field to recording_pkgs for 'release' option

now 'release' option will add vcs field by default

Change-Id: I66402c1e65097dd2b336179c967209681db1ae7c
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agodon't copy vmlinuz to /boot/extlinux
Gui Chen [Thu, 21 Feb 2013 02:29:09 +0000 (10:29 +0800)]
don't copy vmlinuz to /boot/extlinux

as the previous commit by Artem will use relative path
in extlinux.conf, copy vmlinuz to extlinux folder would
be unuseful

Change-Id: Ib74a27872fcea7d388e1f7c5f5de33a8c635385f
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoraw: use relative path to the kernel image in extlinux.conf
Artem Bityutskiy [Tue, 19 Feb 2013 13:59:58 +0000 (15:59 +0200)]
raw: use relative path to the kernel image in extlinux.conf

Currently raw image creator works only when there is a separate boot parition.
But when /boot is in the root partition, extlinux is unable to boot the kernel.

The reason of this is that in extlinux.conf MIC specify the absolute path to
the vmlinuz file - '/vmlinuz', which of course does not work when the correct
path is '/boot/vmlinuz'.

The fix seems to be easy - for extlinux the current directory is where the
'syslinux.conf' file is situated. And we know that the 'vmlinuz' file is one
level up. So all we need to do is to ask extlinux to take the look one level
up, i.e., take '../vmlinuz'.

This patch was tested in both configurations - with and without a separate boot
partition.

Change-Id: Ia87d053b46f7712aa491c38ed13ca6cd61c5b7ba
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: do not try to mount partitions without a mountpoint
Artem Bityutskiy [Fri, 15 Feb 2013 15:20:59 +0000 (17:20 +0200)]
partitionedfs: do not try to mount partitions without a mountpoint

With this patch MIC finally allows partitions wothout any mount point.

Change-Id: I110a90754428c2f216d27287526701ea0cdc5b0c
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw: allow partitions without a file-system
Artem Bityutskiy [Fri, 15 Feb 2013 14:57:09 +0000 (16:57 +0200)]
raw: allow partitions without a file-system

Do not error out if a partition does not have a mount point and file-system
type. We want MIC to create partitions without any format and without any
mount-point.

Change-Id: Ib50fecc2ffd501be8b24dac5d57324cf5de72b74
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agokickstart: allow partitions without mount points
Artem Bityutskiy [Fri, 15 Feb 2013 14:46:35 +0000 (16:46 +0200)]
kickstart: allow partitions without mount points

We need to be able to create partitions without any file-system and without any
mount-point. However, the KS files parser does not allow this, which this patch
fixes.

Change-Id: If046e8895aaa3bb95f25e317464677e019877819
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: fix extended partitions support
Artem Bityutskiy [Fri, 15 Feb 2013 13:10:16 +0000 (15:10 +0200)]
partitionedfs: fix extended partitions support

When we use th elegacy MBR paritions and have more than 3 paritions, MIC
creates and extended parition and which allows us to create 4 more logical
paritions. However, this functionality was broken. It was partially fixed in
the previous commit, and this is the final fix.

The problem is that kpartx maps the extended partirion (sometimes, depending on
the version), and MIC tries to use it and fails. Instead, MIC should just skip
the extended parition. This patch adds the corresponding check.

With this fix we can create images with many paritions, and both MBR and GPT
paritions work.

Change-Id: Iabf17c6407942eec7a7051bff52ebf427aa4f3a1
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoparitionedfs: do not create extended parition in case of GPT
Artem Bityutskiy [Fri, 15 Feb 2013 12:11:45 +0000 (14:11 +0200)]
paritionedfs: do not create extended parition in case of GPT

Change-Id: Ibd2ae31c7e0ed630dd7e392995a21ff90442cc6a
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoparitionedfs: partially fix extended paritions support
Artem Bityutskiy [Fri, 15 Feb 2013 11:37:59 +0000 (13:37 +0200)]
paritionedfs: partially fix extended paritions support

Currently MIC is unable to create more than 3 partitions, because the
logical/extended paritions support is broken. This is because the EBR is not
taken into account, so parted fails to create logical partitions. EBR stands
for "Extended Boot Record" and this ia basically a single sector which prepends
every logical parition.

This patch fixes the issue. We take one sector from each partition starting
from the 3rd one (the last primary parition), and this sector will be used by
parted for the EBR. This works nicely and partitions stay aligned correctly for
the best performance.

Change-Id: I678c52f24750388ffdc09c32939541ba3f3e8b8f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoFix bad indents
Huang Hao [Tue, 19 Feb 2013 05:30:14 +0000 (13:30 +0800)]
Fix bad indents

Change-Id: I4bd330957aeaeaae8367aafdeffd2f511d479077

11 years agoMerge "paritionedfs: remove the 'extended' key from disk dictionary" into devel
Gui Chen [Tue, 19 Feb 2013 05:56:43 +0000 (21:56 -0800)]
Merge "paritionedfs: remove the 'extended' key from disk dictionary" into devel

11 years agoMerge "partitionedfs: simplify the code a tiny bit" into devel
Gui Chen [Tue, 19 Feb 2013 05:36:33 +0000 (21:36 -0800)]
Merge "partitionedfs: simplify the code a tiny bit" into devel

11 years agoMerge "partitionedfs: improve debugging prints" into devel
Gui Chen [Tue, 19 Feb 2013 05:31:12 +0000 (21:31 -0800)]
Merge "partitionedfs: improve debugging prints" into devel

11 years agoMerge "partitionedfs: remove bogus alignment check" into devel
Gui Chen [Tue, 19 Feb 2013 05:28:29 +0000 (21:28 -0800)]
Merge "partitionedfs: remove bogus alignment check" into devel

11 years agoPass command line info to CreatorError in get_file_size()
Huang Hao [Mon, 18 Feb 2013 09:31:44 +0000 (17:31 +0800)]
Pass command line info to CreatorError in get_file_size()

Variable "du" does not exist, so pass the command line to error.

Change the local var name "file" to "filename" to avoid conflicting
with builtin function.

Also refactor last "if" statement to more readable max function.

Change-Id: I661e0a02db940d75a8180c3215f95d5ff1ae8802

11 years agoparitionedfs: remove the 'extended' key from disk dictionary
Artem Bityutskiy [Fri, 15 Feb 2013 10:46:55 +0000 (12:46 +0200)]
paritionedfs: remove the 'extended' key from disk dictionary

The 'extended' key holds the size of the extended partition, and it is only
used once when we create the extended partition. However, we do not really need
this becase we can easily calculate the extended partition size, because we
know the start of the first logical partition and the disk size. Having this
'extended' key only complicates the code unnecessarily.

Change-Id: I58e61e219890339fae63eeb5bdf9f2002401cb72
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: simplify the code a tiny bit
Artem Bityutskiy [Fri, 15 Feb 2013 09:09:31 +0000 (11:09 +0200)]
partitionedfs: simplify the code a tiny bit

When we calculate the minimum disk size, we do not have to search for the last
parition, because we have d['offset'] which points to the first available
sector.

Change-Id: Ida5f92ec11939caa76ad1bf90aee137a2e918d2d
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: improve debugging prints
Artem Bityutskiy [Thu, 14 Feb 2013 12:28:10 +0000 (14:28 +0200)]
partitionedfs: improve debugging prints

Print the starting and ending partition sector numbers as well as partition
size. This makes it easier to debug issues.

Change-Id: Ie96872f6902d2b7c12bb043879e06d5b839d986c
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agopartitionedfs: remove bogus alignment check
Artem Bityutskiy [Thu, 14 Feb 2013 11:48:18 +0000 (13:48 +0200)]
partitionedfs: remove bogus alignment check

The following perfectly valid KS option makes MIC complain about alignment and
exit:

part /d1 --size 1 --fstype=ext4 --ondisk sdb --align 1024

This creates a 1MiB partition and aligned to 1MiB.

And it is even fine to ask for a 1MiB partition to be aligned to 4MiB. So the
alignment size check is totally incorrect - remove it.

Change-Id: If84be72f43c3be91ae5a7c3fa49b10ef1202cf50
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoAdd global declaration to var _LOOP_RULE_PTH
Huang Hao [Mon, 18 Feb 2013 09:19:32 +0000 (17:19 +0800)]
Add global declaration to var _LOOP_RULE_PTH

hide_loopdev_presentation() redefine a var with the same name
_LOOP_RULE_PTH by setting its value without global statement. and
its global counterpart can never be changed.

pylint message:
W0621:136,12:hide_loopdev_presentation: Redefining name '_LOOP_RULE_PTH' from outer scope (line 125)

Change-Id: I1cfafa46a933e22c732d4f4963c4a4f6d1ac4c1d

11 years agoMove function optparser_setup out of class MicCmd
Huang Hao [Mon, 18 Feb 2013 02:52:25 +0000 (10:52 +0800)]
Move function optparser_setup out of class MicCmd

Found this problem by pylint. Decorator optparser_setup is not a
instance/class/static method of MicCmd, so move it out.

Also fix wrong indent.

Change-Id: I0315951134360fa6081b904e6323e57c16b7ef9f

11 years agoMake sure that urlgrabber gets URLs as strings
Markus Lehtonen [Tue, 16 Oct 2012 12:40:50 +0000 (15:40 +0300)]
Make sure that urlgrabber gets URLs as strings

URLs of unicode type cause a crash in python-urlgrabber.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoroll back to original naming for release
Gui Chen [Tue, 5 Feb 2013 11:10:37 +0000 (19:10 +0800)]
roll back to original naming for release

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoremove suffix when release specified
Gui Chen [Tue, 5 Feb 2013 08:14:50 +0000 (16:14 +0800)]
remove suffix when release specified

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix no key 'HOME' in environ variable failure
Gui Chen [Mon, 4 Feb 2013 02:51:35 +0000 (10:51 +0800)]
fix no key 'HOME' in environ variable failure

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoFixed dependency issue for squashfs on OpenSUSE
Ed Bartosh [Tue, 5 Feb 2013 15:31:24 +0000 (17:31 +0200)]
Fixed dependency issue for squashfs on OpenSUSE

Name of the package with mksquashfs and unsquashfs utilities is squashfs
on OpenSUSE and squashfs-tools on Fedora. This change adds Requires:
squashfs to the spec for OpenSUSE and squashfs-tools for the rest of
distros.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
11 years agobump up to release 0.16 0.16
Gui Chen [Tue, 29 Jan 2013 08:22:38 +0000 (16:22 +0800)]
bump up to release 0.16

Change-Id: I4b62e11db18c027d6cd6afe63932fc4d8eaecf7a
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate RELEASE_NOTES
Gui Chen [Tue, 29 Jan 2013 08:09:33 +0000 (16:09 +0800)]
update RELEASE_NOTES

Change-Id: Ide5b483fc7bdc2c36590ea6d1d2fdbc1f970414b
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to 0.16-rc4
Gui Chen [Tue, 29 Jan 2013 05:53:35 +0000 (13:53 +0800)]
bump up to 0.16-rc4

Change-Id: I01121a1ffff0e17d199e1b69dee69c62e8bab28e
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agopartitionedfs: do not use blkid for PARTUUID
Artem Bityutskiy [Tue, 29 Jan 2013 12:19:32 +0000 (14:19 +0200)]
partitionedfs: do not use blkid for PARTUUID

Now, as we have our own GPT partition table parser, lets use it. This patch
teaches partitionedfs.py to add the 'partuuid' key to partitions dictionary.
This value is later used in 'raw.py' when generating the extlinux.conf file.

Change-Id: I1af9e59742171797842f3fafd5c74be78e1414bc
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Conflicts:
mic/imager/raw.py

11 years agoAdd a simple GPT partitions parser
Artem Bityutskiy [Tue, 29 Jan 2013 12:19:11 +0000 (14:19 +0200)]
Add a simple GPT partitions parser

The 'PARTUUID' blkid feature exists only in relatively new versions of blkid,
which causes troubles in some distributions. Therefore, lets implement our own
simple GPT parser instead.

Change-Id: Ie07efc5040770c002ef4be60431c8756fa690d63
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agoraw.py: remove unused variable
Artem Bityutskiy [Tue, 29 Jan 2013 11:24:44 +0000 (13:24 +0200)]
raw.py: remove unused variable

The rootdev variable is unused - remove it.

Change-Id: I7355a006557dced7ad95dbecb053243acf86829f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
11 years agobump up to 0.16-rc3
Gui Chen [Sun, 27 Jan 2013 03:47:45 +0000 (11:47 +0800)]
bump up to 0.16-rc3

Change-Id: I007b70a1091a89a47e81dcc58653d5835f8859f0
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate REALSE_NOTES
Gui Chen [Sun, 27 Jan 2013 03:46:09 +0000 (11:46 +0800)]
update REALSE_NOTES

Change-Id: I748b53f7397009136b0a42c98d45abd5a928b9fe
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix .vcs file not included in output showing
Gui Chen [Sun, 27 Jan 2013 03:45:26 +0000 (11:45 +0800)]
fix .vcs file not included in output showing

Change-Id: I2feeb6de21e6f69bda05ce25ffe6b9eb06537238
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agosome minor fixes
Gui Chen [Sun, 27 Jan 2013 03:37:24 +0000 (11:37 +0800)]
some minor fixes

fix --record-pkgs missing 'vcs' in help text
fix debugsource invalid in --install-pkgs

Change-Id: Ib61c3ec587b7173cc22284779fac05daf910f684
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd option '--fstab-entry' to set the entry in /etc/fstab
Gui Chen [Sun, 27 Jan 2013 03:25:27 +0000 (11:25 +0800)]
add option '--fstab-entry' to set the entry in /etc/fstab

valid values: name, uuid. 'name' means using device names, 'uuid' means using filesystem uuid

Change-Id: I6ea340bc66955cc33ebbe478cbf1425e060f313c
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agogive hints when overwriting loop images
Gui Chen [Sun, 27 Jan 2013 02:55:12 +0000 (10:55 +0800)]
give hints when overwriting loop images

Change-Id: Ia5f3fc69571a34445d8e879227953d3aa5a112af
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to 0.16-rc2
Gui Chen [Wed, 23 Jan 2013 03:53:49 +0000 (11:53 +0800)]
bump up to 0.16-rc2

Change-Id: Idc3d8d191b4d7adb77c7ddad86c2a0211e591909
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoRevert "raw.py: switch to the BmapCreate module"
Gui Chen [Wed, 23 Jan 2013 03:52:04 +0000 (11:52 +0800)]
Revert "raw.py: switch to the BmapCreate module"

This reverts commit 567fc7ad08ebbce84e1cb6894d35749b17637fa3.

11 years agoput the recording stuff before pkg_manager.close
Gui Chen [Wed, 23 Jan 2013 01:41:21 +0000 (09:41 +0800)]
put the recording stuff before pkg_manager.close

Change-Id: I680e2761743a2068919b18221a004152e40068f3
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to version 0.16-0.rc1
Gui Chen [Tue, 22 Jan 2013 09:47:58 +0000 (17:47 +0800)]
bump up to version 0.16-0.rc1

Change-Id: I8d861ae9ee3b35db789347bed2b66a27e81c75d0
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate release notes
Gui Chen [Tue, 22 Jan 2013 09:42:30 +0000 (17:42 +0800)]
update release notes

Change-Id: I44f98af914e3b82117ed227ab2fc46fe07cf9894
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agodon't throw exception if get_partuuid failed
Gui Chen [Tue, 22 Jan 2013 08:11:49 +0000 (16:11 +0800)]
don't throw exception if get_partuuid failed

this try except is not tricky, just make things
going on, if 'gpt' required, root_partuuid valued
None would throw an exception instead

Change-Id: I44a6ae70893eacef52f3cf1673b7c2e5bb21f141
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoupdate debian packaging files
Gui Chen [Tue, 22 Jan 2013 07:53:16 +0000 (15:53 +0800)]
update debian packaging files

Change-Id: Ia857444bb840fa6fa41e633917ac14d3813f8348
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd lost interface getVcsInfo in yum backend
Gui Chen [Tue, 22 Jan 2013 07:39:13 +0000 (15:39 +0800)]
add lost interface getVcsInfo in yum backend

Change-Id: Icda3b0579d87ae4af3dc0fa566fb59be77732fe7
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agocorrect empty prefix string produce '-'
Gui Chen [Tue, 22 Jan 2013 07:33:02 +0000 (15:33 +0800)]
correct empty prefix string produce '-'

Change-Id: I722a1268220848fe76bba7a9f0eee9fa4c689cc9
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agobump up to version 0.16-rc0
Gui Chen [Tue, 22 Jan 2013 07:27:19 +0000 (15:27 +0800)]
bump up to version 0.16-rc0

Change-Id: I7ff7eb8c019afb04598b49c81537e9c103d91c74
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agocompatible with old style in name prefix
Gui Chen [Mon, 21 Jan 2013 17:39:32 +0000 (01:39 +0800)]
compatible with old style in name prefix

Change-Id: I6c223bdaf8c74fd36093da6690d8ba5c7379b57c
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agomake clear message info
Gui Chen [Mon, 21 Jan 2013 16:55:36 +0000 (00:55 +0800)]
make clear message info

Change-Id: I5717d5d92b604b544ad3ddec7a3eb2eebb9d461b
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoclean up the loop devices not released
Gui Chen [Mon, 21 Jan 2013 16:36:18 +0000 (00:36 +0800)]
clean up the loop devices not released

the pidfiles record last running info of device and
process pid, and now mic can clean these up if they
are not released for some unknown reason

Change-Id: I3b0bbd31fbcfaf7fe4c751feab6f7f9b528d64f6
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd pidfile for each used loop device
Gui Chen [Mon, 21 Jan 2013 15:48:53 +0000 (23:48 +0800)]
add pidfile for each used loop device

sometimes mic can't know if the device can be released,
and it will bump up to maxinum used number, now record
an pid file for each used device so that they can be
released when needed

Change-Id: I24308eebd8b2c10a46f2bf20cfdb70bf7f1b04a2
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agocleanup also when sys loop device used
Gui Chen [Mon, 21 Jan 2013 15:25:14 +0000 (23:25 +0800)]
cleanup also when sys loop device used

some interfaces are added to make LoopDevice as
loop device manager:
register: if loop device existed, register it in
          LoopDevice, and benefit the cleanup
reg_atexit: not all loop device need this atexit,
            make it optional
now, such as 'loop0' will benefit the cleanup of
LoopDevice 'cause above interface

Change-Id: I110a1aaf0179d04a31f31f7ed54b2b75cdb6bc01
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agofix the failure if ks under / dir in easy way
Gui Chen [Tue, 15 Jan 2013 13:31:49 +0000 (21:31 +0800)]
fix the failure if ks under / dir in easy way

this patch is to fix the failure if ks file under / dir,
in final, mic should sync the ks file to bootstrap,
the location should be kept inside bootstrap

Change-Id: Ia93013622ffda0fa91c81aeb8f6e0e7c1d6b70cf
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoclean up the mess message of directory not empty
Gui Chen [Tue, 15 Jan 2013 13:15:11 +0000 (21:15 +0800)]
clean up the mess message of directory not empty

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agodon't setup emulator for arm image twice
Gui Chen [Sun, 13 Jan 2013 08:49:27 +0000 (16:49 +0800)]
don't setup emulator for arm image twice

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoregister arm binfmt in every time
Gui Chen [Sun, 13 Jan 2013 08:45:19 +0000 (16:45 +0800)]
register arm binfmt in every time

in bootstrap, there is only 'qemu-arm-static', so should unregister arm binfmt,
and register it for arm image in every time to avoid conflict register

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agosync /etc/passwd to save user info to bootstrap
Gui Chen [Mon, 7 Jan 2013 07:38:27 +0000 (15:38 +0800)]
sync /etc/passwd to save user info to bootstrap

for some reason, mic bootstrap would not has correct /etc/passwd,
using local /etc/passwd also works

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoverify if logfile is a file
Gui Chen [Mon, 7 Jan 2013 07:34:00 +0000 (15:34 +0800)]
verify if logfile is a file

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agocorrect rpm path in local repo for zypp backend
Gui Chen [Mon, 7 Jan 2013 07:29:24 +0000 (15:29 +0800)]
correct rpm path in local repo for zypp backend

Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoadd debuginfo rpm install option
Gui Chen [Mon, 21 Jan 2013 13:52:51 +0000 (21:52 +0800)]
add debuginfo rpm install option

make this option flexible to include 'debuginfo',
and enable '--install-pkgs=debuginfo' to work well.
later mic should add 'source' and 'debugsource' to
this option

Change-Id: I12765aeeeb5d41f9de351b617377ebe654436dac
Signed-off-by: Gui Chen <gui.chen@intel.com>
11 years agoinstall the according debuginfo rpms in zypp
Gui Chen [Mon, 21 Jan 2013 12:00:44 +0000 (20:00 +0800)]
install the according debuginfo rpms in zypp

normally every binary package would have one
corresponding debuginfo package, and now mic
can install those debuginfo rpm in the meantime
in zypp backend if needed

Change-Id: Id3d4dd678257d21a737632a395031b0776c3d2bc
Signed-off-by: Gui Chen <gui.chen@intel.com>