LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating RPM of compiled kernel (https://www.linuxquestions.org/questions/linux-newbie-8/creating-rpm-of-compiled-kernel-4175459083/)

JD Nimavat 04-22-2013 01:51 AM

Creating RPM of compiled kernel
 
I have Files & Directories as shown below,


kernel-smp-2.6.39.4-1
|
|- boot
| |
| |-System.map-2.6.39.4-1smp
| |-vmlinuz-2.6.39.4-1smp
|
|
|- lib
| |
| |-modules
| | |
| | |-2.6.39.4-1smp
| | | |
| | | |-Here is all the modules.


Now, I want to create RPM of above data. so, whenever I install Linux, This rpm will install and My older kernel will replaced by newer.
I don't know how to create rpm of above...
I know rpmbuild command, but it requires Makefile and spec file,
I don't know what to write in Makefile and spec file for kernel rpm.


Thanks.

Jayadip Nimavat.

pan64 04-22-2013 06:21 AM

I think you need to use kernel development tools and that will be able to create a package for you

JD Nimavat 04-24-2013 02:12 AM

Where is lilo.conf in linux disk image?
 
Thanks for your reply,

I have successfully created kernel RPM, Now I want to add this RPM to disk-Image of linux operating System. so that , whenever I install this modified linux, my new kernel will be automatically installed. and I want to modify lilo.conf, so that, by default this newly created kernel can boot.

I know how to extract and recreate disk-Image, but I can't find lilo.conf from this Image. but I can find lilo.conf after installing linux, I want to modify this file in disk-image before installing it.

For that I have some questions:
-------------------------------

When we installs any linux os, is lilo.conf automatically generates?
If yes, then who generates it?
If no, then where to write lilo.conf in disk-image?


Thanks.
JD Nimavat.

pan64 04-24-2013 02:30 AM

I think that works in the reverse order:
first you choose a distro, usually it has a kernel. You install it together with a boot manager. The boot manager will detect runnable OSs (like linux or windows) and will create config file. Adding a new kernel will lead to a new session (or more) in that config file. Usually during the installation of the kernel the boot manager will be updated, but you can always ask the boot manager to reconfigure itself and you can also do it by hand.

JackHamm3r 04-24-2013 07:31 AM

Quote:

Originally Posted by pan64 (Post 4936387)
I think you need to use kernel development tools and that will be able to create a package for you

@pan64: Is it possible with rpmbuild in RHEL6?

pan64 04-24-2013 07:44 AM

yes, rpmbuild is used to create rpm

JD Nimavat 04-24-2013 08:51 AM

Updating hdlist and hdlist2
 
Thanks for your reply.

Now, I have added kernel-rpm into RPMS directory in my disk-image, but I have to update hdlist and hdlist2, which are in base directory.

If I do not update hdlist and hdlist2, the newly added kernel rpm will not install with the customised Linux os.

So, any idea how to recreate hdlist and hdlist2?

Thank you so much.

Jayadip Nimavat

JackHamm3r 04-25-2013 05:19 AM

Quote:

Originally Posted by pan64 (Post 4937942)
yes, rpmbuild is used to create rpm

I'll try it out. I didn't knew even kernel packages can be compiled like that. So what if I try to sign it with my GPG signature? I mean, is there any legal issue or not.

JD Nimavat 04-25-2013 06:55 AM

I have solved this problem using genhdlist command.

Thank you so much for your guidance.


All times are GMT -5. The time now is 02:52 PM.