Participate in preparations for Linux kernel development

Source: Internet
Author: User

I want to participate in the development of the Linux Kernel on the premise that I think I have a strong internal strength. There are two important tasks to do. If I have not touched the kernel source code, I can refer to this article, because almost all open source codes follow this method described in this article. The two jobs are:
1. Use git to download the source code tree, create your own Development Branch, modify/Add code, and generate patches.
2. Configure an email client that supports transparent and plain text to send emails to maillist.
The configuration of the first job is very simple. It mainly involves several commands, but whether the code can be modified or whether the kernel can be understood depends on the practice of multiple days. This section only describes how to configure and use the environment.
1. Install git and install it. You don't need to read its documentation, because we don't have to build our own work environment, and everything is cloned.
2. clone a development environment, which is the source code tree of Linus.
Git-clone http://www.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git (some companies can block ports that are not commonly used, so it is more appropriate to use well-known HTTP)
3. Create a branch of your own, and create your own development branch my outside of the master. The master serves as the benchmark branch. Modifications made on the my branch must generate a patch file based on the master.
Git-branch my
4. Switch to your my branch
Git-checkout my
5. modify my branch, add new functions, and check in/out randomly. Do not worry about damage to the original file or be affected by others, because all operations are performed locally, don't forget that this is git, not SVN/CVS.
6. Insert a question: do you not need to update the source code? How can I know that new features have been added or bugs have been fixed by someone else, and I need to update them (another Git-clone ?)
A: Generally, it does not need to be updated frequently. This is not SVN/CVS, but git. All the formal merge operations of git are performed by a dedicated person and are performed during the proprietary time. You often browse maillist and kernel.org to get the latest news, and you must be familiar with the meaning of the Linux kernel version number, then update it based on your own situation, instead of Git-clone, but Git-pull. I think the biggest difference between git and SVN/CVS lies in the way they are merged. SVN/CVs are almost used within the company, and the links are LAN or VPN at least, the access between each user is equivalent, and it is easy for people to access a central server, and then all the work is submitted there. Submitting is checking in ), git is different. The network environments in different locations are different. Individuals cannot share information (for example, they cannot share a disk as easily as LAN users ), the location and management of the central server are all problems. Therefore, the standard email-maillist method is used for git submission. The submission is not checked in. The check-in is performed by a dedicated person, before checking in, the maillist member must be checked together.
7. Generate patches. This patch is generated as a plain text file. After you add some instructions, you can directly send an email to maillist, the topic we see on maillist is [Patch x/y] XXX :... the body of the email is the text after the patch is added to the description.
Git-format-patch master
8. send an email. Note: This work is not simple. maillist has strict regulations not only on the patch quality, but also on the mail format. Therefore, it is best to send it in Linux, the kernel hacker guys don't need other systems, and their feelings for Linux may be as high as their philosophy. If they can see that your emails contain windows shadows ,.... Therefore, the following describes the mail client settings.

The configuration of the second job is relatively complicated, but it is very easy to understand the mail protocol, and it is the opposite of the first job. Once configured, it will be ready for use once and for all, in the first job, configuring git and the kernel source code tree is just the beginning. In simple terms, the mail system has two major modules: sending and receiving, which are the same as ordinary mail, which has no requirements for sending, you can enter a sender's email address at will, even if it is false. You can enter a recipient's email address at will, and it doesn't matter if the email address does not exist (Van karuskov in "Van ka" writes a letter to Grandpa, although the mail is delivered, Grandpa will never receive it), but the receiving requirement is high. Only those who pass the authentication can open the mailbox. information flow is always one-way, there is no one to worry about, but whoever can listen must be strictly controlled. Information recipients must ensure that this information is sent to themselves. The two modules of the email system are completed by the SMTP and pop protocols (there are other protocols, but these two are the most basic and simple). Simply put, the SMTP Protocol completes the process from sending a mail to reaching the recipient's mailbox. The POP Protocol completes the process from the recipient's mailbox to the recipient's mailbox. Similar to daily normal mail, almost all of them are sent directly to the post office after writing a letter, but the recipient cannot guarantee that the letter will be notified as soon as it arrives. Therefore, almost every apartment or school has an email address, everyone needs to decide when to open the mailbox to check whether there is an email. There is a premise that the mailbox is basically locked and you must have a key.
The operating system I use is Linux, and the mail client naturally chooses mutt. The mail client can also be configured and used in a much simpler way than mutt. For example, sending mail via mail is very simple. Mail-V is the recipient address, and then enter the interactive content.
1. Create a working directory
Mkdir/root/kernel-hack-mail
Mkdir/root/kernel-hack-mail/mail
# Mkdir/root/kernel-hack-mail/Cert # If authentication is required
CD/root/kernel-hack-mail
2. Edit the mutt configuration file
VI mutt. conf
The most important content is the following two aspects: sending and receiving:
Send mail-Delegate to the mail Transmission proxy (sendmail/msmtp...) (similar to delegate to the Post Office)
Set Sendmail = "/usr/bin/msmtp" # indicates the mail transmission agent
Set use_from = Yes
Set From = mimiran@gmail.com # indicates the sender address, of course, can also be indicated in the msmtp configuration file
Set envelope_from = Yes
Receive email -- retrieve it from your mailbox
Set pop_user = mimiran@gmail.com # Your mailbox ID
Set pop_pass = "123456" # key to your mailbox
Set pop_host = POP: // x.y. Z. K # location of your mailbox
3. Edit the configuration file of the mail Transmission proxy msmtp
VI sndmail. conf
Its content is
Host X. y.p.q # is equivalent to the peer Post Office
Port 25 # all of this information
4. Run mutt.
Mutt-F mutt. conf
5. You can use Shift-g to receive emails. You can use M to send emails. It is fast and fully text-based. Vim is used to edit emails and can be quickly used :.! The cat command uses a text file as the mail body. There are a lot of shortcut keys, as shown in the UI. below is the top of the page after the mutt entry:
Q: Quit D: del U: undel S: save m: Mail R: reply G: group? : Help
Press the M key to start sending the message. (I think the help is useless. I 'd better find it myself. Besides, good software doesn't need help at all)
Finally, the combination of git and email perfectly organizes the Internet into a giant Development Team

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.