Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
IOWRT
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
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
Show more breadcrumbs
Markus Gothe
IOWRT
Commits
177d26fb
Commit
177d26fb
authored
3 years ago
by
Jani Juvan
Browse files
Options
Downloads
Patches
Plain Diff
brcm63xx-arm: Use generic function for checking bootloader upgrade
parent
0bfd58a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iopsys-brcm63xx-arm/base-files/lib/upgrade/platform.sh
+7
-40
7 additions, 40 deletions
iopsys-brcm63xx-arm/base-files/lib/upgrade/platform.sh
with
7 additions
and
40 deletions
iopsys-brcm63xx-arm/base-files/lib/upgrade/platform.sh
+
7
−
40
View file @
177d26fb
...
...
@@ -2,51 +2,18 @@ platform_check_image() {
iopsys_check_image
$1
}
platform_compare_bootloader_version
()
{
# FIT image has newer bootloader than on flash => bootlaoder will be updated
# FIT image has same version or older version than on flash => bootloader will not be updated
# Bootloader does not have a version => version is 0 will get updated by new FIT image with a bootloader version
# FIT image does not have a bootloader in it or is old and does not have bootloader version => fit version is 0 and bootloader will not get updated.
# Bootloader does not have version and neither has the FIT-image => will not get updated (0 == 0)
local
iopsys_bootloader_version
=
"0"
local
fit_iopsys_bootloader_version
=
"0"
local
image images
[
-z
"
$1
"
]
&&
return
1
case
"
$(
get_root_device_type
)
"
in
nand
)
local
loader_part
=
/dev/mtd1
;;
emmc
)
local
loader_part
=
/dev/mmcblk0boot0
;;
*
)
return
1
;;
esac
json_init
json_load
"
$(
strings
"
$loader_part
"
|
awk
'/938f0820-2ffb-11e7-bbc9-2f21351ee6fb:/ {$1=""; print $0}'
2> /dev/null |
head
-n1
|
awk
'{$1=$1; print}'
)
"
json_get_vars iopsys_bootloader_version
iopsys_bootloader_version
=
$((
iopsys_bootloader_version
))
images
=
"
$(
fdtextract
-l
"
$1
"
2> /dev/null |
awk
'{print $2}'
| xargs
)
"
for
image
in
$images
;
do
if
fdtextract
-i
"
$image
"
-a
iopsys_bootloader_version
"
$1
"
>
/dev/null 2>&1
;
then
fit_iopsys_bootloader_version
=
"
$(
fdtextract
-i
"
$image
"
-a
iopsys_bootloader_version
"
$1
"
2> /dev/null
)
"
break
fi
done
fit_iopsys_bootloader_version
=
$((
fit_iopsys_bootloader_version
))
if
[
"
$fit_iopsys_bootloader_version
"
-gt
"
$iopsys_bootloader_version
"
]
;
then
return
1
else
return
0
fi
}
platform_do_upgrade
()
{
local
image
=
"
$1
"
local
status
=
0
local
skip_bootloader
=
""
if
!
platform_compare_bootloader_version
"
$1
"
;
then
case
"
$(
get_root_device_type
)
"
in
nand
)
local
loader_part
=
/dev/mtd1
;;
emmc
)
local
loader_part
=
/dev/mmcblk0boot0
;;
*
)
return
1
;;
esac
if
iopsys_is_bootloader_update_needed
"
$image
"
"
$loader_part
"
;
then
UPGRADE_OPT_FORCE_LOADER_UPGRADE
=
1
log
"sysupgrade"
"Bootloader with newer version is available in FIT-image. Enabling bootloader upgrade."
fi
...
...
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