Hi,
Here are two patches that are needed for the kernel CI effort. I would appreciate reviews on my first kernel patches to be submitted, and guidance for where to send them to get them accepted upstream.
Needed in order to run the target when cross-building.
Needed in order to stop jobs in the CI system from overwriting each others files.
Thanks,
James
Pay attention to the cross-building environment variables used in the rest of the kernel build, so that you can successfully make deb-pkg while cross-building. --- scripts/package/builddeb | 80 +++++++++++++++++++++++----------------------- 1 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index f6cbc3d..ea33db3 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -12,6 +12,43 @@
set -e
+# Attempt to find the correct Debian architecture +forcearch="" +debarch="" +case "$UTS_MACHINE" in +i386|ia64|alpha) + debarch="$UTS_MACHINE" ;; +x86_64) + debarch=amd64 ;; +sparc*) + debarch=sparc ;; +s390*) + debarch=s390 ;; +ppc*) + debarch=powerpc ;; +parisc*) + debarch=hppa ;; +mips*) + debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;; +arm*) + debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;; +*) + echo "" >&2 + echo "** ** ** WARNING ** ** **" >&2 + echo "" >&2 + echo "Your architecture doesn't have it's equivalent" >&2 + echo "Debian userspace architecture defined!" >&2 + echo "Falling back to using your current userspace instead!" >&2 + echo "Please add support for $UTS_MACHINE to ${0} ..." >&2 + echo "" >&2 +esac +if [ -z "$KBUILD_DEBARCH" ] ; then + debarch="$KBUILD_DEBARCH" +fi +if [ -n "$debarch" ] ; then + forcearch="-DArchitecture=$debarch" +fi + create_package() { local pname="$1" pdir="$2"
@@ -25,42 +62,6 @@ create_package() { chown -R root:root "$pdir" chmod -R go-w "$pdir"
- # Attempt to find the correct Debian architecture - local forcearch="" debarch="" - case "$UTS_MACHINE" in - i386|ia64|alpha) - debarch="$UTS_MACHINE" ;; - x86_64) - debarch=amd64 ;; - sparc*) - debarch=sparc ;; - s390*) - debarch=s390 ;; - ppc*) - debarch=powerpc ;; - parisc*) - debarch=hppa ;; - mips*) - debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;; - arm*) - debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;; - *) - echo "" >&2 - echo "** ** ** WARNING ** ** **" >&2 - echo "" >&2 - echo "Your architecture doesn't have it's equivalent" >&2 - echo "Debian userspace architecture defined!" >&2 - echo "Falling back to using your current userspace instead!" >&2 - echo "Please add support for $UTS_MACHINE to ${0} ..." >&2 - echo "" >&2 - esac - if [ -n "$KBUILD_DEBARCH" ] ; then - debarch="$KBUILD_DEBARCH" - fi - if [ -n "$debarch" ] ; then - forcearch="-DArchitecture=$debarch" - fi - # Create the package dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" dpkg --build "$pdir" .. @@ -246,15 +247,14 @@ mkdir -p "$destdir" (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -) (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -) rm -f /tmp/files$$ /tmp/objfiles$$ -arch=$(dpkg --print-architecture)
cat <<EOF >> debian/control
Package: $kernel_headers_packagename Provides: linux-headers, linux-headers-2.6 -Architecture: $arch -Description: Linux kernel headers for $KERNELRELEASE on $arch - This package provides kernel header files for $KERNELRELEASE on $arch +Architecture: $debarch +Description: Linux kernel headers for $KERNELRELEASE on $debarch + This package provides kernel header files for $KERNELRELEASE on $debarch . This is useful for people who need to build external modules EOF
Allow the caller to set the output directory for the deb packages using an environment variable. --- scripts/package/builddeb | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index ea33db3..dea0190 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -12,6 +12,10 @@
set -e
+if [ -z $DEB_OUT_DIR ]; then + $DEB_OUT_DIR=".." +fi + # Attempt to find the correct Debian architecture forcearch="" debarch="" @@ -64,7 +68,7 @@ create_package() {
# Create the package dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" - dpkg --build "$pdir" .. + dpkg --build "$pdir" $DEB_OUT_DIR }
# Some variables and settings used throughout the script
Hi Deepti,
It's been suggested that this could be achieved instead by using the standard "O" variable to suggest an output dir.
Running
make deb-pkg O=build/
would use build/ as the build directory, and then put the resulting files in the current working directory.
I haven't tested it, but if it works would it solve your problem?
Thanks,
James
On Tue, 20 Sep 2011 17:30:46 -0400, James Westby james.westby@linaro.org wrote:
Allow the caller to set the output directory for the deb packages using an environment variable.
scripts/package/builddeb | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index ea33db3..dea0190 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -12,6 +12,10 @@ set -e +if [ -z $DEB_OUT_DIR ]; then
- $DEB_OUT_DIR=".."
+fi
# Attempt to find the correct Debian architecture forcearch="" debarch="" @@ -64,7 +68,7 @@ create_package() { # Create the package dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
- dpkg --build "$pdir" ..
- dpkg --build "$pdir" $DEB_OUT_DIR
}
# Some variables and settings used throughout the script
1.7.5.4
Hello James,
I have used the O=build_output_dir option and it builds the debian package in the curdir. It does solve the problem, I need to test and see if the debian package bult in this way functionally works. But, still I think your changes hold good as it creates a debian package in the specified directory than the current behavior of creating a debian package in the parent directory.
Thanks and Regards, Deepti.
On Thu, Sep 22, 2011 at 9:36 PM, James Westby james.westby@linaro.orgwrote:
Hi Deepti,
It's been suggested that this could be achieved instead by using the standard "O" variable to suggest an output dir.
Running
make deb-pkg O=build/
would use build/ as the build directory, and then put the resulting files in the current working directory.
I haven't tested it, but if it works would it solve your problem?
Thanks,
James
On Tue, 20 Sep 2011 17:30:46 -0400, James Westby james.westby@linaro.org wrote:
Allow the caller to set the output directory for the deb packages using an environment variable.
scripts/package/builddeb | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index ea33db3..dea0190 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -12,6 +12,10 @@
set -e
+if [ -z $DEB_OUT_DIR ]; then
- $DEB_OUT_DIR=".."
+fi
# Attempt to find the correct Debian architecture forcearch="" debarch="" @@ -64,7 +68,7 @@ create_package() {
# Create the package dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
dpkg --build "$pdir" ..
dpkg --build "$pdir" $DEB_OUT_DIR
}
# Some variables and settings used throughout the script
1.7.5.4
On Wed, Sep 21, 2011 at 12:30 AM, James Westby james.westby@linaro.org wrote:
Hi,
Here are two patches that are needed for the kernel CI effort. I would appreciate reviews on my first kernel patches to be submitted, and guidance for where to send them to get them accepted upstream.
Needed in order to run the target when cross-building.
Needed in order to stop jobs in the CI system from overwriting each others files.
Thanks, James
(kernel-source-root) $ ./scripts/get_maintainer.pl -f scripts/package/builddeb Michal Marek mmarek@suse.cz (maintainer:KERNEL BUILD + fi...) linux-kbuild@vger.kernel.org (open list:KERNEL BUILD + fi...) linux-kernel@vger.kernel.org (open list)
(kernel-source-root) $
So those are the people/lists to cc. I'd probably add the debian kernel team to the list just as an FYI.
Regards, Amit
On Wed, 21 Sep 2011 01:09:29 +0300, Amit Kucheria amit.kucheria@linaro.org wrote:
On Wed, Sep 21, 2011 at 12:30 AM, James Westby james.westby@linaro.org wrote:
Hi,
Here are two patches that are needed for the kernel CI effort. I would appreciate reviews on my first kernel patches to be submitted, and guidance for where to send them to get them accepted upstream.
Needed in order to run the target when cross-building.
Needed in order to stop jobs in the CI system from overwriting each others files.
Thanks, James
(kernel-source-root) $ ./scripts/get_maintainer.pl -f scripts/package/builddeb Michal Marek mmarek@suse.cz (maintainer:KERNEL BUILD + fi...) linux-kbuild@vger.kernel.org (open list:KERNEL BUILD + fi...) linux-kernel@vger.kernel.org (open list)
(kernel-source-root) $
So those are the people/lists to cc. I'd probably add the debian kernel team to the list just as an FYI.
Thanks Amit.
I would appreciate any comments anyone has on the patches before I submit them upstream (even just stylistic things.)
Thanks,
James