diff options
Diffstat (limited to 'urunlevel/my_linux/Trinux/README')
-rw-r--r-- | urunlevel/my_linux/Trinux/README | 346 |
1 files changed, 346 insertions, 0 deletions
diff --git a/urunlevel/my_linux/Trinux/README b/urunlevel/my_linux/Trinux/README new file mode 100644 index 0000000..b07fa7f --- /dev/null +++ b/urunlevel/my_linux/Trinux/README | |||
@@ -0,0 +1,346 @@ | |||
1 | Trinux Documentation Matthew Franz <mfranz@cisco.com> | ||
2 | http://trinux.sf.net/docs.txt 21 August 2003 | ||
3 | |||
4 | 0. Introduction | ||
5 | |||
6 | 0.1 What is Trinux? | ||
7 | |||
8 | Trinux is a ramdisk-based Linux distribution that was first | ||
9 | released in April of 1998 and has been maintained on and off | ||
10 | since then. Like other Linux distributions it consists of a | ||
11 | Linux kernel, base utilities, and a variety of packages. Like | ||
12 | many embedded distributions, Trinux uses Busybox, which contains | ||
13 | small versions of common utilities. See http://www.busybox.net. | ||
14 | |||
15 | 0.2 Where can I get the source? | ||
16 | |||
17 | Many of the standard utilities came from Slackware 7.1 or | ||
18 | when components needed to be upgraded, I pulled the source | ||
19 | from the Debian stable. The "original code" would be in the | ||
20 | /linuxrc script that is executed within | ||
21 | |||
22 | 0.3 Installation | ||
23 | |||
24 | Trinux is released in either 1.4 meg floppy images or small ISO | ||
25 | images. For the floppy images use dd on unix boxes or rawrite | ||
26 | on Windows. Search the web for info. | ||
27 | |||
28 | 0.4 If in doubt look at the /linuxrc script! | ||
29 | |||
30 | 1. Boot Media | ||
31 | |||
32 | 1.1 Common Format | ||
33 | |||
34 | * bzImage - compressed linux kernel | ||
35 | * tux - trinux configuration directory (like /etc on Unix) that | ||
36 | gets copied to /etc/tux when trinux boots | ||
37 | * bootpkg - packages that need to be loaded early | ||
38 | * kpkg - modular kernel packages | ||
39 | * initrd.gz - compressed initial ramdisk | ||
40 | * modules - raw (*.o) modules will be automatically loaded | ||
41 | |||
42 | 1.2 Floppy Disks | ||
43 | |||
44 | Trinux uses MS-DOS (vfat actually) formatted disks and syslinux | ||
45 | as the bootloader. The files/directories described in 1.1 are | ||
46 | directly off the root of the drive. | ||
47 | |||
48 | * syslinux.cfg - bootloader configuration file | ||
49 | * ldlinux.sys - SYSLINUX bootloader (http://syslinux.zytor.com/) | ||
50 | |||
51 | 1.3 CD-ROM | ||
52 | |||
53 | Bootable CD's are ISO9660 filesytem contain 2 directories: | ||
54 | * isolinux - bzImage, initrd.gz, isolinux.bin, isolinux.cfg | ||
55 | * trinux - bootpkg, kpkg, modules, tux | ||
56 | |||
57 | 1.4 Fixed Partition (IDE Drive) | ||
58 | |||
59 | Trinux can also be booted from a Windows 95/98, MS-DOS, or | ||
60 | FreeDOS partition using loadlin.exe. This is an option for older | ||
61 | hardware that might not have a CD-ROM (or a bootable one) or | ||
62 | if you want to load packages from a compact Flash drive using an | ||
63 | IDE Compact-Flash Adapter. | ||
64 | |||
65 | 1.4.1 Prepping the Drive | ||
66 | |||
67 | Use a Windows 95/98 or MS-DOS boot disk or the Trinux FreeDOS | ||
68 | Utility Disk (available on the downloads page) to create a FAT | ||
69 | partition. This involves running FDISK, FORMAT, and SYS. You | ||
70 | should copy loadlin.exe to the drive and it is also useful to have | ||
71 | a text editor (FreeDOS has TE) to edit batch files. You will | ||
72 | need to create trinux directory. My C:\ drive (mounted from | ||
73 | within Trinux as a vfat) looks like this: | ||
74 | |||
75 | trinux> ls -al | ||
76 | root root 16384 Jul 24 23:28 . | ||
77 | root root 832 Sep 3 2002 .. | ||
78 | root root 2048 Jul 20 18:51 .links | ||
79 | root root 50 Jul 20 17:35 autoexec.bat | ||
80 | root root 618999 Jul 20 18:11 bzimage | ||
81 | root root 86561 Aug 15 2001 command.com | ||
82 | root root 45836 Jul 20 17:35 fdisk.exe | ||
83 | root root 13741 Jul 20 17:35 format.exe | ||
84 | root root 600357 Jul 21 01:01 initrd.gz | ||
85 | root root 75663 Sep 3 2001 kernel.sys | ||
86 | root root 32177 Jul 20 17:35 loadlin.exe | ||
87 | root root 32719 Jul 20 17:35 loadlin.txt | ||
88 | root root 2048 Jul 20 18:33 old | ||
89 | root root 8634 Jul 20 17:36 sys.com | ||
90 | root root 44706 Jul 20 17:35 te.exe | ||
91 | root root 2048 Jul 21 12:31 trinux | ||
92 | |||
93 | TRINUX.BAT on the FreeDOS boot floppy contains the following | ||
94 | which I renamed to AUTOEXEC.BAT once I new it was stable. | ||
95 | |||
96 | loadlin bzimage initrd=initrd.gz root=/dev/ram0 rw | ||
97 | |||
98 | I have had mixed results with FreeDOS, so it might be best | ||
99 | to find a Windows 95/98/SE boot disk with fdisk and format. | ||
100 | I found a DOS 6.22 boot disk with the right tools from | ||
101 | http://www.bootdisk.com. | ||
102 | |||
103 | Copy a kernel that has IDE support (all the kernels on the | ||
104 | boot floppies after Trinux 0.890 should have the or a kernel | ||
105 | from the CD-ROM will work to) and an initrd.gz to the c:\ | ||
106 | drive. You can do this from DOS or from Linux. | ||
107 | |||
108 | 1.4.2 Copying necessary files to the DOS partition | ||
109 | |||
110 | Boot with a Trinux floppy (or CD-ROM) that has IDE support | ||
111 | and then mount the MS-DOS partition with the following | ||
112 | command | ||
113 | |||
114 | # mount -t vfat /dev/hda1 /mnt | ||
115 | |||
116 | This assumes the first IDE drive and should work for most | ||
117 | cases. Now create (or cd) the trinux directory on that | ||
118 | partition and create the subdirectories for packages | ||
119 | |||
120 | # cd /mnt/trinux | ||
121 | # mkdir bootpkg kpkg pkg modules | ||
122 | # mkdir -p tux/config | ||
123 | # mkdir tux/ | ||
124 | |||
125 | Now you need to get a minimum set of packages into the bootpkg | ||
126 | directory. If you have network access you can download them with | ||
127 | links (getpkg links) or you can copy them to floppies. I have | ||
128 | the following in mine: | ||
129 | |||
130 | root root 245776 Jul 20 19:17 baselib.tgz | ||
131 | root root 15932 Jul 20 18:17 dhcpcd.tgz | ||
132 | root root 90312 Jul 20 18:17 dnslibs.tgz | ||
133 | root root 163951 Jul 21 12:28 iptables.tgz | ||
134 | root root 131200 Jul 21 12:28 netfilter.tgz | ||
135 | root root 77834 Jul 20 19:22 pthread.tgz | ||
136 | root root 378444 Jul 20 19:22 term.tgz | ||
137 | |||
138 | These will always get loaded. You can also put packages in the | ||
139 | pkg directory and these may/may not load depending on your | ||
140 | configuration. | ||
141 | |||
142 | Remember, after you are through modifying the partition, it | ||
143 | needs to be unmounted with: | ||
144 | |||
145 | #umount /dev/hda1 | ||
146 | or | ||
147 | #umount /mnt | ||
148 | |||
149 | 1.4.3 Configuarition | ||
150 | |||
151 | |||
152 | 2. Networking | ||
153 | |||
154 | 2.1 Hardware Detection | ||
155 | |||
156 | In order for you to use networking your interface(s) must be | ||
157 | detected by the kernel. In order for this to occur you must either | ||
158 | have support for your NIC compiled into the kernel or use a kernel | ||
159 | module. Older versions of Trinux had support for the most common | ||
160 | NiCs built in, but that is no longer the case. | ||
161 | |||
162 | If your hardware was succuessfully found | ||
163 | |||
164 | # dmesg | grep eth0 | ||
165 | eth0: OEM i82557/i82558 10/100 Ethernet, 00:03:47:B9:12:08, IRQ 11 | ||
166 | |||
167 | 2.2 Module Selection | ||
168 | |||
169 | 3. Kernel Modules | ||
170 | |||
171 | Raw (non-packaged kernel modules are available at: | ||
172 | http://trinux.sf.net/kernel/ | ||
173 | |||
174 | Packaged kernel modules are available at http://trinux.sf.net/pkg/2.4.x/ | ||
175 | and may be installed with the "getkpkg <name>" | ||
176 | |||
177 | Trinux puts all packages in /lib/modules or /usr/lib/modules instead | ||
178 | of the standard linux convention of /lib/modules/2.4.x/... | ||
179 | |||
180 | 4. Packages | ||
181 | |||
182 | 4.1 Package Format | ||
183 | |||
184 | Packages are simply tarballs with an initialization script that | ||
185 | will be executed from within /etc/init.d/package_name or | ||
186 | /etc/init.m/kernel_package_name | ||
187 | |||
188 | 4.2 Scripts | ||
189 | |||
190 | * pkgadd - loads a package from a local filesystem | ||
191 | * getpkg - loads the package from the network | ||
192 | * getkpkg - loads a kernel package from the network | ||
193 | * pkglist - lists available packages | ||
194 | * rmpkg - deletes package | ||
195 | * mypkg - shows packages currently installed | ||
196 | |||
197 | 4.3 Building your own | ||
198 | |||
199 | All the Trinux packages are compiled with glibc 2.1.3 using | ||
200 | Slackware 7.1. I upgraded the compiler to gcc 2.95 and have upgraded | ||
201 | libraries as necessary. | ||
202 | |||
203 | 4.4 Adding packages after bootup | ||
204 | |||
205 | You can either use the getpkg/getkpkg commands to load a package | ||
206 | from the network. If /etc/tux/config/localpkg is set | ||
207 | (added 0.891) | ||
208 | |||
209 | 4.5 Configuration | ||
210 | |||
211 | Add list of package (in order) to /etc/tux/config/pkglist and these | ||
212 | will be loaded at boot | ||
213 | |||
214 | 4.6 Miscellaneous | ||
215 | |||
216 | 5. Filesystems | ||
217 | |||
218 | 5.1 Supported Filesytems | ||
219 | |||
220 | Trinux may only have support for a few filesystems such as minix | ||
221 | vfat (Windows) and ISO9660 (for CDROMs). To see which filesystems | ||
222 | are currently supported in the kernel: | ||
223 | |||
224 | # cat /proc/filesystems | grep -v nodev | ||
225 | minix | ||
226 | vfat | ||
227 | iso9660 | ||
228 | reiserfs | ||
229 | |||
230 | In this case I installed the reiserfs module: | ||
231 | |||
232 | # lsmod | ||
233 | reiserfs 165600 1 | ||
234 | 3c59x 24560 1 | ||
235 | 8139too 13396 1 | ||
236 | mii 2092 0 [8139too] | ||
237 | |||
238 | |||
239 | To mount a device you use the following command: | ||
240 | |||
241 | mount <device> -t <filesystem type> <mount point) | ||
242 | |||
243 | So to mount the floppy you would | ||
244 | |||
245 | You can determine the which IDE devices are present by the following | ||
246 | command: | ||
247 | |||
248 | # dmesg | grep hd | ||
249 | ide0: BM-DMA at 0x1850-0x1857, BIOS settings: hda:DMA, hdb:pio | ||
250 | ide1: BM-DMA at 0x1858-0x185f, BIOS settings: hdc:pio, hdd:pio | ||
251 | hda: IC25N040ATCS04-0, ATA DISK drive | ||
252 | hda: 78140160 sectors (40008 MB) w/1768KiB Cache, CHS=5168/240/63 | ||
253 | hda: hda1 hda2 hda3 < hda5 hda6 > hda4 | ||
254 | hde: LEXAR ATA FLASH, ATA DISK drive | ||
255 | hde: 96384 sectors (49 MB) w/1KiB Cache, CHS=753/4/32 | ||
256 | hde: hde1 | ||
257 | |||
258 | So assuming hde1 were a vfat partition, you would use: | ||
259 | |||
260 | # mount -t vfat /dev/hde1 /mnt | ||
261 | # mount | ||
262 | /dev/hda2 on / type ext3 (rw,errors=remount-ro) | ||
263 | proc on /proc type proc (rw) | ||
264 | devpts on /dev/pts type devpts (rw,gid=5,mode=620) | ||
265 | /dev/hda4 on /alt type reiserfs (rw) | ||
266 | /trinux/boot/trinux.img on /loop type vfat (rw,loop=/dev/loop0) | ||
267 | /dev/hde1 on /mnt type vfat (rw) | ||
268 | |||
269 | This was from my laptop. Within Trinux, the following is more | ||
270 | typical: | ||
271 | |||
272 | # mount | ||
273 | /dev/ram0 on / type minix (rw) | ||
274 | /proc on /proc type proc (rw) | ||
275 | /dev/null on /usr type tmpfs (rw) | ||
276 | /dev/null on /home type tmpfs (rw) | ||
277 | /dev/null on /var type tmpfs (rw) | ||
278 | /dev/hda2 on /hda2 type reiserfs (rw) | ||
279 | |||
280 | |||
281 | 5.3 Swap | ||
282 | |||
283 | Usually, you probably have enough memory (otherwise you wouldn't | ||
284 | be running ramdisks) but if you want to set up a swap file or swap | ||
285 | filesystem, put the name of the file (within an existing filesytem) | ||
286 | the name of the partition (/dev/hda3) in /etc/tux/config/swap and | ||
287 | the linuxrc will automatically run mkswap and swapon. You may | ||
288 | want to make sure the swaputils.tgz package is included, | ||
289 | although it will be loaded automatically if /sbin/makeswap | ||
290 | isn't found. | ||
291 | |||
292 | 5.4 Tmpfs | ||
293 | |||
294 | A neat feature that came out in 2.4 was the ability to use the | ||
295 | temporary or shared memory filesystem instead of ramdisks. The key | ||
296 | advantage is that ramdisks are completed allocated when the are | ||
297 | created, but tmpfs partitions only use RAM as they are filled. | ||
298 | |||
299 | |||
300 | Trinux only has support for a minimal set of filesystems | ||
301 | |||
302 | 6. Management and Monitoring | ||
303 | |||
304 | Although it is probably not the most common option, Trinux can be | ||
305 | used in a headless server capacity | ||
306 | |||
307 | 6.1 Serial Console | ||
308 | |||
309 | 6.2 SSH Remote Logins | ||
310 | |||
311 | 6.3 Enabling Cisco Discovery Protocol (CDP) | ||
312 | |||
313 | 6.4 Building a Local Package Server | ||
314 | |||
315 | 7. Miscellaneous | ||
316 | |||
317 | 6.1 Troubleshooting | ||
318 | |||
319 | Recent versions of trinux have a /sbin/hwinfo script that gathers | ||
320 | hardware information about the system and saves it to the file | ||
321 | /tmp/hwinfo. It basically saves the output of the dmesg command | ||
322 | and copies the values of some /proc files that can be used to help | ||
323 | troubleshoot hardware problems. The following commands allow you to | ||
324 | save this file to the boot floppy (assuming you have enough room) | ||
325 | |||
326 | # fmount | ||
327 | # cp /tmp/hwinfo /floppy | ||
328 | # fumount | ||
329 | |||
330 | You can then post some or all of this file to the trinux-talk mailing | ||
331 | list when you have a problem. | ||
332 | |||
333 | 6.2 Where to get help | ||
334 | |||
335 | You should subscribe to the trinux-talk mailing list | ||
336 | |||
337 | 6.3 Floppy Errors | ||
338 | |||
339 | If you do not have a floppy drive or you floppy drive takes very | ||
340 | long to time out, append "nofloppy" to the kernel boot arguments. | ||
341 | CD-ROM booting automatically disables this checking. I had to do | ||
342 | this on an old Compaq 486-66 because it was taking several minutes | ||
343 | to complete the bootup: | ||
344 | |||
345 | loadlin bzimage initrd=initrd.gz root=/dev/ram0 rw nofloppy | ||
346 | |||