LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 04-30-2012, 04:07 AM   #1
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 30

Rep: Reputation: 2
I'm not getting the proper $KERNELRELEASE string after make rpm


Hello,

I've been at this for the last few hours trying to figure out where in the compilation process where $KERNELRELEASE gets a different value from CONFIG_LOCALVERSION or LOCALVERSION when it reaches "rpmbuild".

Code:
make clean
  CLEAN   .
  CLEAN   .tmp_versions
set -e; cd -P ..; ln -sf /mnt/wsrv/usr/local/src/linux-3.2.16 kernel-3.2.16_grsec.bomb.us
/bin/sh /mnt/wsrv/usr/local/src/linux-3.2.16/scripts/setlocalversion --save-scmversion
set -e; cd -P ..; tar -cz --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc --exclude .hg --exclude .git -f kernel-3.2.16_grsec.bomb.us.tar.
gz kernel-3.2.16_grsec.bomb.us/.
set -e; cd -P ..; rm kernel-3.2.16_grsec.bomb.us
rm -f /mnt/wsrv/usr/local/src/linux-3.2.16/.scmversion
set -e; \
/bin/sh /mnt/wsrv/usr/local/src/linux-3.2.16/scripts/mkversion > /mnt/wsrv/usr/local/src/linux-3.2.16/.tmp_version
set -e; \
mv -f /mnt/wsrv/usr/local/src/linux-3.2.16/.tmp_version /mnt/wsrv/usr/local/src/linux-3.2.16/.version
rpmbuild  --target x86_64 -ta ../kernel-3.2.16_grsec.bomb.us.tar.gz
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.2ddOyE
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd /usr/src/packages/BUILD
+ rm -rf kernel-3.2.16_grsecgrsec
+ /bin/tar -xf -
+ /usr/bin/gzip -dc /mnt/wsrv/usr/local/src/kernel-3.2.16_grsecgrsec.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd kernel-3.2.16_grsecgrsec
make clean
  CLEAN   .
  CLEAN   .tmp_versions
set -e; cd -P ..; ln -sf /mnt/wsrv/usr/local/src/linux-3.2.16 kernel-3.2.16_grsec.bomb.us
/bin/sh /mnt/wsrv/usr/local/src/linux-3.2.16/scripts/setlocalversion --save-scmversion
set -e; cd -P ..; tar -cz --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc --exclude .hg --exclude .git -f kernel-3.2.16_grsec.bomb.us.tar.
gz kernel-3.2.16_grsec.bomb.us/.
set -e; cd -P ..; rm kernel-3.2.16_grsec.bomb.us
rm -f /mnt/wsrv/usr/local/src/linux-3.2.16/.scmversion
set -e; \
/bin/sh /mnt/wsrv/usr/local/src/linux-3.2.16/scripts/mkversion > /mnt/wsrv/usr/local/src/linux-3.2.16/.tmp_version
set -e; \
mv -f /mnt/wsrv/usr/local/src/linux-3.2.16/.tmp_version /mnt/wsrv/usr/local/src/linux-3.2.16/.version
rpmbuild  --target x86_64 -ta ../kernel-3.2.16_grsec.bomb.us.tar.gz
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.2ddOyE
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd /usr/src/packages/BUILD
+ rm -rf kernel-3.2.16_grsecgrsec
+ /bin/tar -xf -
+ /usr/bin/gzip -dc /mnt/wsrv/usr/local/src/kernel-3.2.16_grsecgrsec.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd kernel-3.2.16_grsecgrsec
When the compiling process is done, I'm looking for a resulting "kernel-3.2.16_grsec.bomb.us.x86_64.rpm", instead the result is "kernel-3.2.16_grsecgrsec". I've been going through the Makefile and I can seem to find the exact location where $KERNELRELEASE get's modified to a different string than expected. Any assistance in this issue would be helpful.

Best Regards
 
Old 04-30-2012, 05:16 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,305
Blog Entries: 54

Rep: Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857
Any reason for not posting the .spec file and the command line you build the package with?
 
Old 04-30-2012, 02:03 PM   #3
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 30

Original Poster
Rep: Reputation: 2
Hello

Hello,

Well, if I had known, I would have included the necessary information in my previous post. There were no particular reason the information was withheld.

Code:
make CC=/usr/bin/gcc-4.6 DISABLE_PAX_PLUGINS=y rpm
Note: The spec file is auto generated during compile time by $root/include/package/mkspec

Code:
Name: kernel
Summary: The Linux Kernel
Version: 3.2.16_grsecgrsec
Release: 2
License: GPL
Group: System Environment/Kernel
Vendor: The Linux Community
URL: http://www.kernel.org
Source: kernel-3.2.16_grsecgrsec.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root
Provides:  kernel-3.2.16-grsecgrsec
%define __spec_install_post /usr/lib/rpm/brp-compress || :
%define debug_package %{nil}

%description
The Linux Kernel, the operating system core itself

%package headers
Summary: Header files for the Linux kernel for use by glibc
Group: Development/System
Obsoletes: kernel-headers
Provides: kernel-headers = %{version}
%description headers
Kernel-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs.  The
header files define structures and constants that are needed for
building most standard programs and are also needed for rebuilding the
glibc package.

%prep
%setup -q

%build
make clean && make %{?_smp_mflags}

%install%ifarch ia64
mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules
mkdir -p $RPM_BUILD_ROOT/lib/firmware
%else
mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules
mkdir -p $RPM_BUILD_ROOT/lib/firmware
%endif
INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC= modules_install
%ifarch ia64
cp $KBUILD_IMAGE $RPM_BUILD_ROOT/boot/efi/vmlinuz-3.2.16-grsecgrsec
ln -s efi/vmlinuz-3.2.16-grsecgrsec $RPM_BUILD_ROOT/boot/
%else
%ifarch ppc64
cp vmlinux arch/powerpc/boot
cp arch/powerpc/boot/$KBUILD_IMAGE $RPM_BUILD_ROOT/boot/vmlinuz-3.2.16-grsecgrsec
%else
cp $KBUILD_IMAGE $RPM_BUILD_ROOT/boot/vmlinuz-3.2.16-grsecgrsec
%endif%endif                                                                                                                                                          [7/1117]
make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install
cp System.map $RPM_BUILD_ROOT/boot/System.map-3.2.16-grsecgrsec
cp .config $RPM_BUILD_ROOT/boot/config-3.2.16-grsecgrsec
%ifnarch ppc64
cp vmlinux vmlinux.orig
bzip2 -9 vmlinux
mv vmlinux.bz2 $RPM_BUILD_ROOT/boot/vmlinux-3.2.16-grsecgrsec.bz2
mv vmlinux.orig vmlinux
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, root)
%dir /lib/modules
/lib/modules/3.2.16-grsecgrsec
/lib/firmware
/boot/*

%files headers
%defattr (-, root, root)
/usr/include
From what I could gather, the $KERNELRELEASE variable is modified somewhere in the compile process. The actual parameters passed to rpmbuild could be found in my previous post.

Best Regards
 
Old 04-30-2012, 03:06 PM   #4
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 30

Original Poster
Rep: Reputation: 2
Hello,

YEAH!! After tirelessly spending 24 hours on this issue, I finally figured it out. Apparently $ROOT/include/package/mkspec never is executed while $ROOT/kernel.spec exists. Simply removing it and 'mkspec' will create a new spec with the proper values.

Best Regards

Last edited by markings; 04-30-2012 at 03:07 PM. Reason: Just Rephrasing
 
1 members found this post helpful.
Old 04-30-2012, 03:17 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,305
Blog Entries: 54

Rep: Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857
Well done figuring it out yourself!

//Please mark thread "solved", TIA.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Parse RPM version string in Bash jimwelc Linux - Newbie 1 02-28-2005 05:22 PM
how do I make a binary rpm from a source rpm darkone66669 Linux - Software 3 01-11-2005 10:42 AM
S/W Packaging wont show proper rpm DB pgmer6809 Mandriva 0 05-01-2004 06:57 PM
what is the proper way to make changes to udp.c? coontie Linux - Networking 3 03-04-2004 01:00 PM
how can I get/make a proper squid daemon startup script for boot time binkybuckle Debian 0 07-05-2003 07:58 PM


All times are GMT -5. The time now is 03:51 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration