Revert "build_dlc: Specify image and metadata directories separately"
This reverts commit 8fd9d735fdea790f7e238552bd892976bb5fe36d.
Reason for revert: Breaks build_dlc_unittest
Original change's description:
> build_dlc: Specify image and metadata directories separately
>
> Change the API to allow the caller to specify separate image and
> metadata directories. This is useful when invoking build_dlc from an
> ebuild, since metadata is installed to the device whereas images are
> not.
>
> BUG=chromium:887158
> TEST=Tested along with dlc.eclass on a simple DLC build
>
> Change-Id: I1c74a898fbdf1a4c97f794cc294208e81317bb64
> Reviewed-on: https://chromium-review.googlesource.com/c/1252927
> Commit-Queue: Colin Howes <chowes@google.com>
> Tested-by: Colin Howes <chowes@google.com>
> Trybot-Ready: Colin Howes <chowes@google.com>
> Reviewed-by: Xiaochu Liu <xiaochu@chromium.org>
> Reviewed-by: Colin Howes <chowes@google.com>
Bug: chromium:887158
Change-Id: If4e6749bdabd946151a614153f291dacc46046fe
Reviewed-on: https://chromium-review.googlesource.com/c/1268762
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Commit-Queue: Nicolas Norvez <norvez@chromium.org>
Tested-by: Nicolas Norvez <norvez@chromium.org>
diff --git a/scripts/build_dlc.py b/scripts/build_dlc.py
index 8defd47..8bcd9b7 100644
--- a/scripts/build_dlc.py
+++ b/scripts/build_dlc.py
@@ -45,13 +45,12 @@
# Version of manifest file.
_MANIFEST_VERSION = 1
- def __init__(self, img_dir, meta_dir, src_dir, fs_type, pre_allocated_blocks,
- version, dlc_id, name):
+ def __init__(self, dest_dir, src_dir, fs_type, pre_allocated_blocks, version,
+ dlc_id, name):
"""Object initializer.
Args:
- img_dir: (str) path to the DLC image dest root directory.
- meta_dir: (str) path to the DLC metadata dest root directory.
+ dest_dir: (str) path to the DLC dest root directory.
src_dir: (str) path to the DLC source root directory.
fs_type: (str) file system type.
pre_allocated_blocks: (int) number of blocks pre-allocated on device.
@@ -66,9 +65,9 @@
self.dlc_id = dlc_id
self.name = name
# Create path for all final artifacts.
- self.dest_image = os.path.join(img_dir, 'dlc.img')
- self.dest_table = os.path.join(meta_dir, 'table')
- self.dest_imageloader_json = os.path.join(meta_dir, 'imageloader.json')
+ self.dest_image = os.path.join(dest_dir, 'dlc.img')
+ self.dest_table = os.path.join(dest_dir, 'table')
+ self.dest_imageloader_json = os.path.join(dest_dir, 'imageloader.json')
def SquashOwnerships(self, path):
"""Squash the owernships & permissions for files.
@@ -198,14 +197,9 @@
required=True,
help='Root directory path that contains all DLC files '
'to be packed.')
- required.add_argument('--img-dir', type='path', metavar='IMG_DIR_PATH',
+ required.add_argument('--dest-dir', type='path', metavar='DEST_DIR_PATH',
required=True,
- help='Root directory path that contains DLC image file '
- 'output.')
- required.add_argument('--meta-dir', type='path', metavar='META_DIR_PATH',
- required=True,
- help='Root directory path that contains DLC metadata '
- 'output.')
+ help='Root directory path that contains output.')
required.add_argument('--fs-type', metavar='FS_TYPE', required=True,
choices=['squashfs', 'ext4'],
help='File system type of the image.')
@@ -227,7 +221,7 @@
opts.Freeze()
# Generate final DLC files.
- dlc_generator = DLCGenerator(opts.img_dir, opts.meta_dir, opts.src_dir,
- opts.fs_type, opts.pre_allocated_blocks,
- opts.version, opts.id, opts.name)
+ dlc_generator = DLCGenerator(opts.dest_dir, opts.src_dir, opts.fs_type,
+ opts.pre_allocated_blocks, opts.version, opts.id,
+ opts.name)
dlc_generator.GenerateDLC()