From df5befa9d1f8c3767e3deb3f800cf0174aa26b51 Mon Sep 17 00:00:00 2001 From: Philip Trauner Date: Sat, 7 Apr 2018 23:26:16 +0200 Subject: [PATCH] Initial commit --- .gitattributes | 8 + .gitignore | 4 + Makefile | 53 + boot/MLO | 3 + boot/u-boot.img | 3 + boot/uEnv.txt | 3 + chroot/stage-1.sh | 7 + chroot/stage-2.sh | 50 + chroot/stage-3.sh | 25 + hacks/sfdisk | 3 + root-fs/boot/am335x-botball-hdmi.dtb | 3 + root-fs/boot/am335x-botball-lcd.dtb | 3 + root-fs/etc/X11/xinit/xinitrc | 1 + root-fs/etc/default/udhcpd | 9 + root-fs/etc/fonts/conf.d/44-wqy-zenhei.conf | 45 + .../etc/fonts/conf.d/66-wqy-zenhei-sharp.conf | 17 + root-fs/etc/modprobe.d/8192cu.conf | 1 + root-fs/etc/modules | 6 + root-fs/etc/network/interfaces | 14 + root-fs/etc/ssh/sshd_config | 122 ++ root-fs/etc/systemd/system/c0re.service | 11 + root-fs/etc/systemd/system/harrogate.service | 10 + root-fs/etc/systemd/system/hostname.service | 9 + .../etc/systemd/system/reset_coproc.service | 10 + .../etc/systemd/system/setup_sound.service | 10 + .../etc/systemd/system/startup_sound.service | 9 + root-fs/etc/systemd/system/x11.service | 9 + .../etc/udev/rules.d/70-persistent-net.rules | 7 + root-fs/etc/udhcpd.conf | 5 + .../etc/wpa_supplicant/wpa_supplicant.conf | 8 + root-fs/usr/bin/wallaby_get_id.sh | 16 + root-fs/usr/bin/wallaby_init_gpio | 7 + root-fs/usr/bin/wallaby_reset_coproc | 13 + root-fs/usr/bin/wallaby_set_hostname.py | 23 + root-fs/usr/include/kipr/botball.h | 12 + .../usr/share/X11/xorg.conf.d/20-display.conf | 5 + .../share/X11/xorg.conf.d/99-calibration.conf | 6 + .../usr/share/fonts/truetype/wqy-zenhei.ttf | 3 + root-fs/var/asound.state | 1307 +++++++++++++++++ root-fs/var/startup.wav | 3 + scripts/debian.sh | 42 + scripts/linux-dtbs.sh | 19 + scripts/make-sd-card.sh | 64 + scripts/setup-host.sh | 19 + scripts/setup-root-fs.sh | 23 + 45 files changed, 2030 insertions(+) create mode 100755 .gitattributes create mode 100755 .gitignore create mode 100644 Makefile create mode 100755 boot/MLO create mode 100755 boot/u-boot.img create mode 100755 boot/uEnv.txt create mode 100755 chroot/stage-1.sh create mode 100755 chroot/stage-2.sh create mode 100755 chroot/stage-3.sh create mode 100755 hacks/sfdisk create mode 100755 root-fs/boot/am335x-botball-hdmi.dtb create mode 100755 root-fs/boot/am335x-botball-lcd.dtb create mode 100644 root-fs/etc/X11/xinit/xinitrc create mode 100755 root-fs/etc/default/udhcpd create mode 100755 root-fs/etc/fonts/conf.d/44-wqy-zenhei.conf create mode 100755 root-fs/etc/fonts/conf.d/66-wqy-zenhei-sharp.conf create mode 100644 root-fs/etc/modprobe.d/8192cu.conf create mode 100755 root-fs/etc/modules create mode 100755 root-fs/etc/network/interfaces create mode 100644 root-fs/etc/ssh/sshd_config create mode 100644 root-fs/etc/systemd/system/c0re.service create mode 100644 root-fs/etc/systemd/system/harrogate.service create mode 100644 root-fs/etc/systemd/system/hostname.service create mode 100644 root-fs/etc/systemd/system/reset_coproc.service create mode 100644 root-fs/etc/systemd/system/setup_sound.service create mode 100644 root-fs/etc/systemd/system/startup_sound.service create mode 100644 root-fs/etc/systemd/system/x11.service create mode 100755 root-fs/etc/udev/rules.d/70-persistent-net.rules create mode 100755 root-fs/etc/udhcpd.conf create mode 100755 root-fs/etc/wpa_supplicant/wpa_supplicant.conf create mode 100755 root-fs/usr/bin/wallaby_get_id.sh create mode 100755 root-fs/usr/bin/wallaby_init_gpio create mode 100755 root-fs/usr/bin/wallaby_reset_coproc create mode 100755 root-fs/usr/bin/wallaby_set_hostname.py create mode 100644 root-fs/usr/include/kipr/botball.h create mode 100755 root-fs/usr/share/X11/xorg.conf.d/20-display.conf create mode 100755 root-fs/usr/share/X11/xorg.conf.d/99-calibration.conf create mode 100755 root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf create mode 100755 root-fs/var/asound.state create mode 100755 root-fs/var/startup.wav create mode 100755 scripts/debian.sh create mode 100755 scripts/linux-dtbs.sh create mode 100755 scripts/make-sd-card.sh create mode 100755 scripts/setup-host.sh create mode 100755 scripts/setup-root-fs.sh diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..f609145 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +boot/MLO filter=lfs diff=lfs merge=lfs -text +*.img filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.dtb filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +hacks/sfdisk filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..d08aa58 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build +mnt +root-fs/var/0s/source +scripts/linux.sh1 \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..40bdaa3 --- /dev/null +++ b/Makefile @@ -0,0 +1,53 @@ +.PHONY: all setup build +all: build combine + +setup: + ./scripts/setup-host.sh + +.ONESHELL: +build: + set -e + + cd scripts + + ./setup-root-fs.sh + sudo ./make-sd-card.sh + ./linux-dtbs.sh + sudo ./debian.sh + +.ONESHELL: +combine: + set -e + + mkdir -p mnt + mkdir -p mnt/boot + mkdir -p mnt/rootfs + + echo "Mounting 0s" + sudo kpartx -a build/0s.img + + cd mnt + + sudo mount /dev/mapper/loop0p1 boot + sudo mount /dev/mapper/loop0p2 rootfs + + sleep 1 + + echo "Copying bootloader" + sudo cp ../boot/* boot + echo "Copying Debian" + sudo cp -rp ../build/debian/* rootfs + echo "Copying dtbs" + sudo cp -r ../build/linux/* rootfs + + sleep 1 + + sudo umount boot + sudo umount rootfs + + sleep 1 + + cd .. + + echo "Unmounting 0s" + sudo kpartx -d build/0s.img \ No newline at end of file diff --git a/boot/MLO b/boot/MLO new file mode 100755 index 0000000..0f19fe1 --- /dev/null +++ b/boot/MLO @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9b516032302f72ff4f59f4e1abb55926a57e57dbd6a9052598f3f3579ac75c7 +size 40484 diff --git a/boot/u-boot.img b/boot/u-boot.img new file mode 100755 index 0000000..80f523f --- /dev/null +++ b/boot/u-boot.img @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c3de96e90ccbaf33f6b509ef957efa5e10bcf784ae4eab8ef7009c6a79a48c4 +size 269500 diff --git a/boot/uEnv.txt b/boot/uEnv.txt new file mode 100755 index 0000000..1ecfc5a --- /dev/null +++ b/boot/uEnv.txt @@ -0,0 +1,3 @@ +console="tty0 console=ttyO0,115200n8" +uenvcmd=set optargs "consoleblank=0 fbcon=rotate:2" + diff --git a/chroot/stage-1.sh b/chroot/stage-1.sh new file mode 100755 index 0000000..8951800 --- /dev/null +++ b/chroot/stage-1.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e +set -x + +cd debootstrap +./debootstrap --second-stage diff --git a/chroot/stage-2.sh b/chroot/stage-2.sh new file mode 100755 index 0000000..47e0ba2 --- /dev/null +++ b/chroot/stage-2.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +set -e +set -x + +# Ensure temp files can be created (apt-key error) +chmod -R 777 /tmp + +# Recreate /dev/null +rm -f /dev/null; mknod -m 666 /dev/null c 1 3 + +# Set password of user 'root' to 'wallaby' +echo "root:wallaby" | chpasswd + +echo "Delete debian-fresh if the next step fails, package register is outdated." + +# Fix apt-key and enable https transport for apt +apt-get install -y dirmngr apt-transport-https + +# Add F-WuTS debian repo +apt-key adv --keyserver pgp.mit.edu --recv-keys 0xE9368D5F3DE2EA910F48AF0412F68D62509CD98B +echo "deb https://f-wuts.github.io/repo stretch main" >> /etc/apt/sources.list + +apt-get update + +# Don't setup keyboard layout interactively +DEBIAN_FRONTEND=noninteractive apt-get install -y \ + python python3 python3-pip \ + wpasupplicant wireless-tools udhcpd avahi-daemon openssh-server ntp net-tools \ + alsa-utils fontconfig i2c-tools xorg \ + build-essential \ + busybox sudo curl wget nano screen git \ + dbus \ + linux-image-3.18.21-custom linux-headers-3.18.21-custom linux-libc-dev \ + botui libwallaby libbotball + +cd / + +wget https://deb.nodesource.com/setup_6.x +chmod +x setup_6.x + +./setup_6.x +rm setup_6.x +apt-get install nodejs -y +apt-get clean + +npm config set unsafe-perm true +npm install -g gulp browserify + +pip3 install pipenv \ No newline at end of file diff --git a/chroot/stage-3.sh b/chroot/stage-3.sh new file mode 100755 index 0000000..7f449a6 --- /dev/null +++ b/chroot/stage-3.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +cd /var/0s/source + +cd harrogate +npm install +gulp compile + +cd .. + +cd c0re +# Fix Click encoding error +export LC_ALL=C.UTF-8 +export LANG=C.UTF-8 +pipenv install --system + +systemctl enable c0re +systemctl enable harrogate +systemctl enable hostname +systemctl enable reset_coproc +systemctl enable setup_sound +systemctl enable startup_sound +systemctl enable x11 \ No newline at end of file diff --git a/hacks/sfdisk b/hacks/sfdisk new file mode 100755 index 0000000..2771df1 --- /dev/null +++ b/hacks/sfdisk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fd446ac7b5d4664d8f1252b276e1a3a787b07cbb5f4df8307bfbab78784d7fc +size 61800 diff --git a/root-fs/boot/am335x-botball-hdmi.dtb b/root-fs/boot/am335x-botball-hdmi.dtb new file mode 100755 index 0000000..0e3ac3b --- /dev/null +++ b/root-fs/boot/am335x-botball-hdmi.dtb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e258f64786c924df5cb073060ada51b63d8ae1d2a0193ae5032a22155d743c4f +size 33348 diff --git a/root-fs/boot/am335x-botball-lcd.dtb b/root-fs/boot/am335x-botball-lcd.dtb new file mode 100755 index 0000000..01d783d --- /dev/null +++ b/root-fs/boot/am335x-botball-lcd.dtb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a20e8c6bb619ca9ddb2bb36dc7576ea1fe15af94f923f55a8eb4d124e57d911d +size 33436 diff --git a/root-fs/etc/X11/xinit/xinitrc b/root-fs/etc/X11/xinit/xinitrc new file mode 100644 index 0000000..e21c98e --- /dev/null +++ b/root-fs/etc/X11/xinit/xinitrc @@ -0,0 +1 @@ +while true; do botui && break; done \ No newline at end of file diff --git a/root-fs/etc/default/udhcpd b/root-fs/etc/default/udhcpd new file mode 100755 index 0000000..06a3de2 --- /dev/null +++ b/root-fs/etc/default/udhcpd @@ -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" diff --git a/root-fs/etc/fonts/conf.d/44-wqy-zenhei.conf b/root-fs/etc/fonts/conf.d/44-wqy-zenhei.conf new file mode 100755 index 0000000..e9b729e --- /dev/null +++ b/root-fs/etc/fonts/conf.d/44-wqy-zenhei.conf @@ -0,0 +1,45 @@ + + + + + + + + WenQuanYi Zen Hei + 文泉驿正黑 + 文泉驛正黑 + + false + 0 + true + true + hintnone + false + false + none + false + + + serif + + Bitstream Vera Serif + DejaVu Serif + WenQuanYi Zen Hei + + + + sans-serif + + Bitstream Vera Sans + DejaVu Sans + WenQuanYi Zen Hei + + + + monospace + + Bitstream Vera Sans Mono + DejaVu Sans Mono + + + diff --git a/root-fs/etc/fonts/conf.d/66-wqy-zenhei-sharp.conf b/root-fs/etc/fonts/conf.d/66-wqy-zenhei-sharp.conf new file mode 100755 index 0000000..b757012 --- /dev/null +++ b/root-fs/etc/fonts/conf.d/66-wqy-zenhei-sharp.conf @@ -0,0 +1,17 @@ + + + + + + + WenQuanYi Zen Hei + 文泉驿正黑 + 文泉驛正黑 + + 11 + 16 + false + true + false + + diff --git a/root-fs/etc/modprobe.d/8192cu.conf b/root-fs/etc/modprobe.d/8192cu.conf new file mode 100644 index 0000000..2c40e99 --- /dev/null +++ b/root-fs/etc/modprobe.d/8192cu.conf @@ -0,0 +1 @@ +options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 diff --git a/root-fs/etc/modules b/root-fs/etc/modules new file mode 100755 index 0000000..e38d828 --- /dev/null +++ b/root-fs/etc/modules @@ -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 diff --git a/root-fs/etc/network/interfaces b/root-fs/etc/network/interfaces new file mode 100755 index 0000000..2fcadfe --- /dev/null +++ b/root-fs/etc/network/interfaces @@ -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 diff --git a/root-fs/etc/ssh/sshd_config b/root-fs/etc/ssh/sshd_config new file mode 100644 index 0000000..4bd9b4b --- /dev/null +++ b/root-fs/etc/ssh/sshd_config @@ -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 diff --git a/root-fs/etc/systemd/system/c0re.service b/root-fs/etc/systemd/system/c0re.service new file mode 100644 index 0000000..c3cc491 --- /dev/null +++ b/root-fs/etc/systemd/system/c0re.service @@ -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 diff --git a/root-fs/etc/systemd/system/harrogate.service b/root-fs/etc/systemd/system/harrogate.service new file mode 100644 index 0000000..889c599 --- /dev/null +++ b/root-fs/etc/systemd/system/harrogate.service @@ -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 diff --git a/root-fs/etc/systemd/system/hostname.service b/root-fs/etc/systemd/system/hostname.service new file mode 100644 index 0000000..8dea879 --- /dev/null +++ b/root-fs/etc/systemd/system/hostname.service @@ -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 diff --git a/root-fs/etc/systemd/system/reset_coproc.service b/root-fs/etc/systemd/system/reset_coproc.service new file mode 100644 index 0000000..46618c6 --- /dev/null +++ b/root-fs/etc/systemd/system/reset_coproc.service @@ -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 diff --git a/root-fs/etc/systemd/system/setup_sound.service b/root-fs/etc/systemd/system/setup_sound.service new file mode 100644 index 0000000..c19d673 --- /dev/null +++ b/root-fs/etc/systemd/system/setup_sound.service @@ -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 diff --git a/root-fs/etc/systemd/system/startup_sound.service b/root-fs/etc/systemd/system/startup_sound.service new file mode 100644 index 0000000..7d99ab2 --- /dev/null +++ b/root-fs/etc/systemd/system/startup_sound.service @@ -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 diff --git a/root-fs/etc/systemd/system/x11.service b/root-fs/etc/systemd/system/x11.service new file mode 100644 index 0000000..29d1afd --- /dev/null +++ b/root-fs/etc/systemd/system/x11.service @@ -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 diff --git a/root-fs/etc/udev/rules.d/70-persistent-net.rules b/root-fs/etc/udev/rules.d/70-persistent-net.rules new file mode 100755 index 0000000..2d56e91 --- /dev/null +++ b/root-fs/etc/udev/rules.d/70-persistent-net.rules @@ -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" diff --git a/root-fs/etc/udhcpd.conf b/root-fs/etc/udhcpd.conf new file mode 100755 index 0000000..3ec0557 --- /dev/null +++ b/root-fs/etc/udhcpd.conf @@ -0,0 +1,5 @@ +start 192.168.124.2 +end 192.168.124.254 +interface usb0 +remaining yes +option subnet 255.255.255.0 diff --git a/root-fs/etc/wpa_supplicant/wpa_supplicant.conf b/root-fs/etc/wpa_supplicant/wpa_supplicant.conf new file mode 100755 index 0000000..56f787b --- /dev/null +++ b/root-fs/etc/wpa_supplicant/wpa_supplicant.conf @@ -0,0 +1,8 @@ +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev +update_config=1 + +network={ + ssid="foo" + psk="bar-bar-bar" +} + diff --git a/root-fs/usr/bin/wallaby_get_id.sh b/root-fs/usr/bin/wallaby_get_id.sh new file mode 100755 index 0000000..3ad1da3 --- /dev/null +++ b/root-fs/usr/bin/wallaby_get_id.sh @@ -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})" diff --git a/root-fs/usr/bin/wallaby_init_gpio b/root-fs/usr/bin/wallaby_init_gpio new file mode 100755 index 0000000..c1f2ed6 --- /dev/null +++ b/root-fs/usr/bin/wallaby_init_gpio @@ -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 diff --git a/root-fs/usr/bin/wallaby_reset_coproc b/root-fs/usr/bin/wallaby_reset_coproc new file mode 100755 index 0000000..ca961f1 --- /dev/null +++ b/root-fs/usr/bin/wallaby_reset_coproc @@ -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..." diff --git a/root-fs/usr/bin/wallaby_set_hostname.py b/root-fs/usr/bin/wallaby_set_hostname.py new file mode 100755 index 0000000..668e554 --- /dev/null +++ b/root-fs/usr/bin/wallaby_set_hostname.py @@ -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) diff --git a/root-fs/usr/include/kipr/botball.h b/root-fs/usr/include/kipr/botball.h new file mode 100644 index 0000000..afa1ee8 --- /dev/null +++ b/root-fs/usr/include/kipr/botball.h @@ -0,0 +1,12 @@ +#ifndef _KIPR_BOTBALL_H_ +#define _KIPR_BOTBALL_H_ + +#include +#include +#include +#include +#include +#include + +#endif + diff --git a/root-fs/usr/share/X11/xorg.conf.d/20-display.conf b/root-fs/usr/share/X11/xorg.conf.d/20-display.conf new file mode 100755 index 0000000..fb65b85 --- /dev/null +++ b/root-fs/usr/share/X11/xorg.conf.d/20-display.conf @@ -0,0 +1,5 @@ +Section "Device" + Identifier "Builtin Default fbdev Device 0" + Driver "fbdev" +# Option "Rotate" "UD" +EndSection diff --git a/root-fs/usr/share/X11/xorg.conf.d/99-calibration.conf b/root-fs/usr/share/X11/xorg.conf.d/99-calibration.conf new file mode 100755 index 0000000..c0e4add --- /dev/null +++ b/root-fs/usr/share/X11/xorg.conf.d/99-calibration.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "calibration" + MatchProduct "ADS7846 Touchscreen" + Option "Calibration" "359 3711 3537 501" + Option "SwapAxes" "0" +EndSection diff --git a/root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf b/root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf new file mode 100755 index 0000000..d7e7a9f --- /dev/null +++ b/root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c8334cda79c9537f94d43ff16e83624e1fdf74d1e7ff94d2f0ae03dd7bde91c +size 10808952 diff --git a/root-fs/var/asound.state b/root-fs/var/asound.state new file mode 100755 index 0000000..bdbac75 --- /dev/null +++ b/root-fs/var/asound.state @@ -0,0 +1,1307 @@ +state.AM335xBotball { + control.1 { + iface MIXER + name 'Mono Line2 Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.2 { + iface MIXER + name 'Mono PGA Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.3 { + iface MIXER + name 'Mono DAC Playback Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.4 { + iface MIXER + name 'Mono Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.5 { + iface MIXER + name 'PCM Playback Volume' + value.0 127 + value.1 127 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 127' + dbmin -6350 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.6 { + iface MIXER + name 'Left Line Mixer Line2R Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.7 { + iface MIXER + name 'Left Line Mixer PGAR Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.8 { + iface MIXER + name 'Left Line Mixer DACR1 Playback Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.9 { + iface MIXER + name 'Right Line Mixer Line2L Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.10 { + iface MIXER + name 'Right Line Mixer PGAL Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.11 { + iface MIXER + name 'Right Line Mixer DACL1 Playback Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.12 { + iface MIXER + name 'Left HP Mixer Line2R Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.13 { + iface MIXER + name 'Left HP Mixer PGAR Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.14 { + iface MIXER + name 'Left HP Mixer DACR1 Playback Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.15 { + iface MIXER + name 'Right HP Mixer Line2L Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.16 { + iface MIXER + name 'Right HP Mixer PGAL Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.17 { + iface MIXER + name 'Right HP Mixer DACL1 Playback Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.18 { + iface MIXER + name 'Left HPCOM Mixer Line2R Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.19 { + iface MIXER + name 'Left HPCOM Mixer PGAR Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.20 { + iface MIXER + name 'Left HPCOM Mixer DACR1 Playback Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.21 { + iface MIXER + name 'Right HPCOM Mixer Line2L Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.22 { + iface MIXER + name 'Right HPCOM Mixer PGAL Bypass Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.23 { + iface MIXER + name 'Right HPCOM Mixer DACL1 Playback Volume' + value 118 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + } + } + control.24 { + iface MIXER + name 'Line Line2 Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.25 { + iface MIXER + name 'Line PGA Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.26 { + iface MIXER + name 'Line DAC Playback Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.27 { + iface MIXER + name 'HP Line2 Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.28 { + iface MIXER + name 'HP PGA Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.29 { + iface MIXER + name 'HP DAC Playback Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.30 { + iface MIXER + name 'HPCOM Line2 Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.31 { + iface MIXER + name 'HPCOM PGA Bypass Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.32 { + iface MIXER + name 'HPCOM DAC Playback Volume' + value.0 118 + value.1 118 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 118' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.33 { + iface MIXER + name 'Line Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.34 { + iface MIXER + name 'HP Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.35 { + iface MIXER + name 'HPCOM Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.36 { + iface MIXER + name 'AGC Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.37 { + iface MIXER + name 'Left AGC Target level' + value '-5.5dB' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '-5.5dB' + item.1 '-8dB' + item.2 '-10dB' + item.3 '-12dB' + item.4 '-14dB' + item.5 '-17dB' + item.6 '-20dB' + item.7 '-24dB' + } + } + control.38 { + iface MIXER + name 'Right AGC Target level' + value '-5.5dB' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '-5.5dB' + item.1 '-8dB' + item.2 '-10dB' + item.3 '-12dB' + item.4 '-14dB' + item.5 '-17dB' + item.6 '-20dB' + item.7 '-24dB' + } + } + control.39 { + iface MIXER + name 'Left AGC Attack time' + value '8ms' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '8ms' + item.1 '11ms' + item.2 '16ms' + item.3 '20ms' + } + } + control.40 { + iface MIXER + name 'Right AGC Attack time' + value '8ms' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '8ms' + item.1 '11ms' + item.2 '16ms' + item.3 '20ms' + } + } + control.41 { + iface MIXER + name 'Left AGC Decay time' + value '100ms' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '100ms' + item.1 '200ms' + item.2 '400ms' + item.3 '500ms' + } + } + control.42 { + iface MIXER + name 'Right AGC Decay time' + value '100ms' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '100ms' + item.1 '200ms' + item.2 '400ms' + item.3 '500ms' + } + } + control.43 { + iface MIXER + name 'De-emphasis Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.44 { + iface MIXER + name 'PGA Capture Volume' + value.0 32 + value.1 32 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 119' + dbmin 0 + dbmax 5950 + dbvalue.0 1600 + dbvalue.1 1600 + } + } + control.45 { + iface MIXER + name 'PGA Capture Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.46 { + iface MIXER + name 'ADC HPF Cut-off' + value.0 Disabled + value.1 Disabled + comment { + access 'read write' + type ENUMERATED + count 2 + item.0 Disabled + item.1 '0.0045xFs' + item.2 '0.0125xFs' + item.3 '0.025xFs' + } + } + control.47 { + iface MIXER + name 'Mono Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.48 { + iface MIXER + name 'Mono Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.49 { + iface MIXER + name 'Mono Mixer DACL1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.50 { + iface MIXER + name 'Mono Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.51 { + iface MIXER + name 'Mono Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.52 { + iface MIXER + name 'Mono Mixer DACR1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.53 { + iface MIXER + name 'Right HPCOM Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.54 { + iface MIXER + name 'Right HPCOM Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.55 { + iface MIXER + name 'Right HPCOM Mixer DACL1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.56 { + iface MIXER + name 'Right HPCOM Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.57 { + iface MIXER + name 'Right HPCOM Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.58 { + iface MIXER + name 'Right HPCOM Mixer DACR1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.59 { + iface MIXER + name 'Left HPCOM Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.60 { + iface MIXER + name 'Left HPCOM Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.61 { + iface MIXER + name 'Left HPCOM Mixer DACL1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.62 { + iface MIXER + name 'Left HPCOM Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.63 { + iface MIXER + name 'Left HPCOM Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.64 { + iface MIXER + name 'Left HPCOM Mixer DACR1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.65 { + iface MIXER + name 'Right HP Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.66 { + iface MIXER + name 'Right HP Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.67 { + iface MIXER + name 'Right HP Mixer DACL1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.68 { + iface MIXER + name 'Right HP Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.69 { + iface MIXER + name 'Right HP Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.70 { + iface MIXER + name 'Right HP Mixer DACR1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.71 { + iface MIXER + name 'Left HP Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.72 { + iface MIXER + name 'Left HP Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.73 { + iface MIXER + name 'Left HP Mixer DACL1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.74 { + iface MIXER + name 'Left HP Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.75 { + iface MIXER + name 'Left HP Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.76 { + iface MIXER + name 'Left HP Mixer DACR1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.77 { + iface MIXER + name 'Right Line Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.78 { + iface MIXER + name 'Right Line Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.79 { + iface MIXER + name 'Right Line Mixer DACL1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.80 { + iface MIXER + name 'Right Line Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.81 { + iface MIXER + name 'Right Line Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.82 { + iface MIXER + name 'Right Line Mixer DACR1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.83 { + iface MIXER + name 'Left Line Mixer Line2L Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.84 { + iface MIXER + name 'Left Line Mixer PGAL Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.85 { + iface MIXER + name 'Left Line Mixer DACL1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.86 { + iface MIXER + name 'Left Line Mixer Line2R Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.87 { + iface MIXER + name 'Left Line Mixer PGAR Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.88 { + iface MIXER + name 'Left Line Mixer DACR1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.89 { + iface MIXER + name 'Right Line2R Mux' + value single-ended + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 single-ended + item.1 differential + } + } + control.90 { + iface MIXER + name 'Right Line1R Mux' + value single-ended + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 single-ended + item.1 differential + } + } + control.91 { + iface MIXER + name 'Right Line1L Mux' + value single-ended + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 single-ended + item.1 differential + } + } + control.92 { + iface MIXER + name 'Right PGA Mixer Line1R Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.93 { + iface MIXER + name 'Right PGA Mixer Line1L Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.94 { + iface MIXER + name 'Right PGA Mixer Line2R Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.95 { + iface MIXER + name 'Right PGA Mixer Mic3L Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.96 { + iface MIXER + name 'Right PGA Mixer Mic3R Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.97 { + iface MIXER + name 'Left Line2L Mux' + value single-ended + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 single-ended + item.1 differential + } + } + control.98 { + iface MIXER + name 'Left Line1R Mux' + value single-ended + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 single-ended + item.1 differential + } + } + control.99 { + iface MIXER + name 'Left Line1L Mux' + value single-ended + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 single-ended + item.1 differential + } + } + control.100 { + iface MIXER + name 'Left PGA Mixer Line1L Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.101 { + iface MIXER + name 'Left PGA Mixer Line1R Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.102 { + iface MIXER + name 'Left PGA Mixer Line2L Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.103 { + iface MIXER + name 'Left PGA Mixer Mic3L Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.104 { + iface MIXER + name 'Left PGA Mixer Mic3R Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.105 { + iface MIXER + name 'Right HPCOM Mux' + value 'differential of HPROUT' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'differential of HPROUT' + item.1 'constant VCM' + item.2 single-ended + item.3 'differential of HPLCOM' + item.4 'external feedback' + } + } + control.106 { + iface MIXER + name 'Right DAC Mux' + value DAC_R1 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 DAC_R1 + item.1 DAC_R3 + item.2 DAC_R2 + } + } + control.107 { + iface MIXER + name 'Left HPCOM Mux' + value 'differential of HPLOUT' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'differential of HPLOUT' + item.1 'constant VCM' + item.2 single-ended + } + } + control.108 { + iface MIXER + name 'Left DAC Mux' + value DAC_L1 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 DAC_L1 + item.1 DAC_L3 + item.2 DAC_L2 + } + } +} diff --git a/root-fs/var/startup.wav b/root-fs/var/startup.wav new file mode 100755 index 0000000..ca5c8fb --- /dev/null +++ b/root-fs/var/startup.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b2b9e2bdd1ca7854c44d93f86167b6f54fbd0cd702aee47a46b5807a74d4571 +size 55490 diff --git a/scripts/debian.sh b/scripts/debian.sh new file mode 100755 index 0000000..b63de36 --- /dev/null +++ b/scripts/debian.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -e + +mkdir -p ../build +cd ../build + +if [ "$EUID" -ne 0 ]; then + echo "Please run as root" + exit +fi + +echo "Delete debian-fresh if you interrupted the initial download." + +if [ ! -d debian-fresh ]; then + echo "Initial download, this will take a while." + debootstrap --foreign --verbose --arch=armhf stretch ./debian-fresh + mkdir -p debian-fresh/usr/bin + cp /usr/bin/qemu-arm-static debian-fresh/usr/bin + # Stage 1 + cp ../chroot/stage-1.sh debian-fresh + chroot debian-fresh/ ./stage-1.sh + rm debian-fresh/stage-1.sh +fi + +rm -rf debian + +cp -r debian-fresh debian + +cp -r ../chroot debian + +# Stage 2 +echo "Installing dependencies." +chroot debian/ ./chroot/stage-2.sh + +echo "Applying overlay fs" +cp -r ../root-fs/* debian + +# Stage 3 +echo "Running fs prepare" +chroot debian/ ./chroot/stage-3.sh + +rm -rf debian/chroot diff --git a/scripts/linux-dtbs.sh b/scripts/linux-dtbs.sh new file mode 100755 index 0000000..e73eb23 --- /dev/null +++ b/scripts/linux-dtbs.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +mkdir -p ../build +cd ../build + +[[ -d wallaby-linux ]] || git clone https://github.com/F-WuTS/wallaby-linux.git --depth=1 + +mkdir -p linux/boot + +cd wallaby-linux + +# Remove .git folder to prevent dirty kernel names +[[ -d build ]] || rm -rf .git + +make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs -j8 + +cp -r arch/arm/boot/dts/am335x-pepper*.dt* ../linux/boot diff --git a/scripts/make-sd-card.sh b/scripts/make-sd-card.sh new file mode 100755 index 0000000..bdfc08f --- /dev/null +++ b/scripts/make-sd-card.sh @@ -0,0 +1,64 @@ +#!/bin/bash +set -e + +mkdir -p ../build +cd ../build + +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +if lsblk | grep -q "loop0"; then + echo "loop0 found, trying to unmount automatically" + kpartx -d /dev/loop0 + losetup -d /dev/loop0 +fi + +echo "Creating empty image" +dd if=/dev/zero of=0s.img bs=1M count=7500 + +sync + +sleep 1 + +echo "Mouting empty image" +losetup /dev/loop0 0s.img + +# echo "Zeroing empty image (no real reason to do so, still...)" +# dd if=/dev/zero of=/dev/loop0 bs=1024 count=1024 + +echo "Creating partitions" + +# sfdisk was "upgraded" -> tons of flags removed + +SIZE=`fdisk -l /dev/loop0 | grep Disk | awk '{print $5}'` +CYLINDERS=`echo $SIZE/255/63/512 | bc` + +../hacks/sfdisk --force -D -uS -H 255 -S 63 -C $CYLINDERS /dev/loop0 << EOF +128,130944,0x0C,* +131072,,,- +EOF + +# sfdisk --force -u S /dev/loop0 << EOF +# 128,130944,0x0C,* +# 131072,,,- +# EOF + +losetup -d /dev/loop0 +sync + +kpartx -a 0s.img + +# Resources don't become avaliable immediately +sleep 1 + +echo "Creating fs" +mkfs.vfat -F 32 -n "boot" /dev/mapper/loop0p1 +mkfs.ext3 -F -L "rootfs" /dev/mapper/loop0p2 + +# Creating partitions is apperantly async +sleep 1 + +kpartx -d /dev/loop0 +losetup -d /dev/loop0 diff --git a/scripts/setup-host.sh b/scripts/setup-host.sh new file mode 100755 index 0000000..477c897 --- /dev/null +++ b/scripts/setup-host.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +apt-get update +apt-get install curl -y + +# git-lfs +curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash + +dpkg --add-architecture armhf +apt-get update && apt-get upgrade -y +apt-get install crossbuild-essential-armhf bc git dosfstools kpartx \ + debootstrap qemu-user-static git-lfs -y diff --git a/scripts/setup-root-fs.sh b/scripts/setup-root-fs.sh new file mode 100755 index 0000000..b033897 --- /dev/null +++ b/scripts/setup-root-fs.sh @@ -0,0 +1,23 @@ +cd .. + +mkdir -p root-fs/var/0s/source + +cd root-fs/var/0s/source + +if [ ! -d c0re ]; then + git clone https://github.com/F-WuTS/c0re.git --recursive --depth=1 +else + git -C c0re fetch --all + git -C c0re reset --hard origin/master + +fi + +if [ ! -d harrogate ]; then + git clone https://github.com/F-WuTS/harrogate.git --depth=1 +else + git -C harrogate fetch --all + git -C harrogate reset --hard origin/master + +fi + +