-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from balena-os/jetson_select_ab_slots_on_update
jetson: Update next active slots on HUP
- Loading branch information
Showing
13 changed files
with
302 additions
and
61 deletions.
There are no files selected for viewing
Binary file added
BIN
+1.5 KB
layers/meta-balena-jetson/recipes-bsp/tegra-binaries/files/boot0_t194_agx.bindiff
Binary file not shown.
Binary file modified
BIN
+112 Bytes
(100%)
layers/meta-balena-jetson/recipes-bsp/tegra-binaries/files/boot0_t194_nx_emmc.bindiff
Binary file not shown.
Binary file modified
BIN
+112 Bytes
(100%)
layers/meta-balena-jetson/recipes-bsp/tegra-binaries/files/boot0_t194_nx_sd.bindiff
Binary file not shown.
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
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
9 changes: 9 additions & 0 deletions
9
layers/meta-balena-jetson/recipes-bsp/tools/files/mark-active-slot.service
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,9 @@ | ||
[Unit] | ||
Description=Mark boot slot as successful once the system is up | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/sh -c /usr/bin/mark_active_tegra_boot_slot.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
21 changes: 21 additions & 0 deletions
21
layers/meta-balena-jetson/recipes-bsp/tools/files/mark_active_tegra_boot_slot.sh
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,21 @@ | ||
#!/bin/sh | ||
|
||
# Ensure reduntant boot is enabled | ||
if /usr/bin/tegra-boot-control -e ; then | ||
echo "Tegra redundant boot: enabled successfully" | ||
else | ||
echo "Tegra redundant boot: failed to enable!" | ||
fi; | ||
|
||
# If the boot process was | ||
# able to start the rollback service, we can | ||
# mark the current boot as successful | ||
# Othrwise if not marked, the old kernel | ||
# and dtb slots will be used after 3 attempts | ||
# as per https://forums.developer.nvidia.com/t/failed-bootloader-watchdog-recovery/154380/5 | ||
if /usr/bin/tegra-boot-control -m ; then | ||
echo "Tegra redundant boot: marked successful boot" | ||
else | ||
echo "Tegra redundant boot: failed to record successful boot" | ||
fi | ||
|
33 changes: 33 additions & 0 deletions
33
layers/meta-balena-jetson/recipes-bsp/tools/tegra-boot-tools_%.bbappend
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,33 @@ | ||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | ||
|
||
# libuuid was split from the main | ||
# util-linux later, after Dunfell | ||
DEPENDS:remove = "util-linux-libuuid" | ||
DEPENDS:append = " util-linux" | ||
|
||
SRC_URI += " \ | ||
file://mark_active_tegra_boot_slot.sh \ | ||
file://mark-active-slot.service \ | ||
" | ||
|
||
# Once redundant boot is enabled, each boot | ||
# needs to be marked as successful once | ||
# the system is up to prevent the tegra | ||
# bootloaders from decrementing boot count | ||
# and reverting to the previous slot. If | ||
# redundant boot is disabled, default slot _a | ||
# is used. | ||
SYSTEMD_PACKAGES += " ${PN}" | ||
SYSTEMD_SERVICE:${PN} += " mark-active-slot.service" | ||
|
||
# Upon rollback to a release that does not have | ||
# this feature implemented, the _a slots will | ||
# be used by default, without chaning behavior. | ||
do_install:append() { | ||
install -m 0755 ${WORKDIR}/mark_active_tegra_boot_slot.sh ${D}${bindir}/ | ||
install -m 0644 ${WORKDIR}/mark-active-slot.service ${D}${systemd_unitdir}/system/ | ||
} | ||
|
||
FILES:${PN} += " \ | ||
/lib/systemd/system/mark-active-slot.service \ | ||
" |
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
Oops, something went wrong.