Add audio jack function switching service for Pinebook
This commit is contained in:
parent
6fa8794534
commit
ee58d0cbb5
@ -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"
|
||||
|
||||
|
||||
14
scripts/pinebook-enable-sound.service
Normal file
14
scripts/pinebook-enable-sound.service
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user