aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2014-06-26 23:41:42 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2014-07-08 17:20:05 +0800
commit510a4c080545b82d16da291d78eb4820f0e8f7d8 (patch)
tree0fe964b853ab300ac5597fd2706e353261028bd4 /linaro_image_tools/media_create
parent84ac5df57bee8757e897b19faf2369e2dc8c1858 (diff)
downloadlinaro-image-tools-510a4c080545b82d16da291d78eb4820f0e8f7d8.tar.gz
linaro-android-media-create: add support to use img files
add support for using system.img and userdata.img generated by android build system directly. this is needed for the support of selinux on Android since the img files have the selabel information persisted Change-Id: I40ad1c94817821f6c9a12062c0fa82dd35e34ae4 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'linaro_image_tools/media_create')
-rw-r--r--linaro_image_tools/media_create/__init__.py27
-rw-r--r--linaro_image_tools/media_create/android_boards.py2
-rw-r--r--linaro_image_tools/media_create/tests/test_media_create.py14
3 files changed, 30 insertions, 13 deletions
diff --git a/linaro_image_tools/media_create/__init__.py b/linaro_image_tools/media_create/__init__.py
index a69156d..0e08dda 100644
--- a/linaro_image_tools/media_create/__init__.py
+++ b/linaro_image_tools/media_create/__init__.py
@@ -213,12 +213,29 @@ def get_android_args_parser():
'--console', action='append', dest='consoles', default=[],
help=('Add a console to kernel boot parameter; this parameter can be '
'defined multiple times.'))
+
+ #group for system partition content specification
+ group = parser.add_mutually_exclusive_group(required=True)
+ group.add_argument(
+ '--system', dest="system",
+ help=('The tarball containing the Android system paritition.'
+ 'Like system.tar.bz2'))
+ group.add_argument(
+ '--systemimage', dest="systemimage",
+ help=('The ext4 filesystem data file containing the Android '
+ 'system paritition. Like system.img'))
+
+ #group for userdata partition content specification
+ group = parser.add_mutually_exclusive_group(required=True)
parser.add_argument(
- '--system', default='system.tar.bz2', required=True,
- help=('The tarball containing the Android system paritition'))
- parser.add_argument(
- '--userdata', default='userdata.tar.bz2', required=True,
- help=('The tarball containing the Android data paritition'))
+ '--userdata', dest="userdata",
+ help=('The tarball containing the Android data paritition.'
+ 'Like userdata.tar.bz2'))
+ group.add_argument(
+ '--userdataimage', dest="userdataimage",
+ help=('The ext4 filesystem data containing the Android '
+ 'data paritition. Like userdata.img'))
+
parser.add_argument(
'--boot', default='boot.tar.bz2', required=True,
help=('The tarball containing the Android root partition'))
diff --git a/linaro_image_tools/media_create/android_boards.py b/linaro_image_tools/media_create/android_boards.py
index d1dc9ed..85a2197 100644
--- a/linaro_image_tools/media_create/android_boards.py
+++ b/linaro_image_tools/media_create/android_boards.py
@@ -63,7 +63,7 @@ logger = logging.getLogger(DEFAULT_LOGGER_NAME)
BOOT_MIN_SIZE_S = align_up(128 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
SYSTEM_MIN_SIZE_S = align_up(768 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
CACHE_MIN_SIZE_S = align_up(256 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
-USERDATA_MIN_SIZE_S = align_up(512 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
+USERDATA_MIN_SIZE_S = align_up(576 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
SDCARD_MIN_SIZE_S = align_up(256 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
LOADER_MIN_SIZE_S = align_up(1 * 1024 * 1024, SECTOR_SIZE) / SECTOR_SIZE
diff --git a/linaro_image_tools/media_create/tests/test_media_create.py b/linaro_image_tools/media_create/tests/test_media_create.py
index 0d21ad0..e45e489 100644
--- a/linaro_image_tools/media_create/tests/test_media_create.py
+++ b/linaro_image_tools/media_create/tests/test_media_create.py
@@ -1905,43 +1905,43 @@ class TestGetSfdiskCmd(TestCase):
def test_panda_android(self):
self.assertEqual(
'63,270272,0x0C,*\n270336,1572864,L\n1843200,524288,L\n'
- '2367488,-,E\n2367488,1048576,L\n3416064,,,-',
+ '2367488,-,E\n2367488,1179648,L\n3547136,,,-',
android_boards.AndroidPandaConfig().get_sfdisk_cmd())
def test_origen_android(self):
self.assertEqual(
'1,8191,0xDA\n8253,270274,0x0C,*\n278528,1572864,L\n'
- '1851392,-,E\n1851392,524288,L\n2375680,1048576,L\n3424256,,,-',
+ '1851392,-,E\n1851392,524288,L\n2375680,1179648,L\n3555328,,,-',
android_boards.AndroidOrigenConfig().get_sfdisk_cmd())
def test_origen_quad_android(self):
self.assertEqual(
'1,8191,0xDA\n8253,270274,0x0C,*\n278528,1572864,L\n'
- '1851392,-,E\n1851392,524288,L\n2375680,1048576,L\n3424256,,,-',
+ '1851392,-,E\n1851392,524288,L\n2375680,1179648,L\n3555328,,,-',
android_boards.AndroidOrigenQuadConfig().get_sfdisk_cmd())
def test_snowball_emmc_android(self):
self.assertEqual(
'256,7936,0xDA\n8192,262144,0x0C,*\n270336,1572864,L\n'
- '1843200,-,E\n1843200,524288,L\n2367488,1048576,L\n3416064,,,-',
+ '1843200,-,E\n1843200,524288,L\n2367488,1179648,L\n3547136,,,-',
android_boards.AndroidSnowballEmmcConfig().get_sfdisk_cmd())
def test_vexpress_android(self):
self.assertEqual(
'63,270272,0x0E,*\n270336,1572864,L\n1843200,524288,L\n'
- '2367488,-,E\n2367488,1048576,L\n3416064,,,-',
+ '2367488,-,E\n2367488,1179648,L\n3547136,,,-',
android_boards.AndroidVexpressConfig().get_sfdisk_cmd())
def test_mx5_android(self):
self.assertEqual(
'1,8191,0xDA\n8192,262144,0x0C,*\n270336,1572864,L\n'
- '1843200,-,E\n1843200,524288,L\n2367488,1048576,L\n3416064,,,-',
+ '1843200,-,E\n1843200,524288,L\n2367488,1179648,L\n3547136,,,-',
android_boards.AndroidMx53LoCoConfig().get_sfdisk_cmd())
def test_mx6_android(self):
self.assertEqual(
'1,8191,0xDA\n8192,262144,0x0C,*\n270336,1572864,L\n'
- '1843200,-,E\n1843200,524288,L\n2367488,1048576,L\n3416064,,,-',
+ '1843200,-,E\n1843200,524288,L\n2367488,1179648,L\n3547136,,,-',
android_boards.AndroidMx6QSabreliteConfig().get_sfdisk_cmd())