From 7e7be6443925d1c0c736303225fe547c4eb1d277 Mon Sep 17 00:00:00 2001 From: Mirza Krak Date: Mon, 5 Aug 2019 12:07:50 +0000 Subject: [PATCH 1/2] rpi: remove custom environment changes The changes applied here deviate from the Raspbian environment and will change behaviour. These are not necessary for the Mender integration to work and are mostly for "convenience" and for this reason we drop them to stay as close to possible to the Raspbian environment. Changelog: None Signed-off-by: Mirza Krak --- rpi-convert-stage-2.sh | 11 ----------- rpi-convert-stage-5.sh | 8 -------- 2 files changed, 19 deletions(-) diff --git a/rpi-convert-stage-2.sh b/rpi-convert-stage-2.sh index 4dcb160..f3e9dd6 100755 --- a/rpi-convert-stage-2.sh +++ b/rpi-convert-stage-2.sh @@ -7,17 +7,6 @@ build_log=$output_dir/build.log [ ! -f $output_dir/boot.vfat ] && \ { log "Error: extracted boot partition not found. Aborting."; exit 1; } -# Make a copy of Linux kernel arguments and modify. -mcopy -on -i ${output_dir}/boot.vfat -s ::cmdline.txt ${output_dir}/cmdline.txt -sed -i 's/\b[ ]root=[^ ]*/ root=\/dev\/mmcblk0p2/' ${output_dir}/cmdline.txt -sed -i 's/\b[ ]console=tty1//' ${output_dir}/cmdline.txt -# Update Linux kernel command arguments with our custom configuration -mcopy -o -i ${output_dir}/boot.vfat -s ${output_dir}/cmdline.txt ::cmdline.txt - -mcopy -on -i ${output_dir}/boot.vfat -s ::config.txt ${output_dir}/config.txt -echo -e '\nenable_uart=1\n' >> ${output_dir}/config.txt -mcopy -o -i ${output_dir}/boot.vfat -s ${output_dir}/config.txt ::config.txt - sudo dd if=${output_dir}/boot.vfat of=/dev/mapper/${boot_mapping} bs=1M conv=sparse >> "$build_log" 2>&1 log "\tDone." diff --git a/rpi-convert-stage-5.sh b/rpi-convert-stage-5.sh index a7eb870..7eda331 100755 --- a/rpi-convert-stage-5.sh +++ b/rpi-convert-stage-5.sh @@ -138,14 +138,6 @@ install_files() { sudo cp ${bin_dir_pi}/boot.scr ${boot_dir} - sudo cp ${boot_dir}/config.txt ${output_dir}/config.txt - - # dtoverlays seems to break U-boot for some reason, simply remove all of - # them as they do not actually work when U-boot is used. - sed -i /^dtoverlay=/d ${output_dir}/config.txt - - sudo cp ${output_dir}/config.txt ${boot_dir}/config.txt - # Raspberry Pi configuration files, applications expect to find this on # the device and in some cases parse the options to determinate # functionality. From 9043d8ddfe0615532f3ace47530e917a08d07cef Mon Sep 17 00:00:00 2001 From: Mirza Krak Date: Mon, 5 Aug 2019 13:14:22 +0000 Subject: [PATCH 2/2] rpi: init_resize: pull changes done to cmdline.txt from upstream script It seems some additional manipulation was added to cmdline.txt in the upstream init_resize.sh script, the part that removed the 'quiet' kernel argument is what will add the Linux kernel console on HDMI again and if 'quiet' is present nothing is shown on the HDMI output resulting in a "black screen". MEN-2673 Changelog: Fix console not being available on HDMI on Raspberry Pi in Raspbian Buster. Signed-off-by: Mirza Krak --- files/init_resize.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/init_resize.sh b/files/init_resize.sh index d6b798d..fb83634 100644 --- a/files/init_resize.sh +++ b/files/init_resize.sh @@ -88,6 +88,10 @@ mount -t sysfs sys /sys mount /uboot sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||' /uboot/cmdline.txt +sed -i 's| sdhci\.debug_quirks2=4||' ${output_dir}/cmdline.txt +if ! grep -q splash /uboot/cmdline.txt; then + sed -i "s/ quiet//g" /uboot/cmdline.txt +fi mount /uboot -o remount,ro sync