Do your own floppy disk size Linux (2)

zhaozj2021-02-11  249

Do your own floppy disk size Linux (2) www.palmheart.net is unknown

Back to〗 Forward〗

3. After selecting the kernel, after you have completed the root file system that is compressed, the next step is to select or create a kernel yourself. In most cases, you can copy the kernel of the existing system, but in some cases, you have to create another one. The most likely problem is that capacity restrictions: If you want to make a single boot disk, the biggest file in the disk is often a kernel, so you must find a method of compressing the volume of the kernel. If you want to compress the kernel size, you have to remove unnecessary features when you create it. If you remove support for your network and support for unnecessary equipment, you must remember the support of the kernel to R Amdisk and EXT2, otherwise yours The boot disk will not work. There is also to remember to add the support of the device used to your backup to the kernel, because the maximum use of the boot disk is the detection and repair damaged system, if you don't put the support of the backup device to the kernel, you There will be no way to repair the damaged system, which can only reload L Inux. I will not describe this method, if I have a problem, please refer to the relevant information. Remember to compress the kernel with the "Make Zimage" after the reconstruction. 4. After integrating with root file systems and kernels, the last job is to integrate them together. First check the size of the total file, if it exceeds 1.44M, you have to consider recreate the required or two disks, that is, use two disks, your root file system is less than 1.44m. Then it is to determine that the LILO control is started directly or directly using the kernel control on the disk. The advantage of LILO is that you can increase the parameters to initialize the hardware to the kernel, the disadvantage is more complicated and occupied precious disk space, but I still recommend using the L iLO control system to start. Below I will introduce the process of using LILO, directly using the method of copying the kernel control on the disk, does not describe it. Start with LILO to start to write a LILO configuration file, the following is the simplest configuration file, but it is already enough. Boot = / dev / fd0 install = / boot / boot.b map = / boot / map read-write backup = / dev / null compact image = kernel label = bootdisk root = / dev / fd0 parameter instructions for instructions. Then name it to bdlilo.conf. The next step is to create a kernel file system. Insert a clean floppy disk into the floppy drive, create an EXT2 file system above. MKE2FS -I 8192 -M 0 / DEV / FD0 50 "-i 8192" means that every 8192 bits create an information node. Then Login System: Mount / DEV / FD0 / MNT RM-RF / MNT / LOST FOUND MKDIR / MNT / {Boot, Dev} Create Directory / Lost Found, create two directory / boot, and / dev. Copy the existing system in the directory / DEV, cp -r / dev / {null, fd0} / mnt / dev then copy the boot loader boot.b to the directory / boot, cp /boot/boot.b / MNT / boot Finally, copy your created profile bdlilo.conf and kernel to the root of the kernel file system, cp bdlilo.conf kernel / mnt now, all files required for root file system are ready, you can run it If the results of the run should have no mistake, otherwise you should check it carefully.

The final file directory should be as follows: ----------------------------------------- --------------------------------------- Total 361 1 -RW-R - R- - 1 root root 176 Jan 10 07:22 bdlilo.conf 1 drwxr-xr-x 2 root root 1024 Jan 10 07:23 boot / 1 drwxr-xr-x 2 root root 1024 Jan 10 07:22 DEV / 358 -RW -r - r - 1 root root 362707 Jan 10 07:23 VMLinuz Boot: Total 8 4 -RW-R - R - 1 root root 3708 Jan 10 07:22 boot.b 4 -rw ---- --- 1 root root 3584 Jan 10 07:23 map dev: Total 0 0 BRW-R ----- 1 Root Root 2, 0 Jan 10 07:22 FD0 0 CRW-R - R - ROT ROOT 1, 3 JAN 10 07:22 NULL then sets the offset of RAMDISK in the kernel image file to point out how to determine the positioning root file system. This indicator can be set by command RDEV, and its contents are as follows: BITS 0-10: RamDisk starts offset, in 1024 BYTE data blocks Bits 11-13: No bit 14: Ramdisk load prompt tag Bit 15: Prior to loading root file system Before the bit 15 is set, you will prompt you to prepare another floppy disk when the system disk is started. If your boot disk is two, this setting is useful. For users who use single and two boot discs, the offset of ramdisk is different: if your boot disk has only one, then the compressed root file system will be placed after the kernel, so the offset will be The first idle data block, Bit 14 should be set to 1, and bit 15 is set to 0. For example, if your boot disk root file system starts on data block 253 (decimal), your RAMDisk offset should be 253 214 = 253 16384 = 16637. If your boot disk has two, then your root file system starts from the 0 block of the second disk, so the offset is 0, and Bit 14 should be set to 1, and Bit 15 should be set to 1, the final value Troune 214 215 = 49152. After calculating the offset, use the command RDEV -R to set, remember to use the decimal: RDEV -R / MNT / VMLINUZ offset is set, remove the floppy from / MNT. The final step is to transmit root file system, divided into two cases: • If your kernel is on the same floppy disk, use the option seek command DD transmission, DD if = rootfs.gz of = / dev / fd0 BS = 1K seek = number of kernel data blocks. If the root file system is on the second floppy disk, remove the first floppy disk, insert the second disk, then transfer the root file system DD if = rootfs.gz of = / dev / fd0 BS = 1k. Congratulations, your system boot disk is already done, the rest is to test your startup disk, if you have any problems, sorry, you have to come again.

转载请注明原文地址:https://www.9cbs.com/read-3602.html

New Post(0)