MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
# At the time of writing, the binaries below were uploaded manually. However,
|
|
|
|
# they are simply a vanilla U-Boot build of v2020.07, from Ubuntu 18.04, using
|
|
|
|
# these commands:
|
|
|
|
# make CROSS_COMPILE=arm-linux-gnueabihf- am335x_boneblack_vboot_defconfig
|
|
|
|
# make CROSS_COMPILE=arm-linux-gnueabihf-
|
|
|
|
# make CROSS_COMPILE=arm-linux-gnueabihf- envtools
|
|
|
|
BEAGLEBONE_BLACK_BINARIES="beaglebone_black_uefi-2020.07.tar.gz"
|
|
|
|
BEAGLEBONE_BLACK_BINARIES_URL="${MENDER_STORAGE_URL}/mender-convert/uboot/beaglebone/${BEAGLEBONE_BLACK_BINARIES}"
|
|
|
|
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
# At the time of writing, the binaries below were uploaded manually. They are
|
|
|
|
# simply a dump of the deb package from the link below, with the addition of the
|
|
|
|
# initrd file, which is not part of the package, but which is generated when
|
|
|
|
# installed on a live Beaglebone device.
|
|
|
|
# Original deb URL: http://repos.rcn-ee.com/debian/pool/main/l/linux-upstream/linux-image-4.19.94-ti-r51_1buster_armhf.deb
|
|
|
|
BEAGLEBONE_EFI_COMPATIBLE_KERNEL="linux-image-4.19.94-ti-r51_1buster_armhf-deb-dump.tar.xz"
|
|
|
|
BEAGLEBONE_EFI_COMPATIBLE_KERNEL_URL="${MENDER_STORAGE_URL}/mender-convert/beaglebone/kernel/${BEAGLEBONE_EFI_COMPATIBLE_KERNEL}"
|
|
|
|
BEAGLEBONE_EFI_COMPATIBLE_KERNEL_VERSION=4.19.94-ti-r51
|
|
|
|
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
MENDER_IGNORE_UBOOT_BROKEN_UEFI=1
|
|
|
|
MENDER_IGNORE_MISSING_EFI_STUB=1
|
|
|
|
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
function beaglebone_fix_broken_uefi_uboot() {
|
|
|
|
log_warn "Attempting to work around broken UEFI support in U-Boot by forcing a newer U-Boot version."
|
|
|
|
|
|
|
|
mkdir -p work/bbb/binaries
|
|
|
|
|
|
|
|
run_and_log_cmd "wget -q ${BEAGLEBONE_BLACK_BINARIES_URL} -P work/bbb/binaries"
|
|
|
|
run_and_log_cmd "tar xzvf work/bbb/binaries/${BEAGLEBONE_BLACK_BINARIES} -C work/bbb/binaries"
|
|
|
|
|
|
|
|
# Place u-boot and MLO into rootfs/boot
|
|
|
|
run_and_log_cmd "sudo mkdir -p work/rootfs/boot"
|
|
|
|
run_and_log_cmd "sudo cp work/bbb/binaries/MLO work/boot/"
|
|
|
|
run_and_log_cmd "sudo cp work/bbb/binaries/u-boot.img work/boot/"
|
|
|
|
|
|
|
|
run_and_log_cmd "sudo install -m 755 work/bbb/binaries/fw_printenv work/rootfs/sbin/fw_printenv"
|
|
|
|
run_and_log_cmd "sudo ln -fs /sbin/fw_printenv work/rootfs/sbin/fw_setenv"
|
|
|
|
}
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
|
|
|
|
function beaglebone_fix_broken_uefi_kernel() {
|
|
|
|
log_warn "Attempting to work around kernel without EFI stub by using a newer kernel."
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
|
|
|
|
mkdir -p work/bbb/kernel
|
|
|
|
run_and_log_cmd "wget -q $BEAGLEBONE_EFI_COMPATIBLE_KERNEL_URL -P work/bbb/kernel"
|
|
|
|
mkdir -p work/bbb/kernel/extract
|
|
|
|
run_and_log_cmd "tar xJf work/bbb/kernel/$BEAGLEBONE_EFI_COMPATIBLE_KERNEL -C work/bbb/kernel/extract"
|
|
|
|
run_and_log_cmd "cp -r work/bbb/kernel/extract/* work/rootfs/"
|
|
|
|
run_and_log_cmd "ln -sf vmlinuz-$BEAGLEBONE_EFI_COMPATIBLE_KERNEL_VERSION work/rootfs/boot/kernel"
|
|
|
|
run_and_log_cmd "ln -sf initrd.img-$BEAGLEBONE_EFI_COMPATIBLE_KERNEL_VERSION work/rootfs/boot/initrd"
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
}
|
|
|
|
|
|
|
|
function beaglebone_fix_broken_uefi() {
|
|
|
|
if ! is_uboot_with_uefi_support work/boot-gap.bin; then
|
|
|
|
beaglebone_fix_broken_uefi_uboot
|
|
|
|
fi
|
|
|
|
if ! is_efi_compatible_kernel work/rootfs/boot/$kernel_imagetype; then
|
|
|
|
beaglebone_fix_broken_uefi_kernel
|
|
|
|
fi
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
}
|
|
|
|
PLATFORM_MODIFY_HOOKS+=(beaglebone_fix_broken_uefi)
|
|
|
|
|
|
|
|
function disable_udisks2_service() {
|
|
|
|
# Mask udisks2.service, otherwise it will mount the inactive part and we
|
|
|
|
# might write an update while it is mounted which often result in
|
|
|
|
# corruptions.
|
|
|
|
#
|
|
|
|
# TODO: Find a way to only blacklist mmcblk0pX devices instead of masking
|
|
|
|
# the service.
|
|
|
|
run_and_log_cmd "sudo ln -sf /dev/null work/rootfs/etc/systemd/system/udisks2.service"
|
MEN-3952: beaglebone: Implement workaround for broken U-Boot and kernel.
Originally the intention was to fix the U-Boot integration for
Beaglebone, but this seems to have been broken for a long time, almost
a year, and no one has complained about it. The problem appears to be
connected to this commit [1], but it's not entirely clear to me what
the fix should be, and there are a lot of patches for our U-Boot fork.
However, since the U-Boot integration is supposed to be the backup
solution, rather than dig into U-Boot I decided to just fix the UEFI
path instead. This method doesn't require any patching, but there is
a problem with the specific image which is available for download at
the time of writing. So just grab the boot loader and kernel pieces
from a later, yet unbuilt, image, and it all works again.
Changelog: Title
Changelog: beaglebone: Remove U-Boot integration, which has not worked
for a long time. U-Boot will still be used for booting, but GRUB will
be used for integration with Mender, by chainloading via UEFI.
[1] https://github.com/mendersoftware/uboot-mender/commit/e88d5dbf01dc8c3822c695267b43d6000d9b2a19
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years ago
|
|
|
}
|
|
|
|
PLATFORM_MODIFY_HOOKS+=(disable_udisks2_service)
|