website view en/doc/scratchbook/index.html @ rev 1344

Resize balinor logo to 120px
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jan 22 23:02:15 2021 +0100 (2021-01-22)
parents 5ce7c39d2aa5
children
line source
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>SliTaz Scratchbook</title>
6 <meta name="description" content="">
7 <meta name="expires" content="never">
8 <meta name="modified" content="2008-11-22 17:00:00">
9 <meta name="publisher" content="www.slitaz.org">
10 <meta name="author" content="Christophe Lincoln">
11 <link rel="shortcut icon" href="favicon.ico">
12 <link rel="stylesheet" href="book.css">
13 </head>
14 <body>
16 <!-- Header and quick navigation -->
17 <div id="header">
18 <div align="right" id="quicknav">
19 <span id="top"></span>
20 <a href="../index.php">SliTaz doc</a>
21 </div>
22 <h1><font color="#3E1220">SliTaz Scratchbook</font></h1>
23 </div>
25 <!-- Content. -->
26 <div id="content">
27 <div class="content-right"></div>
30 <h2><font color="#df8f06">Scratchbook</font></h2>
31 <p>
32 Index of documents, step by step construction of a mini GNU/Linux
33 LiveCD and installation instructions.
34 </p>
35 <h3>Table of contents</h3>
36 <h4>LiveCD</h4>
37 <ul>
38 <li><a href="#intro">Introduction.</a></li>
39 <li><a href="#org">Organize a working directory.</a></li>
40 <li><a href="base-system.html">Construction of the base SliTaz system.</a></li>
41 <li><a href="base-apps.html">Base applications.</a></li>
42 <li><a href="base-ncurses.html">Ncurses libraries and applications.</a></li>
43 <li><a href="locale.html">Install and configure Locale &amp; i18n.</a></li>
44 <li><a href="boot-scripts.html">Boot scripts.</a></li>
45 <li><a href="x-window-system.html">X window system.</a></li>
46 <li><a href="gtk-libs.html">GTK+ packages and libraries.</a></li>
47 <li><a href="gtk-apps.html">GTK+ applications.</a></li>
48 <li><a href="xorg.html">Xorg.</a></li>
49 </ul>
51 <h3 id="intro">Introduction</h3>
52 <p>
53 The scratchbook allows you to track the creation of the first public
54 release of SliTaz and make a trip to the heart of GNU/Linux. You'll
55 be able to customize your new system or create your own autonomous
56 distro running in system memory (RAM) that's fully installable on
57 a hard drive or USB key. Once started you'll be able to remove the
58 CD-ROM and still have SliTaz working. SliTaz can also be used as an
59 environment in which we can chroot or use the CD-ROM for multitasking.
60 The only prerequisite is a host distribution in which you can store
61 libraries, use a compiler and development tools, etc. The host
62 system can be a chrooted development environment, a minimal
63 distro, SliTaz installed on a hard drive or a ‘general’ distro such
64 as Debian, Slackware, Fedora, Gentoo, Mandriva, Arch, etc. Note
65 that nothing is installed in the host system by our commands.
66 </p>
67 <p>
68 SliTaz uses the ‘Swiss Army Knife’ BusyBox as the basis of the system and
69 the Linux Kernel, it runs embedded using a small memory footprint and
70 provides many files. BusyBox is our main source of information
71 and it's a utility of the Debian project which we use and cherish.
72 </p>
73 <p>
74 SliTaz uses the Syslinux bootloader and an archived initramfs
75 compressed with cpio. This archive is then decompressed in memory
76 at boot by the Kernel into a system of no fixed size, retaining
77 control over init. At the time of compilation or copying of
78 applications, we use strip to clean the repositoiries. The system commands
79 genisoimage or mkisofs are used to create the ISO images. To
80 finish, you can test the ISO image with Qemu or engrave the
81 generated ISO on to a rewritable CD-ROM.
82 </p>
84 <h3 id="org">Organize a working directory</h3>
85 <p>
86 To create SliTaz, we need a working directory and several subdirectories
87 whether you have a chrooted environment for developing or a host
88 system, we advise to use a directory named distro/ in which to
89 work. The distro/ directory can be a simple folder or a partition,
90 but you are obviously free to put all of this elsewhere.
91 </p>
92 <h4>distro/</h4>
93 <p>Contents of a working directory:
94 </p>
95 <ul>
96 <li>rootfs/ --&gt; The root filesystem - this is the root system, designed
97 to operate in RAM, it is used to generate the initramfs image.</li>
98 <li>rootfs.gz --&gt; The initramfs image of our system - a cpio
99 archive compressed with gzip.</li>
100 <li>rootcd/ --&gt; The rootcd. This is the root of the CD-ROM files.</li>
101 <li>src/ --&gt; The sources, Kernel, Syslinux, Busybox, Dropbear,
102 etc (it can also be a symbolic link).</li>
103 </ul>
104 <p>
105 Thereafter, the initramfs and bootable ISO image (slitaz-cooking.iso)
106 will be created in the root directory of our work named SliTaz/.
107 </p>
108 <h4>Option: rootfs.ext2 - using a virtual hard drive</h4>
109 <p>
110 Option: rootfs.ext2 (root filesystem in ext2) is a virtual hard disk
111 formatted with ext2 and mounted on a (rootfs) loop. A device loop allows
112 a file to be used as a standard device (hard drive, floppy, etc) to build
113 a filesystem inside. This file can be any number of megabytes, we propose
114 20,480, which corresponds to 20MB:
115 </p>
116 <pre> # dd if=/dev/zero of=rootfs.ext2 bs=1k count=20480
117 </pre>
118 <p>
119 Create a ext2 filesystem named rootfs.ext2, the option -F formats the
120 file. Note that the -m 0 option doesn't allocate any space for the user
121 root - by default it occupies approximately 5% and the -t option defines
122 the type of filesystem to be used, such as ext2 or ext3:
123 </p>
124 <pre> # mkfs -t ext2 -F -m 0 rootfs.ext2
125 </pre>
126 <p>
127 We can now assemble rootfs.ext2 with a loop, thanks to the -o loop option
128 provided by the mount utility in the rootfs/ directory. You can check if
129 the assembly went well with the <code>df -h</code> command:
130 </p>
131 <pre> # mkdir rootfs
132 # mount -o loop rootfs.ext2 rootfs
133 # df -h
134 </pre>
135 <p>
136 At the end of the session, you can dismount the volume with umount:
137 </p>
138 <pre> # umount rootfs
139 </pre>
140 <p>
141 Now we can proceed to the construction of the <a href="base-system.html">base SliTaz system</a>.
142 </p>
144 <!-- End of content -->
145 </div>
147 <!-- Footer. -->
148 <div id="footer">
149 <div class="footer-right"></div>
150 <a href="#top">Top of the page</a> |
151 <a href="index.html">Table of contents</a>
152 </div>
154 <div id="copy">
155 Copyright &copy; <span class="year"></span> <a href="http://www.slitaz.org/en/">SliTaz</a> -
156 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
157 Documentation is under
158 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
159 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
160 </div>
162 </body>
163 </html>