Skip to content

Instantly share code, notes, and snippets.

@RandomInsano
Last active March 17, 2019 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RandomInsano/3e00f901e81f735208c3f4810da7e46e to your computer and use it in GitHub Desktop.
Save RandomInsano/3e00f901e81f735208c3f4810da7e46e to your computer and use it in GitHub Desktop.
How I've customized my Kobo Touch

The Kobo Touch

Personal configuration:

# tail /etc/init.d/rcS
/bin/busybox insmod /drivers/ntx508/usb/gadget/arcotg_udc.ko
/bin/busybox insmod /drivers/ntx508/usb/gadget/g_ether.ko
ifconfig usb0 169.254.1.100
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts

# cat /etc/inittab
::sysinit:/etc/init.d/rcS
::respawn:/sbin/getty -L ttymxc0 115200 vt100
::respawn:/usr/sbin/inetd -f /etc/inetd.conf
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::restart:/sbin/init

# cat /etc/inetd.conf
169.254.1.100:21 stream tcp nowait root /bin/busybox ftpd -w                                                                        
169.254.1.100:23 stream tcp nowait root /bin/busybox telnetd -i

Configuration

mkdir -p /home/edwin/
mkdir /home/edwin/.bin/

# cat /home/edwin/.bin/cleanup.sh
#!/bin/sh
pkill nickel
pkill hindenburgp
pkill sickel
pkill fickel

Bootstrapping the world

Userland
# Great resource: http://logan.tw/posts/2017/01/21/introduction-to-qemu-debootstrap/
# Using Debian Jessie as it's the last to support the 2.6.35 kernel on the Kobo

host# sudo docker run --privileged --name kobo-dev -it -v /tank/some/folders/kobo-dev/home:/home debian:jessie /bin/bash
cont# exit
host# modprobe binfmt_misc # Needed for qemu-debootstrap below. If it was missed, re-config the package
host# sudo docker start -ai kobo-dev
cont# apt update
cont# apt install debootstrap qemu-user-static
cont# mkdir -p /home/edwin
cont# cd /home/edwin
cont# qemu-debootstrap --arch=armhf --include=build-essential jessie chroot-jessie http://ftp.ca.debian.org/debian/
 ### Sit at "Unpacking the base system" forever... Maybe watch some commands come and go ###
 ### No joke. This takes forever. Even on a 12 core bohemoth with a 4 disk raidz pool    ###
cont# cp /usr/bin/qemu-arm-static stable-chroot/bin/
cont# chroot stable-chroot /bin/qemu-arm-static /bin/bash
Kernel
# This isn't complete yet. May just run the build inside the chroot env from above

sudo docker run --name kobo-kernel -it -v /tank/some/folders/kobo-dev/home/:/home debian:jessie
# Get the toolchain good to go
apt-get update
apt-get install -y curl
echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.list.d/crosstools.list
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
dpkg --add-architecture armhf
apt-get update
# apt-get install crossbuild-essential-armhf # Failed due to dep versioning
apt-get install libgcc-4.9-dev:armhf binutils-arm-linux-gnueabihf

i2c busses

Digging around:

# find /sys/devices | grep i2c | grep 00../name | xargs cat
zForce-ir-touch   # Touch sensor
tps65185-1        # PMIC (http://www.ti.com/product/TPS65185)
msp430            # I'm pretty sure this is Adobe DRM and is the on-board MSP430 micro on the upper-right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment