Skip to content

Commit 5200cbb

Browse files
vladsokolovskylsun100
authored andcommitted
Added bfb-tool script
Tool for extracting and repackaging BFBs. bfb-tool <action> --bfb <BFB> --psid <PSID>|--opn <OPN>|--all [-p|--profile <Profile>] [--output-dir <dir>] [-v|--verbose] Signed-off-by: Vladimir Sokolovsky <[email protected]>
1 parent f456939 commit 5200cbb

File tree

5 files changed

+785
-1
lines changed

5 files changed

+785
-1
lines changed

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ confdir = $(sysconfdir)
99
dist_conf_DATA = etc/rshim.conf
1010
dist_sbin_SCRIPTS = scripts/bfb-install \
1111
scripts/bf-reg \
12+
scripts/bfb-tool \
1213
scripts/mlx-mkbfb \
1314
third_party/PLDM-unpack/fwpkg_unpack.py
1415

man/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
#
44

55
man1_MANS = mlx-mkbfb.1
6-
man8_MANS = rshim.8 bfb-install.8 bf-reg.8
6+
man8_MANS = rshim.8 bfb-install.8 bf-reg.8 bfb-tool.8

man/bfb-tool.8

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.\" Manpage for bfb-tool.
2+
.TH bfb-tool 8 "2025-03-13" "bfb-tool" "BFB Management Tool"
3+
4+
.SH NAME
5+
bfb-tool - Tool for extracting and repackaging BFBs
6+
7+
.SH SYNOPSIS
8+
bfb-tool <action> --bfb <BFB> --psid <PSID>|--opn <OPN>|--all [-p|--profile <Profile>] [--output-dir <dir>] [-v|--verbose]
9+
10+
.SH DESCRIPTION
11+
The bfb-tool is used for managing BFBs (bf-bundle/bf-fwbundle). It supports two primary actions: extract and repack.
12+
13+
The repack action involves extracting and building a new BFB for a specific OPN/PSID.
14+
15+
.SH OPTIONS
16+
17+
.TP
18+
.B action
19+
Specify the action to perform. Supported actions are: extract and repack
20+
.RS
21+
.TP
22+
.B extract
23+
Extract the payload from the BFB.
24+
.TP
25+
.B repack
26+
Extract and build a new BFB for a specific OPN/PSID.
27+
.RE
28+
29+
.TP
30+
.B --bfb <BFB>
31+
Specify the BFB file (either bf-bundle or bf-fwbundle).
32+
33+
.TP
34+
.B --psid <PSID>
35+
Specify the PSID of the DPU for payload extraction.
36+
37+
.TP
38+
.B --opn <OPN>
39+
Specify the OPN of the DPU for payload extraction.
40+
41+
.TP
42+
.B --all
43+
Extract or repack for all applicable configurations.
44+
45+
.TP
46+
.B -p, --profile <Profile>
47+
Specify a configuration profile.
48+
49+
.TP
50+
.B --output-dir <dir>
51+
Specify the directory where results will be stored.
52+
53+
.TP
54+
.B -v, --verbose
55+
Enable verbose mode for detailed output.
56+
57+
.SH EXAMPLES
58+
59+
Extract payload from a BFB for a specific PSID:
60+
.sp
61+
bfb-tool extract --bfb bf-fwbundle-2.9.2-40_25.02-prod.bfb --psid MT_0000001070
62+
63+
Repack a BFB for a specific OPN:
64+
.sp
65+
bfb-tool repack --bfb bf-fwbundle-2.9.2-40_25.02-prod.bfb --opn 900-9D3B6-F2SV-PA0_Ax
66+
67+
.SH SEE ALSO
68+
mlx-mkbfb(8)
69+
70+
.SH AUTHOR
71+
Written by Vladimir Sokolovsky <[email protected]>

rshim.spec.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ make
5858
%{__install} -d %{buildroot}%{_mandir}/man8
5959
%{__install} -m 0644 man/rshim.8 %{buildroot}%{_mandir}/man8
6060
%{__install} -m 0644 man/bfb-install.8 %{buildroot}%{_mandir}/man8
61+
%{__install} -m 0644 man/bfb-tool.8 %{buildroot}%{_mandir}/man8
6162
%{__install} -m 0644 man/bf-reg.8 %{buildroot}%{_mandir}/man8
6263
%{__install} -d %{buildroot}%{_sysconfdir}
6364
%{__install} -m 0644 etc/rshim.conf %{buildroot}%{_sysconfdir}
6465
%{__install} -m 0755 scripts/bfb-install %{buildroot}%{_sbindir}
66+
%{__install} -m 0755 scripts/bfb-tool %{buildroot}%{_sbindir}
6567
%{__install} -m 0755 scripts/mlx-mkbfb %{buildroot}%{_sbindir}
6668
%{__install} -m 0755 third_party/PLDM-unpack/fwpkg_unpack.py %{buildroot}%{_sbindir}
6769
%{__install} -m 0755 scripts/bf-reg %{buildroot}%{_sbindir}
@@ -129,12 +131,14 @@ fi
129131
%endif
130132
%{_sbindir}/rshim
131133
%{_sbindir}/bfb-install
134+
%{_sbindir}/bfb-tool
132135
%{_sbindir}/mlx-mkbfb
133136
%{_sbindir}/bf-reg
134137
%{_sbindir}/fwpkg_unpack.py
135138
%{_mandir}/man1/mlx-mkbfb.1.gz
136139
%{_mandir}/man8/rshim.8.gz
137140
%{_mandir}/man8/bfb-install.8.gz
141+
%{_mandir}/man8/bfb-tool.8.gz
138142
%{_mandir}/man8/bf-reg.8.gz
139143
%{_datadir}/selinux/packages/rshim-fix.te
140144

0 commit comments

Comments
 (0)