Home Index Search Links About Us
[LinuxFocus Image]
[Navegation Bar]
  News   Archives   Companies   Tips  

Yararlı Bir Linux Sürümü Yaratımı

Yazar: Mooneer Salem

Çeviri Sürüyor


Giriş

Linux'un yararlý bir versiyonunu bir iki floppy de sunan dýteler çok azdir.Size kullanacaginiz hemen hemen her turlü bilgi içeren boot disk yapmayi gösterecegim.. 

Öncelik ile bir veya iki bos diskete ihtiyaciniz var.Temel olarak sizin Linux verisiyonunuz sadece boot yada utility disk olacak .Eger bu terimleri bilmiyorsaniz bölüm ikiye bakmanizi tavsiye ederim 

Linux'un flopy disk versiyonun temel adimlari: 
 
 

    #Bare-bones karnel? olusturmak 
    #Sistem dosyalarini yaratmak 
    #Her seyi diskete kopyalamak

Cekirdegi Derlemek

Çünkü disketiniz sadece 1.440 megabyte lik bilgi tasiyacak, sadece asil kerneli disketinize kopyalayamazsiniz .Önce kernel kaynagini yükleyip usr/src/linux dizinlerinin altina açin.Sonra usr/src/linux içinde iken takip eden komutlari yaziniz. 
 

make config 

programdayken sadece ihtiyaç duyduyulan kurulur .Benimkinin üstüne sadece ex2,disket destekleyicisi ve PPP destekleyicisi kurulu.senin kuruluþun ne kurduðuna baðlý olarak farklý olabilir.sonra takip eden komutlar yazilir 
make dep; make clean; 

make zImage 

make zImage çok önemlidir!Bitirilmiþ olan cekirdegi sIkIstirir. Sonraki komut, cekirdegi /usr/src/linux/i386/boot altinda zImage ismiyle bulur.. 

The Filesystem: Not Just Any Old Set of Files

Now we have to create the filesystem for the disk. Instead of copying the stuff directly to the floppy, we are going to compress all of the programs. This will make it slightly harder to modify anything permanently. First, we issue the following command: 
dd if=/dev/zero of=DEVICE bs=1k count=3000
Where DEVICE is the location on your hard drive where you are going to keep the uncompressed filesystem. Next, enter the following command and press Enter, replacing DEVICE with the location on your hard drive where you are keeping the uncompressed filesystem: 
mke2fs -m 0 DEVICE
If make2fs asks you if you really want to do this, say yes. 

Then we have to mount the newly created filesystem. Since the new filesystem is inside a regular file, the "loopback device" must be compiled in the kernel to mount it. If your kernel (not the created kernel, but your system kernel) do not have it, then recompile it. You have to say (Y)es (or (M)odule) to the question: 

Loopback device support (CONFIG_BLK_DEV_LOOP) [M/n/y/?]
when configuring the kernel. Notice that you are recompiling YOUR normal kernel, not the floppy kernel, so you have to include all the drivers and utilities you already have. If you have compiled the loopback device as a module do not forget to install it (modprobe loop). 
mount -t ext2 DEVICE /mnt
If the mount program complains, try the following: 
mount -o loop -t ext2 DEVICE /mnt
Now you have to copy all of the files that you need to your newly created filesystem. First, cd to /mnt. Create the following directories: 
/dev
/proc
/etc
/bin
/lib
/mnt
/usr
Let's take care of the files in /dev by typing the following: 
cp -dpR /dev /mnt/dev
If you run out of inodes, go to /mnt/dev and delete the device files that you don't need. Having completed copying the files necessary for /dev, let's move on to /etc. To be safe, copy all of the files from /etc to /mnt: 
cp -dpR /etc /mnt/etc
Then copy everything in the /lib directory to /mnt: 
cp -dpR /lib /mnt/lib
For /bin, copy only the things that you think you need to /mnt. 

Herseyi diskete kopyalama

Now we have to copy everything to your floppy(ies). To do this, we now must compress your filesystem by typing the following commands: 
cd /
umount /mnt
dd if=DEVICE bs=1k | gzip -9 > rootfs.gz
Now it's important to check the size of the kernel. Go to /usr/src/linux/arch/i386/boot and issue the command ls -l. Then you have to divide 1024 into the size of the kernel. For example, if the size of my kernel is 250000 bytes, then it is 245 KB. Use the total number of kilobytes that you figured out earlier where any command says ROOTBEGIN. Now copy the kernel to the floppy using the following command: 
dd if=zImage of=/dev/fd0
This command will put the kernel onto the floppy. Next enter the following command to tell the kernel to find the root filesystem on the floppy: 
rdev /dev/fd0 /dev/fd0
Now you'll have to do a little calculating in hex. Add 4000 to the hex equivalent of ROOTBEGIN (which is F5 in this example). Convert the answer into decimal form and type the following command, replacing 16629 with your answer you got: 
rdev -r /dev/fd0 16629
Finally, issue the following command to copy the filesystem to your floppy: 
dd if=rootfs.gz of=/dev/fd0 bs=1k seek=ROOTBEGIN
The root filesystem will be copied to your floppy right after the kernel. Then you're done! For the second floppy, the process is easier. You just copy the files that you want onto the floppy. However, in order to be able to use the files that are on the second disk, you'll have to enter the following after booting with the disk: 
 
 
mount /dev/fd0 /usr
One final note: if you do a little fiddling around, you can probably be able to make a version that you can release to the public as a seperate "distribution" of Linux. Just a thought :) 

Yazının aslı dergiye İngilizce olarak sunulmuştur

Daha Çok Bilgi İçin:
© 1998 Mooneer Salem
Bu sanalyörenin bakımı Miguel A Sepulvedatarafından yapılmaktadır..