This script expands on the original installation script. It performs several tasks to ensure proper installation and compatibility with updated kernel versions. Here's a summary of what the script does:
- Checks for root privileges and sufficient space on the /boot volume.
- Verifies that the system is ARM/Raspberry Pi related by checking for specific directories and commands.
- Checks and potentially updates kernel headers to match the running kernel version.
- Updates and installs required packages, including kernel headers, gcc, git, and audio-related tools.
- Installs a kernel module named "seeed-voicecard" using DKMS (Dynamic Kernel Module Support) to ensure it works across kernel updates.
- Copies device tree overlay files (.dtbo) for different microphone configurations to the appropriate directory.
- Removes an old ALSA plugin and updates kernel module configurations.
- Modifies the boot configuration file to enable I2C and I2S interfaces.
- Installs configuration files for the voice card in /etc/voicecard.
- Sets up a Git repository in /etc/voicecard to track configuration changes.
- Installs a systemd service for the voice card and enables it to start on boot.
- Provides instructions for the user to reboot the system to apply all settings.
This script aims to provide a more robust installation process that adapts to potential kernel version mismatches and ensures all necessary components are in place for the voice card to function properly on a Raspberry Pi system.