forked from mendersoftware/meta-mender-community
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tegra: redundant-boot-overrides: add service to replace nv_update_ver…
…ifier With recent versions of L4T, the NVIDIA bootloader on platforms that support A/B redundancy will automatically decrement the priority level of the current boot slot before starting the operating system, expecting that the nv_update_verifier service will reset it if the OS boot is successful. If the system boots three times without resetting the priority, the bootloader will fail over to the alternate boot slot. For Mender, we do not use nv_update_verifier due to some undesirable side-effects, so we mask it from being run at startup. To prevent the failover from occurring, provide our own service to run the necessary commands to both mark the current boot successful and reset the slot priority. Signed-off-by: Matt Madison <matt@madison.systems>
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...er-tegra/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.service.in
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,13 @@ | ||
[Unit] | ||
Description=Update bootloader on successful boot | ||
Wants=mender-client.service | ||
After=mender-client.service | ||
ConditionPathExists=!@LOCALSTATEDIR@/lib/mender/dont-mark-next-boot-successful | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=@SBINDIR@/update-nvbootctrl | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
10 changes: 10 additions & 0 deletions
10
...-mender-tegra/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.sh.in
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,10 @@ | ||
#!/bin/sh | ||
NVBC=@SBINDIR@/nvbootctrl | ||
curslot=$($NVBC get-current-slot) | ||
if [ -n "$curslot" ]; then | ||
if $NVBC set-active-boot-slot $curslot && $NVBC mark-boot-successful; then | ||
exit 0 | ||
fi | ||
fi | ||
echo "ERR: could not update NV boot slots" >&2 | ||
exit 1 |
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