Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep empty line in armbianEnv.txt #4077

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,6 @@ 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 -i '/^$/d;$G' /boot/armbianEnv.txt
sed -i '/^$/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
Expand All @@ -417,8 +409,7 @@ add_usb_storage_quirks() {
done

read USBQUIRKS < ${TMPFILE}
sed -i '/^usbstoragequirks/d' /boot/armbianEnv.txt
echo "usbstoragequirks=${USBQUIRKS}" >> /boot/armbianEnv.txt
sed -i "s/^usbstoragequirks=.*/usbstoragequirks=${USBQUIRKS}/" /boot/armbianEnv.txt
sync &
if [ -f /sys/module/usb_storage/parameters/quirks ]; then
echo ${USBQUIRKS} > /sys/module/usb_storage/parameters/quirks
Expand Down