aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create/chroot_utils.py
diff options
context:
space:
mode:
authorRicardo Salveti de Araujo <ricardo.salveti@linaro.org>2012-08-05 06:20:30 -0300
committerRicardo Salveti de Araujo <ricardo.salveti@linaro.org>2012-08-05 06:20:30 -0300
commit9346473b59aa97e9826eac8b4b398a1ce6360c40 (patch)
treebe66c24b6c32fa860fba384783fe0c6010a45051 /linaro_image_tools/media_create/chroot_utils.py
parent0ce4296e09ad3e0bbbffb1da1064775c9dd53af6 (diff)
Allow lmc to just extract the kernel pkgs in case it's not a debian/ubuntu based rootfs
Diffstat (limited to 'linaro_image_tools/media_create/chroot_utils.py')
-rw-r--r--linaro_image_tools/media_create/chroot_utils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/linaro_image_tools/media_create/chroot_utils.py b/linaro_image_tools/media_create/chroot_utils.py
index 9295b0e..ff3356e 100644
--- a/linaro_image_tools/media_create/chroot_utils.py
+++ b/linaro_image_tools/media_create/chroot_utils.py
@@ -46,7 +46,7 @@ def prepare_chroot(chroot_dir, tmp_dir):
def install_hwpacks(
chroot_dir, tmp_dir, tools_dir, hwpack_force_yes, verified_files,
- *hwpack_files):
+ extract_kpkgs = False, *hwpack_files):
"""Install the given hwpacks onto the given chroot."""
prepare_chroot(chroot_dir, tmp_dir)
@@ -79,18 +79,19 @@ def install_hwpacks(
hwpack_verified = False
if os.path.basename(hwpack_file) in verified_files:
hwpack_verified = True
- install_hwpack(chroot_dir, hwpack_file,
+ install_hwpack(chroot_dir, hwpack_file, extract_kpkgs,
hwpack_force_yes or hwpack_verified)
finally:
run_local_atexit_funcs()
-def install_hwpack(chroot_dir, hwpack_file, hwpack_force_yes):
+def install_hwpack(chroot_dir, hwpack_file, extract_kpkgs, hwpack_force_yes):
"""Install an hwpack on the given chroot.
Copy the hwpack file to the chroot and run linaro-hwpack-install passing
that hwpack file to it. If hwpack_force_yes is True, also pass
- --force-yes to linaro-hwpack-install.
+ --force-yes to linaro-hwpack-install. In case extract_kpkgs is True, it
+ will not install all the packages, but just extract the kernel ones.
"""
hwpack_basename = os.path.basename(hwpack_file)
copy_file(hwpack_file, chroot_dir)
@@ -110,6 +111,8 @@ def install_hwpack(chroot_dir, hwpack_file, hwpack_force_yes):
'--hwpack-name', name]
if hwpack_force_yes:
args.append('--force-yes')
+ if extract_kpkgs:
+ args.append('--extract-kernel-only')
args.append('/%s' % hwpack_basename)
cmd_runner.run(args, as_root=True, chroot=chroot_dir).wait()
print "-" * 60