Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External 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
Service Desk
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
Johannes Rudolph
lede-mikrotik
Commits
2d61c26f
Commit
2d61c26f
authored
8 years ago
by
Rafał Miłecki
Browse files
Options
Downloads
Patches
Plain Diff
bcm53xx: support SafeLoader format in sysupgrade
Signed-off-by:
Rafał Miłecki
<
rafal@milecki.pl
>
parent
222783c6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
target/linux/bcm53xx/Makefile
+2
-1
2 additions, 1 deletion
target/linux/bcm53xx/Makefile
target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
+34
-1
34 additions, 1 deletion
target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
with
36 additions
and
2 deletions
target/linux/bcm53xx/Makefile
+
2
−
1
View file @
2d61c26f
...
...
@@ -23,7 +23,8 @@ include $(INCLUDE_DIR)/target.mk
KERNELNAME
:=
zImage dtbs
DEFAULT_PACKAGES
+=
swconfig wpad-mini nvram oseama otrx
\
DEFAULT_PACKAGES
+=
swconfig wpad-mini nvram
\
osafeloader oseama otrx
\
kmod-gpio-button-hotplug
\
kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-timer
...
...
This diff is collapsed.
Click to expand it.
target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
+
34
−
1
View file @
2d61c26f
...
...
@@ -59,6 +59,11 @@ platform_identify() {
return
}
if
osafeloader info
"
$1
"
>
/dev/null
;
then
echo
"safeloader"
return
fi
echo
"unknown"
}
...
...
@@ -102,6 +107,8 @@ platform_check_image() {
error
=
1
fi
;;
"safeloader"
)
;;
"seama"
)
local
img_signature
=
$(
oseama info
"
$1
"
|
grep
"Meta entry:.*signature="
|
sed
"s/.*=//"
)
local
dev_signature
=
$(
platform_expected_image
)
...
...
@@ -118,6 +125,13 @@ platform_check_image() {
}
;;
"trx"
)
local
expected
=
$(
platform_expected_image
)
[
"
$expected
"
==
"safeloader"
]
&&
{
echo
"This device expects SafeLoader format and may not work with TRX"
error
=
1
}
if
!
otrx check
"
$1
"
;
then
echo
"Invalid (corrupted?) TRX firmware"
error
=
1
...
...
@@ -245,7 +259,7 @@ platform_pre_upgrade_seama() {
}
platform_pre_upgrade
()
{
export
RAMFS_COPY_BIN
=
"
${
RAMFS_COPY_BIN
}
/usr/bin/oseama /bin/sed"
export
RAMFS_COPY_BIN
=
"
${
RAMFS_COPY_BIN
}
/usr/bin/osafeloader
/usr/bin/oseama /bin/sed"
local
file_type
=
$(
platform_identify
"
$1
"
)
...
...
@@ -270,6 +284,24 @@ platform_trx_from_cybertan_cmd() {
echo
-n
dd
bs
=
32
skip
=
1
}
platform_img_from_safeloader
()
{
local dir
=
"/tmp/sysupgrade-bcm53xx"
# Extract partitions from SafeLoader
rm
-fR
$dir
mkdir
-p
$dir
osafeloader extract
"
$1
"
\
-p
"os-image"
\
-o
$dir
/os-image
osafeloader extract
"
$1
"
\
-p
"file-system"
\
-o
$dir
/file-system
mtd write
$dir
/file-system rootfs
echo
-n
$dir
/os-image
}
platform_img_from_seama
()
{
local dir
=
"/tmp/sysupgrade-bcm53xx"
local
offset
=
$(
oseama info
"
$1
"
-e
0 |
grep
"Entity offset:"
|
sed
"s/.*:
\s
*//"
)
...
...
@@ -298,6 +330,7 @@ platform_do_upgrade() {
case
"
$file_type
"
in
"chk"
)
cmd
=
$(
platform_trx_from_chk_cmd
"
$trx
"
)
;;
"cybertan"
)
cmd
=
$(
platform_trx_from_cybertan_cmd
"
$trx
"
)
;;
"safeloader"
)
trx
=
$(
platform_img_from_safeloader
"
$trx
"
)
;;
"seama"
)
trx
=
$(
platform_img_from_seama
"
$trx
"
)
;;
esac
...
...
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