- Home
- Computers & IT
- Into the Core: a look at Tiny Core Linux
Into the Core: a look at Tiny Core Linux
Book Description:
Your Dvd player doesn’t need to print. Your thermostat doesn’t need to browse the web. The Core project is here to provide you a base to build on, one that includes nothing unnecessary. From digital signage to custom household appliances, from virtual machines to small Android install images, building it your way has never been more convenient. You have complete control over what is included, what hardware is supported, with nothing extra and no bloat. Add just what you require instead of removing what you don’t need. This book covers Core from start to finish. The concepts are explained in detail, from usage details to internals, ending up with several example projects. A stand-alone Rdp client in 17 megabytes? You got it.
Table of Contents
Preface ............................................................................................ ix
1. Conventions ........................................................................ ix
I. Intro & basic use ......................................................................... 1
1. Core concepts ...................................................................... 3
1.1. Philosophies .............................................................. 3
1.2. Frugal install ............................................................. 4
1.3. Boot codes ................................................................ 5
1.4. USB and other external storage devices ................... 5
1.5. Dependency checking and downloading .................. 6
1.6. Modes of operation .................................................. 6
1.7. The default mode: cloud/internet ............................. 6
1.8. Mount mode ............................................................. 7
1.9. Copy mode ............................................................... 8
1.10. Backup/restore & other persistence options ........... 8
1.10.1. Backup/restore ............................................. 9
1.10.2. Persistent home ............................................ 9
1.11. Bottom line ........................................................... 10
2. Installing ............................................................................ 11
2.1. With the official installer ....................................... 11
2.1.1. Step 1: Source and destination .................... 12
2.1.2. Step 2: File system type .............................. 13
2.1.3. Step 3: Boot codes ...................................... 14
2.1.4. Step 4: Optional parts .................................. 15
2.1.5. Step 5: Good to go? .................................... 16
2.2. From Windows via core2usb ................................. 18
2.3. Manually ................................................................. 18
2.3.1. Step 1: Partitioning & formatting ................ 19
2.3.2. Step 2: Files ................................................. 20
2.3.3. Step 3: Bootloader ....................................... 20
3. Basic package management via GUI ................................ 23
4. Basic package management via CLI ................................. 29
4.1. tce-load ................................................................... 30
4.2. Comparing package managers ................................ 32
5. Updating the base system ................................................. 33Into the Core
iv
6. Updating extensions .......................................................... 35
6.1. Apps ........................................................................ 35
6.2. tce-update ............................................................... 36
7. Persistence ......................................................................... 39
7.1. Backup .................................................................... 39
7.2. Persistent home/opt ................................................ 40
7.3. Personal extension .................................................. 41
7.4. Other data storage .................................................. 41
7.5. Common setup ........................................................ 41
7.6. Summary ................................................................. 42
8. Managing extensions ......................................................... 43
8.1. MD5 checking ........................................................ 43
8.2. Check for orphans .................................................. 43
8.3. Dependencies and deletions ................................... 43
8.4. Check onboot unneeded ......................................... 44
8.5. Onboot/ondemand maintenance ............................. 44
9. Virtualization - Core as a guest ........................................ 45
9.1. Qemu / KVM .......................................................... 45
9.2. Virtualbox ............................................................... 45
9.3. VMWare ................................................................. 46
9.4. HyperV ................................................................... 46
10. Bootcodes explained ....................................................... 47
10.1. tce - extensions directory ..................................... 47
10.2. restore - backup location ...................................... 48
10.3. waitusb - slow drive detection ............................. 48
10.4. swapfile - swap in a file ....................................... 49
10.5. home and opt - persistence ................................... 49
10.6. lst - extension list ................................................. 50
10.7. base - don’t load extensions ................................. 50
10.8. norestore - don’t load backup ............................... 50
10.9. safebackup - enable safe backup by default .......... 51
10.10. showapps - verbose extension loading ............... 51
10.11. iso - load extensions from an ISO file ................ 51
10.12. vga - framebuffer resolution ............................... 52
10.13. xsetup - configure X during boot ....................... 52
10.14. lang - system locale ............................................ 53Into the Core
v
10.15. kmap - console keymap ...................................... 53
10.16. text - boot to text mode ...................................... 53
10.17. superuser - boot to text mode, as root ................ 54
10.18. noicons - don’t display icons ............................. 54
10.19. noswap - don’t use the swap partition ................ 54
10.20. nodhcp - don’t grab an IP address ...................... 54
10.21. noutc - BIOS is using local time ........................ 55
10.22. tz - timezone ....................................................... 55
10.23. pause - wait for a keypress before completing
boot ................................................................................ 55
10.24. cron and syslog - start daemons ......................... 55
10.25. host - set host name ............................................ 56
10.26. protect - use encrypted backup ........................... 56
10.27. secure - set password on boot ............................ 56
10.28. noautologin - disable automatic login ................ 57
10.29. user - set the default username ........................... 57
10.30. desktop - specify window manager .................... 57
10.31. laptop - force loading of laptop modules ............ 57
10.32. noembed - use a separate tmpfs ......................... 58
10.33. nozswap - disable compressed swap in
RAM .............................................................................. 58
10.34. xvesa - set resolution directly ............................. 58
10.35. mydata - use a different name for backup .......... 59
10.36. blacklist - blacklist modules ............................... 59
10.37. multivt - setup multiple consoles ....................... 59
II. Advanced use ............................................................................ 61
11. Remastering ..................................................................... 63
11.1. Prerequisites .......................................................... 63
11.2. Unpacking ............................................................. 63
11.3. Packing ................................................................. 64
11.4. Creating an ISO image ......................................... 65
12. Remastering with a separate image ................................. 67
12.1. Practice image ...................................................... 67
12.2. Booting with more than one initrd ....................... 68
13. Including extensions in the ISO ...................................... 69
13.1. Example: including nano ...................................... 69Into the Core
vi
14. Creating a personal (data) extension ............................... 71
15. Creating an extension ...................................................... 73
15.1. Building less ......................................................... 73
15.2. Creating the extension directory tree .................... 74
15.3. Packing up ............................................................ 75
16. Extension install scripts .................................................. 77
16.1. Example: nano ...................................................... 77
17. Creating custom boot codes ............................................ 79
III. Core internals .......................................................................... 81
18. The TCZ format .............................................................. 83
18.1. Squashfs parameters ............................................. 84
18.2. What’s inside? ...................................................... 85
19. The boot process ............................................................. 87
19.1. The first step: /init ................................................ 87
19.2. Real Boot: init ...................................................... 88
19.3. Bootstrap: rcS ....................................................... 88
19.4. Main boot: tc-config ............................................. 88
19.5. Bootsync.sh .......................................................... 90
19.6. Bootlocal.sh .......................................................... 90
19.7. Root’s login .......................................................... 90
19.8. Regular user .......................................................... 90
19.9. The X Window System ........................................ 91
19.10. .X.d ...................................................................... 91
20. The tce directory structure .............................................. 93
20.1. Firstrun ................................................................. 94
20.2. Onboot.lst ............................................................. 94
20.3. Xwbar.lst .............................................................. 94
20.4. Ondemand scripts ................................................. 95
21. Accompanying extension files ........................................ 97
21.1. Dep files ............................................................... 97
21.2. Info files ............................................................... 98
21.3. List files ................................................................ 98
21.4. Md5 files .............................................................. 99
21.5. Tree files ............................................................... 99
21.6. Zsync files .......................................................... 100
IV. Projects .................................................................................. 101Into the Core
vii
22. Simple Web server ........................................................ 103
22.1. Custom CGI example ......................................... 104
23. Automated network installer ......................................... 105
23.1. Start files ............................................................ 105
23.2. The installer script .............................................. 105
23.3. Packing up & testing .......................................... 108
24. Private cloud .................................................................. 109
24.1. SSH ..................................................................... 109
24.2. HTTPD ............................................................... 110
24.3. Connections, ports .............................................. 111
24.4. Security considerations ....................................... 111
24.5. Final result .......................................................... 112
25. A thin remote desktop client ......................................... 115
25.1. Add the rdesktop extension and dependencies
to the ISO .................................................................... 115
25.2. Make the boot wait for getting an IP address ..... 116
25.3. Fire up rdesktop when the system is up ............. 117
25.4. Result .................................................................. 119
26. File hosting via FTP ...................................................... 121
26.1. Installing & configuration .................................. 121
26.2. Testing ................................................................ 123
26.3. Results ................................................................ 123
27. Network booting ............................................................ 125
27.1. Selecting the base image .................................... 126
27.2. Are separate extensions needed? ........................ 126
27.3. Other considerations ........................................... 127
28. Bringing up old hardware - common gotchas ............... 129
28.1. BIOS ................................................................... 129
28.2. Sound .................................................................. 130
28.3. VESA support .................................................... 130
28.4. Networking ......................................................... 131
28.5. Bigger hard drives .............................................. 131
28.6. Memory limitations ............................................ 132
29. A Web kiosk ................................................................. 135
29.1. Selecting extensions ........................................... 135
29.2. Configuring Core extensions .............................. 136Into the Core
viii
29.2.1. iDesk icons .............................................. 136
29.2.2. iDesk autoload ......................................... 138
29.2.3. Firefox profile .......................................... 138
29.2.4. Firefox autoload ...................................... 139
29.2.5. Configuring Firefox ................................. 139
29.3. Creating our add-on ............................................ 140
29.3.1. Folder and file structure .......................... 140
29.4. Shutdown considerations .................................... 146
29.5. Results ................................................................ 146
Index ............................................................................................ 149