Merge lp:~milo/linaro-ci/bug1064686 into lp:linaro-ci

Proposed by Milo Casagrande
Status: Merged
Merged at revision: 112
Proposed branch: lp:~milo/linaro-ci/bug1064686
Merge into: lp:linaro-ci
Diff against target: 15 lines (+1/-1)
1 file modified
jenkins_common_lib (+1/-1)
To merge this branch: bzr merge lp:~milo/linaro-ci/bug1064686
Reviewer Review Type Date Requested Status
Andrey Konovalov (community) Approve
Deepti B. Kalakeri (community) Approve
Paul Sokolovsky Pending
Linaro Infrastructure Pending
Review via email: mp+130741@code.launchpad.net

This proposal supersedes a proposal from 2012-10-11.

Description of the change

As per bug 1064686, this should be the only necessary change to do.
It has to be verified.

This fixes when the make dtbs target is executed, as per Andrey comment.

To post a comment you must log in.
Revision history for this message
Paul Sokolovsky (pfalcon) wrote : Posted in a previous version of this proposal

Can we be sure that all kernel we build contain "dtbs" target? If not (recommended direction of thought), the how do we handle errors? Will it break the build? Should it be "make dtbs || true"?

Revision history for this message
Milo Casagrande (milo) wrote : Posted in a previous version of this proposal

Hey Paul, indeed, it should at least be "... || true". Now it is fixed.

Revision history for this message
Deepti B. Kalakeri (deeptik) wrote : Posted in a previous version of this proposal

I am not sure if all of the folks using this script would like to do a make dtbs. so you should enable this command only for interested folks.

review: Needs Fixing
Revision history for this message
Milo Casagrande (milo) wrote : Posted in a previous version of this proposal

I updated the bash script, now it is using a variable that needs to be set, and also set to true, in order to execute the "make dtbs" step.

Revision history for this message
Paul Sokolovsky (pfalcon) wrote : Posted in a previous version of this proposal

Milo, I don't know where from you got this idiom:

 if [ "${MAKE_DTBS}" ] && $MAKE_DTBS;

But it's dangerous to allow literal input string data to be executed as shell commands. You may say that in this case we allow user to pass commands as inputs (*1), but the above is bad *pattern*: MAKE_DTBS has string value, and should not be allowed to be interpreted as command. Failing that would lead from mildly unpleasant to highly dangerous results, so better never to use that at all.

*1 I'm not sure if that's true for this specific build type or not, but for some build types we may.

review: Needs Fixing
Revision history for this message
Milo Casagrande (milo) wrote : Posted in a previous version of this proposal

Idiom was to check if variable is present and also set to 'true', but indeed, I got your point.

Other solution I had in mind was:

: {$MAKE_DTBS?} && make dtbs

but has the slighty drawback of printing error messages if MAKE_DTBS is not set, and am not able to suppress that, and MAKE_DTBS can be set to whatever value.

Revision history for this message
Milo Casagrande (milo) wrote : Posted in a previous version of this proposal

The syntax above should be:

: ${MAKE_DTBS?} && make dtbs

Revision history for this message
Данило Шеган (danilo) wrote : Posted in a previous version of this proposal

What's wrong with just checking if the value is equal to string "true" (or "yes", "1" or whatever we want to accept)? If MAKE_DTBS is set to any of the other values (eg. "yes" or "no"), it's still going to fail with your command.

Revision history for this message
Milo Casagrande (milo) wrote : Posted in a previous version of this proposal

On Mon, Oct 15, 2012 at 11:16 AM, Данило Шеган <email address hidden> wrote:
> What's wrong with just checking if the value is equal to string "true" (or "yes", "1" or whatever we want to accept)? If MAKE_DTBS is set to any of the other values (eg. "yes" or "no"), it's still going to fail with your command.

There is nothing wrong, I just wanted to avoid exactly that string
check trying to use real boolean values set from Jenkins, but it is
the only thing we can do if we want to accept a value and be somewhat
safe. The other idea (the last syntax) was to just check the presence
of the variable (and execute the command if it is), not its content.

Since Jenkins supports boolean values in parametrized build (not
string or text in Jenkins term, but true and false bash values), I
thought that &VARIABLE would have been safe enough in an if-clause,
since it was coming from a trusted party (Jenkins).

--
Milo Casagrande
Infrastructure Engineer
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

Revision history for this message
Milo Casagrande (milo) wrote : Posted in a previous version of this proposal

Simple string check has been added: MAKE_DTBS value has to be set to 'true' in this case. It is possible to expand it to include "yes" and "1" too, but using "true" we can use default Jenkins boolean parameter.

Revision history for this message
Paul Sokolovsky (pfalcon) wrote : Posted in a previous version of this proposal

Looks good. Supporting one value (especially if standardize on it) is ok by me.

review: Approve
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote : Posted in a previous version of this proposal

looks good.

review: Approve
Revision history for this message
Andrey Konovalov (andrey-konovalov) wrote : Posted in a previous version of this proposal

'make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" dtbs' should be perfomed *before* creating the package with 'make ... deb-pkg'. In the current implementation the dtb is created, but is not included into the linux-image deb as it should.

review: Needs Fixing
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

+1 looks good.

review: Approve
Revision history for this message
Andrey Konovalov (andrey-konovalov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'jenkins_common_lib'
--- jenkins_common_lib 2012-10-17 15:38:51 +0000
+++ jenkins_common_lib 2012-10-22 07:42:19 +0000
@@ -78,11 +78,11 @@
78 yes "" | make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" oldconfig 78 yes "" | make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" oldconfig
79 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" -j$j_count uImage79 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" -j$j_count uImage
80 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" -j$j_count modules80 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" -j$j_count modules
81 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" KBUILD_DEBARCH=armhf V=1 deb-pkg
82 if [ "$MAKE_DTBS" = "true" ]; then81 if [ "$MAKE_DTBS" = "true" ]; then
83 echo "Building with DTBS support..."82 echo "Building with DTBS support..."
84 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" dtbs83 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" dtbs
85 fi84 fi
85 make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" KBUILD_DEBARCH=armhf V=1 deb-pkg
86 END=$(date +%s)86 END=$(date +%s)
87 EXECUTION_TIME_IN_SEC=$(( $END - $START ))87 EXECUTION_TIME_IN_SEC=$(( $END - $START ))
8888

Subscribers

People subscribed via source and target branches