custom kernel with rpmbuild

make targets:
make
make modules
make modules_install

Generate patch:
diff -Naurp old new > my.patch

Modify kernel steps
put the following in .rpmmacros:
cat ~/.rpmmacros
%_topdir %(echo /home/user/mypath)/rpm
%_tmppath %(echo /home/user/mypath)/rpm/tmp
%debug_package %{nil}
  • install the src package
    rpm -i kernel*.src.rpm
  • generate patches and put in SOURCES
  • modified kernel*.config in SOURCES
  • modified SPEC/kernel*.spec to pickup the patches
    Patch3000: my.patch
    %patch3000 -p1
apply the patch (cd to SPECS)
rpmbuild -bp --target=i686 kernel-2.6.spec


build:
rpmbuild -bb --with baseonly --without debug --without debuginfo --without kabichk --target=i686 kernel-2.6.spec
use buildid to change buildname
build without rpm
rpmbuild -bp kernelsrc.rpm
cd rpm/kernel/sourcedir
cp favor_config to .config
make menuconfig # set prefix
make -j8
make modules_install
make install

No comments: