Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> Howto Use Fedpkg To Build A Newer Kernel
leigh123linux
 Posted: Apr 20 2011, 03:28 PM
Quote Post


SLF Junior
**

Group: Members
Posts: 47
Member No.: 48
Joined: 14-April 11









First install fedpkg from the fedora epel repo

CODE
su
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
yum install fedpkg



You will probably need to install and setup the required build tools as well


CODE
su
yum groupinstall "Development tools"



Setup your rpmbuild directory, as non-root run

CODE

cd ~
rpmdev-setuptree


as non root check out and build newt needed for rebuilding the newer kernels.

CODE
mkdir ~/fedpkg_checkout;cd fedpkg_checkout
fedpkg co -a -B newt
cd newt/f15
fedpkg srpm
su -c "yum-builddep -y newt-*.src.rpm"
rpmbuild --rebuild newt-*.src.rpm
su -c "yum -y --nogpgcheck install $HOME/rpmbuild/RPMS/`uname -m`/newt*rpm -x newt-debuginfo,newt-static"



Now for the kernel build (Takes 10 - 60 minutes to complete depending on hardware) (I have chosen the F15 kernel which is currently 2.6.38.3).

CODE
cd ~/fedpkg_checkout
fedpkg co -a  -B kernel
cd kernel/f15
make release
fedpkg srpm
su -c "yum-builddep -y kernel-*.src.rpm"
time rpmbuild --rebuild --with baseonly  --without debuginfo --target=`uname -m` kernel-*.src.rpm



If it completes successfully you will find the packages (kernel,kernel-devel,kernel-headers and perf) at ~/rpmbuild/RPMS/`uname -m`/


You can use fedpkg to build any package in the fedora and epel repos wink.gif

If you have the required build requirements already installed you could run

CODE
fedpkg co -a  -B whatever_packagename
cd whatever_packagename/f15
fedpkg local


to build
PM
^
leigh123linux
 Posted: Apr 20 2011, 04:06 PM
Quote Post


SLF Junior
**

Group: Members
Posts: 47
Member No.: 48
Joined: 14-April 11









I will need to do a guide on rebuilding the kmods next cool.gif


CODE
[leigh@main_pc ~]$ rpm -qa |grep -e kernel -e nvidia |sort
buildsys-build-rpmfusion-kerneldevpkgs-current-13-0.1.x86_64
dracut-kernel-004-33.2.el6_0.noarch
kernel-2.6.38.2-8.el6.x86_64
kernel-2.6.39-0.rc2.git0.0.el6.x86_64
kernel-2.6.39-0.rc2.git3.0.el6.x86_64
kernel-devel-2.6.38-4.el6.x86_64
kernel-devel-2.6.39-0.rc2.git0.0.el6.x86_64
kernel-devel-2.6.39-0.rc2.git3.0.el6.x86_64
kernel-headers-2.6.39-0.rc2.git3.0.el6.x86_64
kmod-nvidia-2.6.38.2-8.el6.x86_64-270.41.03-1.el6.x86_64
kmod-nvidia-2.6.39-0.rc2.git0.0.el6.x86_64-270.41.03-1.el6.x86_64
kmod-nvidia-2.6.39-0.rc2.git3.0.el6.x86_64-270.41.03-1.el6.x86_64
nvidia-settings-1.0-9.fc13.x86_64
nvidia-xconfig-1.0-7.el6.x86_64
xorg-x11-drv-nvidia-270.41.03-1.el6.x86_64
xorg-x11-drv-nvidia-devel-270.41.03-1.el6.x86_64
xorg-x11-drv-nvidia-libs-270.41.03-1.el6.i686
xorg-x11-drv-nvidia-libs-270.41.03-1.el6.x86_64
[leigh@main_pc ~]$

PM
^
AndrewSerk
 Posted: Apr 20 2011, 06:30 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 528
Member No.: 54
Joined: 14-April 11









Hello leigh,


I found that when executing the code "su -c "yum -y --nogpgcheck install ~/rpmbuild/RPMS/`uname -m`/newt*rpm -x newt-debuginfo,newt-static" " It looks in the /root.... directory for the rpm instead of the /home/user/rpmbuild/.........

Besides that everything went great and it was as simple as copy/paste.

Great How To, Thank you, smile.gif


EDIT: Thanks for putting time in the command to remind me how slow my build-system is. tongue.gif
real 29m53.583s
user 55m33.318s
sys 12m6.579s
PM
^
leigh123linux
 Posted: Apr 20 2011, 06:50 PM
Quote Post


SLF Junior
**

Group: Members
Posts: 47
Member No.: 48
Joined: 14-April 11









QUOTE (AndrewSerk @ Apr 20 2011, 06:30 PM)
Hello leigh,


I found that when executing the code "su -c "yum -y --nogpgcheck install ~/rpmbuild/RPMS/`uname -m`/newt*rpm -x newt-debuginfo,newt-static" " It looks in the /root.... directory for the rpm instead of the /home/user/rpmbuild/.........

Besides that everything went great and it was as simple as copy/past.

Great How To, Thank you, smile.gif



Thanks, I have changed it to

CODE
su -c "yum -y --nogpgcheck install $HOME/rpmbuild/RPMS/`uname -m`/newt*rpm -x newt-debuginfo,newt-static"
PM
^
spoovy
 Posted: Apr 20 2011, 07:42 PM
Quote Post


SLF Moderator
****

Group: Moderators
Posts: 281
Member No.: 5
Joined: 8-April 11









Great thanks Leigh i'll give that a go.


--------------------
PMIntegrity Messenger IM
^
alexander.hunt
 Posted: Jul 12 2011, 06:52 PM
Quote Post


SLF Newbie


Group: Members
Posts: 11
Member No.: 149
Joined: 10-May 11









Thank you very much Leigh, I used your instructions to rebuild the F15 kernel (version 2.6.38.8-35.el6.x86_64) last night and also the linux-firmware package from F15 that it wanted at install time. It all worked perfectly, installed perfectly and booted perfectly, even lsmod showed that all the blacklisted modules that I have personally blacklisted on my machine were still blacklisted.
What an easy way to do a kernel upgrade! biggrin.gif
Thank you again, I am a big fan of your work (Thanks for the Firefox5 package as well).
Best regards,
Alex
PM
^
lebenskuenstler
 Posted: Jul 13 2011, 06:42 PM
Quote Post


SLF Newbie


Group: Members
Posts: 4
Member No.: 391
Joined: 6-July 11









Just a minor remark: rpmdevtools (and fakeroot) has also to be installed.

smile.gif

LK
PM
^
spoovy
 Posted: Jul 13 2011, 08:06 PM
Quote Post


SLF Moderator
****

Group: Moderators
Posts: 281
Member No.: 5
Joined: 8-April 11









Is there any advantage to using this fedpkg method over this one = http://scientificlinuxforum.org/index.php?showtopic=128 ?



--------------------
PMIntegrity Messenger IM
^
AndrewSerk
 Posted: Jul 14 2011, 02:53 AM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 528
Member No.: 54
Joined: 14-April 11









QUOTE (spoovy @ Jul 13 2011, 03:06 PM)
Is there any advantage to using this fedpkg method over this one = http://scientificlinuxforum.org/index.php?showtopic=128 ?


One advantage of fedpkg is, you don't have to hunt down srpms.
PM
^
spoovy
 Posted: Aug 15 2011, 09:27 AM
Quote Post


SLF Moderator
****

Group: Moderators
Posts: 281
Member No.: 5
Joined: 8-April 11









I finally got around to testing this out. Very interesting, but i've one question - is it possible to browse the Fedora repos from the command line somehow? I built python3 but just guessed at the name, which luckily worked (ie "fedpkg co -a -B python3").

This post has been edited by spoovy: Aug 15 2011, 09:28 AM


--------------------
PMIntegrity Messenger IM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll