Hello!
I have used Linux since RH9 to FC3 for 6 months but I don't know how to complie the kernel because I can't find any clear procedure to do that. And I noticed that kernel 2.6 is changed and some steps needn't.
I am new in complie the kernel because I just install the rpm before. And due to my USB harddisk shown the buffering error shown from kernel. So I may need to re-complie the kernel to fix it.
And I saw someone posted some steps of complie a custom kernel of 2.6.x as follows:
I read from a magazine as ------------------------------------------------ 1. Unpack sources into /usr/src/ 2. make xconfig 3. make menuconfig 4. make 5. make modules_install 6. make install 7. reboot the machine
OR
Someone posted as ----------------------------- 1. Unpack sources into /usr/src/ 2. make 3. make modules 4. make modules_install 5. make install 6. reboot the mahine
Which one is the right way ? Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
Thanks for helping me first because they make me mixed. And sorry for my english is poor.
Ringo
Wong Kwok-hon wrote:
Which one is the right way ? Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
If you can't answer these questions yourself, you don't need to compile the kernel. Redhat doesn't provide support for custom-compiled kernels. Further, all modules you could possibly need have been compiled by Redhat. As to your USB hard-disk problem, I don't recall seeing the thread, so maybe I'm asking you to do something you've already done. Plug in the HD, then post the output of 'dmesg | tail' and 'tail /var/log/messages'
Brian
On Thu, 23 Dec 2004 02:27:15 -0700, Brian Richardson brian@cubik.ca wrote:
Wong Kwok-hon wrote:
Which one is the right way ? Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
If you can't answer these questions yourself, you don't need to compile the kernel. Redhat doesn't provide support for custom-compiled kernels. Further, all modules you could possibly need have been compiled by Redhat. As to your USB hard-disk problem, I don't recall seeing the thread, so maybe I'm asking you to do something you've already done. Plug in the HD, then post the output of 'dmesg | tail' and 'tail /var/log/messages'
/var/log/messages : Dec 22 15:54:20 ringofc3 kernel: SCSI device sda: 1056992 512-byte hdwr sectors (541 MB) Dec 22 15:54:20 ringofc3 kernel: sda: assuming drive cache: write through Dec 22 15:54:20 ringofc3 kernel: sda: sda1 Dec 22 15:54:20 ringofc3 kernel: Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 Dec 22 15:54:21 ringofc3 fstab-sync[4212]: added mount point /media/NO_NAME for /dev/sda1 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 480496 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 480497 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 480498 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365835 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365836 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365837 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365838 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365839 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365840 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365841 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 365842 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481771 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481772 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481773 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481774 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481775 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481776 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481777 Dec 22 15:54:34 ringofc3 kernel: end_request: I/O error, dev sda, sector 481778 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173863 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173864 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173865 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173866 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173867 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173863 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173864 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173865 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173866 Dec 22 16:48:37 ringofc3 kernel: Buffer I/O error on device sda1, logical block 173867 Dec 22 16:48:37 ringofc3 kernel: FAT: bread(block 199) in fat_access failed Dec 22 16:48:37 ringofc3 kernel: end_request: I/O error, dev sda, sector 262 Dec 22 16:48:37 ringofc3 kernel: FAT: bread(block 199) in fat_access failed Dec 22 16:48:37 ringofc3 kernel: end_request: I/O error, dev sda, sector 262 Dec 22 16:48:37 ringofc3 kernel: FAT: bread(block 199) in fat_access failed Dec 22 16:48:37 ringofc3 kernel: end_request: I/O error, dev sda, sector 262 Dec 22 16:48:37 ringofc3 kernel: FAT: bread(block 199) in fat_access failed Dec 22 16:48:37 ringofc3 kernel: end_request: I/O error, dev sda, sector 262 Dec 22 16:48:37 ringofc3 kernel: FAT: bread(block 199) in fat_access failed
I missed the dmesg because I reboot several times due to system hang and can't unmount.
Ringo
On Thu, 23 Dec 2004 02:27:15 -0700, Brian Richardson brian@cubik.ca wrote:
Wong Kwok-hon wrote:
Which one is the right way ? Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
If you can't answer these questions yourself, you don't need to compile the kernel. Redhat doesn't provide support for custom-compiled kernels.
So what would you recommend he, and basically, I, do? I don't entirely understand the kernel and am having problems with the latest kernel. Still, f I do not recompile I will not be able to move on from the outdated kernel I am using. Heck, from what I understand, if I do not recompile the kernel, I won't be able to move from FC2 to FC3 as there are changes that conflict with my box.
I have the same questions as he did and without recompiling the kernel I have no idea how to proceed.
Thanx, Ryan
Ryan D'Baisse wrote:
On Thu, 23 Dec 2004 02:27:15 -0700, Brian Richardson brian@cubik.ca wrote:
Wong Kwok-hon wrote:
Which one is the right way ? Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
If you can't answer these questions yourself, you don't need to compile the kernel. Redhat doesn't provide support for custom-compiled kernels.
So what would you recommend he, and basically, I, do? I don't entirely understand the kernel and am having problems with the latest kernel. Still, f I do not recompile I will not be able to move on from the outdated kernel I am using. Heck, from what I understand, if I do not recompile the kernel, I won't be able to move from FC2 to FC3 as there are changes that conflict with my box.
I have the same questions as he did and without recompiling the kernel I have no idea how to proceed.
There are two aspects about recompiling the kernel. One is the "mechanical" procedure for actual getting the sources (e.g. download the SRPM for an "official" kernel that is close to what you want), making the edits and building/installing the kernel. I would always advocate creating a kernel RPM as this makes it easier to install/rebuild/uninstall later. A useful tutorial can be found at:
http://crab-lab.zool.ohiou.edu/kevin/kernel-compilation-tutorial-en/
The other aspect is to actually know what configuration changes/patchs you need to apply in order to fix the problem you are having with the "stock" kernel. This is a much harder problem (if not impossible) to give a generic answer to.
Paul.
Wong Kwok-hon wrote:
Hello!
I have used Linux since RH9 to FC3 for 6 months but I don't know how to complie the kernel because I can't find any clear procedure to do that. And I noticed that kernel 2.6 is changed and some steps needn't.
I am new in complie the kernel because I just install the rpm before. And due to my USB harddisk shown the buffering error shown from kernel. So I may need to re-complie the kernel to fix it.
And I saw someone posted some steps of complie a custom kernel of 2.6.x as follows:
I read from a magazine as
- Unpack sources into /usr/src/
- make xconfig
- make menuconfig
- make
- make modules_install
- make install
- reboot the machine
OR
Someone posted as
- Unpack sources into /usr/src/
- make
- make modules
- make modules_install
- make install
- reboot the mahine
Which one is the right way ? Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
Thanks for helping me first because they make me mixed. And sorry for my english is poor.
Ringo
the procedure for making a new kernel is :
un pack kernel new if this a patch for the kernel-old , you can apply that :
gzip -cd ../patch-2.6.xx.gz | patch -p1
or bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1
i make my new kernel with that :
ln -sf /usr/src/linux-Version /usr/src/linux cd /usr/src/linux
make xconfig ( or other config option )
make
according to your config you make your kernel with : make depend make module make modules_install make install
at this moment if you reboot your computer your bzimage is not updated , for lilo , check the /etc/lilo.conf and make a new started line with the old starter cmd : lilo
cp ../linux/arch/i386/boot/bzImage /boot
else see the doc on kernel.org ( or search on the net : howtow kernel )
alexandre
On Thu, 23 Dec 2004 17:14:21 +0800, Wong Kwok-hon kwokhon@gmail.com wrote:
Hello!
[...]
Which one is the right way ?
None.
Would it become rpm? And how about to become a rpm ? How to remove the error kernel if failed ?
The release notes for FC3 tell you how to get the kernel source. The archives for this list, fedora-devel & fedora-test-list have numerous messages on how to set up an environment so that users can compile rpms. There is absolutely no need to use /usr/src for kernel compilation. Setup ~/.rpmmarcos as shown:
%_topdir /home/ringo/work/REDHAT %debug_package %{nil} %_missing_doc_files_terminate_build 0 %_unpackaged_files_terminate_build 0 %packager ringo ringo@localhost
Then follow the steps from Michal Jaegermann's quoted post:
You take 'kernel-2.6.8-1.526.src.rpm' and you run
rpmbuild --rebuild --target=noarch \ --define 'buildsource 1' kernel-2.6.8-1.526.src.rpm
Not tested and it may not work if '%define' inside of a kernel spec file overrides your definition of 'buildsource'. In such case you have to 'rpm -i kernel-2.6.8-1.526.src.rpm',
cd "$(rpm --eval %_topdir)/SPECS"
edit a corresponding spec file to replace 0 with 1 where 'buildsource' is defined, which could be a number of places, and run
rpmbuild -bb --target=noarch "/my/modified/spec/file"
End quote. HTH N.Emile...
On Thu, 23 Dec 2004, Wong Kwok-hon wrote:
Hello!
I have used Linux since RH9 to FC3 for 6 months but I don't know how to complie the kernel because I can't find any clear procedure to do that. And I noticed that kernel 2.6 is changed and some steps needn't.
I am new in complie the kernel because I just install the rpm before. And due to my USB harddisk shown the buffering error shown from kernel. So I may need to re-complie the kernel to fix it.
And how about to become a rpm ?
Checkout: http://www.redhat.com/archives/fedora-list/2004-December/msg06223.html
Satish
Wong Kwok-hon wrote:
Hello!
I have used Linux since RH9 to FC3 for 6 months but I don't know how to complie the kernel because I can't find any clear procedure to do that. And I noticed that kernel 2.6 is changed and some steps needn't.
I am new in complie the kernel because I just install the rpm before. And due to my USB harddisk shown the buffering error shown from kernel. So I may need to re-complie the kernel to fix it.
[snip]
If you want the basics, just read the README file in the directory where you unpacked the kernel source files.
With the latest FC3 kernel, I followed the directions in the release notes to unpack the kernel src rpm. That put the source code here:
/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9
Read the README file in that directory for instructions on how to build the kernel.
--Kenny
Wong Kwok-hon wrote:
I read from a magazine as
- Unpack sources into /usr/src/
- make xconfig
- make menuconfig
- make
- make modules_install
- make install
- reboot the machine
This seems to me a reasonably accurate description, except that 2 and 3 are alternatives - they do the same thing in different ways. It make be a tiny bit safer to say "make oldconfig; make xconfig" or "make oldconfig; make menuconfig".
Most of the advice you have been given is too complicated, IMHO. Compiling the kernel is not very difficult, though going through the options after make xconfig/menuconfig is a little tedious. Save your configuration (there is an option to do this) if you intend repeating the exercise.
I would get the "vanilla" source from http://www.kernel.org/ rather than using sources distributed with Fedora.