mirror of
https://github.com/m5stack/CoreMP135_buildroot-external-st.git
synced 2026-05-20 11:24:38 -07:00
[add] add service to load kernel modules at boot
This commit is contained in:
@@ -19,4 +19,6 @@ CONFIG_LOGO_LINUX_MONO=y
|
||||
CONFIG_LOGO_LINUX_VGA16=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x8=y
|
||||
|
||||
CONFIG_USB_G_SERIAL=m
|
||||
|
||||
@@ -19,4 +19,6 @@ CONFIG_LOGO_LINUX_MONO=y
|
||||
CONFIG_LOGO_LINUX_VGA16=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x8=y
|
||||
|
||||
CONFIG_USB_G_SERIAL=m
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
start() {
|
||||
/sbin/modprobe soundcore
|
||||
/sbin/modprobe snd
|
||||
/sbin/modprobe snd_timer
|
||||
/sbin/modprobe snd_pcm
|
||||
/sbin/modprobe snd_pcm_dmaengine
|
||||
/sbin/modprobe snd_soc_core
|
||||
/sbin/modprobe out_to_pins
|
||||
/sbin/modprobe snd_soc_simple_card_utils
|
||||
/sbin/modprobe snd_soc_audio_graph_card
|
||||
/sbin/modprobe snd_soc_stm32_sai
|
||||
/sbin/modprobe snd_soc_stm32_sai_sub
|
||||
/sbin/modprobe cdc-acm
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "yes" > /dev/null
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
|
||||
MODULES="modules"
|
||||
|
||||
load_unload() {
|
||||
[ ! -f /etc/${MODULES} ] && echo ' OK' && exit 0
|
||||
|
||||
while read module args; do
|
||||
|
||||
case "$module" in
|
||||
""|"#"*) continue ;;
|
||||
esac
|
||||
|
||||
if [ "$1" = "load" ]; then
|
||||
/sbin/modprobe -q ${module} ${args} >/dev/null && \
|
||||
printf ' %s success,' "$module" ||
|
||||
printf ' %s failed,' "$module"
|
||||
else
|
||||
rmmod ${module} >/dev/null
|
||||
fi
|
||||
|
||||
done < /etc/${MODULES}
|
||||
}
|
||||
|
||||
start() {
|
||||
printf 'Starting %s:' "$MODULES"
|
||||
|
||||
load_unload load
|
||||
|
||||
echo ' OK'
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$MODULES"
|
||||
|
||||
load_unload unload
|
||||
|
||||
echo 'OK'
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,18 @@
|
||||
# /etc/modules: kernel modules to load at boot time.
|
||||
#
|
||||
# This file contains the names of kernel modules that should be loaded
|
||||
# at boot time, one per line. Lines beginning with "#" are ignored.
|
||||
soundcore
|
||||
snd
|
||||
snd_timer
|
||||
snd_pcm
|
||||
snd_pcm_dmaengine
|
||||
snd_soc_core
|
||||
out_to_pins
|
||||
snd_soc_simple_card_utils
|
||||
snd_soc_audio_graph_card
|
||||
snd_soc_stm32_sai
|
||||
snd_soc_stm32_sai_sub
|
||||
cdc-acm
|
||||
libcomposite
|
||||
g_serial
|
||||
Reference in New Issue
Block a user