LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-16-2011, 11:00 PM   #1
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Rep: Reputation: 15
linux kernerl3.0.0 build as rpm package got problem.


i make rpm package from linux kerlne 3.0.0 source.

default spec file in "linux-3.0/scripts/package/mkspec" ,i add %post lines,this step use to install new kernel with rpm (ivh) tools
and configure grub automatically

Quote:

echo "%post"
echo '/sbin/new-kernel-pkg --mkinitrd --depmod --install "$__KERNELRELEASE" || exit $?'
then ,make rpm-pkg, it makes rpms bellow:
Wrote: /root/rpmbuild/SRPMS/kernel-3.0.0-1.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-3.0.0-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-headers-3.0.0-1.x86_64.rpm


install new kernel:
rpm -ivh /root/rpmbuild/RPMS/x86_64/kernel-3.0.0-1.x86_64.rpm
come to error:
Quote:
[root@localhost ~]# rpm -ivh kernel-3.0.0-1.x86_64.rpm
Preparing... ########################################### [100%]
1:kernel ########################################### [100%]
Usage: new-kernel-pkg [-v] [--mkinitrd] [--rminitrd] [--dracut]
[--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]
[--kernel-args=<args>] [--remove-args=<args>]
[--banner=<banner>] [--multiboot=multiboot]
[--mbargs=mbargs] [--make-default] [--add-dracut-args]
[--add-plymouth-initrd]
[--host-only]
<--install | --remove | --update | --rpmposttrans> <kernel-version>
(ex: new-kernel-pkg --mkinitrd --depmod --install 2.4.7-2)
warning: %post(kernel-3.0.0-1.x86_64) scriptlet failed, exit status 1
check new kenel status
Quote:
[root@localhost ~]# rpm -qa | grep kernel
kernel-3.0.0-1.x86_64
kernel-headers-2.6.32-71.el6.x86_64
kernel-devel-2.6.32-71.el6.x86_64
abrt-addon-kerneloops-1.1.13-4.el6.x86_64
kernel-firmware-2.6.32-71.el6.noarch
kernel-2.6.32-71.el6.x86_64
dracut-kernel-004-32.el6.noarch

ll /lib/modules/
2.6.32-71.el6.x86_64/ 3.0.0/

[root@localhost ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-71.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root=UUID=b69ab39e-db0b-4d7a-a538-f88bd2dc25e1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
initrd /initramfs-2.6.32-71.el6.x86_64.img

[root@localhost ~]# ls -l /boot/
total 28987
-rw-r--r--. 1 root root 97862 May 20 11:29 config-2.6.32-71.el6.x86_64
-rw-r--r--. 1 root root 93958 Aug 17 2011 config-3.0.0
drwxr-xr-x. 3 root root 1024 Aug 13 02:21 efi
drwxr-xr-x. 2 root root 1024 Aug 13 02:23 grub
-rw-r--r--. 1 root root 13429106 Aug 13 02:22 initramfs-2.6.32-71.el6.x86_64.img
drwx------. 2 root root 12288 Aug 13 02:07 lost+found
-rw-r--r--. 1 root root 160542 May 20 11:29 symvers-2.6.32-71.el6.x86_64.gz
-rw-r--r--. 1 root root 2226490 May 20 11:29 System.map-2.6.32-71.el6.x86_64
-rw-r--r--. 1 root root 2244804 Aug 17 2011 System.map-3.0.0
-rwxr-xr-x. 1 root root 4065933 Aug 17 2011 vmlinux-3.0.0.bz2
-rwxr-xr-x. 1 root root 3791040 May 20 11:29 vmlinuz-2.6.32-71.el6.x86_64
-rw-r--r--. 1 root root 3541040 Aug 17 2011 vmlinuz-3.0.0
new kernel already installed,but grub.conf not configured
and initr-3.0.0.img not installed.


but if i use
Quote:
make;make modules_install; make install

or if i execute commands bellow.
Quote:
rpm -ivh kernel-3.0.0-1.x86_64.rpm
/sbin/new-kernel-pkg --mkinitrd --depmod --install 3.0.0
there are all right.

any suguestion?

Last edited by xiutuo; 08-16-2011 at 11:47 PM.
 
Old 08-17-2011, 01:15 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by xiutuo View Post
any suguestion?
Two: not building packages as root (not good for system integrity and not required unless you do exotic stuff) and finding out (display env, force exporting variable) if "$__KERNELRELEASE" was defined previous to %post running "/sbin/new-kernel-pkg --mkinitrd --depmod --install "$__KERNELRELEASE".".
 
Old 08-18-2011, 12:35 AM   #3
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Original Poster
Rep: Reputation: 15
THANK U,i aleardy resoved.


use %version instead of $____KERNELRELEASE ,it works,but at kernel-3.0.0 version ,
"make rpm-pkg" dont build kernel-devel pkg, only build kernel-3.0.0.x86_64.rpm,kernel-src.3.0.0.x86_64.rpm and kernel-header.x86_64.rpm
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the steps to build and install a Slackware package from a RPM package? sudeepkulkarni Slackware 6 04-25-2011 12:51 PM
[SOLVED] Build problem - ./configure output saying package is not present when it is. spoovy Linux - Software 5 04-07-2011 04:07 PM
How to build httpd-2.2.3-22 as a relocatable rpm package in RHEL 5.3 renjunix Linux - Server 3 11-02-2009 09:04 AM
reinstalling the rpm build package Linden Goodwin Linux - Newbie 1 06-28-2009 06:44 PM
Not able to install rpm-build package deepika Linux - Newbie 2 07-19-2003 09:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration