Add audio jack function switching service for Pinebook

This commit is contained in:
zador-blood-stained 2017-06-03 15:41:37 +03:00
parent 6fa8794534
commit ee58d0cbb5
2 changed files with 22 additions and 0 deletions

View File

@ -88,6 +88,9 @@ create_board_package()
if [ -f "/etc/systemd/system/log2ram.service" ]; then
mv /etc/systemd/system/log2ram.service /etc/systemd/system/log2ram-service.dpkg-old
fi
if [ -f "/lib/systemd/system/pinebook-enable-sound.service" ]; then
systemctl enable pinebook-enable-sound.service
fi
exit 0
EOF
@ -322,6 +325,11 @@ create_board_package()
EOF
fi
#TODO: move to sources.conf
if [[ $BOARD == pinebook-a64 ]]; then
cp $SRC/lib/scripts/pinebook-enable-sound.service $destination/lib/systemd/system/
fi
# add some summary to the image
fingerprint_image "$destination/etc/armbian.txt"

View File

@ -0,0 +1,14 @@
[Unit]
Description=A simple service to switch headphone jack function on Pinebook from serial to sound
ConditionKernelCommandLine=!pinebook.forceserial
[Service]
Type=oneshot
ExecStart=-/bin/bash -c "echo 362 > /sys/class/gpio/export"
ExecStart=/bin/bash -c "echo out > /sys/class/gpio/gpio362/direction"
ExecStart=/bin/bash -c "echo 1 > /sys/class/gpio/gpio362/value"
ExecStop=/bin/bash -c "echo 0 > /sys/class/gpio/gpio362/value"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target