Kernel 2.6.35 patchmerge fails

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kernel 2.6.35 patchmerge fails

1,102 Views
iMxGuy
Contributor II

Hi,

I have made some modifications to my 2.6.35 kernel and now I want to generate the patch files using patchmerge function of ltib. However, I get the following error... It seems there is no patches directory in the source tree. Is this a bug?

 

morrema@ubuntu:~/ltib-atlas2$ ./ltib -p kernel -m patchmerge
+ mv /home/morrema/ltib-atlas2/rpm/BUILD/linux-2.6.35.3 /home/morrema/ltib-atlas2/rpm/BUILD/linux-2.6.35.3.modified
+ cd /home/morrema/ltib-atlas2/rpm/BUILD/linux-2.6.35.3.modified
+ make distclean
+ cd -
/home/morrema/ltib-atlas2
+ rpmbuild --dbpath /home/morrema/ltib-atlas2/rootfs//var/lib/rpm --define _target_cpu arm --define _topdir /home/morrema/ltib-atlas2/rpm --define _prefix /usr --define _tmppath /home/morrema/ltib-atlas2/tmp --define _mandir /usr/share/man --define _sysconfdir /etc -bp /home/morrema/ltib-atlas2/tmp/kernel-2.6.35.spec
+ umask 022
+ cd /home/morrema/ltib-atlas2/rpm/BUILD
+ KSRC_DIR=/home/morrema/ltib-atlas2/rpm/BUILD/linux-2.6.35.3
+ [ -z ]
+ cd /home/morrema/ltib-atlas2/rpm/BUILD
+ rm -rf linux-2.6.35.3
+ /bin/bzip2 -dc /home/morrema/ltib-atlas2/rpm/SOURCES/linux-2.6.35.3.tar.bz2
+ tar -xvvf -
+ STATUS=0
+ [ 0 -ne 0 ]
+ cd linux-2.6.35.3
+ chmod 755 patches/patch-kernel.sh
chmod: cannot access `patches/patch-kernel.sh': No such file or directory
error: Bad exit status from /home/morrema/ltib-atlas2/tmp/rpm-tmp.44113 (%prep)
Bad exit status from /home/morrema/ltib-atlas2/tmp/rpm-tmp.44113 (%prep)
+ exit 1
Died at ./ltib line 1147.
traceback:
main::f_patchmerge:1147
main:560

Exiting on error or interrupt

Labels (1)
Tags (2)
0 Kudos
2 Replies

593 Views
ACGarland
Contributor III

As near as I've been able to determine, the problem comes about because the spec file for making the diff (patch) assumes that the version of the kernel it is differencing against will have patches (a ./patches subdirectory containing patch-kernel.sh). If, however, the patch file is being generated against a release kernel which has no patches, then there are no patches in that release version so the spec file instructions fail.

There also seemed to be a problem in certain flags being passed to the build instruction which confuse the patchmerge process (they get appended to a directory name which then is found not to exist).  Here are changes I made to work around these problems.  (Beware that I'm a total newbie to this so this might be the blind leading the blind...)

diff -r 0dbd374bce49 tools/thoratec/svn/trunk/code/display/linux/build/ltib/config/platform/imx/kernel-2.6.35.spec.in
--- a/tools/thoratec/svn/trunk/code/display/linux/build/ltib/config/platform/imx/kernel-2.6.35.spec.in    Fri Feb 10 14:25:38 2012 -0800
+++ b/tools/thoratec/svn/trunk/code/display/linux/build/ltib/config/platform/imx/kernel-2.6.35.spec.in    Mon Feb 13 14:46:15 2012 -0800
@@ -14,6 +14,7 @@
 Source          : %{pkg_name}-%{version}.tar.bz2
 Source1         : %{pkg_name}-%{version}-%{release}.bz2
 URL             : http://www.kernel.org/
 BuildRoot       : %{_tmppath}/%{name}
 Prefix          : %{pfx}
 
@@ -26,8 +27,12 @@
 
 if [ -z "$PKG_KERNEL_LEAVESRC" ] || [ ! -d "$KSRC_DIR" ]
 then
-%setup -n %{buildsubdir} -a 1
+#%setup -n %{buildsubdir} -a 1
+%setup -n %{buildsubdir}
+if [ -e patches/patch-kernel.sh ]
+then
 chmod 755 patches/patch-kernel.sh
 ./patches/patch-kernel.sh
 fi
+fi


0 Kudos

593 Views
ACGarland
Contributor III

Hi Mike,

Don't know if you are still around?  Did you ever get help on this?  I'm encountering this problem now when I'm trying to apply the patches.tar.gz which is provided with the L2.6.35_11.09.01_ER release for IMX53.  I can apply the patches and even am successful at converting the imx-test and u-boot patches into permanent patch files using ltib, but when I try to do the same with the kernel patch (./ltib -m patchmerge -p kernel) it fails just like you mention above.  At the time I invoke the command, there is a linux-2.6.35.3/patches/patch-kernel.sh file, but during the command the linux-2.6.35.3/patches directory seems to disappear and the final reference to run patch-kernel.sh in the associated spec file fails.

I'm new to ltib -- and especially how to go about converting local changes into semi-permanent patches managed by the ltib framework -- so I'm mystified about what I'm supposed to do to rectify the problem.

(If anyone else knows how to address this, I'd sure like to hear what I'm doing wrong.)

0 Kudos