Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Mayer
u-boot
Commits
bd62e241
Commit
bd62e241
authored
8 years ago
by
Andrej Rosano
Committed by
Tom Rini
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
common: Fix support for environment file in EXT4
Signed-off-by:
Andrej Rosano
<
andrej@inversepath.com
>
parent
ec048369
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/env_ext4.c
+9
-7
9 additions, 7 deletions
common/env_ext4.c
with
9 additions
and
7 deletions
common/env_ext4.c
+
9
−
7
View file @
bd62e241
...
...
@@ -25,6 +25,7 @@
#include
<environment.h>
#include
<linux/stddef.h>
#include
<malloc.h>
#include
<memalign.h>
#include
<search.h>
#include
<errno.h>
#include
<ext4fs.h>
...
...
@@ -49,7 +50,7 @@ int env_init(void)
int
saveenv
(
void
)
{
env_t
env_new
;
block_dev_desc_t
*
dev_desc
=
NULL
;
struct
blk_desc
*
dev_desc
=
NULL
;
disk_partition_t
info
;
int
dev
,
part
;
int
err
;
...
...
@@ -58,13 +59,13 @@ int saveenv(void)
if
(
err
)
return
err
;
part
=
get_device_
and_
part
ition
(
EXT4_ENV_INTERFACE
,
part
=
blk_
get_device_part
_str
(
EXT4_ENV_INTERFACE
,
EXT4_ENV_DEVICE_AND_PART
,
&
dev_desc
,
&
info
,
1
);
if
(
part
<
0
)
return
1
;
dev
=
dev_desc
->
dev
;
dev
=
dev_desc
->
dev
num
;
ext4fs_set_blk_dev
(
dev_desc
,
&
info
);
if
(
!
ext4fs_mount
(
info
.
size
))
{
...
...
@@ -90,18 +91,19 @@ int saveenv(void)
void
env_relocate_spec
(
void
)
{
ALLOC_CACHE_ALIGN_BUFFER
(
char
,
buf
,
CONFIG_ENV_SIZE
);
block_dev_desc_t
*
dev_desc
=
NULL
;
struct
blk_desc
*
dev_desc
=
NULL
;
disk_partition_t
info
;
int
dev
,
part
;
int
err
;
loff_t
off
;
part
=
get_device_
and_
part
ition
(
EXT4_ENV_INTERFACE
,
part
=
blk_
get_device_part
_str
(
EXT4_ENV_INTERFACE
,
EXT4_ENV_DEVICE_AND_PART
,
&
dev_desc
,
&
info
,
1
);
if
(
part
<
0
)
goto
err_env_relocate
;
dev
=
dev_desc
->
dev
;
dev
=
dev_desc
->
dev
num
;
ext4fs_set_blk_dev
(
dev_desc
,
&
info
);
if
(
!
ext4fs_mount
(
info
.
size
))
{
...
...
@@ -110,7 +112,7 @@ void env_relocate_spec(void)
goto
err_env_relocate
;
}
err
=
ext4_read_file
(
EXT4_ENV_FILE
,
buf
,
0
,
CONFIG_ENV_SIZE
);
err
=
ext4_read_file
(
EXT4_ENV_FILE
,
buf
,
0
,
CONFIG_ENV_SIZE
,
&
off
);
ext4fs_close
();
if
(
err
==
-
1
)
{
...
...
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