summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungjae Yoo <seungjaeyoo@google.com>2023-01-02 02:32:04 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-01-02 02:32:04 +0000
commit863fb6f0c889b87a7890a1c0e55968dcc41c8319 (patch)
tree6a14dc9e7c83e9b656c129f47e643453991cb1fd
parentafc52e5bf4cf0098366a1100700c5867bc3b6441 (diff)
parentb11f3343716bd890ec5fc95fcb1bbe7f94502c17 (diff)
downloadopenwrt-prebuilts-863fb6f0c889b87a7890a1c0e55968dcc41c8319.tar.gz
Add default build rules and reduce duplication am: 38e0d5b3b4 am: b11f334371
Original change: https://android-review.googlesource.com/c/platform/external/openwrt-prebuilts/+/2370400 Change-Id: I08fedbae2659eb313ebc55db5d828957db25c59e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp91
1 files changed, 44 insertions, 47 deletions
diff --git a/Android.bp b/Android.bp
index 8f77b67..eebf86a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -38,38 +38,40 @@ license {
],
}
+genrule_defaults {
+ name: "openwrt_rootfs_base_defaults",
+ cmd: "cp $(in) $(genDir) && gzip -d $(genDir)/* && cp $(genDir)/* $(out)",
+}
+
genrule {
- name: "openwrt_rootfs_base_img_x86_64",
+ name: "openwrt_rootfs_base_x86_64",
srcs: [
"x86_64/images/openwrt-22.03.2-x86-64-generic-squashfs-rootfs.img.gz",
],
- out: ["base_rootfs_x86_64.img"],
- cmd: "cp $(in) $(genDir) && gzip -d $(genDir)/* && cp $(genDir)/* $(out)",
+ out: ["openwrt_rootfs_base_x86_64.img"],
+ defaults: ["openwrt_rootfs_base_defaults"],
}
genrule {
- name: "openwrt_rootfs_base_img_aarch64",
+ name: "openwrt_rootfs_base_aarch64",
srcs: [
"arm64/images/openwrt-22.03.2-armvirt-64-rootfs-squashfs.img.gz",
],
- out: ["base_rootfs_aarch64.img"],
- cmd: "cp $(in) $(genDir) && gzip -d $(genDir)/* && cp $(genDir)/* $(out)",
+ out: ["openwrt_rootfs_base_aarch64.img"],
+ defaults: ["openwrt_rootfs_base_defaults"],
}
-genrule {
- name: "openwrt_customization_x86_64",
+genrule_defaults {
+ name: "openwrt_rootfs_customization_defaults",
tools: [
"make_f2fs",
"sload_f2fs",
],
srcs: [
":openwrt_license_files",
- "x86_64/kmods/*",
- "x86_64/packages/*",
"shared/uci-defaults/*",
"shared/config/*",
],
- out: ["customization_x86_64.img"],
cmd: "mkdir -p $(genDir)/root/upper/etc/uci-defaults && " +
"mkdir -p $(genDir)/root/upper/ipks && " +
"mkdir -p $(genDir)/root/upper/etc/config && " +
@@ -85,69 +87,64 @@ genrule {
}
genrule {
- name: "openwrt_customization_aarch64",
- tools: [
- "make_f2fs",
- "sload_f2fs",
+ name: "openwrt_rootfs_customization_x86_64",
+ srcs: [
+ "x86_64/kmods/*",
+ "x86_64/packages/*",
],
+ out: ["openwrt_rootfs_customization_x86_64.img"],
+ defaults: ["openwrt_rootfs_customization_defaults"],
+}
+
+genrule {
+ name: "openwrt_rootfs_customization_aarch64",
srcs: [
- ":openwrt_license_files",
"arm64/kmods/*",
"arm64/packages/*",
- "shared/uci-defaults/*",
- "shared/config/*",
],
- out: ["customization_aarch64.img"],
- cmd: "mkdir -p $(genDir)/root/upper/etc/uci-defaults && " +
- "mkdir -p $(genDir)/root/upper/ipks && " +
- "mkdir -p $(genDir)/root/upper/etc/config && " +
- "cp $(in) $(genDir)/ && " +
- "mv $(genDir)/*.ipk $(genDir)/root/upper/ipks && " +
- "mv $(genDir)/LICENSE $(genDir)/HOW_TO_GET_SOURCE_CODE $(genDir)/root/upper && " +
- "mv $(genDir)/0_default_config $(genDir)/root/upper/etc/uci-defaults && " +
- "find $(genDir) -maxdepth 1 -type f -exec mv {} $(genDir)/root/upper/etc/config \\; && " +
- "ln -s 2 $(genDir)/root/.fs_state && " +
- "truncate -s 128M $(out) && " +
- "$(location make_f2fs) $(out) && " +
- "$(location sload_f2fs) -f $(genDir)/root -t / $(out)",
+ out: ["openwrt_rootfs_customization_aarch64.img"],
+ defaults: ["openwrt_rootfs_customization_defaults"],
}
-genrule {
- name: "combined_openwrt_rootfs_x86_64",
+genrule_defaults {
+ name: "openwrt_rootfs_combined_defaults",
tools: [
"append_squashfs_overlay",
],
- srcs: [
- ":openwrt_rootfs_base_img_x86_64",
- ":openwrt_customization_x86_64",
- ],
- out: ["openwrt_rootfs_x86_64.img"],
cmd: "$(location append_squashfs_overlay) $(in) $(out) -w",
}
genrule {
- name: "combined_openwrt_rootfs_aarch64",
- tools: [
- "append_squashfs_overlay",
+ name: "openwrt_rootfs_combined_x86_64",
+ srcs: [
+ ":openwrt_rootfs_base_x86_64",
+ ":openwrt_rootfs_customization_x86_64",
],
+ out: ["openwrt_rootfs_combined_x86_64.img"],
+ defaults: ["openwrt_rootfs_combined_defaults"],
+
+}
+
+genrule {
+ name: "openwrt_rootfs_combined_aarch64",
srcs: [
- ":openwrt_rootfs_base_img_aarch64",
- ":openwrt_customization_aarch64",
+ ":openwrt_rootfs_base_aarch64",
+ ":openwrt_rootfs_customization_aarch64",
],
- out: ["openwrt_rootfs_aarch64.img"],
- cmd: "$(location append_squashfs_overlay) $(in) $(out) -w",
+ out: ["openwrt_rootfs_combined_aarch64.img"],
+ defaults: ["openwrt_rootfs_combined_defaults"],
}
prebuilt_etc_host {
name: "openwrt_rootfs_x86_64",
- src: ":combined_openwrt_rootfs_x86_64",
+ src: ":openwrt_rootfs_combined_x86_64",
sub_dir: "openwrt/images",
visibility: ["//device/google/cuttlefish/build"],
}
prebuilt_etc_host {
name: "openwrt_rootfs_aarch64",
- src: ":combined_openwrt_rootfs_aarch64",
+ src: ":openwrt_rootfs_combined_aarch64",
sub_dir: "openwrt/images",
visibility: ["//device/google/cuttlefish/build"],
}