forked from mendersoftware/meta-mender-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move verify boot slot alignment scripts into separate files so we can support the client commit service in non redundant bootloader cases like t210 and cboot cases where no verification is necessary Signed-off-by: Dan Walkes <danwalkes@boulderai.com>
- Loading branch information
Showing
6 changed files
with
67 additions
and
14 deletions.
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
2 changes: 1 addition & 1 deletion
2
meta-mender-tegra/recipes-mender/mender-client/files/mender-client-commit.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
5 changes: 5 additions & 0 deletions
5
meta-mender-tegra/recipes-mender/mender-client/files/verify-boot-rootfs-slot-alignment-cboot
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,5 @@ | ||
#!/bin/sh | ||
nvbootctrl_slot=`nvbootctrl get-current-slot` | ||
echo "Current boot slot is ${nvbootctrl_slot}" | ||
echo "Boot slot misalignment is not possible on cboot based tegra platforms" | ||
exit 0 |
3 changes: 3 additions & 0 deletions
3
...ipes-mender/mender-client/files/verify-boot-rootfs-slot-alignment-no-redundant-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,3 @@ | ||
#!/bin/sh | ||
echo "This tegra platform does not support redundant bootloader" | ||
exit 0 |
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 |
---|---|---|
|
@@ -53,4 +53,4 @@ else | |
echo "Verified" | ||
fi | ||
|
||
exit 0 | ||
exit 0 |
57 changes: 49 additions & 8 deletions
57
meta-mender-tegra/recipes-mender/mender-client/mender-client_%.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 |
---|---|---|
@@ -1,25 +1,66 @@ | ||
RDEPENDS_${PN}_append_tegra = "${@' tegra-bup-payload libubootenv-fake' if d.getVar('PREFERRED_PROVIDER_virtual/bootloader').startswith('cboot') else ''}" | ||
|
||
FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
SRC_URI_append_mender-uboot = " \ | ||
SRC_URI_append = " \ | ||
file://mender \ | ||
file://mender-client-commit.service \ | ||
file://mender-client-commit.sh \ | ||
file://verify-boot-rootfs-slot-alignment-uboot \ | ||
file://verify-boot-rootfs-slot-alignment-cboot \ | ||
file://verify-boot-rootfs-slot-alignment-no-redundant-bootloader \ | ||
" | ||
|
||
FILES_${PN}_append_mender-uboot = " ${systemd_system_unitdir}/mender-client-commit.service" | ||
FILES_${PN}_append_mender-uboot = " ${sysconfdir}/mender/mender-client-commit.sh" | ||
FILES_${PN}_append_mender-uboot = " ${bindir}/mender" | ||
FILES_${PN}_append_mender-uboot = " ${sysconfdir}/mender/verify-boot-rootfs-slot-alignment-uboot" | ||
FILES_${PN} += " \ | ||
${systemd_system_unitdir}/mender-client-commit.service \ | ||
${sysconfdir}/mender/mender-client-commit.sh \ | ||
${bindir}/mender_base \ | ||
${sysconfdir}/mender/verify-boot-rootfs-slot-alignment \ | ||
" | ||
|
||
SYSTEMD_SERVICE_${PN}_append_mender-uboot = " mender-client-commit.service" | ||
SYSTEMD_SERVICE_${PN} += "mender-client-commit.service" | ||
|
||
do_install_append_mender-uboot() { | ||
install_commit_service() { | ||
# Rename the mender binary as mender_override. We'll override with a script that records how it's used | ||
mv ${D}${bindir}/mender ${D}${bindir}/mender_override | ||
install -m 0755 ${WORKDIR}/mender ${D}${bindir}/mender | ||
install -d ${D}${sysconfdir}/mender/scripts | ||
install -m 0755 ${WORKDIR}/mender-client-commit.sh ${D}${sysconfdir}/mender/mender-client-commit.sh | ||
install -m 0644 ${WORKDIR}/mender-client-commit.service ${D}${systemd_system_unitdir}/mender-client-commit.service | ||
install -m 0755 ${WORKDIR}/verify-boot-rootfs-slot-alignment-uboot ${D}${sysconfdir}/mender/verify-boot-rootfs-slot-alignment-uboot | ||
} | ||
|
||
# By default, install the cboot version of the slot alignment verify script | ||
install_slot_align_verify() { | ||
install -m 0755 ${WORKDIR}/verify-boot-rootfs-slot-alignment-cboot ${D}${sysconfdir}/mender/verify-boot-rootfs-slot-alignment | ||
} | ||
|
||
|
||
# When mender-uboot override is defined, install the u-boot version. This one is important for ensuring slots are aligned | ||
# between uboot and the rootfs before taking actions like update | ||
install_slot_align_verify_mender-uboot() { | ||
install -m 0755 ${WORKDIR}/verify-boot-rootfs-slot-alignment-uboot ${D}${sysconfdir}/mender/verify-boot-rootfs-slot-alignment | ||
} | ||
|
||
# This verify script is a no-op, since there's nothing to do if redundant bootloader is not supported | ||
install_slot_align_verify_no-redundant-bootloader() { | ||
install -m 0755 ${WORKDIR}/verify-boot-rootfs-slot-alignment-no-redundant-bootloader ${D}${sysconfdir}/mender/verify-boot-rootfs-slot-alignment | ||
} | ||
|
||
# Tegra 210 (nano) platforms don't support redundant bootloader today | ||
# Use the version of the slot alignment verify script which doesn't use redundant bootloader | ||
do_install_append_tegra210() { | ||
install_commit_service | ||
install_slot_align_verify_no-redundant-bootloader | ||
} | ||
|
||
do_install_append_tegra194() { | ||
install_commit_service | ||
install_slot_align_verify | ||
} | ||
|
||
do_install_append_tegra186() { | ||
install_commit_service | ||
# If building the uboot build, the slot alignment verify script will be installed by override here | ||
install_slot_align_verify | ||
} | ||
|
||
PACKAGE_ARCH = "${MACHINE_ARCH}" |