From 5cefec4cca188aa7985fdb2589935010b652f30e Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Sun, 23 Aug 2020 18:27:31 +0100 Subject: [PATCH] make the config file configurable, for Ubuntu --- install.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 209aab3..a0b2802 100755 --- a/install.sh +++ b/install.sh @@ -165,13 +165,16 @@ grep -q "^snd-soc-wm8960$" /etc/modules || \ echo "snd-soc-wm8960" >> /etc/modules #set dtoverlays -sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' /boot/config.txt || true -grep -q "^dtoverlay=i2s-mmap$" /boot/config.txt || \ - echo "dtoverlay=i2s-mmap" >> /boot/config.txt +CONFIG=/boot/config.txt +[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt + +sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' $CONFIG || true +grep -q "^dtoverlay=i2s-mmap$" $CONFIG || \ + echo "dtoverlay=i2s-mmap" >> $CONFIG -grep -q "^dtparam=i2s=on$" /boot/config.txt || \ - echo "dtparam=i2s=on" >> /boot/config.txt +grep -q "^dtparam=i2s=on$" $CONFIG || \ + echo "dtparam=i2s=on" >> $CONFIG #install config files mkdir /etc/voicecard || true