Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How openSUSE patches kernel source code

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Xiaobian to share with you how openSUSE to patch the kernel source code, I believe most people still do not know how, so share this article for everyone's reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

A kernel source update may disable a patch, so there is no single patch that "fixes" all kernel versions. If the patch does not work on the new kernel, either the kernel has already been incorporated into the kernel and there is no need to "patch" it, or the patch has failed the new kernel code. In any case, if there is an error, please search or make a new patch based on the original patch.

openSUSE Using Tutorials Selecting the required patches

This is a test of your knowledge of the system. There are many hardware and patches on Earth. What system and hardware to choose and what patches to use are not within the scope of this document. However, the criteria for selecting patches are very simple, first hardware needs, second functional needs, and *** psychological needs. There is no need to patch all the patches you find. At the extreme, the more patches you find, the slower the system will be.

Hardware needs are based on your hardware to choose patches, a small part of the hardware using the original kernel will appear different degrees of disorder or weakness, some do not affect the normal use, but in the log constantly error; at this time you can use patches to fix this situation.

There are a lot of patches in src.rpm of kernel-source, unzip a few bz2 zipped files at the beginning of patches. First root lsmod to see which modules have been loaded, and then look for those patch file names with one of the module names. If yes, check the system architecture and other information. Don't have to look at each file name carefully, generally browse under the impression can be. If you are an Acer laptop, then the ibm asus in the file name is basically irrelevant to you; similarly, if you are a 32-bit system, the patch with x86_64 ia64 ppc in the file name does not make sense to you; if you use AMD CPU and chipset, you do not have to look at the patch with the word intel in the name. If you are not sure if you need the patch, click on the comments at the beginning of the file.

Remember, if you only have a general understanding of your hardware, you can first do not play or play a few hardware patches that you think are necessary, and then according to the log prompt, search to see if you need a patch, and then recompile with patches. Functional requirements are software that needs patches to perform its functions and has to be patched in order to function properly, such as the Bootsplash patch mentioned below. If you don't know about this, you can wait for the problem to search again. Psychological need is emotional dependence on certain patches for various reasons, and failure to apply the patch will cause the user to enter a bad mood. To avoid serious unpredictable consequences, patches should be applied to avoid such situations.

openSUSE Tutorial Common Patches

MM patch:

http://kernel.org/patchtypes/mm.html

A series of patches put together by 2.6 maintainer Andrew Morton, with many kernel component upgrades and hardware compatibility patches. Very important and often used.

AC patch:

http://kerneltrap.org/forum/linux/kernel/2.6/ac

A set of patches maintained by Alan Cox of Redhat. This is usually a patch that adds hardware support.

CK patch:

http://members.optusnet.com.au/ckolivas/kernel/

A set of patches maintained by Con Kolivas. Contains a large number of performance optimization patches, one for desktop and one for server. If you want to speed up the system, you can pick and choose some of these patches, all of which may cause crashes.

openSUSE Tutorial SUSE Common Patches

Aparmor Patch-works with Novell Aparmor software as a SUSE specific security module.

Bootsplash Patch-Animations when booting into the system.

flush-o-fat patch-write FAT format hard disk plus-o speed-up parameter, without this patch may not automatically mount FAT format mobile hard disk.

openSUSE Tutorial Patching Order and Methods

order

Patching has an order, generally the incremental upgrade patch provided by the official first, followed by the patch required by the hardware, and then the patch required by the function. Psychological needs patches take precedence over all patches, even far above the kernel source code itself.

Use src.rpm only need incremental upgrade patch, the role is to incrementally upgrade the original kernel source code to a new version; download the original kernel can be **, do not have to take this step.

openSUSE Using Tutorials Single Patch File

A single patch file may have the suffix.diff .patch or no suffix, and is essentially a plain text file that can be opened and modified with a text editor. The patch method is as follows:

#cd /usr/src/linux-version #patch -p1 -i /path/patch filename

For example, I downloaded the pure kernel to make a single file patch bootsplash, to achieve the animation before booting into X, download the patch suitable for the *** version kernel, the file is/home/truth/new/patches/bootsplash-2.6.18.diff

#cd /usr/src/linux-2.6.18#patch -p1 -i ~truth/new/patches/bootsplash-2.6.18.diff

openSUSE using tutorial gz/bz2 format patches

Not all gz/bz2 compressed files can be patched in the following way. Such files must only contain more than one single file patch and should not contain other impurities; therefore, in this method, you should first open the gz/bz2 compression package to check whether it meets the conditions. This patch method is essentially according to the compressed package file name in ascending order one by one with a single file patch. Use commands for:

#cd /usr/src/linux-version number gz archive: #zcat path/filename.gz| patch -p1 bz2 archive: #bzcat path/filename.bz2| patch -p1

Using the source code mentioned above using the official src.rpm as an example, kernel delta patches are extracted from src.rpm patches.kernel.org.tar.bz2 in the/home/truth/new/patches/directory

#cd /usr/src/linux-2.6.16#bzcat ~truth/new/patches/patches.kernel.org.tar.bz2 | patch -p1

Some patches in compressed packages require a path, which is generally placed in the/usr/src/directory.

The above is "openSUSE how to patch the kernel source code" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report