There is no error in compiling linux2.6.31 in gcc4.4.1, but gcc3.4 may have several problems. The steps, problems, and solutions are summarized as follows: internal compilation process 1.to official website download internal 2 unzip tar-jxvflinux-2.6.31.tar.bz2 then move the extracted file to/usr/src # mvlinux-2.6.31/usr/src # cd/usr/src/linux-2.6.31 if you are afraid
There is no error in compiling linux 2.6.31 with gcc4.4.1However, gcc3.4 compilation involves several issues, including the steps, problems, and solutions:
Kernel compilation process
1. Download the kernel from the official website.
2. Decompress
# Tar-jxvf linux-2.6.31.tar.bz2
Move the extracted file to/usr/src.
# Music linux-2.6.31/usr/src
# Linux-2.6.31/cd/usr/src/
If someone has already compiled the core file, some. o target files will be generated. Therefore, execute the following command first:
# Make mrproper
The RM file removal message is displayed.
3. If you compile the kernel of the same version, modify the following:
# Cd/lib/modules
# Mv 2.4.18 2.4.18.old
4. Set the compilation mode:
Make config: In this mode, you need to enter the project to be set row by row and cannot modify the settings. Therefore, this method is rarely used to set the project of the Kernel;
Make xconfig: This mode uses X-Window as the main environment setting mode! This mode cannot be used unless you have X-Window execution;
Make menuconfig: This mode is a bit like the menu mode on the text interface, which is relatively simple and can be edited under the pure text interface! Is currently the most commonly used mode.
# Make menuconfig.
# Make clean <= remove old data!
# Make
# Make bzImage <= start to compile the core! This core is compressed (about 30 minutes)
# Make modules <= start compiling the module! This action depends on the number of modules you just compiled! (About 1 hour)
# Make modules_install <= install the required documents in/lib/modules/'uname-R '.
# Make install <= install the just-completed bzImage core! Don't forget this step. For the first time, I forgot to re-compile it. it wasted more than two hours.
# Sudo mkinitramfs-o/boot/initrd. img-2.6.31/lib/modules/2.6.31 generate initrd. img. For other parameters about mkinitramfs, see man mkinitramfs.
5. Modify grub: (two methods)
1) # sduo update-grub
2) # vi/boot/grub/menu. lst
If the compilation succeeds, title Fedora (2.6.31) will be automatically added. This is my new kernel. If you want to use the first kernel, change default = 0. The second kernel is 1, and so on...
Default = 0
Timeout = 0
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Hiddenmenu
Title Fedora (2.6.31)
Root (hd0, 0)
Kernel/vmlinuz-2.6.31 ro root = UUID = b75809ed-8353-4679-bfe4-e5686f3d6b18 rhgb quiet
Initrd/initrd-2.6.31.img
Some errors occurred during kernel compilation. The following is a reference to others' error handling method.
1. After downloading the kernel, start compiling and start to follow the steps on the network. There are three errors in the compilation problem.
Error Message 1 :
Drivers/built-in.o (. init. text + 0x3bad): In function 'Con _ init ':
Include/trace/events/kmem. h: 47: undefined reference to '. L1452'
Solution:
Vi/usr/src/linux/drivers/char/vt. c
Delete the following lines ( The 2875 Line )
Vc_cons [currcons]. d = vc = kzarloc (sizeof (struct vc_daTa), GFP_NOWAIT );
Add in the same location :
Vc_cons [currcons]. d = vc = alloc_bootmem (sizeof (struct vc_daTa ));
Error Message 2 :
Drivers/char/vt. c: In function 'Con _ init ':
Drivers/char/vt. c: 2875: error: implicit declaration of function 'alloc _ bootmem'
Drivers/char/vt. c: 2875: warning: assignment makes pointer from integer without a cast
Cause: Vt. c Referenced in Alloc_bootmem But cannot find the relevant . H The definition file is not included in the relevant header file . H Definition
Solution:
# Vi/usr/src/linux/drivers/char/vt. c , Add the following line:
# Include
Error Message 3 :
Drivers/message/fusion/mptsas. c: In function 'mptsas _ port_delete ':
Drivers/message/fusion/mptsas. c: 105: sorry, unimplemented: inlining failed in call to 'mptsas _ set_rphy ': function body not available
Drivers/message/fusion/mptsas. c: 467: sorry, unimplemented: called from here
Cause:
Mptsas_port_delete Referenced in Mptsas_set_rphy , Mptsas_set_rphy Is defined in Mptsas_port_delete Later.
Solution:
Vi/usr/src/linux/drivers/message/fusion/mptsas. c , Set Mptsas_set_rphy ( 483 Starting from) MoveMptsas_port_delete ( 446 Line.
In addition, when making modules occurs, it cannot be just serial_usb. The solution is to delete the option in the configuration file.
After compilation, the system cannot be started.
Enforcing mode requested but no policy loaded Error
Solution:
Yes. The configuration of/etc/selinux/config is incorrect. You only need to change the SELINUX value to disabled.
Remote Login is not allowed after the startup is successful. error message
Server refused to allocate pty
Solution:
# Mknod-m 666/dev/ptmx c 5 2
# Mkdir/dev/pts
Note: I have successfully compiled 2.6.33.3 kernel with the above method on RedHat as4, but cannot enter the system. You have to install gcc4.5.0 and then compile the kernel. The compilation process is smooth. After compilation, the kernel system 2.6.33.3 is successfully started.