aboutsummaryrefslogtreecommitdiff
path: root/linaro-media-create
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-08-08 10:44:38 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-08-08 10:44:38 +0300
commita854bc17e2fff247974cb999a66b9edb0b6dd6c2 (patch)
treec9ccada57a81bb432cd49fde47c272ab45c9c5a1 /linaro-media-create
parentc0a67563872b9c7d796c8fc901c0d1a2f3f61c35 (diff)
downloadlinaro-image-tools-a854bc17e2fff247974cb999a66b9edb0b6dd6c2.tar.gz
Initial support for Fedora rootfs
Diffstat (limited to 'linaro-media-create')
-rwxr-xr-xlinaro-media-create26
1 files changed, 19 insertions, 7 deletions
diff --git a/linaro-media-create b/linaro-media-create
index 8feb4ed..599bbb1 100755
--- a/linaro-media-create
+++ b/linaro-media-create
@@ -181,12 +181,6 @@ if __name__ == '__main__':
# The binary image is in the new live format.
filesystem_dir = 'binary/boot/filesystem.dir'
- # if not a debian compatible system, just extract the kernel packages
- extract_kpkgs = False
- if not path_in_tarfile_exists(
- os.path.join(filesystem_dir, 'etc', 'debian_version'), args.binary):
- extract_kpkgs = True
-
ROOTFS_DIR = os.path.join(BIN_DIR, filesystem_dir)
try:
@@ -209,6 +203,24 @@ if __name__ == '__main__':
unpack_binary_tarball(args.binary, BIN_DIR)
+ # if compatible system, extract all packages
+ os_release_id = 'linux'
+ os_release_file = '%s/etc/os-release' % ROOTFS_DIR
+ if os.path.exists(os_release_file):
+ for line in open(os_release_file):
+ if line.startswith('ID='):
+ os_release_id = line[(len('ID=')):]
+ os_release_id = os_release_id.strip('\"\n')
+ break
+
+ if os_release_id == 'debian' or os_release_id == 'ubuntu' or \
+ os.path.exists('%s/etc/debian_version' % ROOTFS_DIR):
+ extract_kpkgs = False
+ elif os_release_id == 'fedora':
+ extract_kpkgs = False
+ else:
+ extract_kpkgs = True
+
hwpacks = args.hwpacks
lmc_dir = os.path.dirname(__file__)
if lmc_dir == '':
@@ -252,6 +264,6 @@ if __name__ == '__main__':
populate_rootfs(ROOTFS_DIR, ROOT_DISK, root_partition, args.rootfs,
rootfs_id, create_swap, str(args.swap_file),
board_config.mmc_device_id, board_config.mmc_part_offset,
- board_config)
+ os_release_id, board_config)
logger.info("Done creating Linaro image on %s" % media.path)