diff --git a/board/common/overlay/etc/init.d/base b/board/common/overlay/etc/init.d/base index 1d262a6e7c..b1168c80fd 100644 --- a/board/common/overlay/etc/init.d/base +++ b/board/common/overlay/etc/init.d/base @@ -39,6 +39,14 @@ prepare_conf() { if [[ -n "$user_conf" && -e "$user_conf" ]]; then cp -rf "$user_conf" "$actual_conf" + + # we want only Unix newlines in conf files + if [[ -f "$actual_conf" ]]; then + sed -i 's/\r//g' "$actual_conf" + elif [[ -d "$actual_conf" ]]; then + find "$actual_conf" -type f | xargs -L1 sed -i 's/\r//g' + fi + grep -E "/boot .*ro[\s,]" /proc/mounts &>/dev/null RO=$? test $RO == 0 && mount -o remount,rw /boot @@ -49,12 +57,5 @@ prepare_conf() { if [[ ! -e "$actual_conf" && -e "$system_conf" ]]; then cp "$system_conf" "$actual_conf" fi - - # we want only Unix newlines in conf files - if [[ -f "$actual_conf" ]]; then - sed -i 's/\r//g' "$actual_conf" - elif [[ -d "$actual_conf" ]]; then - find "$actual_conf" -type f | xargs -L1 sed -i 's/\r//g' - fi }