PDA

View Full Version : making kernel rpms?



daywalker
9th May 2006, 03:18 PM
Hi all,

i want to clear some of my doubts about making kernel rpms from kernel source rpms.

after executing
rpmbuild -bp --target=i686 kernel-version.spec

i execute
rpmbuild -ba --target=i686 --define 'disttag FC5' kernel-version.spec

now my question is what is the differents between "rpmbuild -ba --target=i686 --define 'disttag FC5' kernel-version.spec" and "make rpm"?

the thing is after executing
rpmbuild -bp --target=i686 kernel-version.spec
then i did "make menuconfig" to configure my kernel after which i did "make rpm" the resulted kernel is an "i386" but i wanted "i686" now how do i make sure the resulted kernel would be an "i686"?

in the second scenario i issued
rpmbuild -ba --target=i686 --define 'disttag FC5' kernel-version.spec after configuring the kernel thru "make menuconfig" to enable ntfs read & write support, now in this the resulted kernel is an "i686" but when i did "/sbin/lsmod" i could not see the ntfs kernel module being loaded nor does it show up in "cat /proc/filesystems". Now how do i enable the ntfs support if i were to build kernel rpms using "rpmbuild -ba"?

I have some other questions regarding to this issues but i want clear this doubts first.

Thank you.

ccrvic
9th May 2006, 04:11 PM
i want to clear some of my doubts about making kernel rpms from kernel source rpms.

after executing
rpmbuild -bp --target=i686 kernel-version.spec

i execute
rpmbuild -ba --target=i686 --define 'disttag FC5' kernel-version.spec

You don't need to do all that; "-bp" is implied by "-ba". Just the second command would have the same effect.


now my question is what is the differents between "rpmbuild -ba --target=i686 --define 'disttag FC5' kernel-version.spec" and "make rpm"?

"make rpm" builds an RPM from the current contents of the directory; it's a low-traceability option that relies on the Makefile in the kernel source. "rpmbuild", on the other hand, builds from pristine sources and patches, so you know what went into it.


in the second scenario i issued
rpmbuild -ba --target=i686 --define 'disttag FC5' kernel-version.spec after configuring the kernel thru "make menuconfig" to enable ntfs read & write support, now in this the resulted kernel is an "i686" but when i did "/sbin/lsmod" i could not see the ntfs kernel module being loaded nor does it show up in "cat /proc/filesystems".

You wouldn't - "rpmbuild -ba" will first unpack the sources according to the rules in the specfile. This will immediately over-write the build area you had - including your modified .config file...


Now how do i enable the ntfs support if i were to build kernel rpms using "rpmbuild -ba"?

Put the config files you want into the SOURCES directory with a filename that looks like "kernel-2.6.9-i686.config" (but with the right version numbers etc). *Then* do your "rpmbuild -ba"...

Vic.

daywalker
9th May 2006, 04:20 PM
thank you very much vic, i think the last answer is what im looking for.

thank you once again.

daywalker
9th May 2006, 05:11 PM
one more thing, i keep getting this output whenever i compile a kernel as a normal user.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Processing files: kernel-smp-2.6.16-1.2111_FC5.amin
Processing files: kernel-smp-devel-2.6.16-1.2111_FC5.amin
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/kernel-2.6.16-1.2111_FC5.amin-root
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
error: Installed (but unpackaged) file(s) found:
/usr/lib/debug/lib/modules/2.6.16-1.2111_FC5.aminsmp/vmlinux


RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/lib/debug/lib/modules/2.6.16-1.2111_FC5.aminsmp/vmlinux
[amin@cm179 linux-2.6.16.i686]$

but not as root.

Any help on this?

Thank you.

s_esquibel
9th May 2006, 05:16 PM
I got the same i386 rpm, even though I specified a target of 686. I'm interested to find out what happens with your issue.

On a side note, I compiled as non-root using the method supplied in the how-tos
http://forums.fedoraforum.org/showthread.php?t=29434

daywalker
10th May 2006, 05:11 AM
ok, basically im able to build the kernel rpm using "make rpm" as non-root, but when building using "rpmbuild -ba ...." as non-root i always end up with the above output(see my post #4) so i buld as root.

ccrvic
10th May 2006, 07:37 AM
ok, basically im able to build the kernel rpm using "make rpm" as non-root, but when building using "rpmbuild -ba ...." as non-root i always end up with the above output(see my post #4) so i buld as root.

Make sure you've got write access to the appropriate bits of the filesystem in /usr/src/redhat

Vic.

daywalker
10th May 2006, 08:10 AM
ok, how do i get write access to "/usr/src/redhat" as a normal user?

ccrvic
10th May 2006, 09:01 AM
ok, how do i get write access to "/usr/src/redhat" as a normal user?

I would :

- create a "builders" group for people who should be able to build stuff
- chgrp -R builders /usr/src/redhat/*
- chmod 2775 /usr/src/redhat/*

Note that this won't affect anything you've already built into that area; you might have to dibble with those later. But I stopped short of a "chmod -R" because there might be important permissions in there somewhere...

Vic.

Finalzone
10th May 2006, 10:16 AM
How about doing

yum install fedora-rpmdevtools
so you can create the directory rpmbuild similar to /usr/src/redhat with the command fedora-buildtree on your home folder?