Skip to content

Instantly share code, notes, and snippets.

@juliannojungle
Last active July 7, 2022 11:14
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?

WI-FI CONNECTION

  1. Copy the following files to the <sdcard-root>/tcz:
ca-certificates.tcz
ca-certificates.tcz.md5.txt
libnl.tcz
libnl.tcz.md5.txt
firmware-rpi-wifi.tcz
firmware-rpi-wifi.tcz.md5.txt
ncurses.tcz
ncurses.tcz.md5.txt
readline.tcz
readline.tcz.dep
readline.tcz.md5.txt
wifi.tcz
wifi.tcz.dep
wifi.tcz.md5.txt
wireless_tools.tcz
wireless_tools.tcz.md5.txt
wireless-5.10.77-piCore.tcz
wireless-5.10.77-piCore.tcz.md5.txt
wpa_supplicant.tcz
wpa_supplicant.tcz.dep
wpa_supplicant.tcz.md5.txt
  1. Mount the unit and copy the files to permanent optional tce:
sudo mount /dev/mmcblk0p1
sudo cp /mnt/mmcblk0p1/tcz/* /mnt/mmcblk0p2/tce/optional
sudo umount /mnt/mmcblk0p1
  1. Setup firmware and tools to load at startup (during boot process):
echo "wireless-5.10.77-piCore.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
echo "firmware-rpi-wifi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
echo "wifi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
sudo filetool.sh -b
sudo reboot
  1. Setup wi-fi:
sudo wifi.sh
  • Wi-fi credentials gets saved at /home/tc/wifi.db
  1. Connect to wi-fi on startup (after boot process finishes, as a background task):
sudo echo "wifi.sh -a 2>&1 > /tmp/wifi.log" >> /opt/bootlocal.sh
sudo filetool.sh -b
sudo reboot
  1. Verify wi-fi status:
iwconfig && ifconfig wlan0

DOWNLOAD AND BUILD SOME GITHUB PROJECT

  1. Install compiletc and cmake;
  2. Download the repo with wget (appending .tar.gz to the url), decompress and build:
tce-load -wi compiletc.tcz
tce-load -wi cmake.tcz
wget https://github.com/AndrewFromMelbourne/raspi2fb/archive/master.tar.gz
tar -xf master.tar.gz
cd raspi2fb_master
mkdir build
cd build
cmake ..

CREATE AND INSTALL A TCZ EXTENSION

  1. Install squashfs-tools:
tce-load -wi squashfs-tools.tcz
  1. Create a directory to hold the files (e.g. fbdev-module). Inside it, replicate the exact structure to where the files should be placed, starting from / and copy the necessary files to it:
mkdir -p fbdev-module/lib/modules/5.10.77-piCore/kernel/drivers/video/fbdev
cp -r *.ko fbdev-module/lib/modules/5.10.77-piCore/kernel/drivers/video/fbdev
  1. Create the tcz extension
mksquashfs fbdev-module/ fbdev.tcz
  1. Install the extension
cp fbdev.tcz /mnt/mmcblk0p2/tce/optional/
echo "fbdev.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst

Another full example:

mkdir -p mypackage/usr/local/lib
cp libwiringPi.so* mypackage/usr/local/lib
mksquashfs mypackage libwiringPi.tcz -noappend
cp libwiringPi.tcz /mnt/mmcblk0p2/tce/optional/
echo "libwiringPi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst

LOAD STAGING MODULES AS EXTENSIONS

  1. Download the kernel sources from https://www.tinycorelinux.net/13.x/armv6/releases/RPi/src/kernel/5.10.77-piCore_modules.tar.xz, decompress it and create a .tcz extension with the required .ko files (following the above example).
  2. For each .ko file added, verify it's dependency:
modinfo fb_ili9340.ko
...
depends: fbtft
modinfo fbtft.ko
...
depends: fb_sys_fops,syscopyarea,sysfillrect,sysimgblt
  1. Make sure to create and install a .tcz extension for each dependency (e.g. fbdev.tcz and fbtft.tcz).

  2. Install the modules:

sudo modprobe fb_ili9340
  1. Check if the modules were correctly loaded:
lsmod
  1. Load the modules on each boot:
sudo vi /opt/bootlocal.sh
  • append a line with sudo modprobe fb_ili9340 on the # Load modules section and save.
  1. Save the above setup:
sudo filetool.sh -b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment