To enable I2C and SPI interfaces and deactivate the serial console, you can use the raspi-config
tool which works as expected.
As far as I am informed, for SPI and I2C activation, the tool is just adding the required lines to the /etc/modules
file. This could be achieved by a very simple script in order to do this programatically. Is there anything else the config tool does when activating SPI or I2C which needs to be taken into account when writing an own activation script?
What does the tool do when deactivating the console on the serial port?
/boot/config.txt
instead of/etc/modules
. I just had a look at theraspi-config
source code which seems to edit only/boot/config.txt
. In addition, eLinux' explanation states the same.