summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlises Mendez Martinez <umendez@google.com>2022-10-19 13:53:12 +0000
committerIsaac J. Manjarres <isaacmanjarres@google.com>2023-05-02 10:55:20 -0700
commit76ca8d970ce7741813d93d3e0e1f1ec1f4290d6a (patch)
treed8324efd6b1cdd64cf2a0e9b2bf48591bf140431
parent92e8d0541d372646caca7d26fc4a1d7804db7420 (diff)
downloadbuild-76ca8d970ce7741813d93d3e0e1f1ec1f4290d6a.tar.gz
kleaf: cleanup: Fix buildifier linter warnings.
* Buildifier provides linter recommendations when `--lint=warn` is used, so adding the ones for these files before working with them so the cleanup changes are separated from the actual changes. Bug: 236012223 Bug: 252888476 Signed-off-by: Ulises Mendez Martinez <umendez@google.com> Change-Id: I5d1c5a8bfd99d2efbe8f32420225507ac8296d31 [isaacmanjarres: Did not apply the portion of the patch in kernel_images.bzl that refers to kwargs, as it is not necessary on this branch.] Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
-rw-r--r--kleaf/impl/image/image_utils.bzl25
-rw-r--r--kleaf/impl/image/initramfs.bzl15
-rw-r--r--kleaf/impl/image/kernel_images.bzl3
3 files changed, 28 insertions, 15 deletions
diff --git a/kleaf/impl/image/image_utils.bzl b/kleaf/impl/image/image_utils.bzl
index 967c424..331163b 100644
--- a/kleaf/impl/image/image_utils.bzl
+++ b/kleaf/impl/image/image_utils.bzl
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Common utilities for working with kernel images.
+"""
load("//build/kernel/kleaf:directory_with_structure.bzl", dws = "directory_with_structure")
load(
@@ -35,14 +38,17 @@ def _build_modules_image_impl_common(
"""Command implementation for building images that directly contain modules.
Args:
- ctx: ctx
- what: what is being built, for logging
+ ctx: ctx.
+ what: what is being built, for logging.
outputs: list of `ctx.actions.declare_file`
- build_command: the command to build `outputs` and `implicit_outputs`
- modules_staging_dir: a staging directory for module installation
- implicit_outputs: like `outputs`, but not installed to `DIST_DIR` (not returned in
- `DefaultInfo`)
- restore_modules_install: If `True`, restore `ctx.attr.kernel_modules_install`. Default is `True`.
+ build_command: the command to build `outputs` and `implicit_outputs`.
+ modules_staging_dir: a staging directory for module installation.
+ restore_modules_install: If `True`, restore `ctx.attr.kernel_modules_install`.
+ Default is `True`.
+ implicit_outputs: like `outputs`, but not installed to `DIST_DIR` (not
+ returned in `DefaultInfo`).
+ additional_inputs: Additional files to be included.
+ mnemonic: string to reference the build operation.
"""
if restore_modules_install == None:
@@ -57,15 +63,14 @@ def _build_modules_image_impl_common(
what = "{}: outs of dependent kernel_build {}".format(ctx.label, kernel_build),
)
+ modules_install_staging_dws = None
if restore_modules_install:
modules_install_staging_dws = ctx.attr.kernel_modules_install[KernelModuleInfo].modules_staging_dws
inputs = []
if additional_inputs != None:
inputs += additional_inputs
- inputs += [
- system_map,
- ]
+ inputs.append(system_map)
if restore_modules_install:
inputs += dws.files(modules_install_staging_dws)
inputs += ctx.files.deps
diff --git a/kleaf/impl/image/initramfs.bzl b/kleaf/impl/image/initramfs.bzl
index 40c78a2..1b7c6d4 100644
--- a/kleaf/impl/image/initramfs.bzl
+++ b/kleaf/impl/image/initramfs.bzl
@@ -11,14 +11,19 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Build initramfs.
+"""
-load(":debug.bzl", "debug")
load(":image/image_utils.bzl", "image_utils")
-InitramfsInfo = provider(fields = {
- "initramfs_img": "Output image",
- "initramfs_staging_archive": "Archive of initramfs staging directory",
-})
+InitramfsInfo = provider(
+ doc = "Provides information about initramfs outputs.",
+ fields = {
+ "initramfs_img": "Output image",
+ "initramfs_staging_archive": "Archive of initramfs staging directory",
+ },
+)
def _initramfs_impl(ctx):
initramfs_img = ctx.actions.declare_file("{}/initramfs.img".format(ctx.label.name))
diff --git a/kleaf/impl/image/kernel_images.bzl b/kleaf/impl/image/kernel_images.bzl
index 6e305b2..5010be6 100644
--- a/kleaf/impl/image/kernel_images.bzl
+++ b/kleaf/impl/image/kernel_images.bzl
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Build multiple kernel images.
+"""
load(":image/boot_images.bzl", "boot_images")
load(":image/dtbo.bzl", "dtbo")