This file is indexed.

/usr/bin/pkgos-infra-install-sbuild is in openstack-pkg-tools 54.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
#!/bin/sh
# This script installs a building environment using sbuild as a
# builder for the "gbp buildpackage" command line. The sbuild
# chroot uses an union FS (ie: AUFS in Jessie and Trusty,
# OverlayFS on newer kernels) as this is the fastest backend,
# and that unionFS scratch disk is stored on tmpfs, as this
# is the fastest way to run sbuild.

# Author: Thomas Goirand <zigo@debian.org>
# License: Apache-2.0

set -e
set -x

OSTACK_RELEASE=newton
BUILDER_SYS_USERNAME="jenkins"
BUILDER_HOMEDIR=/home/jenkins
GITREPO_ROOT=${WORKSPACE}

DISTRO_VENDOR=$(lsb_release --id -s | awk '{print tolower($0)}')
HOST_DISTRO_NAME=$(lsb_release -c -s)

####################
# Parse parameters #
####################
# There's 3 OS name concept concepts here:
# HOST_DISTRO_NAME: the os of the host (example: jessie, xenial)
# SBUILD_CHROOT_DISTRO_NAME: the name of the distro to setup in the chroot (example: jessie, xenial)
# SBUILD_CHROOT_NAME: the name of the chroot we want to setup (example: jessie-newton or jessie-newton-backports)
DO_EXIT="no"
for i in $@ ; do
    case "${1}" in
    "--sbuild-chroot-name")
        if [ -z "${2}" ] ; then echo "Parameter for option --sbuild-chroot-name is missing" > /dev/stderr ; DO_EXIT="yes" ; fi
        SBUILD_CHROOT_NAME="${2}"
        shift
        shift
    ;;
    "--sbuild-chroot-distro-name")
        if [ -z "${2}" ] ; then echo "Parameter for option --sbuild-chroot-distro-name is missing" > /dev/stderr ; DO_EXIT="yes" ; fi
        SBUILD_CHROOT_DISTRO_NAME="${2}"
        shift
        shift
    ;;
    esac
done

if [ -z "${SBUILD_CHROOT_NAME}" ] ; then
    SBUILD_CHROOT_NAME="${HOST_DISTRO_NAME}-${OSTACK_RELEASE}"
fi

if [ -z "${SBUILD_CHROOT_DISTRO_NAME}" ] ; then
    SBUILD_CHROOT_DISTRO_NAME=${HOST_DISTRO_NAME}
fi

if [ ${DO_EXIT} = "yes" ] ; then
    echo "Parameters not validated: will exit now!" > /dev/stderr
    exit 1
fi
########################
# End parse parameters #
########################

# Some configuration stuff
CLOSEST_DEBIAN_MIRROR=http://ftp.fr.debian.org/debian

PATH=/usr/bin:/usr/sbin:/bin:/sbin
APT="DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends"


disable_init_start () {
    TMPFILE=$(mktemp)
    echo "#!/bin/sh

exit 101

" >${TMPFILE}
    sudo cp ${TMPFILE} /usr/sbin/policy-rc.d
    sudo chmod +x /usr/sbin/policy-rc.d
    rm ${TMPFILE}
}

enable_init_start () {
    sudo rm -f /usr/sbin/policy-rc.d
}

# This gives the closest mirror in the current cloud where we're building
calculate_nodepool_mirror_host () {
    if ! [ -r /etc/nodepool/provider ] ; then
        echo "Could not read /etc/nodepool/provider"
        exit 1
    else
        . /etc/nodepool/provider
        NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.$NODEPOOL_REGION.$NODEPOOL_CLOUD.openstack.org}
        NODEPOOL_MIRROR_HOST=$(echo $NODEPOOL_MIRROR_HOST|tr '[:upper:]' '[:lower:]')
    fi
}

# This is needed to install the backported version of dpkg
add_bpo_repo_to_host () {
    calculate_nodepool_mirror_host

    echo "deb http://${NODEPOOL_MIRROR_HOST}/debian-openstack jessie-newton-backports main
deb-src http://${NODEPOOL_MIRROR_HOST}/debian-openstack jessie-newton-backports main
" >/tmp/jessie-newton-backports.list
    sudo cp /tmp/jessie-newton-backports.list /etc/apt/sources.list.d/jessie-newton-backports.list

    # Add the repo key
    echo "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQENBFdQ8DEBCAC0/jFTh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wMe20dOFN+11OzVZeTvWIwdhWET9KOSVamDyzpRNb
sfXOhqj4o9dWF2ZYB/9J6f51Z5t05wk/5hPdSaUEs+lwXfHkKnp6jrBB5hmgmjz9
uR+5vJC6x+QYA0Pn4lNWg0EWRith9jGXMXzQgNmlyhe3TCCUMrU8WLKqavercY+T
l+yNkxaVfoR09Yb8vtXIVVUM5hLxDbaXESEu9L9XOSYpGwzJs/tDGhizLZNc5HQk
KjS3WFX0nPv40TD/0kNehNuoew4Tj5ntvC/Z2LA2quTh0x2YlrjjNg2gDoi6HtHR
w1WTrACiLkNw60JFWT8zReYS0v3K5utQc7Q64xMn9xpxphGtZefaXxtK2/RuuosX
Fay9Hm4PGbv1efScdmAXCEwE0K8EuHcNRsKFfy+l
=vKaS
-----END PGP PUBLIC KEY BLOCK-----" >/tmp/repo-key.gpg
    sudo apt-key add /tmp/repo-key.gpg
    rm /tmp/repo-key.gpg
    sudo apt-get update
}

install_all_software () {
    echo "===> Installing required packages to run sbuild"
    sudo apt-get update
    sudo ${APT} git-buildpackage eatmydata build-essential \
        fakeroot pristine-tar ssl-cert sudo debootstrap \
        openstack-pkg-tools lsb-release gnupg haveged

    # Jessie needs lintian from jessie-backports, because we are using
    # newer debhelper. New lintian prevents errors like
    # postinst-must-call-ldconfig
    if [ "${HOST_DISTRO_NAME}" = "jessie" ] ; then
        add_bpo_repo_to_host

        # Use lintian from backports
        DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends -t jessie-backports lintian
    # This code thinks anything else than jessie is higher version of lintian
    else
        DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends lintian
    fi

    # Jessie needs sbuild from jessie-backports, because it has the
    # $clean_source = 0 option
    if [ "${HOST_DISTRO_NAME}" = "jessie" ] ; then
        add_bpo_repo_to_host

        # Use sbuild from backports, as we need the $clean_source = 0 option
        DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends -t jessie-backports sbuild

        # Patch libdpkg-perl so that it ignores .gitreview files
        # This is a hack which should be replaced by a newer version of dpkg
        THISDIR=$(pwd)
        cd /usr/share/perl5/Dpkg/Source
        if [ -e /usr/share/openstack-pkg-tools/libdpkg-perl-gitreview.patch ] ; then
            patch -p1 </usr/share/openstack-pkg-tools/libdpkg-perl-gitreview.patch
        else
            patch -p1 <${THISDIR}/misc/libdpkg-perl-gitreview.patch
        fi
        cd ${THISDIR}

    # This code thinks anything else than jessie is higher version of sbuild
    else
        DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends sbuild
    fi
}

configure_dotgitconfig () {
    git config user.name "OpenStack Package Builder"
    git config user.email "openstack-infra@lists.openstack.org"
}

# This key will be used to sign the built package
gen_package_build_key () {
    echo "===> Generating builder's GPG key to sign packages"
    if ! [ -d ${BUILDER_HOMEDIR}/.gnupg ] ; then
        mkdir -p ${BUILDER_HOMEDIR}/.gnupg
        chmod 755 ${BUILDER_HOMEDIR}/.gnupg
    fi
    if ! [ -r ${BUILDER_HOMEDIR}/.gnupg/gpg.conf ] ; then
        echo "keyserver hkp://pool.sks-keyservers.net
personal-digest-preferences SHA256
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
cert-digest-algo SHA256
" >${BUILDER_HOMEDIR}/.gnupg/gpg.conf
    fi
    if ! [ -r ${BUILDER_HOMEDIR}/.gnupg/pkgos-gen-key-batchfile ] ; then
        echo "
%echo Generating a basic OpenPGP key
Key-Type: RSA
Key-Length: 4096
Name-Real: Jenkins
Name-Email: ${BUILDER_SYS_USERNAME}@openstack.org
Expire-Date: 0
" >${BUILDER_HOMEDIR}/.gnupg/pkgos-gen-key-batchfile
    fi
    sudo chown -R ${BUILDER_SYS_USERNAME}:${BUILDER_SYS_USERNAME} ${BUILDER_HOMEDIR}/.gnupg
    su ${BUILDER_SYS_USERNAME} -c "gpg --gen-key --batch ${BUILDER_HOMEDIR}/.gnupg/pkgos-gen-key-batchfile"
}

configure_sbuild () {
    echo "===> Setting-up sbuild's GPG key"
    # Setup the gpg key for sbuild
    sudo mkdir -p /root/.gnupg
    sudo chmod 600 /root/.gnupg
    sudo gpg --list-keys
    sudo sbuild-update --keygen

    # Add the builder as a sbuild user
    sudo sbuild-adduser ${BUILDER_SYS_USERNAME}

    echo "===> Creating sbuild's schroot chroot using a directory backend (ie: not tarball)"
    # Create the actual schroot env
    if ! [ -e /var/lib/sbuild/${SBUILD_CHROOT_NAME} ] ; then
        sudo sbuild-createchroot ${SBUILD_CHROOT_DISTRO_NAME} /var/lib/sbuild/${SBUILD_CHROOT_DISTRO_NAME} ${CLOSEST_DEBIAN_MIRROR}
    fi

    # Let's use a RAMDISK for sbuild chroot to build packages:
    # that's much faster than the HDD backend
    echo "===> Mounting /var/lib/schroot/union/{overlay,underlay} using tmpfs to speed-up build"
    TMPFILE=$(mktemp)
    cp /etc/fstab ${TMPFILE}
#    echo "tmpfs           /var/lib/schroot/union/overlay        tmpfs defaults        0       0
#tmpfs           /var/lib/schroot/union/underlay        tmpfs defaults        0       0" >>${TMPFILE}
#    sudo cp ${TMPFILE} /etc/fstab
#    rm ${TMPFILE}
#    sudo mount /var/lib/schroot/union/overlay
#    sudo mount /var/lib/schroot/union/underlay
    rm ${TMPFILE}

    echo "===> Fixing-up newly created schroot's chroot config and /etc/git-buildpackage/gbp.conf"
    # Make sure git-buildpackage is using sbuild
    sudo sed -i 's/^[ #\t]*builder[ #\t]*=.*/builder = sbuild -v --no-apt-update/' /etc/git-buildpackage/gbp.conf
    # Disable clean outside of the chroot (note: this actually doesn't work due to a bug,
    # but let's keep it there still, when we found out how to fix git-buildpackage).
    sudo sed -i 's/^[ #\t]*cleaner[ #\t]*=.*/cleaner = \/bin\/true/' /etc/git-buildpackage/gbp.conf

    # Fix from jessie to jessie-newton
    # or jessie to jessie-newton-backports
    if ! [ "${SBUILD_CHROOT_NAME}" = "${SBUILD_CHROOT_DISTRO_NAME}" ] ; then
        # Fetch the full chroot.d filename
        SBUILD_SRC_NAME=$(ls /etc/schroot/chroot.d/${SBUILD_CHROOT_DISTRO_NAME}-amd64-sbuild-*)
        SBUILD_CHROOTD_FN=$(echo ${SBUILD_SRC_NAME} | sed s/${SBUILD_CHROOT_DISTRO_NAME}/${SBUILD_CHROOT_NAME}/)

        mv ${SBUILD_SRC_NAME} ${SBUILD_CHROOTD_FN}
        sed -i s/${SBUILD_CHROOT_DISTRO_NAME}-amd64-sbuild/${SBUILD_CHROOT_NAME}-amd64-sbuild/ ${SBUILD_CHROOTD_FN}
        mv /var/lib/sbuild/${SBUILD_CHROOT_DISTRO_NAME} /var/lib/sbuild/${SBUILD_CHROOT_NAME}
        sed -i "s#/var/lib/sbuild/${SBUILD_CHROOT_DISTRO_NAME}#/var/lib/sbuild/${SBUILD_CHROOT_NAME}#" ${SBUILD_CHROOTD_FN}
    fi

    # Switch from tarball to directory (ie: aufs) based build
    # (again, that's much faster...)
    sudo sed -i -e "s/^[ \t]*type[ \t]*=.*/type=directory/" ${SBUILD_CHROOTD_FN}
    # Tell that we'd like to use AUFS as backend for union FS
    # note that for Stretch and Xenial, we should switch to overlay instead
    case ${HOST_DISTRO_NAME} in
    jessie|trusty)
        UNION_TYPE=aufs
    ;;
    *)
        UNION_TYPE=overlay
    ;;
    esac
    if ! grep -q union-type ${SBUILD_CHROOTD_FN} ; then
        TMPFILE=$(mktemp)
        cp ${SBUILD_CHROOTD_FN} ${TMPFILE}
        echo "union-type=${UNION_TYPE}" >>${TMPFILE}
        sudo cp ${TMPFILE} ${SBUILD_CHROOTD_FN}
        rm ${TMPFILE}
    fi
    # Just to make sure in case union-type was there already (it's normally not there),
    # we overwrite it.
    sudo sed -i -e "s/^[ \t]*union-type[ \t]*=.*/union-type=${UNION_TYPE}/" ${SBUILD_CHROOTD_FN}

    # Configure ~/.sbuildrc to use our new sbuild chroot
    GPG_KEY_ID=$(su jenkins -c "gpg --list-keys ${BUILDER_SYS_USERNAME}" | grep ^pub | awk '{print $2}' | cut -d/ -f2)
    DOT_SBUILDRC_PATH=${BUILDER_HOMEDIR}/.sbuildrc
    if ! [ -r "${DOT_SBUILDRC_PATH}" ] ; then
        echo "\$build_arch_all = 1;
\$build_source = 1;
\$distribution = '"${SBUILD_CHROOT_NAME}"';
# We may run lintian by hand later on
# not need to get git-buildpackage to do it
\$run_lintian = 0;

# We don't want to run clean of source tree before
# entering the chroot, because that would mean we need
# some of the build dependencies.
\$clean_source = 0;

# Needed for sbuild to show output in deb-auto-backports
\$verbose = 1;

# In case we decide to no sign packages, uncomment this:
#\$pgp_options = '-us -uc';

\$key_id = '${GPG_KEY_ID}';

# Needed for example for python-glance-store, which as in
# build-depends-indep: python3-all (>= 3.5) | python3-enum34
\$resolve_alternatives = 1;

# This is for perl, just leave it...
1;
" >${DOT_SBUILDRC_PATH}
    fi

    # Add our repos to the sbuild chroot
    echo "deb http://${NODEPOOL_MIRROR_HOST}/debian-openstack jessie-newton-backports main
deb-src http://${NODEPOOL_MIRROR_HOST}/debian-openstack jessie-newton-backports main
" >/tmp/jessie-newton-backports.list
    sudo cp /tmp/jessie-newton-backports.list /var/lib/sbuild/${SBUILD_CHROOT_NAME}/etc/apt/sources.list.d/jessie-newton-backports.list
    echo "deb http://${NODEPOOL_MIRROR_HOST}/debian-openstack jessie-newton main
deb-src http://${NODEPOOL_MIRROR_HOST}/debian-openstack jessie-newton main
" >/tmp/jessie-newton.list
    sudo cp /tmp/jessie-newton.list /var/lib/sbuild/${SBUILD_CHROOT_NAME}/etc/apt/sources.list.d/jessie-newton.list
    # Add the repo key
    echo "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQENBFdQ8DEBCAC0/jFThe7eJiiBL8Rb1c2mXLlSmBsv3/uzL3yV+0U1FShYZ0Ck
s+x+KSGI5aerVXELw2QPCH9eZVknNd4anKzWKIaQ6KBUopIFgzlr5fr1+K5TE7ZH
QISijgzSKMQaHKkELVlw9mOYme5UuzMehsLbOQ/aUDoK+4QHbN7eC5MXjYW+ybzK
V7buapRGgjug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b8vtXIVVUM5hLxDbaXESEu9L9XOSYpGwzJs/tDGhizLZNc5HQk
KjS3WFX0nPv40TD/0kNehNuoew4Tj5ntvC/Z2LA2quTh0x2YlrjjNg2gDoi6HtHR
w1WTrACiLkNw60JFWT8zReYS0v3K5utQc7Q64xMn9xpxphGtZefaXxtK2/RuuosX
Fay9Hm4PGbv1efScdmAXCEwE0K8EuHcNRsKFfy+l
=vKaS
-----END PGP PUBLIC KEY BLOCK-----" >/tmp/repo-key.gpg
    sudo cp /tmp/repo-key.gpg /var/lib/sbuild/${SBUILD_CHROOT_NAME}/repo-key.gpg
    sudo chroot /var/lib/sbuild/${SBUILD_CHROOT_NAME} apt-key add /repo-key.gpg
    rm /tmp/repo-key.gpg /var/lib/sbuild/${SBUILD_CHROOT_NAME}/repo-key.gpg
    sudo sbuild-update -udcar ${SBUILD_CHROOT_NAME}
}

disable_init_start
install_all_software
configure_dotgitconfig
gen_package_build_key
configure_sbuild
enable_init_start