-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jetson: Update next active slots on HUP #245
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c937c7f
balena-image: Install tegra-boot-tools
acostach 6d12e0f
tegra-boot-tools: Enable slot redundancy, mark successful
acostach 873d507
hostapp-update-hooks: Write new bootblobs to next active slot only
acostach f43e1db
tegra-binaries/files: Update NX SD boot blob diff for 32.6.1
acostach 4d9145d
tegra-binaries/tegra194-nxde-sdcard-flash: Adapt boot blob generation…
acostach 9eeec9a
layers/meta-tegra: Update to latest revision to include new cboot fixes
acostach f217f88
tegra-binaries: Adapt NX SD boot blob after cboot update
acostach 18eb121
tegra194-nxde-flash-dry: Update NX Devkit eMMC boot blob for 32.6.1
acostach 6598fad
tegra194-flash-dry: Avoid potential rtcpu firmware load failure
acostach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor type here chaning -> changing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @jakogut , I'll get that fixed |
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acostach is this service running every single boot, even if no HUP happened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @alexgg , indeed, it needs to run every boot, otherwise the tegra bootloaders will consider that the current one failed and decrease the current slot's priority, causing the alternate to be loaded once the retries number is achieved.
Disabling redundant boot after marking a boot sequence as successful unfortunately triggers the default slot _a to be loaded, so the only option for now is to mark every boot if we want to have the kernel and dtb loaded from the selected raw partitions, _a or _b.