Initial commit

This commit is contained in:
Philip Trauner 2018-04-07 23:26:16 +02:00
commit df5befa9d1
45 changed files with 2030 additions and 0 deletions

BIN
root-fs/boot/am335x-botball-hdmi.dtb (Stored with Git LFS) Executable file

Binary file not shown.

BIN
root-fs/boot/am335x-botball-lcd.dtb (Stored with Git LFS) Executable file

Binary file not shown.

View file

@ -0,0 +1 @@
while true; do botui && break; done

9
root-fs/etc/default/udhcpd Executable file
View file

@ -0,0 +1,9 @@
# Comment the following line to enable
DHCPD_ENABLED="yes"
# Options to pass to busybox' udhcpd.
#
# -S Log to syslog
# -f run in foreground
DHCPD_OPTS="-S"

View file

@ -0,0 +1,45 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- WenQuanYi Zen Hei Configure File -->
<fontconfig>
<!-- modified by Madsen@SMTH -->
<match target="font">
<test qual="any" name="family">
<string>WenQuanYi Zen Hei</string>
<string>文泉驿正黑</string>
<string>文泉驛正黑</string>
</test>
<edit name="globaladvance"><bool>false</bool></edit>
<edit name="spacing"><int>0</int></edit>
<edit name="antialias" mode="assign"><bool>true</bool></edit>
<edit name="hinting" mode="assign"><bool>true</bool></edit>
<edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
<edit name="autohint" mode="assign"><bool>false</bool></edit>
<edit name="rh_prefer_bitmaps" mode="assign"><bool>false</bool></edit>
<edit name="rgba" mode="assign"><const>none</const></edit>
<edit name="embeddedbitmap"><bool>false</bool></edit>
</match>
<alias>
<family>serif</family>
<prefer>
<family>Bitstream Vera Serif</family>
<family>DejaVu Serif</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Bitstream Vera Sans</family>
<family>DejaVu Sans</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Bitstream Vera Sans Mono</family>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
</fontconfig>

View file

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- WenQuanYi Zen Hei Configure File -->
<fontconfig>
<match target="font">
<test qual="any" name="family">
<string>WenQuanYi Zen Hei</string>
<string>文泉驿正黑</string>
<string>文泉驛正黑</string>
</test>
<test compare="more_eq" name="pixelsize"><double>11</double></test>
<test compare="less" name="pixelsize"><double>16</double></test>
<edit name="antialias" mode="assign"><bool>false</bool></edit>
<edit name="embeddedbitmap" mode="assign"><bool>true</bool></edit>
<edit name="hinting" mode="assign"><bool>false</bool></edit>
</match>
</fontconfig>

View file

@ -0,0 +1 @@
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

6
root-fs/etc/modules Executable file
View file

@ -0,0 +1,6 @@
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
g_ether

14
root-fs/etc/network/interfaces Executable file
View file

@ -0,0 +1,14 @@
# interfaces(5) file used by ifup(8) and ifdown(8) Include files from
# /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto usb0
iface usb0 inet static
address 192.168.124.1
netmask 255.255.255.0
broadcast 192.168.124.255
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

122
root-fs/etc/ssh/sshd_config Normal file
View file

@ -0,0 +1,122 @@
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

View file

@ -0,0 +1,11 @@
[Unit]
After=systemd-user-sessions.service
[Service]
ExecStart=/usr/bin/python3 /var/0s/source/c0re/app.py
WorkingDirectory=/var/0s/source/c0re
Environment="PYTHONIOENCODING=UTF-8"
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,10 @@
[Unit]
After=multi-user.target
[Service]
ExecStart=/usr/bin/node /var/0s/source/harrogate/server.js
WorkingDirectory=/var/0s/source/harrogate
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=Automatically change hostname to Wallaby hardware ID
After=x11.service
[Service]
ExecStart=/usr/bin/wallaby_set_hostname.py
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=Reset Coprocessor
After=systemd-user-sessions.service
[Service]
RemainAfterExit=yes
ExecStart=/usr/bin/wallaby_reset_coproc
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=Setup sound
After=systemd-user-sessions.service
[Service]
ExecStartPre=/usr/sbin/alsactl --file /var/asound.state restore
ExecStart=/usr/bin/amixer set PCM 100%
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=Play the startup sound
After=setup_sound.service
[Service]
ExecStart=/usr/bin/aplay /var/startup.wav
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
[Unit]
After=systemd-user-sessions.service
[Service]
ExecStart=/bin/su root -l -c /usr/bin/startx
Environment="DISPLAY=:0"
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,7 @@
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

5
root-fs/etc/udhcpd.conf Executable file
View file

@ -0,0 +1,5 @@
start 192.168.124.2
end 192.168.124.254
interface usb0
remaining yes
option subnet 255.255.255.0

View file

@ -0,0 +1,8 @@
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="foo"
psk="bar-bar-bar"
}

View file

@ -0,0 +1,16 @@
#!/bin/bash
VCMD1='i2cget -y 0 0x50 0x40'
VCMD2='i2cget -y 0 0x50 0x41'
VCMD3='i2cget -y 0 0x50 0x42'
VCMD4='i2cget -y 0 0x50 0x43'
V1=$(eval $VCMD1)
V2=$(eval $VCMD2)
V3=$(eval $VCMD3)
V4=$(eval $VCMD4)
printf "\x$(printf %x ${V1})"
printf "\x$(printf %x ${V2})"
printf "\x$(printf %x ${V3})"
printf "\x$(printf %x ${V4})"

View file

@ -0,0 +1,7 @@
#!/bin/bash
echo 33 > /sys/class/gpio/export
echo 34 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio33/direction
echo "out" > /sys/class/gpio/gpio34/direction

View file

@ -0,0 +1,13 @@
#!/bin/bash
if [ ! -d "/sys/class/gpio/gpio34" ]; then
echo "gpio34 missing - initializing gpio pins"
wallaby_init_gpio
fi
echo "resetting co processor..."
echo 1 > /sys/class/gpio/gpio34/value
echo 0 > /sys/class/gpio/gpio34/value
echo 1 > /sys/class/gpio/gpio34/value
echo "Done..."

View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
from subprocess import check_output, call
bot_id = "bot"
for i2c in range(4):
bot_id += check_output("i2cget -y 0 0x50 0x4%i" % i2c, shell=True).decode()[-2]
new_hosts_content = ""
for line in open("/etc/hosts", "r").read().split("\n"):
if line.startswith("127.0.1.1"):
new_hosts_content += "127.0.1.1\t%s\n" % bot_id
elif line != "":
new_hosts_content += "%s\n" % line
open("/etc/hosts", "w").write(new_hosts_content)
call("hostnamectl set-hostname %s" % bot_id, shell=True)
call("systemctl restart avahi-daemon", shell=True)
print("Hostname set: '%s'" % bot_id)

View file

@ -0,0 +1,12 @@
#ifndef _KIPR_BOTBALL_H_
#define _KIPR_BOTBALL_H_
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <wallaby/wallaby.h>
#include <string.h>
#include <time.h>
#endif

View file

@ -0,0 +1,5 @@
Section "Device"
Identifier "Builtin Default fbdev Device 0"
Driver "fbdev"
# Option "Rotate" "UD"
EndSection

View file

@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "359 3711 3537 501"
Option "SwapAxes" "0"
EndSection

BIN
root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf (Stored with Git LFS) Executable file

Binary file not shown.

1307
root-fs/var/asound.state Executable file

File diff suppressed because it is too large Load diff

BIN
root-fs/var/startup.wav (Stored with Git LFS) Executable file

Binary file not shown.