From 802c7be55f7a5ff29f348b4064dca3006b772ae7 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sat, 11 Aug 2018 17:43:20 +0200 Subject: [PATCH] ArmbianEnv.txt file cleanup. Without LF parameters can be added to the same line and board might not boot at all. This should fix the problem. --- .../common/usr/lib/armbian/armbian-hardware-optimization | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization diff --git a/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization b/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization old mode 100755 new mode 100644 index 072dd12a14..507dc94c32 --- a/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization +++ b/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization @@ -48,7 +48,7 @@ prepare_board() { sed -i "s/log\//log.hdd\//" /etc/logrotate.conf else for ConfigFile in /etc/logrotate.d/* ; do sed -i -e "s/\/log.hdd\//\/log\//" "${ConfigFile}"; done - sed -i "s/\/log.hdd\//\/log\//" /etc/logrotate.conf + sed -i "s/\/log.hdd\//\/log\//" /etc/logrotate.conf fi # enable compression where not exists @@ -241,6 +241,12 @@ add_usb_storage_quirks() { # check for /boot/armbianEnv.txt existence [ -f /boot/armbianEnv.txt ] || return + # cleanup. add LF. This prevents adding parameters to the same line + echo "" >> /boot/armbianEnv.txt; sed -ie '/^$/d;$G' /boot/armbianEnv.txt; sed -ie '/^$/d;$G' /boot/armbianEnv.txt + + # cleanup. remove empty lines in the middle + sed -i '/^$/d' /boot/armbianEnv.txt + # preserve old contents if existent TMPFILE=$(mktemp /tmp/${0##*/}.XXXXXX) trap "sleep 1 ; rm \"${TMPFILE}\" ; exit 0" 0 1 2 3 15