add PATH hooks in v3_init.sh and init audio support

This commit is contained in:
Alfonso Gamboa 2022-04-26 01:56:38 -07:00
parent 56222fbdce
commit 6c0174faf8
6 changed files with 23 additions and 4 deletions

BIN
SD_ROOT/wz_mini/bin/audioplay_t31 Executable file

Binary file not shown.

View File

@ -16,6 +16,16 @@ echo '
set -x
if [[ -e /opt/wz_mini/etc/.first_boot ]]; then
echo "first boot already completed"
else
echo "first boot, initializing"
insmod /opt/wz_mini/lib/modules/audio.ko spk_gpio=63 alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/init.wav 50
rmmod audio
touch /opt/wz_mini/etc/.first_boot
fi
mount --bind /opt/wz_mini/etc/inittab /etc/inittab
echo "bind /etc/profile for local/ssh shells"
@ -46,12 +56,22 @@ echo "add v3_post inject to stock rcS"
sed -i '/^".*/aset -x' /opt/wz_mini/tmp/.storage/rcS
sed -i '/^# Mount configs.*/i/opt/wz_mini/etc/init.d/v3_post.sh\n' /opt/wz_mini/tmp/.storage/rcS
sed -i '/sbin:/s/$/:\/opt\/wz_mini\/bin/' /opt/wz_mini/tmp/.storage/rcS
sed -i '/system\/\lib/s/$/:\/opt\/wz_mini\/lib/' /opt/wz_mini/tmp/.storage/rcS
#Custom PATH hooks
#sed -i '/^# Run init script.*/i#Hook Library PATH here\nexport LD_LIBRARY_PATH=/tmp/test/lib:$LD_LIBRARY_PATH\nexport' /opt/wz_mini/tmp/.storage/rcS
#sed -i '/^# Run init script.*/i#Hook system PATH here\nexport PATH=/tmp/test/bin:$PATH\nexport' /opt/wz_mini/tmp/.storage/rcS
echo "replace stock password"
cp /opt/wz_mini/etc/shadow /opt/wz_mini/tmp/.storage/shadow
mount --bind /opt/wz_mini/tmp/.storage/shadow /etc/shadow
chmod 400 /etc/shadow
if [[ -e /opt/wz_mini/swap.gz ]]; then
insmod /opt/wz_mini/lib/modules/audio.ko spk_gpio=63 alc_mode=0 mic_gain=0
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/swap.wav 50
rmmod audio
echo "swap archive present, extracting"
gzip -d /opt/wz_mini/swap.gz
mkswap /opt/wz_mini/swap

View File

@ -1,11 +1,10 @@
#!/bin/sh
##THIS FILE IS CALLED BY rcS, EXECUTED BEFORE app_init.sh IS RUN.
set -x
echo "v3_post.sh"
sed -i '/sbin:/s/$/:\/opt\/wz_mini\/bin/' /opt/wz_mini/tmp/.storage/rcS
sed -i '/system\/\lib/s/$/:\/opt\/wz_mini\/lib/' /opt/wz_mini/tmp/.storage/rcS
echo "v3_post.sh exec"
if [[ $(cat /opt/wz_mini/run_mmc.sh | grep "RTSP_ENABLED\=") == "RTSP_ENABLED\=\"true\"" ]] && ! [[ -e /tmp/dbgflag ]]; then
cp /system/bin/iCamera /opt/wz_mini/tmp/.storage/

Binary file not shown.

Binary file not shown.

Binary file not shown.