• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "external_openwrt-prebuilts_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    //   SPDX-license-identifier-BSD
8    //   SPDX-license-identifier-GPL-2.0
9    default_visibility: ["//visibility:private"],
10    default_applicable_licenses: ["external_openwrt-prebuilts_license"],
11}
12
13filegroup {
14    name: "openwrt_license_files",
15    visibility: [":__subpackages__"],
16    srcs: [
17        "LICENSE",
18        "HOW_TO_GET_SOURCE_CODE",
19    ],
20}
21
22license {
23    name: "external_openwrt-prebuilts_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-Apache-2.0",
27        "SPDX-license-identifier-BSD",
28        "SPDX-license-identifier-GPL-2.0",
29        "SPDX-license-identifier-GPL-3.0",
30        "SPDX-license-identifier-LGPL-2.1",
31        "SPDX-license-identifier-MIT",
32        "SPDX-license-identifier-ISC",
33        "SPDX-license-identifier-OpenSSL",
34    ],
35    license_text: [
36        "LICENSE",
37        "HOW_TO_GET_SOURCE_CODE",
38    ],
39}
40
41genrule_defaults {
42    name: "openwrt_rootfs_base_defaults",
43    cmd: "cp $(in) $(genDir) && gzip -d $(genDir)/* && cp $(genDir)/* $(out)",
44}
45
46genrule {
47    name: "openwrt_rootfs_base_x86_64",
48    srcs: [
49        "x86_64/images/openwrt-22.03.3-x86-64-generic-squashfs-rootfs.img.gz",
50    ],
51    out: ["openwrt_rootfs_base_x86_64.img"],
52    defaults: ["openwrt_rootfs_base_defaults"],
53}
54
55genrule {
56    name: "openwrt_rootfs_base_aarch64",
57    srcs: [
58        "arm64/images/openwrt-22.03.3-armvirt-64-rootfs-squashfs.img.gz",
59    ],
60    out: ["openwrt_rootfs_base_aarch64.img"],
61    defaults: ["openwrt_rootfs_base_defaults"],
62}
63
64genrule_defaults {
65    name: "openwrt_rootfs_customization_defaults",
66    tools: [
67        "make_f2fs",
68        "sload_f2fs",
69    ],
70    srcs: [
71        ":openwrt_license_files",
72        "shared/uci-defaults/*",
73        "shared/config/*",
74    ],
75    cmd: "mkdir -p $(genDir)/root/upper/etc/uci-defaults && " +
76         "mkdir -p $(genDir)/root/upper/ipks && " +
77         "mkdir -p $(genDir)/root/upper/etc/config && " +
78         "cp $(in) $(genDir)/ && " +
79         "mv $(genDir)/*.ipk $(genDir)/root/upper/ipks && " +
80         "mv $(genDir)/LICENSE $(genDir)/HOW_TO_GET_SOURCE_CODE $(genDir)/INFO $(genDir)/root/upper && " +
81         "mv $(genDir)/0_default_config $(genDir)/root/upper/etc/uci-defaults && " +
82         "find $(genDir) -maxdepth 1 -type f -exec mv {} $(genDir)/root/upper/etc/config \\; && " +
83         "ln -s 2 $(genDir)/root/.fs_state && " +
84         "truncate -s 128M $(out) && " +
85         "$(location make_f2fs) $(out) && " +
86         "$(location sload_f2fs) -f $(genDir)/root -t / $(out)",
87}
88
89genrule {
90    name: "openwrt_rootfs_customization_x86_64",
91    srcs: [
92        "x86_64/kmods/*",
93        "x86_64/packages/*",
94        "x86_64/INFO",
95    ],
96    out: ["openwrt_rootfs_customization_x86_64.img"],
97    defaults: ["openwrt_rootfs_customization_defaults"],
98}
99
100genrule {
101    name: "openwrt_rootfs_customization_aarch64",
102    srcs: [
103        "arm64/kmods/*",
104        "arm64/packages/*",
105        "arm64/INFO",
106    ],
107    out: ["openwrt_rootfs_customization_aarch64.img"],
108    defaults: ["openwrt_rootfs_customization_defaults"],
109}
110
111genrule_defaults {
112    name: "openwrt_rootfs_combined_defaults",
113    tools: [
114        "append_squashfs_overlay",
115    ],
116    cmd: "$(location append_squashfs_overlay) $(in) $(out) -w",
117}
118
119genrule {
120    name: "openwrt_rootfs_combined_x86_64",
121    srcs: [
122        ":openwrt_rootfs_base_x86_64",
123        ":openwrt_rootfs_customization_x86_64",
124    ],
125    out: ["openwrt_rootfs_combined_x86_64.img"],
126    defaults: ["openwrt_rootfs_combined_defaults"],
127
128}
129
130genrule {
131    name: "openwrt_rootfs_combined_aarch64",
132    srcs: [
133        ":openwrt_rootfs_base_aarch64",
134        ":openwrt_rootfs_customization_aarch64",
135    ],
136    out: ["openwrt_rootfs_combined_aarch64.img"],
137    defaults: ["openwrt_rootfs_combined_defaults"],
138}
139
140prebuilt_etc_host {
141    name: "openwrt_rootfs_x86_64",
142    src: ":openwrt_rootfs_combined_x86_64",
143    sub_dir: "openwrt/images",
144    visibility: ["//device/google/cuttlefish/build"],
145}
146
147prebuilt_etc_host {
148    name: "openwrt_rootfs_aarch64",
149    src: ":openwrt_rootfs_combined_aarch64",
150    sub_dir: "openwrt/images",
151    visibility: ["//device/google/cuttlefish/build"],
152}
153
154prebuilt_etc_host {
155    name: "openwrt_kernel_x86_64",
156    src: "x86_64/images/openwrt-22.03.3-x86-64-generic-kernel.bin",
157    sub_dir: "openwrt/images",
158    visibility: ["//device/google/cuttlefish/build"],
159}
160
161prebuilt_etc_host {
162    name: "openwrt_kernel_aarch64",
163    src: "arm64/images/openwrt-22.03.3-armvirt-64-Image",
164    sub_dir: "openwrt/images",
165    visibility: ["//device/google/cuttlefish/build"],
166}
167