WIP target for Nanopi K2

This commit is contained in:
Igor Pecovnik 2017-06-28 12:07:31 +02:00
parent 727fc96470
commit 89a6cc3e1f
2 changed files with 50 additions and 16 deletions

View File

@ -0,0 +1,19 @@
# S905 K2 quad core
BOARD_NAME="Nanopi K2"
LINUXFAMILY="meson64"
BOOTCONFIG="nanopi-k2_defconfig"
#
MODULES=""
MODULES_NEXT=""
#
KERNEL_TARGET="default"
CLI_TARGET="jessie,xenial:default"
CLI_BETA_TARGET="xenial:default"
DESKTOP_TARGET="xenial:default"
DESKTOP_BETA_TARGET="xenial:default"
#
RECOMMENDED="Ubuntu_xenial_default_desktop:90,Debian_jessie_default:90"
#
BOARDRATING=""
HARDWARE="http://docs.armbian.com/board_details/odroidc2/"
FORUMS="http://forum.armbian.com/index.php/forum/16-amlogic/"

View File

@ -1,13 +1,16 @@
BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc2-v2015.01'
BOOTDIR='u-boot-odroidc2'
BOOTPATCHDIR='u-boot-odroidc2'
UBOOT_USE_GCC='< 5.0'
BOOTSCRIPT='boot-odroid-c2.ini:boot.ini'
case $BOARD in
nanopik2)
BOOTSOURCE='https://github.com/friendlyarm/u-boot.git'
BOOTBRANCH='branch:nanopi-k2-v2015.01'
BOOTDIR='u-boot-nanopik2'
UBOOT_USE_GCC='< 5.0'
BOOTSCRIPT="boot-odroid-c2.ini:boot.ini"
UBOOT_TARGET_MAP='ARCH=arm;;fip/gxb/u-boot.bin'
HAS_UUID_SUPPORT=yes
;;
esac
UBOOT_TARGET_MAP='ARCH=arm;;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin'
HAS_UUID_SUPPORT=yes
# NOTE: This u-boot version incorrectly parses boot.scr header
# due to wrong data type for 64 bit compiler, so boot.scr doesn't work
@ -25,10 +28,7 @@ GOVERNOR=ondemand
write_uboot_platform()
{
dd if=$1/bl1.bin.hardkernel of=$2 bs=1 count=442 conv=fsync > /dev/null 2>&1
dd if=$1/bl1.bin.hardkernel of=$2 bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1
dd if=$1/u-boot.bin of=$2 bs=512 seek=97 conv=fsync > /dev/null 2>&1
#dd if=/dev/zero of=$2 seek=1249 count=799 bs=512 conv=fsync > /dev/null 2>&1
dd if=$1/u-boot.bin of=$2 bs=512 seek=1 conv=fsync > /dev/null 2>&1
}
family_tweaks()
@ -39,8 +39,23 @@ family_tweaks()
sed -i 's/LIRCD_ARGS=.*/LIRCD_ARGS="--uinput"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
cp $SRC/lib/config/lirc.conf.odroidc2 $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/etc/
sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local
echo "/etc/c2_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local
echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local
install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/usr/local/bin
# systemd service for c1_init.sh
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/odroid-c2-hdmi.service
[Unit]
Description=Odroid C2 HDMI init
DefaultDependencies=no
Wants=rsyslog.service systemd-journald.service
Before=syslog.target sysinit.target
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/c2_init.sh
RemainAfterExit=no
[Install]
WantedBy=sysinit.target
EOF
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c2-hdmi.service >/dev/null 2>&1"
}