~linaro-image-tools/linaro-image-tools/trunk

« back to all changes in this revision

Viewing changes to linaro-media-create

  • Committer: Fathi Boudra
  • Date: 2013-08-17 05:10:14 UTC
  • mfrom: (633.3.3 initial-fedora-support)
  • Revision ID: fathi.boudra@linaro.org-20130817051014-wiur8eyipw0upske
Add initial support for Fedora rootfs

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
        # The binary image is in the new live format.
182
182
        filesystem_dir = 'binary/boot/filesystem.dir'
183
183
 
184
 
    # if not a debian compatible system, just extract the kernel packages
185
 
    extract_kpkgs = False
186
 
    if not path_in_tarfile_exists(
187
 
            os.path.join(filesystem_dir, 'etc', 'debian_version'), args.binary):
188
 
        extract_kpkgs = True
189
 
 
190
184
    ROOTFS_DIR = os.path.join(BIN_DIR, filesystem_dir)
191
185
 
192
186
    try:
209
203
 
210
204
    unpack_binary_tarball(args.binary, BIN_DIR)
211
205
 
 
206
    # if compatible system, extract all packages
 
207
    os_release_id = 'linux'
 
208
    os_release_file = '%s/etc/os-release' % ROOTFS_DIR
 
209
    if os.path.exists(os_release_file):
 
210
        for line in open(os_release_file):
 
211
            if line.startswith('ID='):
 
212
                os_release_id = line[(len('ID=')):]
 
213
                os_release_id = os_release_id.strip('\"\n')
 
214
                break
 
215
 
 
216
    if os_release_id == 'debian' or os_release_id == 'ubuntu' or \
 
217
            os.path.exists('%s/etc/debian_version' % ROOTFS_DIR):
 
218
        extract_kpkgs = False
 
219
    elif os_release_id == 'fedora':
 
220
        extract_kpkgs = False
 
221
    else:
 
222
        extract_kpkgs = True
 
223
 
212
224
    hwpacks = args.hwpacks
213
225
    lmc_dir = os.path.dirname(__file__)
214
226
    if lmc_dir == '':
263
275
        populate_rootfs(ROOTFS_DIR, ROOT_DISK, root_partition, args.rootfs,
264
276
            rootfs_id, create_swap, str(args.swap_file),
265
277
            board_config.mmc_device_id, board_config.mmc_part_offset,
266
 
            board_config)
 
278
            os_release_id, board_config)
267
279
 
268
280
    logger.info("Done creating Linaro image on %s" % media.path)