Skip to content

Commit 31cb6fa

Browse files
committed
Merge remote-tracking branch 'origin/6.0/stage' into 6.0/release
2 parents 11130e2 + a682265 commit 31cb6fa

61 files changed

Lines changed: 156 additions & 135 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

buildpkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2021 Delphix
44
#

checkupdates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2020 Delphix
44
#

default-package-config.sh

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2020 Delphix
44
#
@@ -234,20 +234,24 @@ function kernel_update_upstream() {
234234
# version and the ABI num that we got above.
235235
#
236236
# Note that "generic" (used mainly ESX) is a special
237-
# case as we are currently using the HWE kernel image.
237+
# case on bionic where we are using the HWE kernel image.
238238
#
239239
local tag_prefix_flavour
240-
if [[ "${platform}" == generic ]] &&
241-
[[ "$UBUNTU_DISTRIBUTION" == bionic ]]; then
242-
tag_prefix_flavour="Ubuntu-hwe"
243-
elif [[ "${platform}" == aws ]] ||
244-
[[ "${platform}" == azure ]] ||
245-
[[ "${platform}" == gcp ]] ||
246-
[[ "${platform}" == oracle ]]; then
240+
case "${platform}" in
241+
generic)
242+
if [[ "$UBUNTU_DISTRIBUTION" == bionic ]]; then
243+
tag_prefix_flavour="Ubuntu-hwe"
244+
else
245+
tag_prefix_flavour="Ubuntu"
246+
fi
247+
;;
248+
aws | azure | gcp | oracle)
247249
tag_prefix_flavour="Ubuntu-${platform}"
248-
else
250+
;;
251+
*)
249252
die "assertion: unexpected platform: ${platform}"
250-
fi
253+
;;
254+
esac
251255

252256
local tag_prefix kvers_major kvers_minor short_kvers
253257
kvers_major=$(echo "${kernel_version}" | cut -d '.' -f 1)
@@ -282,6 +286,26 @@ function kernel_update_upstream() {
282286
#
283287
local upstream_tag_info
284288
upstream_tag_info=$(git ls-remote --tags --ref upstream | grep "${tag_prefix}" | tail -n 1)
289+
290+
if [[ -z "${upstream_tag_info}" ]]; then
291+
echo "tag with prefix ${tag_prefix} not found."
292+
tag_prefix="${tag_prefix_flavour}-${kernel_version}-${abinum}"
293+
#
294+
# Canonical has 2 ways of naming their tags:
295+
# - Ubuntu-gcp-5.4.0-1046.49
296+
# - Ubuntu-gcp-5.4-5.4.0-1046.49_18.04.1
297+
#
298+
# For a given kernel version and a given distribution, only one
299+
# naming scheme is being used. When two distributions (such
300+
# as 20.04 and 18.04) use the same major kernel version,
301+
# Canonical first applies the patches to one distribution and
302+
# then creates a base tag. It then backports those changes to
303+
# the older distribution, and then creates a longer tag name.
304+
#
305+
echo "trying tag prefix: ${tag_prefix}."
306+
upstream_tag_info=$(git ls-remote --tags --ref upstream | grep "${tag_prefix}" | tail -n 1)
307+
fi
308+
285309
[[ -z "${upstream_tag_info}" ]] && die "could not find upstream tag for tag prefix: ${tag_prefix}"
286310

287311
local upstream_tag
@@ -347,17 +371,12 @@ function kernel_merge_with_upstream() {
347371

348372
check_git_ref "$upstream_ref" "$repo_ref"
349373

350-
if git merge-base --is-ancestor "$upstream_ref" "$repo_ref"; then
351-
echo "NOTE: $PACKAGE is already up-to-date with upstream."
352-
return 0
353-
fi
354-
355374
#
356375
# Ensure that there is a commit marking the start of
357376
# the Delphix set of patches. Then get the hash of
358377
# the commit right before it.
359378
#
360-
local dlpx_patch_end dlpx_patch_start current_ubuntu_commit
379+
local dlpx_patch_end dlpx_patch_start current_ubuntu_commit upstream_head_commit
361380
dlpx_patch_start=$(git log --pretty=oneline repo-HEAD | grep @@DELPHIX_PATCHSET_START@@ | awk '{ print $1 }')
362381
[[ -z "${dlpx_patch_start}" ]] && die "could not find DELPHIX_PATCHSET_START"
363382
[[ $(wc -l <<<"${dlpx_patch_start}") != 1 ]] && die "multiple DELPHIX_PATCHSET_START commits - ${dlpx_patch_start}"
@@ -366,6 +385,13 @@ function kernel_merge_with_upstream() {
366385
dlpx_patch_end=$(git rev-parse repo-HEAD)
367386
[[ -z "${dlpx_patch_end}" ]] && die "could not find repo-HEAD's head commit"
368387

388+
upstream_head_commit="$(git rev-parse "$upstream_ref")"
389+
390+
if [[ "$current_ubuntu_commit" == "$upstream_head_commit" ]]; then
391+
echo "NOTE: $PACKAGE is already up-to-date with upstream."
392+
return 0
393+
fi
394+
369395
#
370396
# We rebase all the Delphix commits on top of the new upstream-HEAD
371397
# by using git cherry-pick. Note that we also save the previous

lib/common.sh

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2020 Delphix
44
#
@@ -444,9 +444,22 @@ function create_workdir() {
444444
function install_pkgs() {
445445
for attempt in {1..3}; do
446446
echo "Running: sudo env DEBIAN_FRONTEND=noninteractive " \
447-
"apt-get install -y $*"
447+
"apt-get install -y --allow-downgrades $*"
448+
449+
#
450+
# We use the "--allow-downgrades" for the case of a
451+
# package needing to install the "unzip" debian package
452+
# that we build via the "misc-debs" linux-pkg package.
453+
# The "misc-debs" based "unzip" package may have an
454+
# older version than what's already installed on the
455+
# system, so we need to "--allow-downgrades" in order to
456+
# install that specific package; further, that specific
457+
# package is required to build the "virtualization"
458+
# debian packages.
459+
#
448460
sudo env DEBIAN_FRONTEND=noninteractive apt-get install \
449461
-y --allow-downgrades "$@" && return
462+
450463
echo "apt-get install failed, retrying."
451464
sleep 10
452465
done
@@ -481,12 +494,13 @@ function list_all_packages() {
481494
}
482495

483496
#
484-
# Read a package-list file and return listed packages in _RET_LIST.
497+
# Read a new-line separated list from a file, removing extra whitespace
498+
# and comments. Return items in _RET_LIST.
485499
#
486-
function read_package_list() {
500+
function read_list() {
487501
local file="$1"
488502

489-
local pkg
503+
local item
490504
local line
491505

492506
_RET_LIST=()
@@ -495,13 +509,26 @@ function read_package_list() {
495509

496510
while read -r line; do
497511
# trim whitespace
498-
pkg=$(echo "$line" | tr -d '[:space:]')
499-
[[ -z "$pkg" ]] && continue
512+
item=$(echo "$line" | tr -d '[:space:]')
513+
[[ -z "$item" ]] && continue
500514
# ignore comments
501-
[[ ${pkg:0:1} == "#" ]] && continue
515+
[[ ${item:0:1} == "#" ]] && continue
516+
_RET_LIST+=("$item")
517+
done <"$file" || die "Failed to read list: $file"
518+
}
519+
520+
#
521+
# Read a package-list file and return listed packages in _RET_LIST.
522+
#
523+
function read_package_list() {
524+
local file="$1"
525+
526+
local pkg
527+
528+
logmust read_list "$file"
529+
for pkg in "${_RET_LIST[@]}"; do
502530
check_package_exists "$pkg"
503-
_RET_LIST+=("$pkg")
504-
done <"$file" || die "Failed to read package list: $file"
531+
done
505532
}
506533

507534
#

packages/adoptopenjdk/config.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2020 Delphix
44
#
@@ -19,8 +19,8 @@
1919
DEFAULT_PACKAGE_GIT_URL=none
2020
PACKAGE_DEPENDENCIES="make-jpkg"
2121

22-
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u262b10.tar.gz"
23-
_tarfile_sha256="733755fd649fad6ae91fc083f7e5a5a0b56410fb6ac1815cff29f744b128b1b1"
22+
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u282b08.tar.gz"
23+
_tarfile_sha256="e6e6e0356649b9696fa5082cfcb0663d4bef159fc22d406e3a012e71fce83a5c"
2424
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
2525

2626
function prepare() {

packages/bcc/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2020 Delphix
44
#

packages/bpftrace/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2020 Delphix
44
#

packages/challenge-response/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2019 Delphix
44
#

packages/cloud-init/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2019 Delphix
44
#

packages/connstat/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2018, 2020 Delphix
44
#

0 commit comments

Comments
 (0)