From 7c6ad744289f79bd91e90c154bdc3ae59b5ab177 Mon Sep 17 00:00:00 2001 From: Lluis Campos Date: Fri, 5 Mar 2021 13:24:28 +0100 Subject: [PATCH] MEN-4117: Support headless configuration on Raspberry Pi By editing upstream systemd services to expect boot partition in /uboot instead of /boot Changelog: raspberrypi_config: Modify headless configuration services to expect boot partition in /uboot instead of /boot. Signed-off-by: Lluis Campos --- configs/raspberrypi_config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/raspberrypi_config b/configs/raspberrypi_config index a8b8b7e..b656513 100644 --- a/configs/raspberrypi_config +++ b/configs/raspberrypi_config @@ -91,6 +91,13 @@ function platform_modify() { run_and_log_cmd "sudo ln -fs /uboot/overlays work/rootfs/boot/overlays" run_and_log_cmd "sudo ln -fs /uboot/$CMDLINE work/rootfs/boot/$CMDLINE" + # Raspberry Pi headless configuration expects boot partition to be mounted + # at /boot, so replace these services with /uboot + run_and_log_cmd "find work/rootfs/lib/ -type f -name *.service | xargs sed -i.bak 's|/boot/|/uboot/|g'" + log_debug "Diff from modified service files:\n$(find work/rootfs/lib/ -type f -name '*.service' | xargs -I@ bash -c 'diff -u @.bak @')" + run_and_log_cmd "find work/rootfs/lib/ -type f -name *.service.bak | xargs rm" + log_info "Certain service files have been changed to align with our /uboot boot partition mount point. See convert.log for more information" + run_and_log_cmd "sudo install -m 755 work/rpi/binaries/fw_printenv work/rootfs/sbin/fw_printenv" run_and_log_cmd "sudo ln -fs /sbin/fw_printenv work/rootfs/sbin/fw_setenv"