downshiftertech.eu

Describe your website

Email LinkedIn

/* Title: Installing Tiny Core Linux on a Thinkpad T42 Description: Reviving old hardware Date: 2019/10/25 Category: Tiny Core Linux Keywords: Linux, Thinkpad, IBM, T42, TinyCoreLinux Template: post_eng */

This article describes setting up Tiny Core Linux on a Thinkpad T42 with both a CLI interface and a tiling window manager dwm.


Installation

In order to get Tiny Core to install I downloaded the Core Plus 32-bit version from the website and used the graphical installer. My T42 is equipped with 1GB of RAM, so it was enough to boot into graphical mode. I won’t go into much detail here, as the process is fairly straightforward. The rest of the article assumes you have installed Tiny Core to /dev/sda, installed the bootloader, and rebooted the system.


Introduction

My original intention was to have a system that would:

  • be usable without a cable connection
  • use WIFI
  • boot into the command-line and display both latin and cyrillic characters
  • use tmux for running multiple programs on one screen
  • run vim as a text editor
  • use links as a web browser
  • use mc as an FTP client and file manager
  • have X and a tiling window manager in case I need to type text in Russian

Modifying boot parameters

With the the bootloader installed, you can edit /mnt/sda1/tce/boot/extlinux/extlinux.conf to change any boot options. I did a few changes to the APPEND line by adding:

  • blacklist=pcspkr (disable the beep from the motherboard)
  • multivt (enable multiple ttys)
  • kmap=qwerty/et (enable Estonian keyboard layout when in CLI mode)
  • lang=en_DK.UTF-8 (make umlauts visible in CLI mode) ???

Running extensions on boot

We don’t want our system to boot slowly, so we need as few extensions to load during boot as possible, but still get a usable bare system. The ones I consider minimum are:

  • xf86-video-intel (have a properly scaled font in CLI and get acceleration in X)
  • kmaps (enable Estonian keyboard layout when in CLI mode)
  • firmware-ipw2000 (load the WIFI drivers for my particular adapter)
  • setfont (load the font that can display both Estonian and Russian characters in CLI mode)
  • mc (have a basic file browser and FTP client)
  • tmux (have tiling in CLI mode)
  • vim (have a proper text editor)
  • links (have a text web browser in CLI mode)

We can make these available after boot by running: tce-load -wi xf86-video-intel kmaps firmware-ipw2000 setfont mc tmux vim links


Other extensions

Other extensions can be loaded when we need them. These include:

  • wifi (contains wifi.sh script to scan and connect to wireless networks)
  • Xorg-7.7 dwm aterm (minimum to have a working dwm session)
  • dmenu (I’m working on adding this to the official Tiny Core repo)
  • rxvt (contains rxvt-unicode, a terminal emulator that can properly work with unicode)
  • getlocale (we only need to run this once to generate en_DK.UTF-8 locale extension that will autoload at boot)

These can be downloaded using: tce-load -w wifi Xorg-7.7 dwm dmenu aterm rxvt

Generate the locale extension using: tce-load -i getlocale


Modifying ~/.ashrc

The following lines need to be added:

  • alias wifi='tce-load -i wifi && sudo wifi.sh' (running wifi will scan for WIFI networks)
  • alias font='echo "setting LatArCyrHeb-14" && setfont LatArCyrHeb-14' (running font will load a font supporting Latin and Cyrillic in CLI mode)
  • alias x='tce-load -i Xorg-7.7 dwm aterm rxvt dmenu && startx' (running x will load the window manager)

Creating ~/.tmux.conf

In order for tmux to behave properly in CLI mode, the following line needs to be put in ~/.tmux.conf (which doesn’t get created by default): set -g default-terminal xterm


Modifying ~/.Xdefaults

The following lines need to be added to make rxvt not so bright:

URxvt*background: black
URxvt*foreground: white

Modifying ~/.setbackground

In order to disable Tiny Core logo in X, we need to modify the line as follows: hsetroot -add "#0E5CA8" --add "#87C6C9" -gradient 0


Enabling keyboard layout switching in X

Layout switching can be enabled using the command after each booting X: setxkbmap -layout "ee,ru" -option "grp:ctrl_shift_toggle &"

This line should be added to ~/.ash_history so that you can use Ctrl+R to look it up in the history file and not having to remember it. I could not run it automatically and get consistent results. This has to be done manually after launching X every time.

Alternatively, you can add the same line to ~/.setbackground so that it gets executed automatically.


Final steps

At this point you need to run sudo wifi.sh to connect to WIFI. A file called ~/wifi.db will be automatically generated.

All we have to do right now is to run backup to save our manual changes and reboot the system

Hint: if you log into X and don’t know where to begin, then:

  • Alt+Shift+Enter will open aterm where you can run the setxkbmap command
  • Alt+P will open dmenu where you can start typing the commands
  • Alt+2 will switch to workspace 2
  • Alt+j and Alt+k will cycle focus between windows
  • links -g will launch links in graphical mode