openubmc-bingo 0.6.66__py3-none-any.whl → 0.6.70__py3-none-any.whl
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.
Potentially problematic release.
This version of openubmc-bingo might be problematic. Click here for more details.
- bmcgo/__init__.py +1 -1
- bmcgo/functional/check.py +5 -1
- bmcgo/tasks/task_build_rootfs_img.py +120 -83
- bmcgo/tasks/task_buildgppbin.py +30 -13
- bmcgo/tasks/task_buildhpm_ext4.py +5 -3
- bmcgo/utils/fetch_component_code.py +4 -4
- bmcgo/utils/mapping_config_patch.py +2 -1
- {openubmc_bingo-0.6.66.dist-info → openubmc_bingo-0.6.70.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.6.66.dist-info → openubmc_bingo-0.6.70.dist-info}/RECORD +12 -12
- {openubmc_bingo-0.6.66.dist-info → openubmc_bingo-0.6.70.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.6.66.dist-info → openubmc_bingo-0.6.70.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.6.66.dist-info → openubmc_bingo-0.6.70.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
bmcgo/functional/check.py
CHANGED
|
@@ -155,8 +155,12 @@ class BmcgoCommand:
|
|
|
155
155
|
FetchComponentCode(self.packages, tempdir, self.remote, include_open_source=False).run()
|
|
156
156
|
cmd = self._get_studio_command(tempdir)
|
|
157
157
|
|
|
158
|
+
# 额外加入仓颉runtime的依赖库
|
|
159
|
+
insert_path = '/usr/share/bmc_studio/server'
|
|
158
160
|
os.chdir(self.studio_dir)
|
|
159
|
-
os.environ
|
|
161
|
+
cur_path = os.environ.get('LD_LIBRARY_PATH', '')
|
|
162
|
+
new_path = f"{insert_path}:{cur_path}"
|
|
163
|
+
os.environ['LD_LIBRARY_PATH'] = new_path
|
|
160
164
|
Helper.run(cmd, stdout=subprocess.DEVNULL)
|
|
161
165
|
os.chdir(cwd)
|
|
162
166
|
error, warning = self.filter_output()
|
|
@@ -21,6 +21,7 @@ import stat
|
|
|
21
21
|
import time
|
|
22
22
|
import subprocess
|
|
23
23
|
import tempfile
|
|
24
|
+
import re
|
|
24
25
|
from multiprocessing import Process
|
|
25
26
|
|
|
26
27
|
from git import Repo
|
|
@@ -32,19 +33,6 @@ from bmcgo.utils.mapping_config_patch import MappingConfigPatch
|
|
|
32
33
|
from bmcgo import errors, misc
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
class MakeZeroImageProcess(Process):
|
|
36
|
-
def __init__(self, work, bs_count, img_path):
|
|
37
|
-
super().__init__()
|
|
38
|
-
self.work = work
|
|
39
|
-
self.bs_count = bs_count
|
|
40
|
-
self.img_path = img_path
|
|
41
|
-
|
|
42
|
-
def run(self):
|
|
43
|
-
self.work.work_name = os.path.basename(self.img_path)
|
|
44
|
-
cmd = f"dd if=/dev/zero of={self.img_path} bs=4096 count={self.bs_count}"
|
|
45
|
-
self.work.run_command(cmd)
|
|
46
|
-
|
|
47
|
-
|
|
48
36
|
class TaskClass(Task):
|
|
49
37
|
def __init__(self, config: Config, work_name=""):
|
|
50
38
|
super(TaskClass, self).__init__(config, work_name)
|
|
@@ -57,6 +45,38 @@ class TaskClass(Task):
|
|
|
57
45
|
self.rootfs_img_path = f"{self.config.work_out}/rootfs_BMC.img"
|
|
58
46
|
self.datafs_img_path = f"{self.config.hpm_build_dir}/datafs_{self.config.board_name}.img"
|
|
59
47
|
|
|
48
|
+
@staticmethod
|
|
49
|
+
def make_strip_cmd(file_list, relative_path, build_type=None):
|
|
50
|
+
base = ["sudo find {} -type f ".format(relative_path)]
|
|
51
|
+
base.append("grep -v \"/share/\"")
|
|
52
|
+
base.append("grep -v \".json$\"")
|
|
53
|
+
base.append("grep -v \"\.lua$\"")
|
|
54
|
+
base.append("grep -v \".sh$\"")
|
|
55
|
+
base.append("grep -v \".png$\"")
|
|
56
|
+
base.append("grep -v \".jpg$\"")
|
|
57
|
+
base.append("grep -v \".jpeg$\"")
|
|
58
|
+
base.append("grep -v \".html$\"")
|
|
59
|
+
base.append("grep -v \".js$\"")
|
|
60
|
+
base.append("grep -v \".css$\"")
|
|
61
|
+
base.append("grep -v \".svg$\"")
|
|
62
|
+
base.append("grep -v \".sr$\"")
|
|
63
|
+
base.append("grep -v \".conf$\"")
|
|
64
|
+
base.append("grep -v \".service$\"")
|
|
65
|
+
base.append("grep -v \".cfg$\"")
|
|
66
|
+
base.append("grep -v \".gif$\"")
|
|
67
|
+
base.append("grep -v \".ttf$\"")
|
|
68
|
+
base.append("grep -v \".target$\"")
|
|
69
|
+
if build_type == "debug":
|
|
70
|
+
# so库一般带有版本号,此处不能注明具体的版本号,否则可能导致版本变更时不能正确strip
|
|
71
|
+
not_striped_list = ["rootfs/opt/bmc"]
|
|
72
|
+
for file in not_striped_list:
|
|
73
|
+
base.append("grep -v \"{}\"".format(file))
|
|
74
|
+
base.append("sudo xargs -P 0 -I {{}} file {{}}".format(file_list))
|
|
75
|
+
base.append("grep 'not stripped'")
|
|
76
|
+
base.append("awk -F: '{{print $1}}'")
|
|
77
|
+
base.append("grep -v '.ko$'")
|
|
78
|
+
return base
|
|
79
|
+
|
|
60
80
|
def set_evn(self):
|
|
61
81
|
self.buildimg_dir = self.config.buildimg_dir
|
|
62
82
|
self.tools.check_path(self.buildimg_dir)
|
|
@@ -202,13 +222,37 @@ class TaskClass(Task):
|
|
|
202
222
|
# 差异化处理完schema文件之后已完成schema整合,不在需要产品schema目录(强制删除时即使不存在也不会出错)
|
|
203
223
|
self.run_command(f"rm -rf {product_schema_path}", sudo=True)
|
|
204
224
|
|
|
225
|
+
# 将默认接口配置复制到节点目录中
|
|
226
|
+
def copy_interface_config(self, config_path, custom_path):
|
|
227
|
+
for config_dir in os.listdir(config_path):
|
|
228
|
+
# redfish的schema文件仍放在原路径,不需要进行复制
|
|
229
|
+
if not re.match(r'^[a-fA-F0-9]{2}_[a-fA-F0-9]{2}$', config_dir) and \
|
|
230
|
+
config_dir != "static_resource" and config_dir != "config_patch":
|
|
231
|
+
source_path = os.path.join(config_path, config_dir)
|
|
232
|
+
copy_cmd = f"cp -r {source_path} {custom_path}/"
|
|
233
|
+
self.tools.run_command(copy_cmd, sudo=True)
|
|
234
|
+
|
|
235
|
+
# 支持产品层级多节点共包,每个节点有独立的定制化接口配置
|
|
236
|
+
def custom_mapping_config_patch(self, config_path):
|
|
237
|
+
for custom_item in os.listdir(config_path):
|
|
238
|
+
# 节点目录命名为xx_xx格式,以十六进制表示
|
|
239
|
+
if re.match(r'^[a-fA-F0-9]{2}_[a-fA-F0-9]{2}$', custom_item):
|
|
240
|
+
custom_path = os.path.join(config_path, custom_item)
|
|
241
|
+
self.copy_interface_config(config_path, custom_path)
|
|
242
|
+
patch_work = MappingConfigPatch(self.config, config_path=custom_path)
|
|
243
|
+
patch_work.run()
|
|
244
|
+
|
|
205
245
|
# 支持映射配置文件根据产品差异进行打补丁
|
|
206
246
|
def mapping_config_patch(self):
|
|
207
247
|
self.info("开始根据配置映射打补丁")
|
|
208
248
|
for item in ["redfish", "web_backend", misc.CLI, "snmp"]:
|
|
209
249
|
config_path = os.path.join(self.rtos_rootfs, "opt/bmc/apps", item, "interface_config")
|
|
210
|
-
|
|
250
|
+
ret = self.tools.run_command(f"test -d {config_path}", ignore_error=True, sudo=True)
|
|
251
|
+
if ret.returncode != 0:
|
|
211
252
|
continue
|
|
253
|
+
|
|
254
|
+
self.custom_mapping_config_patch(config_path)
|
|
255
|
+
# 各节点的配置打完补丁后再进行默认配置的打补丁操作
|
|
212
256
|
patch_work = MappingConfigPatch(self.config, config_path=config_path)
|
|
213
257
|
patch_work.run()
|
|
214
258
|
|
|
@@ -334,38 +378,19 @@ class TaskClass(Task):
|
|
|
334
378
|
self.run_command(f"chmod {sr_dir_permission} {sr_dir}", sudo=True, command_echo=False)
|
|
335
379
|
self.run_command(f"chmod 440 {csr_version_file_path}", sudo=True, command_echo=False)
|
|
336
380
|
|
|
337
|
-
def
|
|
381
|
+
def strip(self):
|
|
382
|
+
# strip非ko文件
|
|
383
|
+
file_list = os.path.join(self.buildimg_dir, "no_striped.filelist")
|
|
338
384
|
work_path = os.getcwd()
|
|
339
385
|
relative_path = os.path.relpath(work_path, self.rtos_rootfs)
|
|
340
|
-
base =
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
base.append("grep -v \".html$\"")
|
|
349
|
-
base.append("grep -v \".js$\"")
|
|
350
|
-
base.append("grep -v \".css$\"")
|
|
351
|
-
base.append("grep -v \".svg$\"")
|
|
352
|
-
base.append("grep -v \".sr$\"")
|
|
353
|
-
base.append("grep -v \".conf$\"")
|
|
354
|
-
base.append("grep -v \".service$\"")
|
|
355
|
-
base.append("grep -v \".cfg$\"")
|
|
356
|
-
base.append("grep -v \".gif$\"")
|
|
357
|
-
base.append("grep -v \".ttf$\"")
|
|
358
|
-
base.append("grep -v \".target$\"")
|
|
359
|
-
if self.config.build_type == "debug":
|
|
360
|
-
# so库一般带有版本号,此处不能注明具体的版本号,否则可能导致版本变更时不能正确strip
|
|
361
|
-
not_striped_list = ["rootfs/opt/bmc"]
|
|
362
|
-
for file in not_striped_list:
|
|
363
|
-
base.append("grep -v \"{}\"".format(file))
|
|
364
|
-
base.append("sudo xargs -P 0 -I {{}} file {{}}".format(file_list))
|
|
365
|
-
base.append("grep 'not stripped'")
|
|
366
|
-
base.append("awk -F: '{{print $1}}'")
|
|
367
|
-
base.append("grep -v '.ko$'")
|
|
368
|
-
return base
|
|
386
|
+
base = self.make_strip_cmd(file_list, relative_path, self.config.build_type)
|
|
387
|
+
strip = os.path.join(self.config.cross_compile_install_path, "bin", self.config.strip)
|
|
388
|
+
self.pipe_command(base, file_list)
|
|
389
|
+
if os.path.isfile(file_list) and not self.config.enable_arm_gcov:
|
|
390
|
+
cmd = ["cat {}".format(file_list), "sudo xargs -P 0 -I {{}} {} -R .comment {{}}".format(strip)]
|
|
391
|
+
self.pipe_command(cmd)
|
|
392
|
+
cmd = ["cat {}".format(file_list), "sudo xargs -P 0 -I {{}} {} {{}}".format(strip)]
|
|
393
|
+
self.pipe_command(cmd)
|
|
369
394
|
|
|
370
395
|
def build_common_fs(self):
|
|
371
396
|
"""
|
|
@@ -374,43 +399,22 @@ class TaskClass(Task):
|
|
|
374
399
|
self.chdir(self.buildimg_dir)
|
|
375
400
|
self.info("开始构建 rootfs ...")
|
|
376
401
|
|
|
377
|
-
|
|
378
|
-
sdk_tar = os.path.join(self.config.sdk_path, "hi1711sdk.tar.gz")
|
|
379
|
-
# 解压SDK
|
|
380
|
-
self.run_command(f"rm -rf {self.rtos_rootfs}", sudo=True)
|
|
381
|
-
self.run_command(f"tar --xattrs --xattrs-include=* -xf {rtos_tar}", sudo=True)
|
|
382
|
-
self.run_command(f"sudo chown -R 0:0 {self.rtos_rootfs}", sudo=True)
|
|
383
|
-
self.info("拷贝RTOS提供的mke2fs.conf配置文件覆盖本地环境中的/etc/mke2fs.conf文件, 确保mkfs.ext4使用该配置文件")
|
|
384
|
-
self.run_command(f"cp -f {self.rtos_rootfs}/etc/mke2fs.conf /etc/mke2fs.conf", sudo=True)
|
|
385
|
-
self.run_command(f"rm -rf {self.rtos_rootfs}/etc/ssh", sudo=True)
|
|
386
|
-
self.run_command(f"rm -rf {self.rtos_rootfs}/usr/share/doc/openubmc", sudo=True)
|
|
402
|
+
self.make_rtos_rootfs()
|
|
387
403
|
|
|
388
404
|
# 记录代码分支和提交节点
|
|
389
405
|
self.create_bmc_release()
|
|
390
406
|
|
|
391
|
-
|
|
392
|
-
sdk_path = os.path.join(self.buildimg_dir, "sdk")
|
|
393
|
-
self.run_command(f"rm -rf {sdk_path}", sudo=True)
|
|
394
|
-
self.run_command(f"mkdir -p {sdk_path}", sudo=True)
|
|
395
|
-
self.run_command("tar -xf {} -C {}".format(sdk_tar, sdk_path), sudo=True)
|
|
396
|
-
ko_path = f"{self.rtos_rootfs}/lib/modules/"
|
|
397
|
-
self.run_command("cp -dfr {}/. {}".format(sdk_path, ko_path), sudo=True)
|
|
407
|
+
self.copy_ko_modules()
|
|
398
408
|
|
|
399
409
|
self.chdir(self.config.work_out)
|
|
400
410
|
self.copy_rtos_modules()
|
|
411
|
+
self.copy_upgrade_dat_file()
|
|
401
412
|
|
|
402
413
|
for cus in self.customization:
|
|
403
414
|
cus.rootfs_cust(self.rtos_rootfs)
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
strip = os.path.join(self.config.cross_compile_install_path, "bin", self.config.strip)
|
|
408
|
-
self.pipe_command(base, file_list)
|
|
409
|
-
if os.path.isfile(file_list) and not self.config.enable_arm_gcov:
|
|
410
|
-
cmd = ["cat {}".format(file_list), "sudo xargs -P 0 -I {{}} {} -R .comment {{}}".format(strip)]
|
|
411
|
-
self.pipe_command(cmd)
|
|
412
|
-
cmd = ["cat {}".format(file_list), "sudo xargs -P 0 -I {{}} {} {{}}".format(strip)]
|
|
413
|
-
self.pipe_command(cmd)
|
|
415
|
+
|
|
416
|
+
self.strip()
|
|
417
|
+
|
|
414
418
|
# 删除.a文件
|
|
415
419
|
cmd = ["sudo find {} -type f -name *.a".format(self.rtos_rootfs), "sudo xargs -P 0 -i{{}} rm {{}}"]
|
|
416
420
|
self.pipe_command(cmd)
|
|
@@ -422,6 +426,18 @@ class TaskClass(Task):
|
|
|
422
426
|
self.prepare_preloader_for_luacov()
|
|
423
427
|
self.prepare_coverage_config()
|
|
424
428
|
|
|
429
|
+
def make_rtos_rootfs(self):
|
|
430
|
+
self.info("开始构建 rootfs ...")
|
|
431
|
+
rtos_tar = os.path.join(self.config.sdk_path, "rtos.tar.gz")
|
|
432
|
+
# 解压SDK
|
|
433
|
+
self.run_command(f"rm -rf {self.rtos_rootfs}", sudo=True)
|
|
434
|
+
self.run_command(f"tar --xattrs --xattrs-include=* -xf {rtos_tar}", sudo=True)
|
|
435
|
+
self.run_command(f"sudo chown -R 0:0 {self.rtos_rootfs}", sudo=True)
|
|
436
|
+
self.info("拷贝RTOS提供的mke2fs.conf配置文件覆盖本地环境中的/etc/mke2fs.conf文件, 确保mkfs.ext4使用该配置文件")
|
|
437
|
+
self.run_command(f"cp -f {self.rtos_rootfs}/etc/mke2fs.conf /etc/mke2fs.conf", sudo=True)
|
|
438
|
+
self.run_command(f"rm -rf {self.rtos_rootfs}/etc/ssh", sudo=True)
|
|
439
|
+
self.run_command(f"rm -rf {self.rtos_rootfs}/usr/share/doc/openubmc", sudo=True)
|
|
440
|
+
|
|
425
441
|
def create_bmc_release(self):
|
|
426
442
|
bmc_release_path = f"{self.rtos_rootfs}/etc/bmc-release"
|
|
427
443
|
temp_bmc_release_file = tempfile.NamedTemporaryFile()
|
|
@@ -448,6 +464,16 @@ class TaskClass(Task):
|
|
|
448
464
|
self.run_command(f"cp {temp_bmc_release_file.name} {bmc_release_path}", sudo=True, command_echo=False)
|
|
449
465
|
self.run_command(f"chmod 644 {bmc_release_path}", sudo=True)
|
|
450
466
|
|
|
467
|
+
def copy_ko_modules(self):
|
|
468
|
+
# 解压SDK并复制到指定位置
|
|
469
|
+
sdk_tar = os.path.join(self.config.sdk_path, "hi1711sdk.tar.gz")
|
|
470
|
+
sdk_path = os.path.join(self.buildimg_dir, "sdk")
|
|
471
|
+
self.run_command(f"rm -rf {sdk_path}", sudo=True)
|
|
472
|
+
self.run_command(f"mkdir -p {sdk_path}", sudo=True)
|
|
473
|
+
self.run_command("tar -xf {} -C {}".format(sdk_tar, sdk_path), sudo=True)
|
|
474
|
+
ko_path = f"{self.rtos_rootfs}/lib/modules/"
|
|
475
|
+
self.run_command("cp -dfr {}/. {}".format(sdk_path, ko_path), sudo=True)
|
|
476
|
+
|
|
451
477
|
def copy_rtos_modules(self):
|
|
452
478
|
self.run_command("cp -af {}/. {}".format(self.config.rootfs_path, self.rtos_rootfs), sudo=True)
|
|
453
479
|
cp_cmd = "cp -df {} {}"
|
|
@@ -455,14 +481,17 @@ class TaskClass(Task):
|
|
|
455
481
|
f"{self.rtos_rootfs}/lib64/libgcc_s.so.1"), sudo=True)
|
|
456
482
|
self.run_command(cp_cmd.format("/opt/hcc_arm64le/aarch64-target-linux-gnu/lib64/libstdc++.so.6",
|
|
457
483
|
f"{self.rtos_rootfs}/lib64/libstdc++.so.6"), sudo=True)
|
|
484
|
+
self.run_command("chmod 755 {}".format(f"{self.rtos_rootfs}/lib64/libgcc_s.so.1"), sudo=True)
|
|
485
|
+
self.run_command("chmod 755 {}".format(f"{self.rtos_rootfs}/lib64/libstdc++.so.6"), sudo=True)
|
|
486
|
+
|
|
487
|
+
def copy_upgrade_dat_file(self):
|
|
488
|
+
cp_cmd = "cp -df {} {}"
|
|
458
489
|
self.run_command("mkdir -p {}".format(f"{self.rtos_rootfs}/opt/pme/upgrade"), sudo=True)
|
|
459
490
|
self.run_command(cp_cmd.format(f"{self.config.code_path}/manufacture/misc/pme_profile_en.dat",
|
|
460
491
|
f"{self.rtos_rootfs}/opt/pme/upgrade/pme_profile_en"), sudo=True)
|
|
461
492
|
self.run_command(cp_cmd.format(f"{self.config.code_path}/manufacture/misc/datatocheck_upgrade.dat",
|
|
462
493
|
f"{self.rtos_rootfs}/opt/pme/upgrade/datatocheck_upgrade.dat"),
|
|
463
494
|
sudo=True)
|
|
464
|
-
self.run_command("chmod 755 {}".format(f"{self.rtos_rootfs}/lib64/libgcc_s.so.1"), sudo=True)
|
|
465
|
-
self.run_command("chmod 755 {}".format(f"{self.rtos_rootfs}/lib64/libstdc++.so.6"), sudo=True)
|
|
466
495
|
self.run_command("chmod 400 {}".format(f"{self.rtos_rootfs}/opt/pme/upgrade/pme_profile_en"), sudo=True)
|
|
467
496
|
self.run_command("chmod 400 {}".format(f"{self.rtos_rootfs}/opt/pme/upgrade/datatocheck_upgrade.dat"),
|
|
468
497
|
sudo=True)
|
|
@@ -496,6 +525,20 @@ class TaskClass(Task):
|
|
|
496
525
|
self.run_command(f"chown 0:0 {tar_path}", sudo=True)
|
|
497
526
|
return
|
|
498
527
|
|
|
528
|
+
def rootfs_customization(self):
|
|
529
|
+
if self.config.build_type == 'debug':
|
|
530
|
+
for cus in self.customization:
|
|
531
|
+
cus.rootfs_debug_cust(self.mnt_datafs)
|
|
532
|
+
elif self.config.build_type == 'release':
|
|
533
|
+
for cus in self.customization:
|
|
534
|
+
cus.rootfs_release_cust(self.mnt_datafs)
|
|
535
|
+
|
|
536
|
+
for cus in self.customization:
|
|
537
|
+
cus.rootfs_common(self.mnt_datafs)
|
|
538
|
+
|
|
539
|
+
def make_img(self):
|
|
540
|
+
self.tools.make_img(self.rootfs_img_path, self.mnt_datafs, "376")
|
|
541
|
+
|
|
499
542
|
def make_rootfs_img(self):
|
|
500
543
|
self.make_datafs_img()
|
|
501
544
|
|
|
@@ -519,18 +562,11 @@ class TaskClass(Task):
|
|
|
519
562
|
|
|
520
563
|
self.component_swbom()
|
|
521
564
|
self.run_command(f"sudo cp -a {self.rtos_rootfs}/. {self.mnt_datafs}/")
|
|
522
|
-
|
|
523
|
-
for cus in self.customization:
|
|
524
|
-
cus.rootfs_debug_cust(self.mnt_datafs)
|
|
525
|
-
elif self.config.build_type == 'release':
|
|
526
|
-
for cus in self.customization:
|
|
527
|
-
cus.rootfs_release_cust(self.mnt_datafs)
|
|
528
|
-
|
|
529
|
-
for cus in self.customization:
|
|
530
|
-
cus.rootfs_common(self.mnt_datafs)
|
|
565
|
+
self.rootfs_customization()
|
|
531
566
|
self.chdir(self.config.work_out)
|
|
532
|
-
self.
|
|
567
|
+
self.make_img()
|
|
533
568
|
|
|
569
|
+
def post_make_rootfs_img(self):
|
|
534
570
|
self.run_command(f"zerofree -v {self.rootfs_img_path}")
|
|
535
571
|
self.run_command(f"get_img_parma_area.sh {self.rootfs_img_path}")
|
|
536
572
|
|
|
@@ -568,3 +604,4 @@ class TaskClass(Task):
|
|
|
568
604
|
self.set_evn()
|
|
569
605
|
self.build_common_fs()
|
|
570
606
|
self.make_rootfs_img()
|
|
607
|
+
self.post_make_rootfs_img()
|
bmcgo/tasks/task_buildgppbin.py
CHANGED
|
@@ -24,6 +24,10 @@ from bmcgo import misc
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class TaskClass(Task):
|
|
27
|
+
def __init__(self, config, work_name=""):
|
|
28
|
+
super(TaskClass, self).__init__(config, work_name=work_name)
|
|
29
|
+
self.suffix = "BMC"
|
|
30
|
+
|
|
27
31
|
def copy_files(self):
|
|
28
32
|
rootca = os.path.join(self.config.work_out, misc.ROOTCA_DER)
|
|
29
33
|
crl = os.path.join(self.config.work_out, misc.CMS_CRL)
|
|
@@ -79,16 +83,17 @@ class TaskClass(Task):
|
|
|
79
83
|
else:
|
|
80
84
|
pmode_file = ""
|
|
81
85
|
|
|
86
|
+
self.write_gpp_bin(pmode_file)
|
|
82
87
|
|
|
88
|
+
def write_gpp_bin(self, pmode_file):
|
|
83
89
|
self.info(f"打包: {self.config.board_name}_gpp.bin")
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
files = f"hpm_top_header Hi1711_boot_4096.bin {pmode_file}"
|
|
91
|
+
files += f"hpm_sub_header rootca.der rootfs_{self.suffix}.img.cms cms.crl rootfs_{self.suffix}.tar.gz"
|
|
92
|
+
cmd = f"ls -al {files}"
|
|
86
93
|
self.run_command(cmd, show_log=True)
|
|
87
94
|
|
|
88
95
|
target_path = f"{self.config.work_out}/{self.config.board_name}_gpp.bin"
|
|
89
|
-
cmd = f"cat
|
|
90
|
-
cmd += "hpm_sub_header rootca.der rootfs_BMC.img.cms cms.crl rootfs_BMC.tar.gz"
|
|
91
|
-
self.info("执行命令: " + cmd)
|
|
96
|
+
cmd = f"cat {files}"
|
|
92
97
|
self.pipe_command([cmd], target_path)
|
|
93
98
|
|
|
94
99
|
def run(self):
|
|
@@ -99,31 +104,37 @@ class TaskClass(Task):
|
|
|
99
104
|
def move_dependency(self):
|
|
100
105
|
# 移动到tools/build_tools目录中
|
|
101
106
|
self.chdir(self.config.sdk_path)
|
|
107
|
+
if self.config.chip == "1711":
|
|
108
|
+
self.prepare_boot_1711()
|
|
109
|
+
else:
|
|
110
|
+
self.prepare_boot_1712()
|
|
111
|
+
|
|
112
|
+
def prepare_boot_1711(self):
|
|
102
113
|
unsigned_boot = None
|
|
103
114
|
for file in os.listdir("."):
|
|
104
115
|
if re.match("^Hi1711_[0-9]{8}_[0-9a-f]{40}.tar.gz$", file) is None:
|
|
105
116
|
continue
|
|
106
117
|
unsigned_boot = file
|
|
107
118
|
break
|
|
108
|
-
|
|
119
|
+
|
|
109
120
|
if self.config.self_sign:
|
|
110
121
|
if not unsigned_boot:
|
|
111
122
|
raise errors.BmcGoException("打开了自签名模式但未找到待签名的uboot文件,构建失败")
|
|
112
|
-
self.run_command(f"tar -xvf {
|
|
123
|
+
self.run_command(f"tar -xvf {unsigned_boot}")
|
|
113
124
|
# 解压uboot_debug未签名包
|
|
114
125
|
os.makedirs("origin_uboot_debug")
|
|
115
126
|
self.run_command(f"tar -xvf bin/original_bin/uboot_debug.tar.gz -C origin_uboot_debug")
|
|
116
|
-
self.
|
|
127
|
+
self.self_sign_uboot_1711("origin_uboot_debug", ".", True)
|
|
117
128
|
# 解压uboot未签名包
|
|
118
129
|
os.makedirs("origin_uboot")
|
|
119
130
|
self.run_command(f"tar -xvf bin/original_bin/uboot.tar.gz -C origin_uboot")
|
|
120
|
-
self.
|
|
121
|
-
|
|
131
|
+
self.self_sign_uboot_1711("origin_uboot", ".", False)
|
|
132
|
+
else:
|
|
122
133
|
self.run_command(f"dd if=Hi1711_boot_4096_pmode.bin of=Hi1711_boot_pmode.bin bs=1k count=1024 skip=768")
|
|
123
134
|
self.run_command(f"dd if=Hi1711_boot_4096_pmode_debug.bin of=Hi1711_boot_pmode_debug.bin bs=1k " +
|
|
124
135
|
"count=1024 skip=768")
|
|
125
136
|
|
|
126
|
-
def
|
|
137
|
+
def self_sign_uboot_1711(self, uboot_dir, output_dir, is_debug):
|
|
127
138
|
"""签名uboot包"""
|
|
128
139
|
cwd = os.getcwd()
|
|
129
140
|
output_dir = os.path.realpath(output_dir)
|
|
@@ -137,9 +148,15 @@ class TaskClass(Task):
|
|
|
137
148
|
self.signature("uboot.bin", "uboot.bin.cms", "cms.crl", "rootca.der")
|
|
138
149
|
self.copy_gpp_headers_files()
|
|
139
150
|
self.run_command("gpp_header uboot")
|
|
140
|
-
self.run_command("make_uboot_img.sh
|
|
141
|
-
run_cmd =
|
|
151
|
+
self.run_command(f"make_uboot_img.sh {l0_kb_size}")
|
|
152
|
+
run_cmd = (
|
|
153
|
+
f"dd if=Hi1711_boot_4096.bin of={output_dir}/Hi1711_boot_pmode{debug_flag}.bin "
|
|
142
154
|
f" bs=1K count=1024 skip={l0_kb_size}"
|
|
155
|
+
)
|
|
143
156
|
self.run_command(run_cmd)
|
|
144
157
|
self.run_command(f"cp Hi1711_boot_4096.bin {output_dir}/Hi1711_boot_4096{debug_flag}.bin")
|
|
145
158
|
self.chdir(cwd)
|
|
159
|
+
|
|
160
|
+
def prepare_boot_1712(self):
|
|
161
|
+
# 打桩函数,不允许变更函数名,供扩展实现
|
|
162
|
+
pass
|
|
@@ -22,6 +22,8 @@ import os
|
|
|
22
22
|
import stat
|
|
23
23
|
import shutil
|
|
24
24
|
import subprocess
|
|
25
|
+
|
|
26
|
+
from bmcgo import misc
|
|
25
27
|
from bmcgo.tasks.task import Task
|
|
26
28
|
|
|
27
29
|
|
|
@@ -58,9 +60,9 @@ class TaskClass(Task):
|
|
|
58
60
|
digest = self.get_manufacture_config("base/signature/hpm_digest", ["sha256"])
|
|
59
61
|
with os.fdopen(os.open(filelist, os.O_WRONLY | os.O_CREAT | os.O_TRUNC,
|
|
60
62
|
stat.S_IWUSR | stat.S_IRUSR), 'w') as f:
|
|
61
|
-
f.write(
|
|
62
|
-
f.write(
|
|
63
|
-
f.write(f
|
|
63
|
+
f.write("Manifest Version: 1.0\n")
|
|
64
|
+
f.write(f"Create By: {misc.vendor()}\n")
|
|
65
|
+
f.write(f"Name: {hpm_file}\n")
|
|
64
66
|
if "sha256" in digest:
|
|
65
67
|
sha256sum = shutil.which("sha256sum")
|
|
66
68
|
cmd = [sha256sum, hpm_file]
|
|
@@ -251,10 +251,10 @@ class FetchComponentCode:
|
|
|
251
251
|
conan_version)
|
|
252
252
|
except exc.GitCommandError as exp:
|
|
253
253
|
# 尝试修补MDS
|
|
254
|
-
cmd = f"conan install --requires={conan_version} -r openubmc_dev
|
|
255
|
-
|
|
256
|
-
result = json.loads(Tools().run_command(cmd, capture_output=True, ignore_error=True))
|
|
257
|
-
nodes = result.
|
|
254
|
+
cmd = f"conan install --requires={conan_version} -r openubmc_dev\
|
|
255
|
+
--build=missing -pr profile.ini --format=json --output-folder=tmp"
|
|
256
|
+
result = json.loads(Tools().run_command(cmd, capture_output=True, ignore_error=True).stdout.strip())
|
|
257
|
+
nodes = result.get("graph").get("nodes")
|
|
258
258
|
for node in nodes.values():
|
|
259
259
|
if node.get("ref").startswith(conan_version):
|
|
260
260
|
package_folder = node.get("package_folder")
|
|
@@ -411,7 +411,8 @@ class MappingConfigPatch(Task):
|
|
|
411
411
|
|
|
412
412
|
|
|
413
413
|
def run(self):
|
|
414
|
-
|
|
414
|
+
ret = self.tools.run_command(f"test -d {self.config_patch_path}", ignore_error=True, sudo=True)
|
|
415
|
+
if ret.returncode != 0:
|
|
415
416
|
return
|
|
416
417
|
|
|
417
418
|
# 给予权限方便对文件做变更
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256=
|
|
1
|
+
bmcgo/__init__.py,sha256=ZseRGGw1BIo33Zy9RTeEklcfSC1yc7r54gsFo5abONU,562
|
|
2
2
|
bmcgo/bmcgo.py,sha256=uD4TsfjrFB5aQPIS6WRUVc9ShXX-dSImY9ezkB13g1w,685
|
|
3
3
|
bmcgo/bmcgo_config.py,sha256=-KYhC3jNqWkCWu6YkyxDZlyC3floXIHaibGpmyB6YWQ,11873
|
|
4
4
|
bmcgo/errors.py,sha256=QW1ndrJcJ2Ws7riOznPKVvZsNlrYk73eZol7w8gJTPU,3076
|
|
@@ -195,7 +195,7 @@ bmcgo/component/template_v2/conanfile.deploy.py.mako,sha256=Xbd-PlfVHOWeRFLfvzIN
|
|
|
195
195
|
bmcgo/functional/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
196
196
|
bmcgo/functional/analysis.py,sha256=4FaJlz7CbupHAdCdhdrRZCTlnHZ0bz7Cy32FNg9Ik_0,4097
|
|
197
197
|
bmcgo/functional/bmc_studio_action.py,sha256=1-O44mp--_r6M971cZ5JgutcQMM8aQtfQgDsSRXSrX8,3920
|
|
198
|
-
bmcgo/functional/check.py,sha256=
|
|
198
|
+
bmcgo/functional/check.py,sha256=MSWjgPpHPHqM7uSyHFZLHPmQHY4KP9kXjQVGJxht_x4,9614
|
|
199
199
|
bmcgo/functional/conan_index_build.py,sha256=Mp1fDpZVvecn5lUCsWZqq3mKSx9yu5pznQrDZr4Liuk,13443
|
|
200
200
|
bmcgo/functional/config.py,sha256=ZQ-a9hegI0cV41iTo7t49ryBeUH4wPJ-qkVvWp8toV4,10824
|
|
201
201
|
bmcgo/functional/csr_build.py,sha256=k6vEWuhrmTXTndMQX-RF6v9S7So-Gi4WWjoUYzh5IVA,42046
|
|
@@ -224,10 +224,10 @@ bmcgo/tasks/__init__.py,sha256=VapgzhPMmB7dzPIRohoVm1jjfVn_v97cYNCRmkxScaU,539
|
|
|
224
224
|
bmcgo/tasks/misc.py,sha256=GK_bSDLGZW0FxywB2ICG1iIEz2y2QoCb1YQQk8SYOIA,711
|
|
225
225
|
bmcgo/tasks/task.py,sha256=95nKxTe5PW3rfhpm5YFasPtmP8oCraeWJKq0D5mbl6A,18578
|
|
226
226
|
bmcgo/tasks/task_build_conan.py,sha256=Si-8fIrQ_Vva6gw0kdLApEZY5cKt8Mt1C_8Ef4If61I,53872
|
|
227
|
-
bmcgo/tasks/task_build_rootfs_img.py,sha256=
|
|
227
|
+
bmcgo/tasks/task_build_rootfs_img.py,sha256=ffFLFVZ6wMpAvUi9au32IYNTr8TBmi7R6ZE1orvOj68,30565
|
|
228
228
|
bmcgo/tasks/task_build_wbd_up.py,sha256=X9-0Qqad-s3mGfJBMeBQvfZ99KlWcgaMluDr_zv6Z-o,3122
|
|
229
|
-
bmcgo/tasks/task_buildgppbin.py,sha256=
|
|
230
|
-
bmcgo/tasks/task_buildhpm_ext4.py,sha256=
|
|
229
|
+
bmcgo/tasks/task_buildgppbin.py,sha256=VdViuNyOEBwHV3zbP6fJnZ3aUxK_RwyIPTv4Hseszrw,7018
|
|
230
|
+
bmcgo/tasks/task_buildhpm_ext4.py,sha256=giAWz-XYmtYv6KTK9BJOyXJY7yDar6oONmEvHPoqsl0,3514
|
|
231
231
|
bmcgo/tasks/task_create_interface_config.py,sha256=rkFRGLrUgYCics-n1CKwCoQscU2BaRQkH7KP3zwJ6FI,5393
|
|
232
232
|
bmcgo/tasks/task_download_buildtools.py,sha256=imiOIWXxKOiWolALasTuSp3EkXrVeFWD0bPLERA78W0,4520
|
|
233
233
|
bmcgo/tasks/task_download_dependency.py,sha256=-ZkRcUKZyx3KYWlbBEOoJEm9rpfDGIItnJZQqpimNDM,3369
|
|
@@ -245,10 +245,10 @@ bmcgo/utils/combine_json_schemas.py,sha256=08JrAlLeo_JgUqzYcZNgSwJZPLfjbWVJ4esPP
|
|
|
245
245
|
bmcgo/utils/component_post.py,sha256=rTSMv36geI6rbm6ZFQenZfG0mn1nVPpdJqn7g8bYtKA,2330
|
|
246
246
|
bmcgo/utils/component_version_check.py,sha256=ukc-H-A4ljkOShzVtkYWL0oTIYwxgDIZtP-fPqqHnRY,6274
|
|
247
247
|
bmcgo/utils/config.py,sha256=BoNx8U8VjnHrC-lFXIhp6Ex8f02kZgUS-mTkRxi_SYM,51141
|
|
248
|
-
bmcgo/utils/fetch_component_code.py,sha256=
|
|
248
|
+
bmcgo/utils/fetch_component_code.py,sha256=4C65ct7HdsgaRuF86ifttHQFmGQQCjaA0UhvHdQ8NRY,12329
|
|
249
249
|
bmcgo/utils/install_manager.py,sha256=Ag7tcTbhBfc6aTe5FOiET-8koq8_iY38Sozmi3dquio,4919
|
|
250
250
|
bmcgo/utils/json_validator.py,sha256=_k5wU78wfYGrzvSDaqOEtT4otgKUjquVhZNpVf2PW_c,7524
|
|
251
|
-
bmcgo/utils/mapping_config_patch.py,sha256=
|
|
251
|
+
bmcgo/utils/mapping_config_patch.py,sha256=ersqH5AmDvSfrOLbsNs3mfBxLQ3AUbJlCAjjtO6dMDk,16909
|
|
252
252
|
bmcgo/utils/merge_csr.py,sha256=JNxHCfW1au84WQshdz0aQy8wMTEOHonjQT3s6LjlZN4,4580
|
|
253
253
|
bmcgo/utils/perf_analysis.py,sha256=fh6lV9AAKVhpPkGPwAJ8EWfGfUoHjqGYQxrvc32Xiac,4767
|
|
254
254
|
bmcgo/utils/tools.py,sha256=MmFWnfL1ahRReBb7QaHjLNH3731IXDiBBRiOk9CPsQE,33152
|
|
@@ -263,8 +263,8 @@ bmcgo/utils/installations/install_plans/qemu.yml,sha256=lT7aKag60QUH6hTGFKa3hGRq
|
|
|
263
263
|
bmcgo/utils/installations/install_plans/studio.yml,sha256=AEspVgsVAnmUdvqZYNCb7SPoUEq_0i61dfpauyguLa4,229
|
|
264
264
|
bmcgo/utils/installations/installers/apt_installer.py,sha256=nPaCb4cobSi9InN_aHsEPtQ0k4FgsCUWE5_VgBPvcRE,3769
|
|
265
265
|
bmcgo/utils/installations/installers/pip_installer.py,sha256=dDdios1EQ7fzt90r02pZeoM3jCmjslLzkSvzd2hgRVM,3241
|
|
266
|
-
openubmc_bingo-0.6.
|
|
267
|
-
openubmc_bingo-0.6.
|
|
268
|
-
openubmc_bingo-0.6.
|
|
269
|
-
openubmc_bingo-0.6.
|
|
270
|
-
openubmc_bingo-0.6.
|
|
266
|
+
openubmc_bingo-0.6.70.dist-info/METADATA,sha256=r8PH4Z1EhzTs-bAcIfANC1pVpQ8J-6P2Ziz4ZfrTbcE,1010
|
|
267
|
+
openubmc_bingo-0.6.70.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
268
|
+
openubmc_bingo-0.6.70.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
269
|
+
openubmc_bingo-0.6.70.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
270
|
+
openubmc_bingo-0.6.70.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|