armbian-build/config/sources/sun8i.conf
2017-03-18 19:00:56 +01:00

53 lines
1.8 KiB
Plaintext

source "${BASH_SOURCE%/*}/sunxi_common.inc"
[[ -z $OVERLAY_PREFIX ]] && OVERLAY_PREFIX='sun8i-h3'
case $BRANCH in
default)
BOOTENV_FILE='sun8i-default.txt'
KERNELSOURCE='https://github.com/igorpecovnik/linux'
KERNELBRANCH='branch:sun8i'
KERNELDIR='linux-sun8i'
;;
dev)
KERNELSOURCE='https://github.com/megous/linux/'
KERNELBRANCH='branch:orange-pi-4.10'
KERNELDIR='linux-sun8i-mainline'
GOVERNOR=ondemand
;;
esac
[[ -z $CPUMIN ]] && CPUMIN=480000
[[ -z $CPUMAX ]] && CPUMAX=1010000
family_tweaks()
{
# this is for legacy kernel only
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
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
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
if [[ $BRANCH == default ]]; then
cp $SRC/lib/config/asound.state.sun8i-default $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
else
cp $SRC/lib/config/asound.state.sun8i-dev $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
fi
# enable serial gadget on OTG port since the board doesn't have Ethernet
if [[ $BOARD == orangepilite || $BOARD == nanopiair || $BOARD == orangepizero || $BOARD == orangepizeroplus2 ]]; then
mkdir -p $CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d
if [[ $BRANCH == default ]]; then
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
fi
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
echo "ttyGS0" >> $CACHEDIR/$SDCARD/etc/securetty
fi
}