lbkit 0.9.1__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lbkit-0.9.1/lbkit.egg-info → lbkit-0.9.2}/PKG-INFO +1 -1
- lbkit-0.9.2/lbkit/__init__.py +2 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/public.h.mako +1 -1
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/ukr/build.py +98 -30
- {lbkit-0.9.1 → lbkit-0.9.2/lbkit.egg-info}/PKG-INFO +1 -1
- lbkit-0.9.1/lbkit/__init__.py +0 -2
- {lbkit-0.9.1 → lbkit-0.9.2}/AUTHORS +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/LICENSE +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/MANIFEST.in +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/README.md +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/build_conan_parallel.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/ci_robot/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/ci_robot/gitee.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/cli.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/codegen.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/ctype_defination.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/idf_interface.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/renderer.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/client.c.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/client.h.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/interface.c.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/interface.introspect.xml.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/public.c.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/server.c.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/codegen/template/server.h.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/component/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/component/arg_parser.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/component/build.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/component/template/conanbase.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/component/template/deploy.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/component/test.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/errors.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/helper.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/lbkit.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/log.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/misc.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/config.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/executor.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/image_maker/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/image_maker/make_image.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/image_maker/make_qemu_image.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/image_maker/make_rockchip_image.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/task.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/task_build_image.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/task_build_manifest.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/task_build_prepare.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/task_build_rootfs.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/task_download.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/template/conanfile.py.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tasks/template/rootfs.py.mako +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/tools.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/ukr/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/utils/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/utils/env_detector.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/utils/images/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit/utils/images/emmc.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit.egg-info/SOURCES.txt +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit.egg-info/dependency_links.txt +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit.egg-info/entry_points.txt +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit.egg-info/requires.txt +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/lbkit.egg-info/top_level.txt +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/setup.cfg +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/setup.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/test/__init__.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/test/test_codegen.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/test/test_config.py +0 -0
- {lbkit-0.9.1 → lbkit-0.9.2}/test/test_helper.py +0 -0
|
@@ -315,7 +315,7 @@ typedef struct {
|
|
|
315
315
|
<% RSP_PARA = f'' %>\
|
|
316
316
|
<% REQ_PARA = f'' %>\
|
|
317
317
|
% if len(action.returns.parameters) > 0:
|
|
318
|
-
<% RSP_PARA = f', {class_name}_{action.name}
|
|
318
|
+
<% RSP_PARA = f', {class_name}_{action.name}_Rsp **rsp' %>\
|
|
319
319
|
% endif
|
|
320
320
|
% if len(action.parameters.parameters) > 0:
|
|
321
321
|
<% REQ_PARA = f', const {class_name}_{action.name}_Req *req' %>\
|
|
@@ -2,27 +2,13 @@
|
|
|
2
2
|
import os
|
|
3
3
|
import yaml
|
|
4
4
|
import shutil
|
|
5
|
-
import re
|
|
6
|
-
import json
|
|
7
|
-
import tempfile
|
|
8
5
|
from string import Template
|
|
9
|
-
from multiprocessing import Pool
|
|
10
|
-
import traceback
|
|
11
|
-
from argparse import ArgumentParser
|
|
12
|
-
from jsonschema import validate, ValidationError
|
|
13
|
-
from git import Repo
|
|
14
|
-
from git.exc import InvalidGitRepositoryError
|
|
15
|
-
from mako.lookup import TemplateLookup
|
|
16
|
-
from lbkit.misc import Color, load_yml_with_json_schema_validate, get_json_schema_file, load_json_schema
|
|
17
|
-
from lbkit import errors
|
|
18
|
-
from lbkit.codegen.codegen import CodeGen, history_versions
|
|
19
6
|
from lbkit.tools import Tools
|
|
20
|
-
from lbkit.build_conan_parallel import BuildConanParallel
|
|
21
|
-
from lbkit.codegen.codegen import Version
|
|
22
7
|
from lbkit.tasks.task_download import DownloadTask
|
|
23
8
|
from lbkit.misc import DownloadFlag
|
|
24
9
|
from lbkit.tools import Tools
|
|
25
10
|
from lbkit.utils.env_detector import EnvDetector
|
|
11
|
+
from lbkit.misc import load_yml_with_json_schema_validate
|
|
26
12
|
|
|
27
13
|
|
|
28
14
|
tools = Tools("comp_build")
|
|
@@ -33,10 +19,25 @@ class SourceDest():
|
|
|
33
19
|
def __init__(self, cfg):
|
|
34
20
|
self.source = cfg.get("source")
|
|
35
21
|
self.dest = cfg.get("dest")
|
|
22
|
+
self.pattern = cfg.get("pattern")
|
|
36
23
|
|
|
37
24
|
def copy(self, source_dir, dest_dir, with_template, **kwargs):
|
|
38
25
|
source = os.path.join(source_dir, self.source)
|
|
39
26
|
dest = os.path.join(dest_dir, self.dest)
|
|
27
|
+
if self.pattern and os.path.isdir(source):
|
|
28
|
+
if not source.endswith("/"):
|
|
29
|
+
source += "/"
|
|
30
|
+
files = tools.pipe([f"find {source} -name {self.pattern}"], out_file=None).decode("utf-8").split("\n")
|
|
31
|
+
for file in files:
|
|
32
|
+
file = file.strip()
|
|
33
|
+
if not file:
|
|
34
|
+
continue
|
|
35
|
+
new_dest = os.path.join(dest, file[len(source):])
|
|
36
|
+
self._copy(file, new_dest, with_template, **kwargs)
|
|
37
|
+
else:
|
|
38
|
+
self._copy(source, dest, with_template, **kwargs)
|
|
39
|
+
|
|
40
|
+
def _copy(self, source, dest, with_template, **kwargs):
|
|
40
41
|
if os.path.isfile(dest):
|
|
41
42
|
os.unlink(dest)
|
|
42
43
|
dest_dir = os.path.dirname(dest)
|
|
@@ -86,9 +87,6 @@ class BuildGeneral():
|
|
|
86
87
|
}
|
|
87
88
|
task = DownloadTask(cfg, os.getcwd())
|
|
88
89
|
task.start()
|
|
89
|
-
_, sha = DownloadFlag.read(self.dir_name)
|
|
90
|
-
if sha == sha256:
|
|
91
|
-
return
|
|
92
90
|
cmd = f"tar -xf {task.dst} -C {self.dir_name}"
|
|
93
91
|
if task.strip_components:
|
|
94
92
|
cmd += f" --strip-components={task.strip_components}"
|
|
@@ -101,10 +99,15 @@ class BuildGeneral():
|
|
|
101
99
|
def prepare_defconfig(self):
|
|
102
100
|
defconf = self.cfg.get("defconfig")
|
|
103
101
|
compiler_path=os.path.join(self.work_dir, "toolchain")
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
if isinstance(defconf, list):
|
|
103
|
+
for conf in defconf:
|
|
104
|
+
sd = SourceDest(conf)
|
|
105
|
+
sd.copy(self.cwd, os.path.join(self.work_dir, self.dir_name), True, compiler_path=compiler_path)
|
|
106
|
+
else:
|
|
107
|
+
sd = SourceDest(defconf)
|
|
108
|
+
sd.copy(self.cwd, os.path.join(self.work_dir, self.dir_name), True, compiler_path=compiler_path)
|
|
106
109
|
os.environ["ARCH"] = self.arch
|
|
107
|
-
os.environ["CROSS_COMPILE"] = self.cross_compile + "-"
|
|
110
|
+
os.environ["CROSS_COMPILE"] = os.path.join(compiler_path, "bin", self.cross_compile + "-")
|
|
108
111
|
path = os.environ.get("PATH", "")
|
|
109
112
|
if compiler_path not in path:
|
|
110
113
|
path += ":" + compiler_path + "/bin"
|
|
@@ -113,13 +116,21 @@ class BuildGeneral():
|
|
|
113
116
|
|
|
114
117
|
def build(self):
|
|
115
118
|
os.chdir(self.dir_name)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
cmds = self.cfg.get("cmds", [])
|
|
120
|
+
if cmds:
|
|
121
|
+
for cmd in cmds:
|
|
122
|
+
compiler = os.environ["CROSS_COMPILE"]
|
|
123
|
+
cmd = cmd.replace("${compiler}", compiler)
|
|
124
|
+
cmd = cmd.replace("${workdir}", self.dir_name)
|
|
125
|
+
self.tools.exec(cmd, verbose=True)
|
|
120
126
|
else:
|
|
121
|
-
cmd = f"make
|
|
122
|
-
|
|
127
|
+
cmd = f"make {self.defconfig}"
|
|
128
|
+
self.tools.exec(cmd, verbose=True)
|
|
129
|
+
if self.name == "compiler":
|
|
130
|
+
cmd = f"make sdk -j" + str(os.cpu_count())
|
|
131
|
+
else:
|
|
132
|
+
cmd = f"make -j" + str(os.cpu_count())
|
|
133
|
+
self.tools.exec(cmd, verbose=True)
|
|
123
134
|
|
|
124
135
|
def tar_files(self):
|
|
125
136
|
os.chdir(self.dir_name)
|
|
@@ -139,6 +150,8 @@ class BuildGeneral():
|
|
|
139
150
|
sd.copy(self.dir_name, self.output, False)
|
|
140
151
|
|
|
141
152
|
def run(self):
|
|
153
|
+
if not self.cfg:
|
|
154
|
+
return
|
|
142
155
|
self.download()
|
|
143
156
|
self.prepare_defconfig()
|
|
144
157
|
self.build()
|
|
@@ -181,6 +194,59 @@ class BuildUBoot(BuildGeneral):
|
|
|
181
194
|
super().__init__(config, cwd, "uboot", "uboot")
|
|
182
195
|
|
|
183
196
|
|
|
197
|
+
class PreDownload():
|
|
198
|
+
def __init__(self, config, cwd):
|
|
199
|
+
self.cwd = cwd
|
|
200
|
+
self.cfg = config.get("predownload", [])
|
|
201
|
+
|
|
202
|
+
def run(self):
|
|
203
|
+
if not self.cfg:
|
|
204
|
+
return
|
|
205
|
+
for down in self.cfg:
|
|
206
|
+
url = down.get("url")
|
|
207
|
+
sha256 = down.get("sha256")
|
|
208
|
+
verify = down.get("verify", True)
|
|
209
|
+
destfile = down.get("destfile")
|
|
210
|
+
destfile = os.path.join(self.cwd, ".temp", destfile)
|
|
211
|
+
destfile = os.path.realpath(destfile)
|
|
212
|
+
if not destfile.startswith(self.cwd):
|
|
213
|
+
raise Exception(f"dest file {destfile} not startswith {self.cwd}")
|
|
214
|
+
destdir = os.path.dirname(destfile)
|
|
215
|
+
if not os.path.isdir(destdir):
|
|
216
|
+
os.makedirs(destdir)
|
|
217
|
+
|
|
218
|
+
tmpfile = os.path.join(self.cwd, ".temp", os.path.basename(url))
|
|
219
|
+
|
|
220
|
+
cfg = {
|
|
221
|
+
"url": url,
|
|
222
|
+
"file": tmpfile,
|
|
223
|
+
"decompress": {
|
|
224
|
+
"dirname": self.cwd,
|
|
225
|
+
"strip_components": 0
|
|
226
|
+
},
|
|
227
|
+
"sha256": sha256,
|
|
228
|
+
"verify": verify
|
|
229
|
+
}
|
|
230
|
+
task = DownloadTask(cfg, os.getcwd())
|
|
231
|
+
task.start()
|
|
232
|
+
if tmpfile != destfile:
|
|
233
|
+
shutil.copyfile(tmpfile, destfile)
|
|
234
|
+
decomp = down.get("decompress")
|
|
235
|
+
if not decomp:
|
|
236
|
+
continue
|
|
237
|
+
strip_components = decomp.get("strip_components", 0)
|
|
238
|
+
dirname = decomp.get("dirname")
|
|
239
|
+
if not dirname:
|
|
240
|
+
continue
|
|
241
|
+
dirname = os.path.join(self.cwd, ".temp", dirname)
|
|
242
|
+
if os.path.isdir(dirname):
|
|
243
|
+
shutil.rmtree(dirname)
|
|
244
|
+
os.makedirs(dirname)
|
|
245
|
+
cmd = f"tar -xf {task.dst} -C {dirname}"
|
|
246
|
+
if strip_components:
|
|
247
|
+
cmd += f" --strip-components={strip_components}"
|
|
248
|
+
tools.exec(cmd)
|
|
249
|
+
|
|
184
250
|
class UKRBuild():
|
|
185
251
|
def __init__(self, env_detector: EnvDetector):
|
|
186
252
|
os.chdir(env_detector.ukr.folder)
|
|
@@ -188,8 +254,10 @@ class UKRBuild():
|
|
|
188
254
|
|
|
189
255
|
def run(self):
|
|
190
256
|
cwd = os.getcwd()
|
|
191
|
-
|
|
192
|
-
|
|
257
|
+
|
|
258
|
+
cfg = load_yml_with_json_schema_validate("config.yml", "/usr/share/litebmc/schema/ukr_config.v1.json")
|
|
259
|
+
download = PreDownload(cfg, cwd)
|
|
260
|
+
download.run()
|
|
193
261
|
build = BuildCompiler(cfg, cwd)
|
|
194
262
|
build.run()
|
|
195
263
|
build = BuildRootfs(cfg, cwd)
|
|
@@ -199,4 +267,4 @@ class UKRBuild():
|
|
|
199
267
|
build = BuildUBoot(cfg, cwd)
|
|
200
268
|
build.run()
|
|
201
269
|
cmd = f"tar -czf {cwd}/.temp/output/firmware.tar.gz -C {cwd}/.temp/output/images ."
|
|
202
|
-
tools.exec(cmd)
|
|
270
|
+
tools.exec(cmd)
|
lbkit-0.9.1/lbkit/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|