Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broadcom-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Broadcom
broadcom-utils
Commits
40d54a94
Commit
40d54a94
authored
5 years ago
by
Ronny Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Turns out all UBI volumes need to have a unique name.
parent
851e166b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
brcm_fw_tool/image-ubi.c
+13
-2
13 additions, 2 deletions
brcm_fw_tool/image-ubi.c
with
13 additions
and
2 deletions
brcm_fw_tool/image-ubi.c
+
13
−
2
View file @
40d54a94
...
...
@@ -226,14 +226,21 @@ int ubi_erase_volume(int volId)
int
ubi_create_volume
(
int
volId
,
long
long
size
)
{
struct
ubi_mkvol_request
mkReq
;
char
*
nodePath
;
char
*
nodePath
,
*
name
;
if
(
volId
<
0
||
volId
>=
UBI_MAX_VOLUMES
)
return
-
1
;
if
(
size
<=
0ll
)
return
-
1
;
// Generate a system unique name for the volume.
name
=
calloc
(
1
,
strlen
(
ubiStr3
)
+
8
);
snprintf
(
name
,
strlen
(
ubiStr3
)
+
8
,
"%s_%d"
,
ubiStr3
,
volId
);
memset
(
&
mkReq
,
0
,
sizeof
(
mkReq
));
mkReq
.
vol_id
=
volId
;
mkReq
.
alignment
=
1
;
mkReq
.
bytes
=
size
;
mkReq
.
vol_type
=
UBI_STATIC_VOLUME
;
mkReq
.
name
=
ubiStr3
;
mkReq
.
name
=
name
;
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
errno
=
0
;
...
...
@@ -241,6 +248,7 @@ int ubi_create_volume(int volId, long long size)
fprintf
(
stderr
,
"Error creating UBI volume %d %s: %s
\n
"
,
volId
,
nodePath
,
strerror
(
errno
));
free
(
nodePath
);
free
(
name
);
return
-
1
;
}
else
if
(
verbose
)
{
...
...
@@ -248,6 +256,7 @@ int ubi_create_volume(int volId, long long size)
}
free
(
nodePath
);
free
(
name
);
return
0
;
}
...
...
@@ -791,6 +800,8 @@ int gen_image_ubi(const char *in_file, char *sequence_number)
if
(
!
res
)
res
=
meta_manage_vols
();
unlink
(
"/tmp/ronny"
);
// Possibly erase temporary file.
// Close the UBI library.
if
(
libubi
)
{
for
(
i
=
0
;
i
<
MAX_METAS
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment