@@ -83,7 +83,7 @@ checkoutSCM:
8383 dir : kmod-script
8484
8585buildVars : [LINUX_ARCH, ARCH, CROSS_COMPILE, CC]
86- buildTools : [m4, bison, flex, target-toolchain, host-toolchain]
86+ buildTools : [m4, bison, flex, target-toolchain, host-toolchain, perl ]
8787buildSetup : |
8888 # make sure we find our kmod-dist script in the package step
8989 ln -sf $1/kmod-script .
@@ -92,28 +92,32 @@ buildSetup: |
9292 #
9393 # $1: linux kernel source directory
9494 # $2: defconfig (optional)
95+ # - if omitted, use the kernel defconfig
9596 # - if this is an actual file, use it as the config
96- # - if this is not a file, check if a defconfig for the target arch by
97- # that name exists and if yes, use that one
97+ # - if this is not a file, treat it as a defconfig of the target arch
9898 linuxConfig()
9999 {
100- DEF_CFG=${2:-$1/arch/${LINUX_ARCH}/configs/defconfig}
101- if [[ -f "$1/arch/${LINUX_ARCH}/configs/${DEF_CFG}" ]] ; then
102- DEF_CFG=$1/arch/${LINUX_ARCH}/configs/${DEF_CFG}
103- fi
104- # check if the defconfig file exists
105- if [[ ! -f "$DEF_CFG" ]]; then
106- >&2 echo "Don't know how to use '$DEF_CFG' as linux kernel config!"
107- false
108- fi
109- # check if the source file is newer than .config
110- if [[ -f .config && .config -nt $DEF_CFG ]]; then
111- return 0
100+ if [[ ${2+set} ]] ; then
101+ local DEF_CFG
102+ if [[ -f "$2" ]] ; then
103+ DEF_CFG="$2"
104+ else
105+ DEF_CFG="$1/arch/${LINUX_ARCH}/configs/$2"
106+ fi
107+
108+ if [[ ! -f "$DEF_CFG" ]]; then
109+ >&2 echo "Specified kernel defconfig '$DEF_CFG' does not exist!"
110+ false
111+ fi
112+
113+ # check if the source file is newer than .config
114+ if [[ ! -f .config || .config -ot $DEF_CFG ]]; then
115+ cp -u "$DEF_CFG" .config
116+ makeSequential -C "$1" O="$PWD" olddefconfig
117+ fi
118+ elif [[ ! -f .config ]] ; then
119+ makeSequential -C "$1" O="$PWD" defconfig
112120 fi
113- # redo the .config file
114- cp -u "$DEF_CFG" .config
115- makeSequential -C $1 O=$PWD \
116- olddefconfig
117121 }
118122
119123 # Build the actual target linux image and all configured modules
0 commit comments