summaryrefslogtreecommitdiffstats
path: root/urunlevel/my_linux/Trinux/README
blob: b07fa7f45979f75558b26dbf4f21320f7a4b86ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
Trinux Documentation 			        Matthew Franz <mfranz@cisco.com>
http://trinux.sf.net/docs.txt		    21 August 2003

0. Introduction

	0.1 What is Trinux?

		Trinux is a ramdisk-based Linux	distribution that was first
		released in April of 1998 and has been maintained on and off
		since then. Like other Linux distributions it consists of a 
		Linux kernel, base utilities, and a variety of packages. Like
		many embedded distributions, Trinux uses Busybox, which contains
		small versions of common utilities. See http://www.busybox.net.

	0.2 Where can I get the source?

		Many of the standard utilities came from Slackware 7.1 or
		when components needed to be upgraded, I pulled the source
		from the Debian stable. The "original code" would be in the
		/linuxrc script that is executed within

	0.3 Installation

		Trinux is released in either 1.4 meg floppy images or small ISO
		images. For the floppy images use dd on unix boxes or rawrite
		on Windows. Search the web for info.

	0.4 If in doubt look at the /linuxrc script!

1. Boot Media

	1.1 Common Format

		* bzImage - compressed linux kernel
		* tux - trinux configuration directory (like /etc on Unix) that
		  gets copied to /etc/tux when trinux boots
		* bootpkg - packages that need to be loaded early
		* kpkg - modular kernel packages
		* initrd.gz - compressed initial ramdisk
		* modules - raw (*.o) modules will be automatically loaded

	1.2 Floppy Disks

		Trinux uses MS-DOS (vfat actually) formatted disks and syslinux
		as the bootloader. The files/directories described in 1.1 are 
		directly off the root of the drive.

		* syslinux.cfg - bootloader configuration file
		* ldlinux.sys - SYSLINUX bootloader (http://syslinux.zytor.com/)

	1.3 CD-ROM

		Bootable CD's are ISO9660 filesytem contain 2 directories:
		* isolinux - bzImage, initrd.gz, isolinux.bin, isolinux.cfg
		* trinux - bootpkg, kpkg, modules, tux

	1.4 Fixed Partition (IDE Drive)

		Trinux can also be booted from a Windows 95/98, MS-DOS, or
		FreeDOS partition using loadlin.exe. This is an option for older
		hardware that might not have a CD-ROM (or a bootable one) or
		if you want to load packages from a compact Flash drive using an
		IDE Compact-Flash Adapter.

		1.4.1 Prepping the Drive

			Use a Windows 95/98 or MS-DOS boot disk or the Trinux FreeDOS
			Utility Disk (available on the downloads page) to create a FAT
			partition. This involves running FDISK, FORMAT, and SYS. You
			should copy loadlin.exe to the drive and it is also useful to have
			a text editor (FreeDOS has TE) to edit batch files. You will 
			need to create trinux directory. My C:\ drive (mounted from
			within Trinux as a vfat) looks like this:

			trinux> ls -al
			root     root        16384 Jul 24 23:28 .
			root     root          832 Sep  3  2002 ..
			root     root         2048 Jul 20 18:51 .links
			root     root           50 Jul 20 17:35 autoexec.bat
			root     root       618999 Jul 20 18:11 bzimage
			root     root        86561 Aug 15  2001 command.com
			root     root        45836 Jul 20 17:35 fdisk.exe
			root     root        13741 Jul 20 17:35 format.exe
			root     root       600357 Jul 21 01:01 initrd.gz
			root     root        75663 Sep  3  2001 kernel.sys
			root     root        32177 Jul 20 17:35 loadlin.exe
			root     root        32719 Jul 20 17:35 loadlin.txt
			root     root         2048 Jul 20 18:33 old
			root     root         8634 Jul 20 17:36 sys.com
			root     root        44706 Jul 20 17:35 te.exe
			root     root         2048 Jul 21 12:31 trinux

			TRINUX.BAT on the FreeDOS boot floppy contains the following
			which I renamed to AUTOEXEC.BAT once I new it was stable.

				loadlin bzimage initrd=initrd.gz root=/dev/ram0 rw

			I have had mixed results with FreeDOS, so it might be best
			to find a Windows 95/98/SE boot disk with fdisk and format.
			I found a DOS 6.22 boot disk with the right tools from
			http://www.bootdisk.com.

			Copy a kernel that has IDE support (all the kernels on the
			boot floppies after Trinux 0.890 should have the or a kernel
			from the CD-ROM will work to) and an initrd.gz to the c:\
			drive. You can do this from DOS or from Linux.

		1.4.2 Copying necessary files to the DOS partition

			Boot with a Trinux floppy (or CD-ROM) that has IDE support
			and then mount the MS-DOS partition with the following 
			command
			
				# mount -t vfat /dev/hda1 /mnt

			This assumes the first IDE drive and should work for most
			cases. Now create (or cd) the trinux directory on that 
			partition and create the subdirectories for packages

				# cd /mnt/trinux
				# mkdir bootpkg kpkg pkg modules
				# mkdir -p tux/config
				# mkdir tux/

			Now you need to get a minimum set of packages into the bootpkg
			directory. If you have network access you can download them with
			links (getpkg links) or you can copy them to floppies. I have
			the following in mine:

			root     root       245776 Jul 20 19:17 baselib.tgz
			root     root        15932 Jul 20 18:17 dhcpcd.tgz
			root     root        90312 Jul 20 18:17 dnslibs.tgz
			root     root       163951 Jul 21 12:28 iptables.tgz
			root     root       131200 Jul 21 12:28 netfilter.tgz
			root     root        77834 Jul 20 19:22 pthread.tgz
			root     root       378444 Jul 20 19:22 term.tgz

			These will always get loaded. You can also put packages in the
			pkg directory and these may/may not load depending on your
			configuration.

			Remember, after you are through modifying the partition, it
			needs to be unmounted with:

			#umount /dev/hda1  
				or
			#umount /mnt
			
		1.4.3 Configuarition


2. Networking

	2.1 Hardware Detection

		In order for you to use networking your interface(s) must be
		detected by the kernel. In order for this to occur you must either
		have support for your NIC compiled into the kernel or use a kernel
		module. Older versions of Trinux had support for the most common
		NiCs built in, but that is no longer the case.

		If your hardware was succuessfully found

		# dmesg | grep eth0
		eth0: OEM i82557/i82558 10/100 Ethernet, 00:03:47:B9:12:08, IRQ 11

	2.2 Module Selection

3. Kernel Modules

	Raw (non-packaged kernel modules are available at:
	http://trinux.sf.net/kernel/
	
	Packaged kernel modules are available at http://trinux.sf.net/pkg/2.4.x/ 
	and may be installed with the "getkpkg <name>"

	Trinux puts all packages in /lib/modules or /usr/lib/modules instead
	of the standard linux convention of /lib/modules/2.4.x/...

4. Packages
	
	4.1 Package Format

		Packages are simply tarballs with an initialization script that
		will be executed from within /etc/init.d/package_name or 
		/etc/init.m/kernel_package_name

	4.2 Scripts
	
		* pkgadd  - loads a package from a local filesystem
		* getpkg  - loads the package from the network
		* getkpkg - loads a kernel package from the network
        * pkglist - lists available packages
		* rmpkg   - deletes package
		* mypkg   - shows packages currently installed

	4.3 Building your own

		All the Trinux packages are compiled with glibc 2.1.3 using
		Slackware 7.1. I upgraded the compiler to gcc 2.95 and have upgraded
		libraries as necessary.

	4.4 Adding packages after bootup

		You can either use the getpkg/getkpkg commands to load a package
		from the network. If /etc/tux/config/localpkg is set 
		(added 0.891)

	4.5 Configuration

		Add list of package (in order) to /etc/tux/config/pkglist and these
		will be loaded at boot

	4.6 Miscellaneous

5. Filesystems

	5.1 Supported Filesytems

		Trinux may only have support for a few filesystems such as minix
		vfat (Windows) and ISO9660 (for CDROMs). To see which filesystems
		are currently supported in the kernel:

		# cat /proc/filesystems | grep -v nodev
		        minix
				vfat
				iso9660
		        reiserfs

		In this case I installed the reiserfs module:

		# lsmod
		reiserfs              165600   1
		3c59x                  24560   1
		8139too                13396   1
		mii                     2092   0 [8139too]


		To mount a device you use the following command:
		
			mount <device> -t <filesystem type> <mount point)
		
		So to mount the floppy you would 

		You can determine the which IDE devices are present by the following
		command:

		# dmesg | grep hd
		ide0: BM-DMA at 0x1850-0x1857, BIOS settings: hda:DMA, hdb:pio
		ide1: BM-DMA at 0x1858-0x185f, BIOS settings: hdc:pio, hdd:pio
		hda: IC25N040ATCS04-0, ATA DISK drive
		hda: 78140160 sectors (40008 MB) w/1768KiB Cache, CHS=5168/240/63
		hda: hda1 hda2 hda3 < hda5 hda6 > hda4
		hde: LEXAR ATA FLASH, ATA DISK drive
	 	hde: 96384 sectors (49 MB) w/1KiB Cache, CHS=753/4/32
	  	hde: hde1

		So assuming hde1 were a vfat partition, you would use:

		# mount -t vfat /dev/hde1 /mnt
		# mount
		/dev/hda2 on / type ext3 (rw,errors=remount-ro)
		proc on /proc type proc (rw)
		devpts on /dev/pts type devpts (rw,gid=5,mode=620)
		/dev/hda4 on /alt type reiserfs (rw)
		/trinux/boot/trinux.img on /loop type vfat (rw,loop=/dev/loop0)
		/dev/hde1 on /mnt type vfat (rw)

		This was from my laptop. Within Trinux, the following is more
		typical:

		# mount
		/dev/ram0 on / type minix (rw)
		/proc on /proc type proc (rw)
		/dev/null on /usr type tmpfs (rw)
		/dev/null on /home type tmpfs (rw)
		/dev/null on /var type tmpfs (rw)
		/dev/hda2 on /hda2 type reiserfs (rw)

		
	5.3 Swap

		Usually, you probably have enough memory (otherwise you wouldn't
		be running ramdisks) but if you want to set up a swap file or swap
		filesystem, put the name of the file (within an existing filesytem)
		the name of the partition (/dev/hda3) in /etc/tux/config/swap and 
		the linuxrc will automatically run mkswap and swapon. You may 
		want to make sure the swaputils.tgz package is included, 
		although it will be loaded automatically if /sbin/makeswap 
		isn't found.

	5.4 Tmpfs

		A neat feature that came out in 2.4 was the ability to use the
		temporary or shared memory filesystem instead of ramdisks. The key
		advantage is that ramdisks are completed allocated when the are
		created, but tmpfs partitions only use RAM as they are filled.


		Trinux only has support for a minimal set of filesystems

6. Management and Monitoring

		Although it is probably not the most common option, Trinux can be
		used in a headless server capacity

	6.1 Serial Console

	6.2 SSH Remote Logins

	6.3 Enabling Cisco Discovery Protocol (CDP)

	6.4 Building a Local Package Server

7. Miscellaneous

	6.1 Troubleshooting

		Recent versions of trinux have a /sbin/hwinfo script that gathers
		hardware information about the system and saves it to the file
		/tmp/hwinfo. It basically saves the output of the dmesg command
		and copies the values of some /proc files that can be used to help
		troubleshoot hardware problems. The following commands allow you to
		save this file to the boot floppy (assuming you have enough room)
		
			# fmount
			# cp /tmp/hwinfo /floppy
			# fumount

		You can then post some or all of this file to the trinux-talk mailing
		list when you have a problem.

	6.2 Where to get help

		You should subscribe to the trinux-talk mailing list

	6.3 Floppy Errors

		If you do not have a floppy drive or you floppy drive takes very 
		long to time out, append "nofloppy" to the kernel boot arguments.
		CD-ROM booting automatically disables this checking. I had to do
		this on an old Compaq 486-66 because it was taking several minutes
		to complete the bootup:

			loadlin bzimage initrd=initrd.gz root=/dev/ram0 rw nofloppy