* [RFC PATCH v3] kbuild: fix error when building from src rpm
@ 2013-06-04 20:12 Marciniszyn, Mike
2013-06-05 9:53 ` Michal Marek
0 siblings, 1 reply; 5+ messages in thread
From: Marciniszyn, Mike @ 2013-06-04 20:12 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild@vger.kernel.org, Doug Ledford
Sorry for the confusion with the patch.
The latest version I've changed to an RFC because of some testing issues I've encountered.
The /sbin/installkernel doesn't behave very nicely when INSTALL_PATH is modified on RH6.4.
I haven't tested SLES11SP2 yet.
The trace from installkernel called from "make install" is:
+ INSTALL_PATH=/home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot
+ make -j8 KBUILD_SRC= install
sh /home/user/rpmbuild/BUILD/kernel-3.10.0_rc1+/arch/x86/boot/install.sh 3.10.0-rc1+ arch/x86/boot/bzImage \
System.map "/home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot"
+ '[' -x /home/user/bin/installkernel ']'
+ '[' -x /sbin/installkernel ']'
+ exec sh -x /sbin/installkernel 3.10.0-rc1+ arch/x86/boot/bzImage System.map /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot
+ cfgLoader=
+ '[' -z /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot -o /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot == /boot ']'
+ LINK_PATH=/boot
++ echo /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/
++ sed 's|^/boot/||'
+ RELATIVE_PATH=/home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/
+ KERNEL_VERSION=3.10.0-rc1+
+ BOOTIMAGE=arch/x86/boot/bzImage
+ MAPFILE=System.map
++ uname -m
+ ARCH=x86_64
+ '[' x86_64 = ppc64 -o x86_64 = ppc ']'
+ KERNEL_NAME=vmlinuz
+ '[' -z 3.10.0-rc1+ -o -z arch/x86/boot/bzImage -o -z System.map ']'
+ '[' -f /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/vmlinuz-3.10.0-rc1+ ']'
+ '[' '!' -L /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/vmlinuz ']'
+ '[' -e /vmlinuz ']'
+ '[' -f /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/System.map-3.10.0-rc1+ ']'
+ '[' '!' -L /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/System.map ']'
+ '[' -e /System.map ']'
+ ln -sf /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot//home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/System.map-3.10.0-rc1+ /boot/System.map
ln: cannot remove `/boot/System.map': Permission denied
+ cat arch/x86/boot/bzImage
+ cp System.map /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/System.map-3.10.0-rc1+
+ ln -fs /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot//home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/vmlinuz-3.10.0-rc1+ /boot/vmlinuz
ln: cannot remove `/boot/vmlinuz': Permission denied
+ ln -fs /home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot//home/user/rpmbuild/BUILDROOT/kernel-3.10.0_rc1+-1.x86_64/boot/System.map-3.10.0-rc1+ /boot/System.map
ln: cannot remove `/boot/System.map': Permission denied
+ '[' -n '' -a -x /sbin/new-kernel-pkg ']'
Note the attempts to remove and symlink stuff. I also think there is some inconsistent use of INSTALL_PATH and INSTALLPATH:
if [ ! -L $INSTALL_PATH/$KERNEL_NAME ]; then
if [ -e $INSTALLPATH/$KERNEL_NAME ]; then
mv $INSTALL_PATH/$KERNEL_NAME $INSTALL_PATH/$KERNEL_NAME.old
fi
fi
I'm seeing when spec file tries to do its own install...
I'm open to suggestions for making this part of the spec file portable and the src RPM usable.
Mike
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFC PATCH v3] kbuild: fix error when building from src rpm
2013-06-04 20:12 [RFC PATCH v3] kbuild: fix error when building from src rpm Marciniszyn, Mike
@ 2013-06-05 9:53 ` Michal Marek
2013-06-05 10:17 ` Marciniszyn, Mike
0 siblings, 1 reply; 5+ messages in thread
From: Michal Marek @ 2013-06-05 9:53 UTC (permalink / raw)
To: Marciniszyn, Mike; +Cc: linux-kbuild@vger.kernel.org, Doug Ledford
On 4.6.2013 22:12, Marciniszyn, Mike wrote:
> Sorry for the confusion with the patch.
>
> The latest version I've changed to an RFC because of some testing
> issues I've encountered.
>
> The /sbin/installkernel doesn't behave very nicely when INSTALL_PATH
> is modified on RH6.4.
[snip]
> I'm seeing when spec file tries to do its own install...
>
> I'm open to suggestions for making this part of the spec file
> portable and the src RPM usable.
You could introduce a new Makefile target, say image_name, that would
simply print the image name after including the arch Makefile. Then in
the spec file, you would simply do
KBUILD_IMAGE=$(make -s image_name)
I think that this target would be a useful addition to the already
existing kernelversion and kernelrelease targets. And BTW, we could use
make -s kernelrelease in the specfile as well, instead of hardcoding the
value there.
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [RFC PATCH v3] kbuild: fix error when building from src rpm
2013-06-05 9:53 ` Michal Marek
@ 2013-06-05 10:17 ` Marciniszyn, Mike
2013-06-05 14:06 ` Doug Ledford
0 siblings, 1 reply; 5+ messages in thread
From: Marciniszyn, Mike @ 2013-06-05 10:17 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild@vger.kernel.org, Doug Ledford
I sent a different version today that used %defines for each arch, but this idea is better and doesn't create a maintenance issue. The scope would be kbuild wide so I assume that the cc list needs to expand?
Also, I will also want to add a new package to create a kernel-devel package and will be submitting patch for that shortly.
Thanks,
Mike
> -----Original Message-----
> From: Michal Marek [mailto:mmarek@suse.cz]
> Sent: Wednesday, June 05, 2013 5:54 AM
> To: Marciniszyn, Mike
> Cc: linux-kbuild@vger.kernel.org; Doug Ledford
> Subject: Re: [RFC PATCH v3] kbuild: fix error when building from src rpm
>
> On 4.6.2013 22:12, Marciniszyn, Mike wrote:
> > Sorry for the confusion with the patch.
> >
> > The latest version I've changed to an RFC because of some testing
> > issues I've encountered.
> >
> > The /sbin/installkernel doesn't behave very nicely when INSTALL_PATH
> > is modified on RH6.4.
> [snip]
> > I'm seeing when spec file tries to do its own install...
> >
> > I'm open to suggestions for making this part of the spec file portable
> > and the src RPM usable.
>
> You could introduce a new Makefile target, say image_name, that would
> simply print the image name after including the arch Makefile. Then in the
> spec file, you would simply do
>
> KBUILD_IMAGE=$(make -s image_name)
>
> I think that this target would be a useful addition to the already existing
> kernelversion and kernelrelease targets. And BTW, we could use make -s
> kernelrelease in the specfile as well, instead of hardcoding the value there.
>
> Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH v3] kbuild: fix error when building from src rpm
2013-06-05 10:17 ` Marciniszyn, Mike
@ 2013-06-05 14:06 ` Doug Ledford
0 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2013-06-05 14:06 UTC (permalink / raw)
To: Marciniszyn, Mike; +Cc: Michal Marek, linux-kbuild@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]
On 6/5/2013 6:17 AM, Marciniszyn, Mike wrote:
> I sent a different version today that used %defines for each arch,
I didn't look through the original patch (especially since you said you
are sending a new one). However, please keep in mind that we need to
either put firmware in a kernel version specific directory or split it
off to a separate patch. Otherwise you can't install more than one
kernel package at a time.
> but this idea is better and doesn't create a maintenance issue. The
> scope would be kbuild wide so I assume that the cc list needs to
> expand?
>
> Also, I will also want to add a new package to create a kernel-devel
> package and will be submitting patch for that shortly.
>
> Thanks, Mike
>
>
>> -----Original Message----- From: Michal Marek
>> [mailto:mmarek@suse.cz] Sent: Wednesday, June 05, 2013 5:54 AM To:
>> Marciniszyn, Mike Cc: linux-kbuild@vger.kernel.org; Doug Ledford
>> Subject: Re: [RFC PATCH v3] kbuild: fix error when building from
>> src rpm
>>
>> On 4.6.2013 22:12, Marciniszyn, Mike wrote:
>>> Sorry for the confusion with the patch.
>>>
>>> The latest version I've changed to an RFC because of some
>>> testing issues I've encountered.
>>>
>>> The /sbin/installkernel doesn't behave very nicely when
>>> INSTALL_PATH is modified on RH6.4.
>> [snip]
>>> I'm seeing when spec file tries to do its own install...
>>>
>>> I'm open to suggestions for making this part of the spec file
>>> portable and the src RPM usable.
>>
>> You could introduce a new Makefile target, say image_name, that
>> would simply print the image name after including the arch
>> Makefile. Then in the spec file, you would simply do
>>
>> KBUILD_IMAGE=$(make -s image_name)
>>
>> I think that this target would be a useful addition to the already
>> existing kernelversion and kernelrelease targets. And BTW, we could
>> use make -s kernelrelease in the specfile as well, instead of
>> hardcoding the value there.
>>
>> Michal
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH v3] kbuild: fix error when building from src rpm
@ 2013-06-04 19:37 Mike Marciniszyn
0 siblings, 0 replies; 5+ messages in thread
From: Mike Marciniszyn @ 2013-06-04 19:37 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild
The following issue can be reproduced with Linus' tree.
+ cp /home/user/rpmbuild-test/BUILDROOT/kernel-3.9.2.x86_64/boot/vmlinuz-3.9.2
cp: missing destination file operand after
`/home/user/rpmbuild-test/BUILDROOT/kernel-3.9.2-1.x86_64/boot/vmlinuz-3.9.2'
Try `cp --help' for more information.
error: Bad exit status from /var/tmp/rpm-tmp.R4o0iI (%install)
make defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
make rpm-pkg
Use the resulting src rpm to build as follows:
mkdir ~/rpmbuild-test
cd ~/rpmbuild-test
rpmbuild --rebuild --define "_topdir `pwd`" -vv
~/rpmbuild/SRPMS/kernel-3.10.0_rc1+-1.src.rpm
The issue is because the %install script uses $KBUILD_IMAGE and it hasn't
been set.
echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
It probably isn't as simple as allowing it to come from the environment, since
it might be architecture specific.
This patch changes the manual install code to user the kernel's make install
with an INSTALL_PATH override. installkernel with then install the
files into $RPM_BUILD_ROOT/boot.
Unfortunately, the /sbin/installkernel on RH6.4 has issues when presented
a target directory that is not /boot. The trace looks like:
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
---
scripts/package/mkspec | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fbbfd08..9b4f209 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -83,17 +83,7 @@ echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
echo "%endif"
echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC= modules_install'
-echo "%ifarch ia64"
-echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE"
-echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/"
-echo "%else"
-echo "%ifarch ppc64"
-echo "cp vmlinux arch/powerpc/boot"
-echo "cp arch/powerpc/boot/"'$KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
-echo "%else"
-echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
-echo "%endif"
-echo "%endif"
+echo 'INSTALL_PATH=$RPM_BUILD_ROOT/boot make %{?_smp_mflags} KBUILD_SRC= install'
echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr KBUILD_SRC= headers_install'
echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-05 14:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 20:12 [RFC PATCH v3] kbuild: fix error when building from src rpm Marciniszyn, Mike
2013-06-05 9:53 ` Michal Marek
2013-06-05 10:17 ` Marciniszyn, Mike
2013-06-05 14:06 ` Doug Ledford
-- strict thread matches above, loose matches on Subject: below --
2013-06-04 19:37 Mike Marciniszyn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox