-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add image-update postinst dir and u-boot update script (#35)
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
wb-utils (3.4.0) stable; urgency=medium | ||
|
||
* image-postinst: add script to update u-boot during factory reset | ||
|
||
-- Nikita Maslov <[email protected]> Thu, 20 Jan 2022 23:29:28 +0300 | ||
|
||
wb-utils (3.3.0) stable; urgency=medium | ||
|
||
* support for factory restore fit on eMMC and new update mode in bootloader | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh -e | ||
|
||
# Called from install_update.sh with arguments | ||
# /path/to/script /path/to/new/rootfs [flag1 [flag2 ...]] | ||
# | ||
# This script may run in Busybox initramfs environment, | ||
# so if you need some special tools or features, use ones from rootfs. | ||
# | ||
# /dev, /proc and /sys are already bind-mounted | ||
# from host system to rootfs tree. | ||
|
||
if [ $# -lt 1 ]; then | ||
echo "Usage: $0 path/to/rootfs [flag1 [flag2 ...]]" | ||
exit 2 | ||
fi | ||
|
||
ROOTFS="$1" | ||
shift | ||
FLAGS="$*" | ||
|
||
flag_set() { | ||
echo "$FLAGS" | grep -- "--$1" >/dev/null 2>&1 | ||
} | ||
|
||
if ! flag_set "factoryreset" ; then | ||
echo "Skipping u-boot update (use factory reset to do it)" | ||
exit | ||
fi | ||
|
||
if [ -e "$ROOTFS/usr/bin/u-boot-install-wb" ] ; then | ||
echo "Trying to install u-boot using u-boot-install-wb from new rootfs" | ||
chroot "$ROOTFS" /usr/bin/u-boot-install-wb --force | ||
else | ||
echo "No u-boot installer found in new rootfs, skipping step" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Wiren Board image update postinst scripts | ||
========================================= | ||
|
||
Scripts from this directory are called in FIT image installation process | ||
after rootfs is extracted and device certificates are recovered. | ||
|
||
Scripts from NEW rootfs are used. | ||
|
||
Scripts are called NOT from this rootfs environment. They may be even | ||
called from Busybox minimal environment (initramfs in FIT images). | ||
If you need some tools from rootfs, use chroot. | ||
/dev, /proc and /sys are already mounted to rootfs here. | ||
|
||
Scripts are called in alphabetic order; you can use it by adding numeric | ||
prefixes to script names (e.g. 99-install-uboot.sh). | ||
|
||
Invokation of these scripts is performed in install_image.sh script | ||
(see https://github.com/wirenboard/wirenboard repo for more details). | ||
|
||
See 10update-u-boot script as an example. |