Add: clear title for each install/uninstall steps
This commit is contained in:
parent
f1a46d63cc
commit
c1c2e5ca56
2 changed files with 38 additions and 28 deletions
25
install.sh
25
install.sh
|
@ -164,12 +164,12 @@ done
|
||||||
|
|
||||||
if [ "X$keep_kernel" != "X" ]; then
|
if [ "X$keep_kernel" != "X" ]; then
|
||||||
FORCE_KERNEL=$(dpkg -s raspberrypi-kernel | awk '/^Version:/{printf "%s\n",$2;}')
|
FORCE_KERNEL=$(dpkg -s raspberrypi-kernel | awk '/^Version:/{printf "%s\n",$2;}')
|
||||||
echo "Keep current system kernel not to change"
|
echo -e "\n### Keep current system kernel not to change"
|
||||||
elif [ "X$compat_kernel" != "X" ]; then
|
elif [ "X$compat_kernel" != "X" ]; then
|
||||||
echo "will compile with a compatible kernel..."
|
echo -e "\n### will compile with a compatible kernel..."
|
||||||
else
|
else
|
||||||
FORCE_KERNEL=""
|
FORCE_KERNEL=""
|
||||||
echo "will compile with the latest kernel..."
|
echo -e "\n### will compile with the latest kernel..."
|
||||||
fi
|
fi
|
||||||
[ "X$FORCE_KERNEL" != "X" ] && {
|
[ "X$FORCE_KERNEL" != "X" ] && {
|
||||||
echo -e "The kernel & headers use package version: $FORCE_KERNEL\r\n\r\n"
|
echo -e "The kernel & headers use package version: $FORCE_KERNEL\r\n\r\n"
|
||||||
|
@ -202,6 +202,7 @@ which apt &>/dev/null
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
apt update -y
|
apt update -y
|
||||||
apt-get -y install dkms git i2c-tools libasound2-plugins
|
apt-get -y install dkms git i2c-tools libasound2-plugins
|
||||||
|
echo -e "\n### Install required kernel package"
|
||||||
install_kernel
|
install_kernel
|
||||||
# rpi-update checker
|
# rpi-update checker
|
||||||
check_kernel_headers
|
check_kernel_headers
|
||||||
|
@ -253,13 +254,15 @@ function install_module {
|
||||||
mkdir -p /var/lib/dkms/$mod/$ver/$marker
|
mkdir -p /var/lib/dkms/$mod/$ver/$marker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo -e "\n### Install sound card driver"
|
||||||
install_module "./" "seeed-voicecard"
|
install_module "./" "seeed-voicecard"
|
||||||
|
|
||||||
|
|
||||||
# install dtbos
|
# install dtbos
|
||||||
cp seeed-2mic-voicecard.dtbo $OVERLAYS
|
echo -e "\n### Install device tree overlays"
|
||||||
cp seeed-4mic-voicecard.dtbo $OVERLAYS
|
cp -v seeed-2mic-voicecard.dtbo $OVERLAYS
|
||||||
cp seeed-8mic-voicecard.dtbo $OVERLAYS
|
cp -v seeed-4mic-voicecard.dtbo $OVERLAYS
|
||||||
|
cp -v seeed-8mic-voicecard.dtbo $OVERLAYS
|
||||||
|
|
||||||
# install alsa plugins
|
# install alsa plugins
|
||||||
# we don't need this plugin now
|
# we don't need this plugin now
|
||||||
|
@ -267,6 +270,7 @@ cp seeed-8mic-voicecard.dtbo $OVERLAYS
|
||||||
rm -f /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_ac108.so
|
rm -f /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_ac108.so
|
||||||
|
|
||||||
#set kernel modules
|
#set kernel modules
|
||||||
|
echo -e "\n### Install startup modules in /etc/modules"
|
||||||
grep -q "^snd-soc-seeed-voicecard$" /etc/modules || \
|
grep -q "^snd-soc-seeed-voicecard$" /etc/modules || \
|
||||||
echo "snd-soc-seeed-voicecard" >> /etc/modules
|
echo "snd-soc-seeed-voicecard" >> /etc/modules
|
||||||
grep -q "^snd-soc-ac108$" /etc/modules || \
|
grep -q "^snd-soc-ac108$" /etc/modules || \
|
||||||
|
@ -277,6 +281,7 @@ grep -q "^snd-soc-wm8960$" /etc/modules || \
|
||||||
#set dtoverlays
|
#set dtoverlays
|
||||||
CONFIG=/boot/config.txt
|
CONFIG=/boot/config.txt
|
||||||
[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt
|
[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt
|
||||||
|
echo -e "\n### Found boot configuration file $CONFIG"
|
||||||
|
|
||||||
sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' $CONFIG || true
|
sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' $CONFIG || true
|
||||||
grep -q "^dtoverlay=i2s-mmap$" $CONFIG || \
|
grep -q "^dtoverlay=i2s-mmap$" $CONFIG || \
|
||||||
|
@ -287,11 +292,13 @@ grep -q "^dtparam=i2s=on$" $CONFIG || \
|
||||||
echo "dtparam=i2s=on" >> $CONFIG
|
echo "dtparam=i2s=on" >> $CONFIG
|
||||||
|
|
||||||
#install config files
|
#install config files
|
||||||
|
echo -e "\n### Install alsa and widget configuration"
|
||||||
mkdir /etc/voicecard || true
|
mkdir /etc/voicecard || true
|
||||||
cp *.conf /etc/voicecard
|
cp -v *.conf /etc/voicecard
|
||||||
cp *.state /etc/voicecard
|
cp -v *.state /etc/voicecard
|
||||||
|
|
||||||
#create git repo
|
#create git repo
|
||||||
|
echo -e "\n### Manage alsa configuration by git"
|
||||||
git_email=$(git config --global --get user.email)
|
git_email=$(git config --global --get user.email)
|
||||||
git_name=$(git config --global --get user.name)
|
git_name=$(git config --global --get user.name)
|
||||||
if [ "x${git_email}" == "x" ] || [ "x${git_name}" == "x" ] ; then
|
if [ "x${git_email}" == "x" ] || [ "x${git_name}" == "x" ] ; then
|
||||||
|
@ -306,6 +313,8 @@ git --git-dir=/etc/voicecard/.git --work-tree=/etc/voicecard/ add --all
|
||||||
echo "git commit -m \"origin configures\""
|
echo "git commit -m \"origin configures\""
|
||||||
git --git-dir=/etc/voicecard/.git --work-tree=/etc/voicecard/ commit -m "origin configures"
|
git --git-dir=/etc/voicecard/.git --work-tree=/etc/voicecard/ commit -m "origin configures"
|
||||||
|
|
||||||
|
echo -e "\n### Start service seeed-voicecard"
|
||||||
|
echo -e " see /var/log/seeed-voicecard for more service information"
|
||||||
cp seeed-voicecard /usr/bin/
|
cp seeed-voicecard /usr/bin/
|
||||||
cp seeed-voicecard.service /lib/systemd/system/
|
cp seeed-voicecard.service /lib/systemd/system/
|
||||||
systemctl enable seeed-voicecard.service
|
systemctl enable seeed-voicecard.service
|
||||||
|
|
41
uninstall.sh
41
uninstall.sh
|
@ -54,39 +54,40 @@ do_overlay() {
|
||||||
RPI_HATS="seeed-2mic-voicecard seeed-4mic-voicecard seeed-8mic-voicecard"
|
RPI_HATS="seeed-2mic-voicecard seeed-4mic-voicecard seeed-8mic-voicecard"
|
||||||
|
|
||||||
PATH=$PATH:/opt/vc/bin
|
PATH=$PATH:/opt/vc/bin
|
||||||
echo "remove dtbos"
|
echo -e "\n### Remove dtbos"
|
||||||
for i in $RPI_HATS; do
|
for i in $RPI_HATS; do
|
||||||
dtoverlay -r $i
|
dtoverlay -r $i
|
||||||
done
|
done
|
||||||
OVERLAYS=/boot/overlays
|
OVERLAYS=/boot/overlays
|
||||||
[ -d /boot/firmware/overlays ] && OVERLAYS=/boot/firmware/overlays
|
[ -d /boot/firmware/overlays ] && OVERLAYS=/boot/firmware/overlays
|
||||||
|
|
||||||
rm ${OVERLAYS}/seeed-2mic-voicecard.dtbo || true
|
rm -v ${OVERLAYS}/seeed-2mic-voicecard.dtbo || true
|
||||||
rm ${OVERLAYS}/seeed-4mic-voicecard.dtbo || true
|
rm -v ${OVERLAYS}/seeed-4mic-voicecard.dtbo || true
|
||||||
rm ${OVERLAYS}/seeed-8mic-voicecard.dtbo || true
|
rm -v ${OVERLAYS}/seeed-8mic-voicecard.dtbo || true
|
||||||
|
|
||||||
echo "remove alsa configs"
|
echo -e "\n### Remove alsa configs"
|
||||||
rm -rf /etc/voicecard/ || true
|
rm -rfv /etc/voicecard/ || true
|
||||||
|
|
||||||
echo "disabled seeed-voicecard.service "
|
echo -e "\n### Disable seeed-voicecard.service "
|
||||||
|
systemctl stop seeed-voicecard.service
|
||||||
systemctl disable seeed-voicecard.service
|
systemctl disable seeed-voicecard.service
|
||||||
|
|
||||||
echo "remove seeed-voicecard"
|
echo -e "\n### Remove seeed-voicecard"
|
||||||
rm /usr/bin/seeed-voicecard || true
|
rm -v /usr/bin/seeed-voicecard || true
|
||||||
rm /lib/systemd/system/seeed-voicecard.service || true
|
rm -v /lib/systemd/system/seeed-voicecard.service || true
|
||||||
|
|
||||||
echo "remove dkms"
|
echo -e "\n### Remove dkms"
|
||||||
rm -rf /var/lib/dkms/seeed-voicecard || true
|
rm -rfv /var/lib/dkms/seeed-voicecard || true
|
||||||
|
|
||||||
echo "remove kernel modules"
|
echo -e "\n### Remove kernel modules"
|
||||||
rm /lib/modules/*/kernel/sound/soc/codecs/snd-soc-wm8960.ko || true
|
rm -v /lib/modules/*/kernel/sound/soc/codecs/snd-soc-wm8960.ko || true
|
||||||
rm /lib/modules/*/kernel/sound/soc/codecs/snd-soc-ac108.ko || true
|
rm -v /lib/modules/*/kernel/sound/soc/codecs/snd-soc-ac108.ko || true
|
||||||
rm /lib/modules/*/kernel/sound/soc/bcm/snd-soc-seeed-voicecard.ko || true
|
rm -v /lib/modules/*/kernel/sound/soc/bcm/snd-soc-seeed-voicecard.ko || true
|
||||||
rm /lib/modules/*/updates/dkms/snd-soc-wm8960.ko || true
|
rm -v /lib/modules/*/updates/dkms/snd-soc-wm8960.ko || true
|
||||||
rm /lib/modules/*/updates/dkms/snd-soc-ac108.ko || true
|
rm -v /lib/modules/*/updates/dkms/snd-soc-ac108.ko || true
|
||||||
rm /lib/modules/*/updates/dkms/snd-soc-seeed-voicecard.ko || true
|
rm -v /lib/modules/*/updates/dkms/snd-soc-seeed-voicecard.ko || true
|
||||||
|
|
||||||
echo "remove $CONFIG configuration"
|
echo -e "\n### Remove $CONFIG configuration"
|
||||||
for i in $RPI_HATS; do
|
for i in $RPI_HATS; do
|
||||||
echo Uninstall $i ...
|
echo Uninstall $i ...
|
||||||
do_overlay $i 1
|
do_overlay $i 1
|
||||||
|
|
Loading…
Reference in a new issue