Article title: create tinylinux using busybox. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I am saving myself for the process of making the boot disk. I can catch it on the Internet!
More...
Install linux on the hard disk to obtain the linux partition:
/Dev/hda1/boot
/Dev/hda2/
/Dev/hda3 swap
Well, now we can use busybox to make it...
The actual operation process is quite simple:
Download the source file of busybox. you 'd better go to the official website of busybox to see a lot of documents :)
I downloaded the busybox-1.00-rc3 version and the latest version of it.
Tar zxvf busybox-1.00-rc3.tar.gz
Cd busybox-1.00-rc3
Make menuconfig
(This process is similar to compiling the Linux kernel. if you haven't compiled the kernel yet, check another document in my blog)
After setting your options,
Make dep
Make
Make install
By default, busybox will generate a _ INSTALL directory under the current directory, and all the files generated after compilation are under this directory, we will also use files in this directory to create our tiny linux
Let's first take a look at the structure in this directory:
/Usr
/Etc
/....
I wrote this document only after compilation, so the Directory column is not complete. this is not important anyway. let's take a look at it in your attempt.
Then there is the replacement work. for the working principle of busybox, you can refer to the information of busybox and refer to the online workshop to get the idea !!
The main operation directories are etc usr bin sbin.
Replace these directories with the compiled directories, and put the passwd-shadow-files in the original etc directory to the busybox Directory (you have to log on to the Directory, haha, these files are used for login)
In fact, the system size is less than MB at this time,
The following is a further reduction, which is mainly concentrated in the lib directory.
Lib directory structure:
The root directory contains some common so libraries.
Modules is a linux module.
The modules directory contains the folder directory ending with EL. if you have multiple CPUs, there is a directory ending with smp. if you have compiled the kernel, there is a directory ending with ELcustom.
Decide which kernel you use. if you use smp, delete the other two. if you use your own compiled kernel, delete the other two. The same principle applies.
You can decide the other so files in the lib directory by yourself, but there is such a problem: if the User 'unknown 'failed on 'tty2' prompt is displayed, it is likely that you have deleted the above database and made up it ..
In addition to deleting files, I think there is another problem in the cutting process: improving functions and implementing common linux functions, such as the rw attribute of the network and file system.
This is also a problem I encountered during the reduction process,
1. restore the network
Network functions require the following conditions:
1) kernel support for inet4
2) with NIC driver
Okay, let's assume that all of the above settings are true. let's set up the network for tinylinux:
My Nic is 8139, so the NIC driver I need is in/lib/modules/2.4.21-9. ELcustom/kernel/drivers/net/8139too. so
Of course, the pci Nic still needs this stuff:/lib/modules/2.4.21-9. ELcustom/kernel/drivers/net/mii. o (why do I need this? I cannot tell you clearly. it must be there anyway. freebsd must add mii when compiling the kernel, friends who have compiled the bsd kernel must be impressed)
OK, there is also a so to be added, that is,/lib/modules/2.4.21-9. ELcustom/kernel/lib/crc32.o. what is the role of this Dongdong? I am not sure if you want to answer this question. or you can search for it on google.
[1] [2] [3] [4] Next page