Skip to content

Instantly share code, notes, and snippets.

@BillyNate
Last active May 6, 2025 19:06
Show Gist options
  • Save BillyNate/6a4a653c91f2be34c253e0805463c85e to your computer and use it in GitHub Desktop.
Save BillyNate/6a4a653c91f2be34c253e0805463c85e to your computer and use it in GitHub Desktop.
TinyCore Linux (RAM only OS) setup starting point

Basic setup of TinyCore/PiCore on a Raspberry Pi

These are the steps taken to setup piCore 14
Newer version might work as well (or maybe even better), but have not been tested.
This covers the basics to get started.

Set up piCore

  1. Download the piCore image
  2. Unpack the .zip file and write the .img file to the SD-Card (using USB Image Tool for example)
  3. Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
  4. SSH into the Pi (using Putty for example)
    Login using tc / piCore
  5. Execute backup shell command after the first boot to save generated unique SSH keys which will be used during next boots.

Expand the partition

  1. Start the partition tool: sudo fdisk -u /dev/mmcblk0
  2. List partitions: p
  3. Take note of the StartLBA value of the second partition
  4. Delete partition: d
  5. Choose second partition: 2
  6. Recreate second partition: n
    • Partition type is primary: p
    • Set partition number: 2
    • For first sector enter value of previously noted StartLBA
    • For last sector keep suggested default value
  7. Exit fdisk with w command
  8. Reboot the Pi: sudo reboot
  9. After reboot expand the partition: sudo resize2fs /dev/mmcblk0p2 (may take a while)

Update extensions

  1. Run an update: tce-update

Optionally: Install preferred extensions

  1. Install mirrors: tce-load -wi mirrors
    • Run tcemirror.sh
  2. Install the nano text editor (or keep using vi): tce-load -wi nano
  3. Install tools to create your own extensions tce-load -wi squashfs-tools
  4. Install screen: tce-load -wi screen
    • Add termcapinfo xterm* ti@:te@ to ~/.screenrc to be able to scroll

Change hostname

  1. Set hostname for easier recognisable network device: sudo sethostname myhostname

Improve backup strategy

  1. Edit /opt/.xfiletool.lst
    1. Add .ash_history
    2. Add .cargo
    3. Add .python_history

Add piwheels:

If you're going to use Python with Pip on your Raspberry Pi, add piwheels for significant faster package installation:

  1. Create directory: mkdir ~/.pip
  2. Create file ~/.pip/pip.conf and add:
    [global]
    extra-index-url=https://www.piwheels.org/simple
    
  3. If your Python version doesn't match piwheel's support, add these lines to use wheels for an older Python version:
    ignore-requires-python=yes
    
  4. Optionally add:
    prefer-binary=yes
    
  5. Save changes: backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment