Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
targets
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
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
Show more breadcrumbs
Feed
targets
Commits
263f731b
Commit
263f731b
authored
4 years ago
by
Sukru Senli
Browse files
Options
Downloads
Patches
Plain Diff
ramips: change function names in upgrade script
parent
c73b4de1
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
iopsys-ramips/base-files/lib/upgrade/iopsys.sh
+16
-16
16 additions, 16 deletions
iopsys-ramips/base-files/lib/upgrade/iopsys.sh
with
16 additions
and
16 deletions
iopsys-ramips/base-files/lib/upgrade/iopsys.sh
+
16
−
16
View file @
263f731b
...
@@ -22,7 +22,7 @@ log() {
...
@@ -22,7 +22,7 @@ log() {
}
}
#--------------------------------------------------------------
#--------------------------------------------------------------
is_i
nten
o_image
()
{
is_io
p
_image
()
{
local
magic
local
magic
[
-n
"
$1
"
]
||
return
1
[
-n
"
$1
"
]
||
return
1
...
@@ -39,7 +39,7 @@ is_inteno_image() {
...
@@ -39,7 +39,7 @@ is_inteno_image() {
#--------------------------------------------------------------
#--------------------------------------------------------------
get_image_type
()
{
get_image_type
()
{
if
is_i
nten
o_image
"
$1
"
;
then
if
is_io
p
_image
"
$1
"
;
then
echo
"INTENO"
echo
"INTENO"
else
else
echo
"UNKNOWN"
echo
"UNKNOWN"
...
@@ -49,7 +49,7 @@ get_image_type() {
...
@@ -49,7 +49,7 @@ get_image_type() {
#--------------------------------------------------------------
#--------------------------------------------------------------
get_i
nten
o_tag_val
()
{
get_io
p
_tag_val
()
{
local
from
=
"
$1
"
local
from
=
"
$1
"
local
tag
=
"
$2
"
local
tag
=
"
$2
"
local
val
local
val
...
@@ -64,21 +64,21 @@ get_inteno_tag_val() {
...
@@ -64,21 +64,21 @@ get_inteno_tag_val() {
#--------------------------------------------------------------
#--------------------------------------------------------------
get_image_model_name
()
{
get_image_model_name
()
{
get_i
nten
o_tag_val
$1
model
get_io
p
_tag_val
$1
model
}
}
#--------------------------------------------------------------
#--------------------------------------------------------------
get_image_customer
()
{
get_image_customer
()
{
get_i
nten
o_tag_val
$1
customer
get_io
p
_tag_val
$1
customer
}
}
#--------------------------------------------------------------
#--------------------------------------------------------------
get_image_chip_id
()
{
get_image_chip_id
()
{
get_i
nten
o_tag_val
$1
chip
get_io
p
_tag_val
$1
chip
}
}
...
@@ -91,7 +91,7 @@ get_section_size_v3() {
...
@@ -91,7 +91,7 @@ get_section_size_v3() {
local
sec
=
"
$2
"
# Named section
local
sec
=
"
$2
"
# Named section
local
sz
local
sz
sz
=
"
$(
get_i
nten
o_tag_val
$from
$sec
)
"
sz
=
"
$(
get_io
p
_tag_val
$from
$sec
)
"
[
-z
"
$sz
"
]
&&
sz
=
0
[
-z
"
$sz
"
]
&&
sz
=
0
echo
-n
$sz
echo
-n
$sz
}
}
...
@@ -143,8 +143,8 @@ get_section_offset_v5() {
...
@@ -143,8 +143,8 @@ get_section_offset_v5() {
local
from
=
"
$1
"
# Image file
local
from
=
"
$1
"
# Image file
local
sec
=
"
$2
"
# Named section
local
sec
=
"
$2
"
# Named section
ofs
=
"
$(
get_i
nten
o_tag_val
$from
${
sec
}
ofs
)
"
ofs
=
"
$(
get_io
p
_tag_val
$from
${
sec
}
ofs
)
"
filesize
=
"
$(
get_i
nten
o_tag_val
$from
size
)
"
filesize
=
"
$(
get_io
p
_tag_val
$from
size
)
"
[
-n
"
$ofs
"
]
||
ofs
=
0
[
-n
"
$ofs
"
]
||
ofs
=
0
[
-n
"
$filesize
"
]
||
filesize
=
0
[
-n
"
$filesize
"
]
||
filesize
=
0
[
$ofs
-ge
1024
-a
$ofs
-lt
$filesize
]
||
ofs
=
0
# Verify tag is less than file size
[
$ofs
-ge
1024
-a
$ofs
-lt
$filesize
]
||
ofs
=
0
# Verify tag is less than file size
...
@@ -159,7 +159,7 @@ get_section_size() {
...
@@ -159,7 +159,7 @@ get_section_size() {
local
from
=
"
$1
"
# Image file
local
from
=
"
$1
"
# Image file
local
ver
local
ver
ver
=
$(
get_i
nten
o_tag_val
"
$from
"
version
)
ver
=
$(
get_io
p
_tag_val
"
$from
"
version
)
if
[
$ver
-ge
3
-a
$ver
-le
8
]
;
then
# Version 4 differs from 3 in having a larger cfe.
if
[
$ver
-ge
3
-a
$ver
-le
8
]
;
then
# Version 4 differs from 3 in having a larger cfe.
get_section_size_v3
"
$@
"
||
return
# Version 5 appear in .y3 and have section offsets.
get_section_size_v3
"
$@
"
||
return
# Version 5 appear in .y3 and have section offsets.
else
else
...
@@ -175,7 +175,7 @@ get_section_offset() {
...
@@ -175,7 +175,7 @@ get_section_offset() {
local
from
=
"
$1
"
# Image file
local
from
=
"
$1
"
# Image file
local
ver
local
ver
ver
=
$(
get_i
nten
o_tag_val
"
$from
"
version
)
ver
=
$(
get_io
p
_tag_val
"
$from
"
version
)
if
[
$ver
-ge
3
-a
$ver
-le
4
]
;
then
# Version 4 differs from 3 in having a larger cfe.
if
[
$ver
-ge
3
-a
$ver
-le
4
]
;
then
# Version 4 differs from 3 in having a larger cfe.
get_section_offset_v3
"
$@
"
||
return
get_section_offset_v3
"
$@
"
||
return
elif
[
$ver
-ge
5
-a
$ver
-le
8
]
;
then
# Version 5 appear in .y3 and have section offsets.
elif
[
$ver
-ge
5
-a
$ver
-le
8
]
;
then
# Version 5 appear in .y3 and have section offsets.
...
@@ -329,7 +329,7 @@ get_bootbank() {
...
@@ -329,7 +329,7 @@ get_bootbank() {
check_crc
()
{
check_crc
()
{
local
from
=
"
$1
"
local
from
=
"
$1
"
case
$(
get_i
nten
o_tag_val
"
$from
"
integrity
)
in
case
$(
get_io
p
_tag_val
"
$from
"
integrity
)
in
MD5SUM
)
MD5SUM
)
tail
-c
32
"
$from
"
>
"
${
from
}
-
$$
.md5"
tail
-c
32
"
$from
"
>
"
${
from
}
-
$$
.md5"
echo
" *-"
>>
"
${
from
}
-
$$
.md5"
echo
" *-"
>>
"
${
from
}
-
$$
.md5"
...
@@ -407,7 +407,7 @@ iopsys_check_image() {
...
@@ -407,7 +407,7 @@ iopsys_check_image() {
;;
;;
esac
esac
is_i
nten
o_image
"
$from
"
||
{
is_io
p
_image
"
$from
"
||
{
echo
"Header magic failed"
echo
"Header magic failed"
return
1
return
1
}
}
...
@@ -442,12 +442,12 @@ iopsys_check_image() {
...
@@ -442,12 +442,12 @@ iopsys_check_image() {
k_sz
=
$(
get_section_size
$from
vmlinux
)
||
return
1
k_sz
=
$(
get_section_size
$from
vmlinux
)
||
return
1
ubi_sz
=
$(
get_section_size
$from
ubi
)
||
return
1
ubi_sz
=
$(
get_section_size
$from
ubi
)
||
return
1
ubifs_sz
=
$(
get_section_size
$from
ubifs
)
||
return
1
ubifs_sz
=
$(
get_section_size
$from
ubifs
)
||
return
1
ver
=
$(
get_i
nten
o_tag_val
"
$from
"
version
)
||
return
1
ver
=
$(
get_io
p
_tag_val
"
$from
"
version
)
||
return
1
if
[
$ver
-eq
3
]
;
then
if
[
$ver
-eq
3
]
;
then
echo
"y2 image unsupported"
echo
"y2 image unsupported"
return
1
return
1
fi
fi
filesize
=
$(
get_i
nten
o_tag_val
"
$from
"
size
)
||
return
1
filesize
=
$(
get_io
p
_tag_val
"
$from
"
size
)
||
return
1
if
[
$ver
-le
4
-a
$cfe_sz
-eq
0
-a
$k_sz
-eq
0
-a
$ubi_sz
-eq
0
\
if
[
$ver
-le
4
-a
$cfe_sz
-eq
0
-a
$k_sz
-eq
0
-a
$ubi_sz
-eq
0
\
-a
$ubifs_sz
-eq
0
]
;
then
-a
$ubifs_sz
-eq
0
]
;
then
echo
"Unexpected image file contents, upgrade aborted!"
echo
"Unexpected image file contents, upgrade aborted!"
...
@@ -615,7 +615,7 @@ perhaps_image_self_upgrade() {
...
@@ -615,7 +615,7 @@ perhaps_image_self_upgrade() {
# the image do a self upgrade.) Instead we try a best effort
# the image do a self upgrade.) Instead we try a best effort
# approach. Are there SOME backwards compatible parts we
# approach. Are there SOME backwards compatible parts we
# recognize? Then try to satisfy with those parts only.
# recognize? Then try to satisfy with those parts only.
is_i
nten
o_image
"
$from
"
||
return
0
is_io
p
_image
"
$from
"
||
return
0
head
-c
1024
"
$from
"
| strings |
\
head
-c
1024
"
$from
"
| strings |
\
awk
'$1 ~ "^version" && $2 ~ "[[:digit:]]+" {
awk
'$1 ~ "^version" && $2 ~ "[[:digit:]]+" {
if($2 < 7) { exit 1; }; # .y3 version 7 at least.
if($2 < 7) { exit 1; }; # .y3 version 7 at least.
...
...
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