summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarton <joel.carron@eeproperty.ch>2019-07-18 12:18:51 +0200
committerAndrei Gherzan <andrei@gherzan.ro>2019-07-18 17:19:06 +0100
commite4936f361b63a57ee324abe71ce0642d36b81172 (patch)
treed7d4c0cf6cb54cceff8364f373ec5714dee17d49
parentc49d09c725a19ec9c4ee79bef56c5f8784fd23bc (diff)
downloadmeta-raspberrypi-e4936f361b63a57ee324abe71ce0642d36b81172.tar.gz
rpi-config: Check some config values against "1"
When we read the docs, we have the feelings that theses variables are boolean ones. So I was setting, for example in my distro.conf file the variable ' ENABLE_I2C = "1" ' to enable I2C. Then I wanted to disable it by simply setting 'ENABLE_I2C' to "0" but it wasn't working. So I noticed that, for example, ' ENABLE_UART ' was checked with ' = "1" ' condition and some other "boolean" was checked against ' -n ' like for ENABLE_I2C. This commit tries to have an uniform behavior for all variables that are shown in the doc under the format ' VARIABLE = "1" ' to enable them and the reader can think they are kind of 'boolean' values. Signed-off-by: Joël Carron <joel.carron@eeproperty.ch>
-rw-r--r--recipes-bsp/bootfiles/rpi-config_git.bb10
1 files changed, 5 insertions, 5 deletions
diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb
index 08c80a6..0efb274 100644
--- a/recipes-bsp/bootfiles/rpi-config_git.bb
+++ b/recipes-bsp/bootfiles/rpi-config_git.bb
@@ -41,7 +41,7 @@ do_deploy() {
41 if [ -n "${DISABLE_OVERSCAN}" ]; then 41 if [ -n "${DISABLE_OVERSCAN}" ]; then
42 sed -i '/#disable_overscan=/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt 42 sed -i '/#disable_overscan=/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
43 fi 43 fi
44 if [ -n "${DISABLE_SPLASH}" ]; then 44 if [ "${DISABLE_SPLASH}" = "1" ]; then
45 sed -i '/#disable_splash=/ c\disable_splash=${DISABLE_SPLASH}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt 45 sed -i '/#disable_splash=/ c\disable_splash=${DISABLE_SPLASH}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
46 fi 46 fi
47 47
@@ -111,25 +111,25 @@ do_deploy() {
111 fi 111 fi
112 112
113 # Video camera support 113 # Video camera support
114 if [ -n "${VIDEO_CAMERA}" ]; then 114 if [ "${VIDEO_CAMERA}" = "1" ]; then
115 echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 115 echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
116 echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 116 echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
117 fi 117 fi
118 118
119 # Offline compositing support 119 # Offline compositing support
120 if [ -n "${DISPMANX_OFFLINE}" ]; then 120 if [ "${DISPMANX_OFFLINE}" = "1" ]; then
121 echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 121 echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
122 echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 122 echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
123 fi 123 fi
124 124
125 # SPI bus support 125 # SPI bus support
126 if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then 126 if [ "${ENABLE_SPI_BUS}" = "1" ] || [ "${PITFT}" = "1" ]; then
127 echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 127 echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
128 echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 128 echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
129 fi 129 fi
130 130
131 # I2C support 131 # I2C support
132 if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then 132 if [ "${ENABLE_I2C}" = "1" ] || [ "${PITFT}" = "1" ]; then
133 echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 133 echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
134 echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 134 echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
135 echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 135 echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt