[PATCH 1/2] UBUNTU: Packaging: Introduce copy-files and local-mangle

Thadeu Lima de Souza Cascardo cascardo at canonical.com
Fri Mar 1 23:56:33 UTC 2019

BugLink: https://bugs.launchpad.net/bugs/1817734

Two new scripts are introduced in order to do some of the copying and mangling
of copies that update-from-*master does.

One of the changes on copy-files compared to update-from-*master is that the -c
option is given to rsync, so it compares checksums of files in order to decide
whether they are different and need an update. That's necessary because
sometimes files will have the same size and their modified time will be whithin
one second or the original file will be older because git checked it out

The script is split in two so the copy-files may be shared between different
kernel tress and the very specific changes are done on the local-mangle file,
which is different between trees.

Also, in order to make the copy-files the same one for all trees, some of the
copies and updates are dependent on a local.conf file, which is present only on
those trees where it's needed. The contents of those files are not so easily
generated, so they are not part of update.conf.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri at canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously at canonical.com>
 .../scripts/helpers/copy-files                | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100755 debian.azure-bionic/scripts/helpers/copy-files

diff --git a/debian.azure-bionic/scripts/helpers/copy-files b/debian.azure-bionic/scripts/helpers/copy-files
new file mode 100755
index 000000000000..0ce0afe84578
--- /dev/null
+++ b/debian.azure-bionic/scripts/helpers/copy-files
@@ -0,0 +1,67 @@
+#!/bin/bash -eu
+if [ -f debian/debian.env ]; then
+	# shellcheck disable=SC1091
+	. debian/debian.env
+if [ ! -d "${DEBIAN}" ]; then
+	echo You must run this script from the top directory of this repository.
+	exit 1
+if [ -f "${CONF}" ]; then
+	# shellcheck disable=SC1090
+	. "${CONF}"
+if [ -f "${LOCAL_CONF}" ]; then
+	# shellcheck disable=SC1090
+	. "${LOCAL_CONF}"
+# Pick up any master branch changes to udeb modules or firmware.
+rsync -avc --delete "${DEBIAN_MASTER}/d-i/" "${DEBIAN}/d-i"
+# Update configs from master
+rsync -avc --delete "${DEBIAN_MASTER}/config/" "${DEBIAN}/config"
+# Update package and DTB settings from master.
+if [ -z "${SKIP_RULES_D}" ] ; then
+	rsync -avc "${DEBIAN_MASTER}/rules.d/"*.mk "${DEBIAN}/rules.d/"
+# Remove the .mk files from the arch's that are not supported
+for i in ${FOREIGN_ARCHES}
+	rm -f "${DEBIAN}/rules.d/${i}.mk"
+	git rm -f --ignore-unmatch "${DEBIAN}/rules.d/${i}.mk" || true
+# Update modprobe.d from master
+# Some releases (trusty) don't have this directory, and rsync would fail
+# without this check.
+if [ -d "${DEBIAN}/modprobe.d/" ]; then
+	rsync -avc --delete "${DEBIAN_MASTER}/modprobe.d/" "${DEBIAN}/modprobe.d"
+cp -p "${DEBIAN_MASTER}/control.d/"*.inclusion-list "${DEBIAN}/control.d"
+cp -p "${DEBIAN_MASTER}/reconstruct" "${DEBIAN}/reconstruct"
+if [ -x "${DEBIAN}/scripts/helpers/local-mangle" ]; then
+	"./${DEBIAN}/scripts/helpers/local-mangle"

More information about the kernel-team mailing list