Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
dd245fae
Commit
dd245fae
authored
Jun 09, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rootfs: add printouts during firmware update
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
a09620c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
wrs-boot-procedure
userspace/rootfs_override/etc/init.d/wrs-boot-procedure
+22
-4
No files found.
userspace/rootfs_override/etc/init.d/wrs-boot-procedure
View file @
dd245fae
...
...
@@ -148,16 +148,30 @@ if [ -f /update/$WRS_FW -o -f /update/$WRS_USR ]; then
# check if we have an initramfs and/or kernel too
# FIXME: should rather check first and save a backup
cd
/boot
# The commands may fail because we miss wrs-firmware.tar or the content
for
file
in
$WRS_KER
$WRS_RAMFS
;
do
tar
-xf
/update/
$WRS_FW
$file
&&
reboot
=
true
done
if
[
-f
/update/
$WRS_FW
]
;
then
# The commands may fail because we miss wrs-firmware.tar or the content
for
file
in
$WRS_KER
$WRS_RAMFS
;
do
echo
-n
"Trying to extract
$file
..."
|
$TEE
/dev/ttyGS0
tar
-xf
/update/
$WRS_FW
$file
&> /dev/null
ret
=
$?
if
[
$ret
=
0
]
;
then
echo
" done"
|
$TEE
/dev/ttyGS0
reboot
=
true
else
echo
" not present in anchive"
|
$TEE
/dev/ttyGS0
fi
done
fi
# Do the same for barebox.bin, so we can upgrade it all in a step
cd
/tmp
tar
-xf
/update/
$WRS_FW
$WRS_BB
if
[
-f
$WRS_BB
]
;
then
echo
-n
"Updating barebox..."
|
$TEE
/dev/ttyGS0
cat
$WRS_BB
>
/dev/mtd3
rm
$WRS_BB
echo
" done"
|
$TEE
/dev/ttyGS0
fi
# done: rename the firmware file (whole or usr, whatever is there)
...
...
@@ -176,20 +190,24 @@ fi
# Allow replacing the kernel or initramfs alone (new in v4.1 of wr-switch-sw)
for
file
in
$WRS_KER
$WRS_RAMFS
;
do
if
[
-f
/update/
$file
]
;
then
echo
-n
"Replacing
$file
..."
|
$TEE
/dev/ttyGS0
cp
/update/
$file
/boot
;
sync
mv
/update/current-
$file
/update/previous-
${
file
}
2> /dev/null
mv
/update/
$file
/update/current-
$file
reboot
=
true
echo
" done"
|
$TEE
/dev/ttyGS0
fi
done
# Allow changing the boot loader (new in v4.1 of wr-switch-sw)
if
[
-f
/update/
$WRS_BB
]
;
then
echo
-n
"Updating barebox..."
|
$TEE
/dev/ttyGS0
cat
/update/
$WRS_BB
>
/dev/mtd3
mv
/update/current-
$WRS_BB
/update/previous-
$WRS_BB
mv
/update/
$WRS_BB
/update/current-
$WRS_BB
reboot
=
true
change_update_date
=
true
echo
" done"
|
$TEE
/dev/ttyGS0
fi
if
$change_update_date
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment