openubmc-bingo 0.6.62__py3-none-any.whl → 0.6.63__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 CHANGED
@@ -9,4 +9,4 @@
9
9
  # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
10
  # See the Mulan PSL v2 for more details.
11
11
 
12
- __version__ = '0.6.62'
12
+ __version__ = '0.6.63'
@@ -18,52 +18,6 @@ from bmcgo.tasks.task import Task
18
18
  from bmcgo import errors
19
19
 
20
20
 
21
- class SignProcess(Process):
22
- def __init__(self, work: Task):
23
- super().__init__()
24
- self.work = work
25
- self.config = self.work.config
26
-
27
- def run(self):
28
- self.work.work_name = "sign_rootfs_image"
29
- self.work.chdir(self.config.build_path)
30
- if self.config.self_sign:
31
- self.self_sign()
32
- else:
33
- self.online_sign()
34
-
35
- # 自签名函数,继承类可扩展,不能变更方法名,重要!!!
36
- def self_sign(self):
37
- self.work.signature(
38
- f"{self.config.work_out}/rootfs_BMC.img",
39
- f"{self.config.work_out}/rootfs_BMC.img.cms",
40
- f"{self.config.work_out}/cms.crl",
41
- f"{self.config.work_out}/rootca.der",
42
- )
43
-
44
- # 在线签名函数,继承类可扩展,不能变更方法名,重要!!!
45
- def online_sign(self):
46
- # bingo无需在线签名逻辑,仅占位满足后续流程即可
47
- out_file = f"{self.config.work_out}/rootfs_BMC.img.cms"
48
- self.work.tools.pipe_command([f"echo 'cms placeholder'"], out_file=out_file)
49
-
50
-
51
- class TarImageProcess(Process):
52
- def __init__(self, work):
53
- super().__init__()
54
- self.work: Task = work
55
- self.config = self.work.config
56
-
57
- def run(self):
58
- self.work.work_name = "tar_rootfs_image"
59
- self.work.chdir(self.config.work_out)
60
- self.tar_image()
61
-
62
- def tar_image(self):
63
- self.work.run_command("tar --format=gnu --exclude BMC_rootfs.tar.gz -czf rootfs_BMC.tar.gz rootfs_BMC.img")
64
- self.work.success("tar BMC_rootfs.tar.gz successfully")
65
-
66
-
67
21
  class TaskClass(Task):
68
22
  skip_post_hpm = False
69
23
 
@@ -109,25 +63,36 @@ class TaskClass(Task):
109
63
  f"sed -i \"/^Version=/s/{curr_ver}/{ver}/g\" update.cfg")
110
64
  self.run_command("chmod +x . -R")
111
65
 
112
- def run(self):
113
- # 创建签名进程
114
- sign = SignProcess(self)
115
- sign.start()
66
+ def sign_img(self):
67
+ if self.config.self_sign:
68
+ self.self_sign()
69
+ else:
70
+ self.online_sign()
116
71
 
117
- self.prepare_hpm()
72
+ # 自签名函数,继承类可扩展,不能变更方法名,重要!!!
73
+ def self_sign(self):
74
+ self.signature(
75
+ f"{self.config.work_out}/rootfs_BMC.img",
76
+ f"{self.config.work_out}/rootfs_BMC.img.cms",
77
+ f"{self.config.work_out}/cms.crl",
78
+ f"{self.config.work_out}/rootca.der",
79
+ )
118
80
 
119
- # 创建压缩进程
120
- tar = TarImageProcess(self)
121
- tar.start()
122
- while True:
123
- if not sign.is_alive():
124
- if sign.exitcode is not None and sign.exitcode != 0:
125
- raise errors.BmcGoException(f"签名进程发生错误, 返回值: {sign.exitcode}")
126
- break
127
- time.sleep(0.1)
128
- while True:
129
- if not tar.is_alive():
130
- if tar.exitcode is not None and tar.exitcode != 0:
131
- raise errors.BmcGoException(f"打包进程发生错误, 返回值: {tar.exitcode}")
132
- break
133
- time.sleep(0.1)
81
+ # 在线签名函数,继承类可扩展,不能变更方法名,重要!!!
82
+ def online_sign(self):
83
+ # bingo无需在线签名逻辑,仅占位满足后续流程即可
84
+ out_file = f"{self.config.work_out}/rootfs_BMC.img.cms"
85
+ self.pipe_command([f"echo 'cms placeholder'"], out_file=out_file)
86
+
87
+ def tar_img(self):
88
+ self.run_command("tar --format=gnu --exclude BMC_rootfs.tar.gz -czf rootfs_BMC.tar.gz rootfs_BMC.img")
89
+ self.success("tar BMC_rootfs.tar.gz successfully")
90
+
91
+ def run(self):
92
+ # 签名
93
+ self.chdir(self.config.build_path)
94
+ self.sign_img()
95
+ self.prepare_hpm()
96
+ # 压缩
97
+ self.chdir(self.config.work_out)
98
+ self.tar_img()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openubmc-bingo
3
- Version: 0.6.62
3
+ Version: 0.6.63
4
4
  Summary: Tools provided by openubmc
5
5
  Home-page: https://openubmc.cn
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,4 +1,4 @@
1
- bmcgo/__init__.py,sha256=AakrBEE0OLoYJqOtyMmj_oXuKZzZNxOMFT1yjxm-Bqc,562
1
+ bmcgo/__init__.py,sha256=43ixOvkIh39o4ZhQabt-Iqd-IW0mIERU1M3-k75tKt8,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
@@ -232,7 +232,7 @@ bmcgo/tasks/task_buildhpm_ext4.py,sha256=DBZnmU_eb14J0CW_wVoCc9VKnssFF1vXmRhLJQ6
232
232
  bmcgo/tasks/task_create_interface_config.py,sha256=rkFRGLrUgYCics-n1CKwCoQscU2BaRQkH7KP3zwJ6FI,5393
233
233
  bmcgo/tasks/task_download_buildtools.py,sha256=QZpsrm2eaoJ0z5PkdSuHXg1n7L9qPz2s3XAVCnQi-hA,4292
234
234
  bmcgo/tasks/task_download_dependency.py,sha256=2AW4awv_njlTrKy11ygKWekFBXLyS18FLcws8cVXGz0,3169
235
- bmcgo/tasks/task_hpm_envir_prepare.py,sha256=fG_5VAYF8x00VEes1RNBzkd1ucwMRQ_J7qrD-WUH7Ok,4597
235
+ bmcgo/tasks/task_hpm_envir_prepare.py,sha256=KVxiYeLtONpWe6Sh2l7hj09HD3NydrSTx3ycrpT6gLg,3457
236
236
  bmcgo/tasks/task_packet_to_supporte.py,sha256=5VSnC9typxiShCxt8YWWyBVojJ6MaXvgPHiIf6bObuA,4351
237
237
  bmcgo/tasks/task_prepare.py,sha256=K1cb_3lhclRkCYa2wgp5E2FMOd3pC7VHBnm_4L_nrRE,6704
238
238
  bmcgo/tasks/task_sign_and_pack_hpm.py,sha256=dLXTea5zfYg9UwYzhpl6o3eYd4Zg3vyB5GED4QcTvT0,2238
@@ -264,8 +264,8 @@ bmcgo/utils/installations/install_plans/qemu.yml,sha256=lT7aKag60QUH6hTGFKa3hGRq
264
264
  bmcgo/utils/installations/install_plans/studio.yml,sha256=AEspVgsVAnmUdvqZYNCb7SPoUEq_0i61dfpauyguLa4,229
265
265
  bmcgo/utils/installations/installers/apt_installer.py,sha256=nPaCb4cobSi9InN_aHsEPtQ0k4FgsCUWE5_VgBPvcRE,3769
266
266
  bmcgo/utils/installations/installers/pip_installer.py,sha256=dDdios1EQ7fzt90r02pZeoM3jCmjslLzkSvzd2hgRVM,3241
267
- openubmc_bingo-0.6.62.dist-info/METADATA,sha256=OBCy8TdKhZ1JnE_S2_xipqSKFs4awl-a_8TJqfFCOZ8,1010
268
- openubmc_bingo-0.6.62.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
269
- openubmc_bingo-0.6.62.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
270
- openubmc_bingo-0.6.62.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
271
- openubmc_bingo-0.6.62.dist-info/RECORD,,
267
+ openubmc_bingo-0.6.63.dist-info/METADATA,sha256=Cu1hBuatPipUUr2RecPDKy_Q3yClsDgiN6LnVJJ9IjA,1010
268
+ openubmc_bingo-0.6.63.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
269
+ openubmc_bingo-0.6.63.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
270
+ openubmc_bingo-0.6.63.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
271
+ openubmc_bingo-0.6.63.dist-info/RECORD,,