Skip to content

Commit

Permalink
With Debian >11, config.txt and cmdline.txt is in /boot/firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
radio24 committed Sep 17, 2024
1 parent f47f781 commit 11375ea
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions install/LCD-show/LCD35-show
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@
###### SET VARIABLES ######
# How many degrees should the display output be rotated?
ROTATE=$(($1))
CONFIGFILE="/boot/config.txt"

# Where is the config.txt?
if [ "$DEBIAN_VERSION" -gt "11" ]; then
CONFIGFILE="/boot/firmware/config.txt"
else
CONFIGFILE="/boot/config.txt"
fi

# Where is the cmdline.txt?
if [ "$DEBIAN_VERSION" -gt "11" ]; then
CMDLINEFILE="/boot/firmware/cmdline.txt"
else
CMDLINEFILE="/boot/cmdline.txt"
fi

sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo
Expand All @@ -29,8 +42,8 @@ else
fi

if ! grep "fbcon=map:10" /boot/cmdline.txt ; then
CMDLINE=$(</boot/cmdline.txt)
CMDLINE=$(<${CMDLINEFILE})
CMDLINE=${CMDLINE//[$'\n']}
CMDLINE="$CMDLINE fbcon=map:10"
echo "$CMDLINE" > /boot/cmdline.txt
echo "$CMDLINE" > ${CMDLINEFILE}
fi

0 comments on commit 11375ea

Please sign in to comment.