Tinux 

Tinux - short for Clementinux - is a Linux From Scratch distribution.

One repo with one Devuan Linux ISO - afterwards no more downloads, no binaries, zero configs.

It's source code all the way down...

Table of Contents

Tinux is a Linux distribution based on the Linux From Scratch book. During the installation, all the packages from the book get compiled and installed automatically, including the kernel and grub boot loader. The result is a working Qemu virtual machine image disk file. As the stable base for the installation process an official Devuan install ISO disk image is being used.

(A few more screenshots are here..)

Another distribution's install disk image is used, so that Tinux does not depend on itself. The Devuan binary image is signed by the official Devuan maintainer. The rest of Tinux are all the official source project packages curated by the Linux From Scratch project. So besides this Devuan ISO image to bootstrap from, everything else of Tinux is 100.0 percent build from source code and without any further manual intervention of configuration!

So all you need to get your own Linux operating system build entirely from source code is any standard Linux system with a Qemu/KVM virtual machine on a 64 bit amd64/x86_64 Intel architecture system and a bit over 100 GB of extra disk space.

If you later want to move the Tinux virtual machine installation to the bare metal hardware, a simple free partition on your host and copy via rsync on the host from the running VM is sufficient. Just add the partition to your existing /boot/grub/grub.cfg configuration file on the host and edit the /etc/fstab file on the new destination's partition with input from blkid before reboot. Network configuration of /etc/sysconfig/ifconfig.eth0 after reboot might be a good idea too:).

 

Table of Contents

  1. News
  2. Download
  3. Requirements
  4. Installation
  5. Documentation
  6. FAQ
  7. License
  8. Version History
  9. Contact

News

2023-12-02 16:58:13  

TFS Version 11.6 has split up again the /bin and /sbin directories from the /usr/bin and /usr/sbin directories.

/usr/bin has so many programs in it, it is much more educational for the user to easily see in the separate /bin directory what really constituents the base of a Linux/Unix system.

Furthermore, the good old ed line editor has been added, even to the base system. In additional, some freely distributable books or additional documentation have been added too.

Look for older news via the version history.

Download

Once you downloaded the Clementinux repository with git to your local disk, everything compiles offline, assuming you have all requirements (see below). But be warned, the Tinux git repository is 11 GB huge and contains the original Devuan Beowulf 3.1.1 desktop installation ISO disk image and lots of LFS/BLFS packages. This is to provide a stable, reproducable, and sufficiant base in one single download that contains everything thereafter.

So take a cup of coffee and hit:

git clone http://techinvest.li/git/tinux.git

Afterwards you can use my public PGP key listed under contact to verify the git hashes in doc/git.log and the binary files in SHA256SUMS with: gpg --verify SHA256SUMS.asc

If you want just a pre peak at how this all looks without downloading 6+ Gigs of stuff you might already have, here is a 1.6MB tar file of everything except the binaries and history:

tinux.tar.gz

 
Thanks and gratitude go to the LFS authors, malina, the mrustc project, bryanpedini, the #lfs crew, the Devuan project, and wallpaperflare.com.
 

Requirements

  • A Linux System with:
    • 100 GB disk space
    • /bin/bash
    • make
    • X.Org
    • Qemu
    • openssh
    • expect
    And recommended:
    • git
    • sha256sum
    • gpg
    • md5sum
 

Installation

./configure
make
make blfs   # If you want X11 and a web browser (Falkon, chromium based).
make run

Notice the password '123123' that is given to each user (root and and in the Devuan VM also the tinux user). After all is done, you might want to change the root password in the final Tinux VM manually with the 'passwd' command after login.

If you rerun everything, 'make clean' will delete all the images created inbetween, but also the used ports for the local ssh connection in your ~/.ssh/known_hosts file. After the final Tinux image is create and started in server mode, you can continue to create some base tools from the Beyond Linux From Scratch book like emacs and a handy tool like tmux with: 'make blfs'

Outside of the Qemu VM window, you can connect to the Virtual Machine with: 'ssh -p 2231 root@localhost'

And the very first things before the installation you can do, are:
 
gpg --verify ftp/iso/devuan/SHA256SUMS.asc
gpg --verify SHA256SUMS.asc

And have a look at those SHA256 hashes;-).

 

Documentation

The steps to create the Devuan virtual machine image are here.

Tinux comes with the original LFS and BLFS documentation. The best documentation about the nitty gritty details of all related to Linux in generell. TFS and BTFS are forks of these two books to accomodate the priorities that Tinux has.

As Tinux uses package specifications from different LFS versions, all currently used LFS or BLFS versions are included here.

Unix Documentation

Once you login to you new Tinux installation, on a terminal, if you are not familiar with Unix, in order to get an introduction to basic Unix commands:

help

The next step in order to customize your Tinux setup, when you have already some Unix experience, is to look at the 'afterboot' man page with:

man afterboot

Some packages come with additional documentation besides the man pages, like HTML or pdf documents. For those, look in the /usr/share/doc directory. The have been all part of the LFS and BLFS project.

Unique to Tinux is also this command to print out version information:

about

This current Tinux page with the overview documentation can be read on Tinux from the command line with:

lynx /usr/share/doc/tinux/index.html

Books

Below are some documents and books for offline reading. They are all allowed to be freely distributed, so therefore they are included with Tinux.

 
  Command Line
 
  The GNU ed line editor by the Free Software Foundation First, here is the official manual for the current iteration of ed, the line editor, which can be traced all the way back to the first version of Unix in 1969.  
 
  GNU sed, a stream editor by Ken Pizzini, Paoli Bonzini, Jim Meyering, and Assaf Gordon Another GNU manual.  
 
  GNU Awk by Diane Barlow Close, Arnold D. Robbins, Paul H. Rubin, Richard Stallman, and Piet van Oostrum Edition 1.0 , December 1995.  
 
  GNU Awk by Arnold D. Robbins A User's Guid for GNU Awk, edition 5.3, October 2023.  
 
  Unix Text Processing by Dale Dougherty and Tim O'Reilly Another mix of ancient (and not so ancient) text tools (read: ex, vi, awk, nroff, troff).  
 
  Bash Guide for Beginners by Machtelt Garrels Nothing works without a shell - the shell.  
 
  The Linux Command Line by William Shotts All in one place.  
 
  TeX for the Impatient by Paul W. Abrahams, Kathryn A. Hargreaves, and Karl Berry About a slightly more recent text tool (and some day Tinux might install TeX automatically).  
 
  Programming Languages
 
  Learning Perl the Hard Way by Allen B. Downey Using perl you don't need to learn and use ed, ex, sed, and awk.  
 
  Essential Perl by Nick Parlante The basics condensed onto 25 pages.  
 
  Programming Ruby by Dave Thomas and Andy Hunt Learned Ruby 20 years ago with this book and I am still using the language daily to this day.  
 
  Think Python by Allen Downey It's getting harder and harder to get away without using Python.  
 
  Python for Everybody by Charles R. Severance Another version of and based on the book above.  
 
  Guile Reference Manual by the Guile developers Just in case.  
 
  Going from Python to Guile Scheme by Arne Babenhauserheide Sounds interesting, not.  
 
  Effective Go by the Go development team Fast, simple, easy multithreading, and with a memory garbage collector.  
 
  C Programming by lots of contributors Unix is C.  
 
  An Introduction to GCC by Brian Gough Linux is GCC.  
 
  Framebuffer
 
  Back to the Linux Framebuffer! by Nicolas Caramelli It is just a presentation. But then, it is better than a book.  
 
  Linux Fb Documentation by the kernel development community Describes the frame buffer API used by applications.  
 
  X Window System
 
  Inter-Client Communication Conventions Manual by David Rosenthal Mentioned in the X-Windows Disaster chapter out of the Unix-Haters Handbook.  
 
  Assembler
 
  X86 Assembly from Wikibooks C is assembler.  
 
  AI
 
  Undertanding Deep Learning by Simon J.D. Prince And for something recent in IT development and for you offline entertainment.  
 

Original Software/Sources/Packages

kernelhttps://www.kernel.org/
GCChttps://gcc.gnu.org/
Glibchttps://sourceware.org/glibc/wiki/Glibc%20Timeline
binutilshttps://www.gnu.org/software/binutils/
util-linuxhttps://mirrors.edge.kernel.org/pub/linux/utils/util-linux/
OpenSSLhttps://www.openssl.org/source/
OpenSSHhttps://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/
xzhttps://tukaani.org/xz/
Rubyhttps://cache.ruby-lang.org/pub/ruby/2.6/
Xorghttps://lists.x.org/archives/xorg-announce/
githttps://github.com/git/git
Openboxhttp://openbox.org/
LLVMhttps://github.com/llvm/llvm-project/releases
Apachehttps://archive.apache.org/dist/httpd/
gtkhttps://gitlab.gnome.org/GNOME/gtk
Falkonhttps://www.falkon.org/
qtwebenginehttps://code.qt.io/cgit/qt/qtwebengine.git/
Firefoxhttps://www.mozilla.org/en-US/firefox/releases/
nsshttps://hg.mozilla.org/projects/nss
node.jshttps://nodejs.org/en/
Mrustchttps://github.com/thepowersgang/mrustc
Rusthttps://github.com/rust-lang/rust/blob/master/RELEASES.md
LibreOfficehttps://www.libreoffice.org/
D-Bushttps://dbus.freedesktop.org/releases/dbus/
expathttps://github.com/libexpat/libexpat/releases/
Ninjahttps://ninja-build.org/
Mesonhttps://github.com/mesonbuild/meson
CMakehttps://www.kitware.com//tag/cmake/
Qemuhttps://www.qemu.org/
Gnumerichttp://www.gnumeric.org/
Xtermhttps://invisible-island.net/xterm/xterm.log.html
libwebphttps://chromium.googlesource.com/webm/libwebp

CVE Details

Apache
Firefox
NSS
Qemu
 

FAQ

The Tinux Qemu VM starts up with a screen resolution of 1024x768. However, I have a bigger screen. How can I use the full screen resolution?

It takes a little bit of hand work, like on Arch. And you will have to do it again once you restart your VM. Candidate to automate it therefore. Here is how it goes with 1280x1024 as an example from the command line:

xrandr
cvt 1280 1024
# E.g. having used the output of xrandr and cvt in the following commands..
xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
xrandr --addmode Virtual-1 "1280x1024_60.00"
xrandr --output Virtual-1 --mode "1280x1024_60.00"

How can I change my wallpaper from the command line?

ls -la /usr/share/wallpapers
# Choose a file that covers, at lest, your screen size.
feh --bg-center <choosen.jpg>
vi ~/.config/openbox/autostart
# Edit the feh line accordingly, so you enjoy your new wallpaper in the next session as well.

Changed the screen resolution, and now my xclock is out of location. How can I setup a new location?

Kill the running xclock process and edit ~/.config/openbox/autostart. For 1280x1024 this line works for me:

xclock -geometry 141x28+1137-1002 -digital -strftime "%Y-%m-%d %H:%M" &

Copy paste the same line into an xterm to make it work for your current session.

Love my wallpaper so much, but my screen is fully covered with application windows. How can I have a look at it?

In ~/.config/openbox/rc.xml is ToggleShowDesktop defined with a key binding of W-d. W might stand for the Windows key, AltGr, the right Alt key, or what have you. If you can't figure it out, you can rebind it also to something that works for you (and reload the X config - or restart X). Using it will show the wallpaper/desktop. Use it again to get all your windows back, including the xclock.

All the windows also don't allow me to use the right mouse click on the background to open the applications menu. How to get to this menu without seeing the desktop background?

In ~/.config/openbox/rc.xml is also the W-m keybinding defined. Same remarks as to the question above apply here.

Great having a whole build of a running Linux From Scratch system with a bunch of Beyond Linux From Scratch applications (notably X Org) already in place. Still, there is not all there yet that I wish.. How can I continue playing with BLFS and installing more applications to my desire?

Open an xterm terminal and switch to the 'lfs' user and proceed with something like the following:

su - lfs
cd /sources
find . -type d
ls -la /usr/share/doc/tinux/
lynx /usr/share/doc/tinux/BLFS-BOOK-10.1-nochunks.html
wget https://ftp.gnu.org/gnu/screen/screen-4.8.0.tar.gz
md5sum screen-4.8.0.tar.gz | grep d276213d3acd10339cd37848b8c4ab1e
echo $?
wget http://www.linuxfromscratch.org/patches/blfs/10.1/screen-4.8.0-upstream_fixes-1.patch
less screen-4.8.0-upstream_fixes-1.patch
tar xf screen-4.8.0.tar.gz
cd screen-4.8.0
patch -Np1 -i ../screen-4.8.0-upstream_fixes-1.patch
./configure --prefix=/usr \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--with-socket-dir=/run/screen \
--with-pty-group=5 \
--with-sys-screenrc=/etc/screenrc
sed -i -e "s%/usr/local/etc/screenrc%/etc/screenrc%" {etc,doc}/*
make
sudo make install
sudo install -m 644 etc/etcscreenrc /etc/screenrc
cd ..
sudo rm -rf screen-4.8.0
which screen

Then put this into a bash script and send it to me:).

How to build rustc from source without using a pre-existing binary rustc version?

./configure
time { make lfs_9.0 && make blfs_9.0 && make rustc; }

The resulting rustc and cargo binaries (1.52.0) are stored on the host in the build directory (./build/rustc-1.52.0/bin). The bootstrap process starts with mrustc, which uses GCC to build itself. Afterwards mrustc is used to build rustc 1.40 which is then used recursively all the way up till version 1.52.
The build process takes an additional 100 GB of disk space (so a total of 200GB is needed!).
The resulting 1.52 binaries can then be copied and used in Tinux/LFS 11.0, e.g. to build Firefox. The detour via Tinux/LFS 9.0 has been taken, as mrustc does not yet support the latest GCC 11.2.0 version.
Oh, and on my setup with an AMD 2700X and 32GB of ram, the whole build process takes over 21 hours. Especially with less RAM, expect another 10 hours.

In case you don't use Tinux but LFS/BLFS directly, here is an HowTo for building Rustc from source with LFS/BLFS 11.0 (hint, you have to install GCC 9.2.0 first). Actually, this HowTo works also on Tinux 11.0 :).

In case you use the latest Tinux, 11.12 right now, just use 'make rustc' (after the whole BLFS and LFS had been built already) on the host with the Qemu client image not running and powered off.

How to replace the xterm icon?

Who got the idea to mix the colors red and blue for an icon?! So this is how our slight variation looks:

To build xterm with this icon, add the following two files into the icons directory inside the untarred xterm-368 folder, when building xterm according to the BLFS 11.0 guide.

cd xterm-368/icons
mv mini.xterm_32x32.xpm mini.xterm_32x32.xpm.orig
mv mini.xterm_48x48.xpm mini.xterm_48x48.xpm.orig
wget http://techinvest.li/tinux/images/mini.xterm_32x32.xpm
wget http://techinvest.li/tinux/images/mini.xterm_48x48.xpm
cd ..
# Continue with the BLFS build instructions (see link above)..

Having build all of BLFS and using the Falkon web browser is all fine and dandy. But how about building Firefox?

For Firefox you need Java (I think) and especially Rustc. You can install both via binary packages according to the BLFS book. Or you can build them mostly (in the Java case) from source. But rust on an AMD 2700X with 8 cores and 16 threads takes 20 hours to build.

So if you want to go ahead, do this on the host with no Qemu image actively running:

make java && make rustc && make firefox

 

License

The LFS/BLFS books are licensed under the MIT License, and therefore everything that represents Tinux, scripts and documentation, is also licensed under the MIT Licence. The binary Devuan install image and all the source based packages/projects in archive files, which Tinux bundles together, are of course licensed each under their respective licenses, e.g. the Linux kernel under the GPL version 2.0 etc. Except the Devuan installation image, all the included packages are distributed with full source code (and only source code) and contain their full license information each. For Devuan see here: https://www.devuan.org/os/source-code

 
Version History
 
2023-10-08 16:24:57   New version 11.5 with updates for the Falkon and Firefox browsers. GCC version is 12.3.0.
2023-08-13 19:02:25   Added base TFS rule for version 11.5. 11.4 is still the default rule and version. But the next full release of Tinux will be based on the Tinux From Scratch book 11.5, a fork of Linux From Scratch. TFS 11.5 updates GCC to 12.2.0, adds OpenSSH to the base set already, and removes Ninja and Meson packages, that were never needed for LFS in the first place.
2023-06-12 22:34:22   A new rule 'make emu' to build DOSBox and a Risc-V 64 BusyBox QEmu virtual machine. This rule should be used as the last rule, after 'make x' and after all other BLFS applications desired have been build, like LibreOffice or Firfox.
2023-05-26 12:24:24  

And we are back in the Rust and Firefox business. Mrustc supports now building Rustc 1.54 directly, so we can skip build of all the inbetween versions starting with 1.39.

So if you want to build for Tinux everything we've got, do the following:

make && make blfs && make libreoffice && make db && make rustc && make firefox && make emu

Grab a huge huge coffee cup, fill it to the max, and watch the console log message run by...

Oh, and everything is tested now to really work offline. There is still an additional 'inofficial' make java rule, which however uses one binary JDK 12 to bootstrap up to JDK 17.

2023-05-01 16:16:40  Upgrade to 11.4, based on a development version of LFS 11.4. Gimp has been added to BLFS. The Vice C64 emulator is used to offer a Basic programming environment.
2023-03-06 07:34:58 The BLFS 11.3 part for Tinux is now ready. Default and only full blown web browser is now Falkon, the Chromium based browser from KDE. Firefox is not build, as we save 20 hours without building Rustc from source.
2023-03-04 11:09:10 New make rule lfs_11.3 to create the base system according to LFS 11.3. BLFS support still in the works.
2023-01-28 14:17:52 Default make rules now use LFS version 11.2.
2023-01-23 13:44:01 New 11.2 make rules, not yet set as default. Especially building rustc from source needs new steps.
2022-10-18 19:51:33 Fix firefox build.
2022-10-17 15:05:48 'make java' has been adapted to version 11.12.
2022-10-17 11:48:07 Intermediate version 11.12 released, which is a step inbetween 11.1 and the upcoming 11.2 version.
2022-03-05 13:08:29 Use official realease of LFS 11.1 for Tinux now. OpenSSL still uses 1.1.1m instead of 3.0.1 for be bootstrapping of rustc-1.58.1.
2022-02-16 11:34:19 Upgrade to LFS 11.1 and some BLFS 11.1.
2021-11-21 10:23:56 Build rustc-1.52.0 via mrustc using GCC.
2021-11-17 19:10:48 Fix BLFS build bug in the older version based on version 9.0. Signing of the 11.0 tar files.
2021-11-12 15:25:18 Use most of the memory available.
2021-09-28 10:34:02 Finally based on LFS/BLFS version 11.0. BLFS contains two browsers, Falkon and Epiphany, and Abiword and Gnumeric. Total build time with LFS on 7 threads is 16.4 hours.
2021-08-22 22:59:30 More openbox window manager polishing via menu.
2021-08-08 17:35:00 FAQ added.
2021-08-07 07:55:49 Reboot and power off scripts added to the Openbox menu, as well as early basic java tools added.
2021-08-05 09:32:28 AbiWord and a wallpaper added as well as a polished Openbox user menu plus an introductory message before login.
2021-08-01 12:34:57 Added youtube-dl version 2021.06.06, which is not part of BLFS, but extremely useful.
2021-07-18 13:55:22 Gnumeric from BLFS 8.1 added (because it doesn't need Rust).
2021-07-13 15:02:03 X.Org and Falkon web browser are now a part of make blfs.
2021-06-28 09:04:08 Tested installation on the bare metal via rsync.
2021-06-19 07:28:58 First mini steps of BLFS are included, so the user can continue to enjoy Tinux with OpenSSH available to connect from and to the host environment.
2021-06-18 10:48:43 Start kernel with net.ifnames=0 to get eth0 interface back. Whole LFS build works now in one go as well as resulting VM startup in GUI mode added to the makefile.
2021-06-17 14:53:13 Finished all of LFS-10.1 (kernel and grub installation), but minimum missing to be useful is OpenSSH from BLFS. Those packages as well as the BLFS-10.1 documentation have been added, but are not used yet.
2021-06-17 12:04:10 Inside the virtual machine use all the cores/threads, instead of a fixed number.
2021-06-17 11:45:20 First version that runs through the whole book compilation in one go, except the final kernel and grub setup.
2021-06-16 14:16:34 PGP signing of binary and git hashes.
 

Contact

For contact join the IRC channel #tinux on the Libera network (irc.libera.chat) or send email to: clemens.lahme@techinvest.li

My PGP public key you can find at: http://techinvest.li/clemens_lahme_at_techinvest_dot_li.pgp

 

The original location of this Tinux home page is at: http://techinvest.li/tinux/