Enable g_serial on Orange Pi Lite by default

Closes #368
This commit is contained in:
zador-blood-stained
2016-07-29 12:32:11 +03:00
parent bc9404c460
commit b98de7ebb3
2 changed files with 12 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi Lite"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_one_defconfig
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2 #sunxi-cir"
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2 sunxi-cir g_serial"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1200000

View File

@@ -25,4 +25,15 @@ family_tweaks()
sed -e 's/MODULES=""/MODULES="sunxi_cir"/g' -i $CACHEDIR/sdcard/etc/lirc/hardware.conf
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="default"/g' -i $CACHEDIR/sdcard/etc/lirc/hardware.conf
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/sdcard/etc/lirc/lircd.conf
# enable serial gadget on OTG port since the board doesn't have Ethernet
if [[ $BOARD == orangepilite && ( $RELEASE == jessie || $RELEASE == xenial ) ]]; then
mkdir -p $CACHEDIR/sdcard/etc/systemd/system/serial-getty@ttyGS0.service.d
cat <<-EOF > $CACHEDIR/sdcard/etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf
[Service]
ExecStartPre=-/bin/sh -c "echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role"
EOF
chroot $CACHEDIR/sdcard /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
echo "ttyGS0" >> $CACHEDIR/sdcard/etc/securetty
fi
}