diff --git a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv-fake/fw_printenv b/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv-fake/fw_printenv deleted file mode 100644 index f2b92d9..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv-fake/fw_printenv +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -quiet= -if [ "$1" = "-n" ]; then - quiet="yes" - shift - if [ -z "$1" ]; then - echo "ERR: missing var name with -n" >&2 - exit 1 - fi -fi -if [ -z "$1" ]; then - echo "mender_boot_part=`tegra-boot-control --current-slot`" - exit 0 -fi -while [ -n "$1" ]; do - case "$1" in - mender_boot_part|mender_boot_part_hex) - [ -n "$quiet" ] || echo -n "$1=" - tegra-boot-control --current-slot - ;; - mender_uboot_separator) - [ -n "$quiet" ] || echo -n "$1=" - echo "something other than just 1" - ;; - upgrade_available) - [ -n "$quiet" ] || echo -n "$1=" - if [ -e "/var/lib/mender/upgrade_available" ]; then - echo "1" - else - echo "0" - fi - ;; - *) - echo "ERR: no such variable: $1" >&2 - exit 1 - esac - shift -done diff --git a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv-fake_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv-fake_%.bbappend deleted file mode 100644 index 44858b5..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv-fake_%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" - -RDEPENDS_${PN} += "tegra-boot-tools" diff --git a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv_%.bbappend deleted file mode 100644 index a757051..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/libubootenv_%.bbappend +++ /dev/null @@ -1,25 +0,0 @@ -# XXX --- Temporary until these changes go upstream -MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_tegra210 = "${@'3866624' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '3801088'}" -# --- XXX - -# Mender, for some reason, decided that libubootenv should supply the -# fw_env.config file, rather than keeping libubootenv generic and -# having the already platform-dependent u-boot recipe supply both -# that config file and the initial environment file, as was intended. -# We'll need the initial environment file to support bootloader -# updates that relocate the u-boot environment storage location, -# so remove this RPROVIDES so it can be supplied by the u-boot -# recipe. The config file is still provided by this recipe, -# however. -RPROVIDES_${PN}_remove_tegra = "u-boot-default-env" - -# Also stash an extra copy of the fw_env.config file in the -# rootfs so we can compare it to the currently-installed one -# in a state script, to see if we need to take steps to save -# and restore u-boot environment variables during a bootloader -# update. -do_install_append_tegra() { - install -d ${D}${datadir}/u-boot - install -m 0644 ${WORKDIR}/fw_env.config ${D}${datadir}/u-boot/ -} -FILES_${PN}_append_tegra = " ${datadir}/u-boot" diff --git a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/u-boot-tegra_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/u-boot-tegra_%.bbappend deleted file mode 100644 index 472dab0..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-bsp/u-boot/u-boot-tegra_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# Work around Mender's installation of this file (symlink) -# in its libubootenv bbappend. -do_install_append_mender-uboot() { - rm -f ${D}${sysconfdir}/fw_env.config -} - diff --git a/dynamic-layers/meta-mender-tegra/recipes-core/initrdscripts/tegra-minimal-init/platform-preboot-cboot.sh b/dynamic-layers/meta-mender-tegra/recipes-core/initrdscripts/tegra-minimal-init/platform-preboot-cboot.sh deleted file mode 100644 index 88574cb..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-core/initrdscripts/tegra-minimal-init/platform-preboot-cboot.sh +++ /dev/null @@ -1,23 +0,0 @@ -slotsfx="" -mayberoot="" -for bootarg in `cat /proc/cmdline`; do - case "$bootarg" in - boot.slot_suffix=*) slotsfx="${bootarg##boot.slot_suffix=}" ;; - root=*) mayberoot="${bootarg##root=}" ;; - ro) opt="ro" ;; - rootwait) wait="yes" ;; - esac -done -rootdev=`blkid -l -t PARTLABEL=APP$slotsfx | cut -d: -f1` -if [ -z "$rootdev" ]; then - if [ -n "$mayberoot" ]; then - rootdev="$mayberoot" - else - rootdev="/dev/mmcblk0p1" - fi -fi - -if which bootcountcheck >/dev/null 2>&1; then - bootcountcheck -fi - diff --git a/dynamic-layers/meta-mender-tegra/recipes-core/initrdscripts/tegra-minimal-init_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-core/initrdscripts/tegra-minimal-init_%.bbappend deleted file mode 100644 index 6ecf3b9..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-core/initrdscripts/tegra-minimal-init_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" - -EXTRADEPS = "" -EXTRADEPS_tegra = "tegra-boot-tools-earlyboot" -EXTRADEPS_tegra210 = "" -RDEPENDS_${PN} += "${EXTRADEPS}" diff --git a/dynamic-layers/meta-mender-tegra/recipes-kernel/linux/linux-tegra_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-kernel/linux/linux-tegra_%.bbappend deleted file mode 100644 index 411bc09..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-kernel/linux/linux-tegra_%.bbappend +++ /dev/null @@ -1,13 +0,0 @@ -# Undo the following additions made by meta-mender-core, -# which does not apply to tegra platforms -SRC_URI_remove_mender-grub = "${@if_kernel_recipe(' file://enable_efi_stub.cfg', '', d)}" - -# Rather ugly hack to ensure that meta-mender-core's files directory -# is also removed from consideration, since linux-yocto.bbclass adds -# all directories that contain config fragments into its file-cksums -# list, which needlessly (for us) changes the task hash. -python() { - extrapaths = d.getVar('FILESEXTRAPATHS').split(':') - newpaths = ':'.join([path for path in extrapaths if not path.endswith('meta-mender-core/recipes-kernel/linux/files')]) - d.setVar('FILESEXTRAPATHS', newpaths) -} diff --git a/dynamic-layers/meta-mender-tegra/recipes-mender/mender-client/mender-client_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-mender/mender-client/mender-client_%.bbappend deleted file mode 100644 index ab28ded..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-mender/mender-client/mender-client_%.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -EXTRADEPS = "" -EXTRADEPS_tegra = "tegra-boot-tools tegra-boot-tools-nvbootctrl tegra-boot-tools-lateboot" -EXTRADEPS_tegra210 = "" -RDEPENDS_${PN} += "${EXTRADEPS}" diff --git a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot b/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot deleted file mode 100644 index 12b5fe2..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -LABELCHARS="AB" - -echo "Verifying Tegra bootloader update" -curslot=`tegra-boot-control --current-slot` -cfglbl="\"RootfsPart${LABELCHARS:$curslot:1}\"" -devnam=`grep -h "$cfglbl:" /etc/mender/mender.conf /var/lib/mender/mender.conf | cut -d: -f2 | cut -d, -f1 | tr -d '" '` -if [ -z "$devnam" ]; then - echo "ERR: could not determine expected mender device name for boot slot $curslot" >&2 - exit 1 -fi - -# If the rootfs partitions are eMMC/SDcard device names, verify that -# the mender boot partition in U-Boot and the Tegra bootloader boot -# slot match. If not, the Tegra bootloader update failed, and we -# need to reset the boot slot to get the Tegra bootloader and Mender -# resynchronized. -if [ "${devnam##/dev/mmcblk}" != "${devnam}" ]; then - bootpart=`fw_printenv -n mender_boot_part` - if [ -z "$bootpart" ]; then - echo "ERR: could not retrieve mender_boot_part from U-Boot env" >&2 - exit 1 - fi - devnampart=`expr "${devnam##/dev/mmcblk*p}" \+ 0 2>/dev/null` - if [ -z "$devnampart" ]; then - echo "ERR: could not extract partition number from rootfs device name" >&2 - exit 1 - fi - if [ $bootpart -ne $devnampart ]; then - altslot=$(expr 1 - $curslot) - echo "Detected Tegra bootloader upgrade failure, resetting boot slot to $altslot" >&2 - echo "*** Reboot required ***" >&2 - tegra-boot-control --set-active $altslot - exit 1 - fi -fi -exit 0 diff --git a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script b/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script deleted file mode 100644 index 5779ac8..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -mnt= -LABELCHARS="AB" -COPY_MACHINE_ID=@COPY_MACHINE_ID@ - -cleanup() { - [ -n "$mnt" ] || return - for d in sys proc dev run; do - if mountpoint -q "${mnt}/${d}"; then - umount "${mnt}/${d}" >/dev/null 2>&1 || true - fi - done - if mountpoint -q "$mnt"; then - umount "$mnt" >/dev/null 2>&1 || true - fi - rmdir "$mnt" >/dev/null 2>&1 || true -} - -echo "Installing NVIDIA bootloader update payload" - -if which tegra-boot-control >/dev/null 2>&1; then - current_slot=`tegra-boot-control --current-slot` -else - current_slot=`nvbootctrl get-current-slot` -fi -echo "Current boot slot: $current_slot" -otherslot=`expr 1 - $current_slot` -cfglbl="\"RootfsPart${LABELCHARS:$otherslot:1}\"" -devnam=`grep -h "$cfglbl:" /etc/mender/mender.conf /var/lib/mender/mender.conf | cut -d: -f2 | cut -d, -f1 | tr -d '" '` -if [ -z "$devnam" ]; then - echo "ERR: could not determine device name for boot slot $otherslot" >&2 - exit 1 -fi -mnt=`mktemp -d -t nvbup.XXXXXX` -if [ -z "$mnt" -o ! -d "$mnt" ]; then - echo "ERR: could not create directory for mounting install partition" >&2 - exit 1 -fi -mount -o ro "$devnam" "$mnt" -if [ ! -d "${mnt}/opt/ota_package" ]; then - echo "ERR: Missing /opt/ota_package directory in installed rootfs" >&2 - cleanup - exit 1 -fi -# tegra-bootloader-update needs access to these filesystems, -# so bind-mount them into the new rootfs for the chroot -mount --bind /sys "${mnt}/sys" -mount --bind /proc "${mnt}/proc" -mount --bind /dev "${mnt}/dev" -# for tegra-bootinfo -mount --bind /run "${mnt}/run" - -if ! chroot "${mnt}" /usr/bin/tegra-bootloader-update /opt/ota_package/bl_update_payload; then - echo "ERR: bootloader update failed" >&2 - cleanup - exit 1 -fi -echo "Successful bootloader update" -if [ -n "$COPY_MACHINE_ID" ]; then - curid=$(systemd-machine-id-setup --print) - storedid=$(chroot "${mnt}" /usr/bin/tegra-bootinfo -n -v machine_id 2>/dev/null) - if [ "$curid" != "$storedid" ]; then - chroot "${mnt}" /usr/bin/tegra-bootinfo --initialize 2>/dev/null - chroot "${mnt}" /usr/bin/tegra-bootinfo -V machine_id "$curid" - fi -fi -cleanup -exit 0 diff --git a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot b/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot deleted file mode 100644 index 2793295..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -mnt= -UBOOTVARS="bootcount mender_boot_part mender_boot_part_hex upgrade_available" -ubvarfile= -install_fwenv= - -cleanup() { - [ -n "$mnt" ] || return - for d in sys proc dev run; do - if mountpoint -q "${mnt}/${d}"; then - umount "${mnt}/${d}" >/dev/null 2>&1 || true - fi - done - if mountpoint -q "$mnt"; then - umount "$mnt" >/dev/null 2>&1 || true - fi - rmdir "$mnt" >/dev/null 2>&1 || true -} - -save_vars() { - local v - ubvarfile=$(mktemp -p "$1" ubvars.XXXXXX) - for v in $UBOOTVARS; do - fw_printenv $v >>$ubvarfile - done -} - -echo "Installing NVIDIA bootloader update payload" - -new_boot_part=`fw_printenv -n mender_boot_part` -mnt=`mktemp -d -t nvbup.XXXXXX` -if [ -z "$mnt" -o ! -d "$mnt" ]; then - echo "ERR: could not create directory for mounting install partition" >&2 - exit 1 -fi -mount -o ro /dev/mmcblk0p${new_boot_part} "$mnt" -if [ ! -d "${mnt}/opt/ota_package" ]; then - echo "ERR: Missing /opt/ota_package directory in installed rootfs" >&2 - cleanup - exit 1 -fi -# tegra-bootloader-update needs access to these filesystems, -# so bind-mount them into the new rootfs for the chroot -mount --bind /sys "${mnt}/sys" -mount --bind /proc "${mnt}/proc" -mount --bind /dev "${mnt}/dev" -mount -t tmpfs tmpfs "${mnt}/run" - -# Check for u-boot environment location change; save vars for restoration -# into the new environment after the update -if [ -e "$mnt/usr/share/u-boot/fw_env.config" ]; then - if ! diff -qbi /etc/fw_env.config $mnt/usr/share/u-boot/fw_env.config > /dev/null 2>&1; then - save_vars "${mnt}/run" - install_fwenv=yes - fi -fi - -if ! chroot "${mnt}" /usr/bin/tegra-bootloader-update --dry-run /opt/ota_package/bl_update_payload >/dev/null 2>&1; then - # If the tool reports that the version partitions are corrupted, this is an update on a tegra210 - # device with the old partition layout where the U-Boot environment overwrote the version partition(s), - # in which case we recover via complete initialization. - if chroot "${mnt}" /usr/bin/tegra-bootloader-update --dry-run /opt/ota_package/bl_update_payload 2>&1 | grep -q 'version partitions are corrupted'; then - # For the recoverable case, we will have also detected a change the U-Boot environment change - if [ -n "$install_fwenv" ]; then - echo "Detected bootloader partition upgrade, reinitializing" >&2 - if ! chroot "${mnt}" /usr/bin/tegra-bootloader-update --initialize /opt/ota_package/bl_update_payload; then - echo "ERR: bootloader re-initialization failed" >&2 - cleanup - exit 1 - fi - else - echo "WARN: VER partitions are corrupted" >&2 - echo "WARN: Please refer to https://github.com/OE4T/tegra-demo-distro/pull/113 for additional context" >&2 - echo "WARN: Attempting update anyway" >&2 - fi - else - echo "ERR: cannot perform bootloader update" >&2 - cleanup - exit 1 - fi -elif ! chroot "${mnt}" /usr/bin/tegra-bootloader-update /opt/ota_package/bl_update_payload; then - echo "ERR: bootloader update failed" >&2 - cleanup - exit 1 -fi -# If the U-Boot environment config has changed, propagate the important variables -# to the new environment -if [ -n "$install_fwenv" ]; then - if ! chroot "${mnt}" /usr/bin/fw_setenv -c /usr/share/u-boot/fw_env.config -s /run/$(basename "$ubvarfile"); then - echo "ERR: could not restore U-Boot environment after bootloader update" >&2 - cleanup - exit 1 - fi - if [ -L /etc/fw_env.config ]; then - cp $mnt/usr/share/u-boot/fw_env.config $(readlink /etc/fw_env.config) - fi -fi -echo "Successful bootloader update" -cleanup -exit 0 diff --git a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/tegra-state-scripts_%.bbappend b/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/tegra-state-scripts_%.bbappend deleted file mode 100644 index bc2a975..0000000 --- a/dynamic-layers/meta-mender-tegra/recipes-mender/tegra-state-scripts/tegra-state-scripts_%.bbappend +++ /dev/null @@ -1,20 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI_remove = "file://redundant-boot-rollback-script-uboot" - -copy_install_script() { - sed -e's,@COPY_MACHINE_ID@,${PERSIST_MACHINE_ID},' ${S}/redundant-boot-install-script > ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_80_bl-update -} - -copy_install_script_mender-uboot() { - cp ${S}/redundant-boot-install-script-uboot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_80_bl-update - cp ${S}/redundant-boot-commit-check-script-uboot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactCommit_Enter_80_bl-check-update -} - -copy_other_scripts() { - : -} - -do_compile_tegra210() { - cp ${S}/redundant-boot-install-script-uboot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_80_bl-update -}