59 lines
2.2 KiB
Plaintext
59 lines
2.2 KiB
Plaintext
|
|
source "${BASH_SOURCE%/*}/sunxi_common.inc"
|
|
|
|
case $BRANCH in
|
|
default)
|
|
BOOTENV_FILE='sun8i-default.txt'
|
|
|
|
KERNELSOURCE='https://github.com/igorpecovnik/linux'
|
|
KERNELBRANCH='branch:sun8i'
|
|
KERNELDIR='linux-sun8i'
|
|
;;
|
|
|
|
next)
|
|
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
|
KERNELBRANCH=$MAINLINE_KERNEL_BRANCH
|
|
KERNELDIR=$MAINLINE_KERNEL_DIR
|
|
;;
|
|
|
|
dev)
|
|
KERNELSOURCE='https://github.com/megous/linux'
|
|
KERNELBRANCH='branch:orange-pi-4.8'
|
|
KERNELDIR='linux-sun8i-mainline'
|
|
;;
|
|
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
|
|
if [[ $BRANCH == default ]]; then
|
|
mkdir -p $CACHEDIR/sdcard/var/lib/alsa/
|
|
cp $SRC/lib/config/asound.state.sun8i-default $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 ) && $BRANCH == default && ( $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
|
|
|
|
# u-boot default is nonsec. Legacy requires sec, mainline requires nonsec for SMP
|
|
if [[ ! -f $CACHEDIR/sdcard/boot/armbianEnv.txt ]]; then
|
|
local boot_mode=nonsec
|
|
[[ $BRANCH == default ]] && boot_mode=sec
|
|
sed -i -e "1s/^/gpio set PL10\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode $boot_mode\n/" \
|
|
-e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' $CACHEDIR/sdcard/boot/boot.cmd
|
|
fi
|
|
}
|