diff options
Diffstat (limited to 'linaro_image_tools/media_create')
-rw-r--r-- | linaro_image_tools/media_create/chroot_utils.py | 2 | ||||
-rw-r--r-- | linaro_image_tools/media_create/rootfs.py | 19 | ||||
-rw-r--r-- | linaro_image_tools/media_create/unpack_binary_tarball.py | 5 |
3 files changed, 16 insertions, 10 deletions
diff --git a/linaro_image_tools/media_create/chroot_utils.py b/linaro_image_tools/media_create/chroot_utils.py index 83b0f6d..6776c4c 100644 --- a/linaro_image_tools/media_create/chroot_utils.py +++ b/linaro_image_tools/media_create/chroot_utils.py @@ -105,7 +105,7 @@ def install_hwpack(rootfs_dir, hwpack_file, extract_kpkgs, hwpack_force_yes): print "Installing (linaro-hwpack-install) %s in target rootfs." % ( hwpack_basename) - # Get infromation required by linaro-hwpack-install + # Get information required by linaro-hwpack-install with HardwarepackHandler([hwpack_file]) as hwpack: version, _ = hwpack.get_field("version") architecture, _ = hwpack.get_field("architecture") diff --git a/linaro_image_tools/media_create/rootfs.py b/linaro_image_tools/media_create/rootfs.py index 73bc8eb..765cc99 100644 --- a/linaro_image_tools/media_create/rootfs.py +++ b/linaro_image_tools/media_create/rootfs.py @@ -43,7 +43,8 @@ def rootfs_mount_options(rootfs_type): def populate_rootfs(content_dir, root_disk, partition, rootfs_type, rootfs_id, should_create_swap, swap_size, - mmc_device_id, partition_offset, board_config=None): + mmc_device_id, partition_offset, os_release_id, + board_config=None): """Populate the rootfs and make the necessary tweaks to make it usable. This consists of: @@ -86,13 +87,14 @@ def populate_rootfs(content_dir, root_disk, partition, rootfs_type, append_to_fstab(root_disk, fstab_additions) - print "\nCreating /etc/flash-kernel.conf\n" - create_flash_kernel_config( - root_disk, mmc_device_id, 1 + partition_offset) + if os_release_id == 'debian' or os_release_id == 'ubuntu': + print "\nCreating /etc/flash-kernel.conf\n" + create_flash_kernel_config( + root_disk, mmc_device_id, 1 + partition_offset) - if board_config is not None: - print "\nUpdating /etc/network/interfaces\n" - update_network_interfaces(root_disk, board_config) + if board_config is not None: + print "\nUpdating /etc/network/interfaces\n" + update_network_interfaces(root_disk, board_config) def update_network_interfaces(root_disk, board_config): @@ -136,7 +138,8 @@ def _list_files(directory): not be world-readable. """ p = cmd_runner.run( - ['find', directory, '-maxdepth', '1', '-mindepth', '1'], + ['find', directory, '-maxdepth', '1', '-mindepth', '1', + '!', '-name', 'lost+found'], stdout=subprocess.PIPE, as_root=True) stdout, _ = p.communicate() return stdout.split() diff --git a/linaro_image_tools/media_create/unpack_binary_tarball.py b/linaro_image_tools/media_create/unpack_binary_tarball.py index ba00261..8dcdef8 100644 --- a/linaro_image_tools/media_create/unpack_binary_tarball.py +++ b/linaro_image_tools/media_create/unpack_binary_tarball.py @@ -29,8 +29,11 @@ def unpack_android_binary_tarball(tarball, unpack_dir, as_root=True): def unpack_binary_tarball(tarball, unpack_dir, as_root=True): + extract_opt = '-xf' + if tarball.endswith('.xz'): + extract_opt = '-Jxf' proc = cmd_runner.run( - ['tar', '--numeric-owner', '-C', unpack_dir, '-xf', tarball], + ['tar', '--numeric-owner', '-C', unpack_dir, extract_opt, tarball], as_root=as_root) proc.wait() return proc.returncode |