* [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild
@ 2021-08-11 11:34 Jan Kiszka
2021-08-11 11:52 ` Henning Schild
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2021-08-11 11:34 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
This check dates back to the time isar-bootstrap could have run multiple
times for the same distro-arch and was lock-protected to avoid this.
Long history, locks were removed in 1cae951259b3.
Now this check only prevented proper rebuilding when apt sources or
preferences changed.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../isar-bootstrap/isar-bootstrap.inc | 202 +++++++++---------
1 file changed, 100 insertions(+), 102 deletions(-)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 0edefc5..b858c8c 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -256,125 +256,123 @@ isar_bootstrap() {
fi
E="${@ isar_export_proxies(d)}"
export IS_HOST debootstrap_args E
- if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
- sudo rm -rf --one-file-system "${ROOTFSDIR}"
- if [ "${IS_HOST}" ];then
- deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
+
+ sudo rm -rf --one-file-system "${ROOTFSDIR}"
+ if [ "${IS_HOST}" ];then
+ deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
+ else
+ deb_dl_dir_import "${ROOTFSDIR}" "${DISTRO}"
+ fi
+
+ sudo -E -s <<'EOSUDO'
+ set -e
+ if [ ${IS_HOST} ]; then
+ ${DEBOOTSTRAP} $debootstrap_args \
+ ${@get_distro_components_argument(d, True)} \
+ "${@get_distro_suite(d, True)}" \
+ "${ROOTFSDIR}" \
+ "${@get_distro_source(d, True)}" \
+ ${DISTRO_DEBOOTSTRAP_SCRIPT}
else
- deb_dl_dir_import "${ROOTFSDIR}" "${DISTRO}"
+ ${DEBOOTSTRAP} $debootstrap_args \
+ --arch="${DISTRO_ARCH}" \
+ ${@get_distro_components_argument(d, False)} \
+ "${@get_distro_suite(d, False)}" \
+ "${ROOTFSDIR}" \
+ "${@get_distro_source(d, False)}" \
+ ${DISTRO_DEBOOTSTRAP_SCRIPT}
fi
- sudo -E -s <<'EOSUDO'
- set -e
- if [ ${IS_HOST} ]; then
- ${DEBOOTSTRAP} $debootstrap_args \
- ${@get_distro_components_argument(d, True)} \
- "${@get_distro_suite(d, True)}" \
- "${ROOTFSDIR}" \
- "${@get_distro_source(d, True)}" \
- ${DISTRO_DEBOOTSTRAP_SCRIPT}
- else
- ${DEBOOTSTRAP} $debootstrap_args \
- --arch="${DISTRO_ARCH}" \
- ${@get_distro_components_argument(d, False)} \
- "${@get_distro_suite(d, False)}" \
- "${ROOTFSDIR}" \
- "${@get_distro_source(d, False)}" \
- ${DISTRO_DEBOOTSTRAP_SCRIPT}
+ # Install apt config
+ mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d"
+ install -v -m644 "${APTPREFS}" \
+ "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
+ mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
+ if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
+ line="file:///base-apt/${BASE_DISTRO} ${BASE_DISTRO_CODENAME} main"
+ if [ -z "${BASE_REPO_KEY}" ]; then
+ line="[trusted=yes] ${line}"
fi
+ echo "deb ${line}" > "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
+ echo "deb-src ${line}" >> "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
- # Install apt config
- mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d"
- install -v -m644 "${APTPREFS}" \
- "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
- mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
- if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
- line="file:///base-apt/${BASE_DISTRO} ${BASE_DISTRO_CODENAME} main"
- if [ -z "${BASE_REPO_KEY}" ]; then
- line="[trusted=yes] ${line}"
- fi
- echo "deb ${line}" > "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
- echo "deb-src ${line}" >> "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
-
- mkdir -p ${ROOTFSDIR}/base-apt
- mount --bind ${REPO_BASE_DIR} ${ROOTFSDIR}/base-apt
- else
- install -v -m644 "${APTSRCS}" \
- "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
- fi
- install -v -m644 "${APTSRCS_INIT}" \
- "${ROOTFSDIR}/etc/apt/sources-list"
- rm -f "${ROOTFSDIR}/etc/apt/sources.list"
- rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
- mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
- install -v -m644 "${WORKDIR}/isar-apt.conf" \
- "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
- if [ "${@get_distro_needs_gpg_support(d)}" = "gnupg" ]; then
- MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"
- echo "Created temporary directory ${MY_GPGHOME} for gpg-agent"
- export GNUPGHOME="${MY_GPGHOME}"
- chroot "${ROOTFSDIR}" gpg-agent --daemon
- APT_KEY_APPEND="--homedir ${MY_GPGHOME}"
- fi
- find ${APT_KEYS_DIR}/ -type f | while read keyfile
- do
- kfn="$(basename $keyfile)"
- cp $keyfile "${ROOTFSDIR}/tmp/$kfn"
- chroot "${ROOTFSDIR}" /usr/bin/apt-key \
- --keyring ${THIRD_PARTY_APT_KEYRING} ${APT_KEY_APPEND} add "/tmp/$kfn"
- rm "${ROOTFSDIR}/tmp/$kfn"
- done
- if [ -d "${MY_GPGHOME}" ]; then
- echo "Killing gpg-agent for ${MY_GPGHOME}"
- chroot "${ROOTFSDIR}" gpgconf --kill gpg-agent && /bin/rm -rf "${MY_GPGHOME}"
- fi
+ mkdir -p ${ROOTFSDIR}/base-apt
+ mount --bind ${REPO_BASE_DIR} ${ROOTFSDIR}/base-apt
+ else
+ install -v -m644 "${APTSRCS}" \
+ "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
+ fi
+ install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
+ rm -f "${ROOTFSDIR}/etc/apt/sources.list"
+ rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
+ mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
+ install -v -m644 "${WORKDIR}/isar-apt.conf" \
+ "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
+ if [ "${@get_distro_needs_gpg_support(d)}" = "gnupg" ]; then
+ MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"
+ echo "Created temporary directory ${MY_GPGHOME} for gpg-agent"
+ export GNUPGHOME="${MY_GPGHOME}"
+ chroot "${ROOTFSDIR}" gpg-agent --daemon
+ APT_KEY_APPEND="--homedir ${MY_GPGHOME}"
+ fi
+ find ${APT_KEYS_DIR}/ -type f | while read keyfile
+ do
+ kfn="$(basename $keyfile)"
+ cp $keyfile "${ROOTFSDIR}/tmp/$kfn"
+ chroot "${ROOTFSDIR}" /usr/bin/apt-key \
+ --keyring ${THIRD_PARTY_APT_KEYRING} ${APT_KEY_APPEND} add "/tmp/$kfn"
+ rm "${ROOTFSDIR}/tmp/$kfn"
+ done
+ if [ -d "${MY_GPGHOME}" ]; then
+ echo "Killing gpg-agent for ${MY_GPGHOME}"
+ chroot "${ROOTFSDIR}" gpgconf --kill gpg-agent && /bin/rm -rf "${MY_GPGHOME}"
+ fi
- if [ "${@get_distro_suite(d, True)}" = "stretch" ] && [ "${@get_host_release().split('.')[0]}" -lt "4" ]; then
- install -v -m644 "${WORKDIR}/isar-apt-fallback.conf" \
- "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf"
- fi
+ if [ "${@get_distro_suite(d, True)}" = "stretch" ] && [ "${@get_host_release().split('.')[0]}" -lt "4" ]; then
+ install -v -m644 "${WORKDIR}/isar-apt-fallback.conf" \
+ "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf"
+ fi
- # Set locale
- install -v -m644 "${WORKDIR}/locale" "${ROOTFSDIR}/etc/locale"
+ # Set locale
+ install -v -m644 "${WORKDIR}/locale" "${ROOTFSDIR}/etc/locale"
- sed -i '/en_US.UTF-8 UTF-8/s/^#//g' "${ROOTFSDIR}/etc/locale.gen"
- chroot "${ROOTFSDIR}" /usr/sbin/locale-gen
+ sed -i '/en_US.UTF-8 UTF-8/s/^#//g' "${ROOTFSDIR}/etc/locale.gen"
+ chroot "${ROOTFSDIR}" /usr/sbin/locale-gen
- # setup chroot
- install -v -m755 "${WORKDIR}/chroot-setup.sh" "${ROOTFSDIR}/chroot-setup.sh"
- "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
+ # setup chroot
+ install -v -m755 "${WORKDIR}/chroot-setup.sh" "${ROOTFSDIR}/chroot-setup.sh"
+ "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
- # update APT
- mount --rbind /dev ${ROOTFSDIR}/dev
- mount --make-rslave ${ROOTFSDIR}/dev
- mount -t proc none ${ROOTFSDIR}/proc
- mount --rbind /sys ${ROOTFSDIR}/sys
- mount --make-rslave ${ROOTFSDIR}/sys
+ # update APT
+ mount --rbind /dev ${ROOTFSDIR}/dev
+ mount --make-rslave ${ROOTFSDIR}/dev
+ mount -t proc none ${ROOTFSDIR}/proc
+ mount --rbind /sys ${ROOTFSDIR}/sys
+ mount --make-rslave ${ROOTFSDIR}/sys
- export DEBIAN_FRONTEND=noninteractive
+ export DEBIAN_FRONTEND=noninteractive
- if [ ${IS_HOST} ]; then
- chroot "${ROOTFSDIR}" /usr/bin/dpkg --add-architecture ${DISTRO_ARCH}
- fi
+ if [ ${IS_HOST} ]; then
+ chroot "${ROOTFSDIR}" /usr/bin/dpkg --add-architecture ${DISTRO_ARCH}
+ fi
- if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
- chroot "${ROOTFSDIR}" /usr/bin/dpkg --add-architecture ${COMPAT_DISTRO_ARCH}
- fi
+ if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
+ chroot "${ROOTFSDIR}" /usr/bin/dpkg --add-architecture ${COMPAT_DISTRO_ARCH}
+ fi
- chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
- chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y -f
- chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
- -o Debug::pkgProblemResolver=yes
+ chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
+ chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y -f
+ chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
+ -o Debug::pkgProblemResolver=yes
- umount -l "${ROOTFSDIR}/dev"
- umount -l "${ROOTFSDIR}/proc"
- umount -l "${ROOTFSDIR}/sys"
- umount -l "${ROOTFSDIR}/base-apt" || true
+ umount -l "${ROOTFSDIR}/dev"
+ umount -l "${ROOTFSDIR}/proc"
+ umount -l "${ROOTFSDIR}/sys"
+ umount -l "${ROOTFSDIR}/base-apt" || true
- # Finalize debootstrap by setting the link in deploy
- ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
+ # Finalize debootstrap by setting the link in deploy
+ ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
EOSUDO
- fi
if [ "${IS_HOST}" ];then
deb_dl_dir_export "${ROOTFSDIR}" "${HOST_DISTRO}"
else
--
2.31.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild
2021-08-11 11:34 [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild Jan Kiszka
@ 2021-08-11 11:52 ` Henning Schild
2021-08-11 14:41 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2021-08-11 11:52 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users
Am Wed, 11 Aug 2021 13:34:44 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This check dates back to the time isar-bootstrap could have run
> multiple times for the same distro-arch and was lock-protected to
> avoid this. Long history, locks were removed in 1cae951259b3.
>
> Now this check only prevented proper rebuilding when apt sources or
> preferences changed.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> .../isar-bootstrap/isar-bootstrap.inc | 202
> +++++++++--------- 1 file changed, 100 insertions(+), 102 deletions(-)
>
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
> 0edefc5..b858c8c 100644 ---
> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -256,125
> +256,123 @@ isar_bootstrap() { fi
> E="${@ isar_export_proxies(d)}"
> export IS_HOST debootstrap_args E
> - if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
Let me guess, you removed that line and the closing "fi", and the rest
is git showing a pretty messy diff on the indentation that came with
things?
I am almost tempted to ask for two patches ... one that does
"whitespace only" and the other one doing the real work. Because the
diff presented here can not be reviewed.
Henning
> - sudo rm -rf --one-file-system "${ROOTFSDIR}"
> - if [ "${IS_HOST}" ];then
> - deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
> +
> + sudo rm -rf --one-file-system "${ROOTFSDIR}"
> + if [ "${IS_HOST}" ];then
> + deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
> + else
> + deb_dl_dir_import "${ROOTFSDIR}" "${DISTRO}"
> + fi
> +
> + sudo -E -s <<'EOSUDO'
> + set -e
> + if [ ${IS_HOST} ]; then
> + ${DEBOOTSTRAP} $debootstrap_args \
> + ${@get_distro_components_argument(d,
> True)} \
> + "${@get_distro_suite(d, True)}" \
> + "${ROOTFSDIR}" \
> + "${@get_distro_source(d, True)}" \
> + ${DISTRO_DEBOOTSTRAP_SCRIPT}
> else
> - deb_dl_dir_import "${ROOTFSDIR}" "${DISTRO}"
> + ${DEBOOTSTRAP} $debootstrap_args \
> + --arch="${DISTRO_ARCH}" \
> + ${@get_distro_components_argument(d,
> False)} \
> + "${@get_distro_suite(d, False)}" \
> + "${ROOTFSDIR}" \
> + "${@get_distro_source(d, False)}" \
> + ${DISTRO_DEBOOTSTRAP_SCRIPT}
> fi
>
> - sudo -E -s <<'EOSUDO'
> - set -e
> - if [ ${IS_HOST} ]; then
> - ${DEBOOTSTRAP} $debootstrap_args \
> - ${@get_distro_components_argument(d,
> True)} \
> - "${@get_distro_suite(d, True)}" \
> - "${ROOTFSDIR}" \
> - "${@get_distro_source(d, True)}" \
> - ${DISTRO_DEBOOTSTRAP_SCRIPT}
> - else
> - ${DEBOOTSTRAP} $debootstrap_args \
> - --arch="${DISTRO_ARCH}" \
> - ${@get_distro_components_argument(d,
> False)} \
> - "${@get_distro_suite(d, False)}" \
> - "${ROOTFSDIR}" \
> - "${@get_distro_source(d, False)}" \
> - ${DISTRO_DEBOOTSTRAP_SCRIPT}
> + # Install apt config
> + mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d"
> + install -v -m644 "${APTPREFS}" \
> +
> "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
> + mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
> + if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> + line="file:///base-apt/${BASE_DISTRO}
> ${BASE_DISTRO_CODENAME} main"
> + if [ -z "${BASE_REPO_KEY}" ]; then
> + line="[trusted=yes] ${line}"
> fi
> + echo "deb ${line}" >
> "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
> + echo "deb-src ${line}" >>
> "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
> - # Install apt config
> - mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d"
> - install -v -m644 "${APTPREFS}" \
> -
> "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
> - mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
> - if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> - line="file:///base-apt/${BASE_DISTRO}
> ${BASE_DISTRO_CODENAME} main"
> - if [ -z "${BASE_REPO_KEY}" ]; then
> - line="[trusted=yes] ${line}"
> - fi
> - echo "deb ${line}" >
> "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
> - echo "deb-src ${line}" >>
> "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list" -
> - mkdir -p ${ROOTFSDIR}/base-apt
> - mount --bind ${REPO_BASE_DIR} ${ROOTFSDIR}/base-apt
> - else
> - install -v -m644 "${APTSRCS}" \
> -
> "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
> - fi
> - install -v -m644 "${APTSRCS_INIT}" \
> - "${ROOTFSDIR}/etc/apt/sources-list"
> - rm -f "${ROOTFSDIR}/etc/apt/sources.list"
> - rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
> - mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
> - install -v -m644 "${WORKDIR}/isar-apt.conf" \
> -
> "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
> - if [ "${@get_distro_needs_gpg_support(d)}" = "gnupg" ];
> then
> - MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d
> /tmp/gpghomeXXXXXXXXXX)"
> - echo "Created temporary directory ${MY_GPGHOME} for
> gpg-agent"
> - export GNUPGHOME="${MY_GPGHOME}"
> - chroot "${ROOTFSDIR}" gpg-agent --daemon
> - APT_KEY_APPEND="--homedir ${MY_GPGHOME}"
> - fi
> - find ${APT_KEYS_DIR}/ -type f | while read keyfile
> - do
> - kfn="$(basename $keyfile)"
> - cp $keyfile "${ROOTFSDIR}/tmp/$kfn"
> - chroot "${ROOTFSDIR}" /usr/bin/apt-key \
> - --keyring ${THIRD_PARTY_APT_KEYRING}
> ${APT_KEY_APPEND} add "/tmp/$kfn"
> - rm "${ROOTFSDIR}/tmp/$kfn"
> - done
> - if [ -d "${MY_GPGHOME}" ]; then
> - echo "Killing gpg-agent for ${MY_GPGHOME}"
> - chroot "${ROOTFSDIR}" gpgconf --kill gpg-agent &&
> /bin/rm -rf "${MY_GPGHOME}"
> - fi
> + mkdir -p ${ROOTFSDIR}/base-apt
> + mount --bind ${REPO_BASE_DIR} ${ROOTFSDIR}/base-apt
> + else
> + install -v -m644 "${APTSRCS}" \
> +
> "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
> + fi
> + install -v -m644 "${APTSRCS_INIT}"
> "${ROOTFSDIR}/etc/apt/sources-list"
> + rm -f "${ROOTFSDIR}/etc/apt/sources.list"
> + rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
> + mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
> + install -v -m644 "${WORKDIR}/isar-apt.conf" \
> +
> "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
> + if [ "${@get_distro_needs_gpg_support(d)}" = "gnupg" ]; then
> + MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d
> /tmp/gpghomeXXXXXXXXXX)"
> + echo "Created temporary directory ${MY_GPGHOME} for
> gpg-agent"
> + export GNUPGHOME="${MY_GPGHOME}"
> + chroot "${ROOTFSDIR}" gpg-agent --daemon
> + APT_KEY_APPEND="--homedir ${MY_GPGHOME}"
> + fi
> + find ${APT_KEYS_DIR}/ -type f | while read keyfile
> + do
> + kfn="$(basename $keyfile)"
> + cp $keyfile "${ROOTFSDIR}/tmp/$kfn"
> + chroot "${ROOTFSDIR}" /usr/bin/apt-key \
> + --keyring ${THIRD_PARTY_APT_KEYRING}
> ${APT_KEY_APPEND} add "/tmp/$kfn"
> + rm "${ROOTFSDIR}/tmp/$kfn"
> + done
> + if [ -d "${MY_GPGHOME}" ]; then
> + echo "Killing gpg-agent for ${MY_GPGHOME}"
> + chroot "${ROOTFSDIR}" gpgconf --kill gpg-agent &&
> /bin/rm -rf "${MY_GPGHOME}"
> + fi
>
> - if [ "${@get_distro_suite(d, True)}" = "stretch" ] && [
> "${@get_host_release().split('.')[0]}" -lt "4" ]; then
> - install -v -m644 "${WORKDIR}/isar-apt-fallback.conf"
> \
> -
> "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf"
> - fi
> + if [ "${@get_distro_suite(d, True)}" = "stretch" ] && [
> "${@get_host_release().split('.')[0]}" -lt "4" ]; then
> + install -v -m644 "${WORKDIR}/isar-apt-fallback.conf" \
> +
> "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf"
> + fi
>
> - # Set locale
> - install -v -m644 "${WORKDIR}/locale"
> "${ROOTFSDIR}/etc/locale"
> + # Set locale
> + install -v -m644 "${WORKDIR}/locale"
> "${ROOTFSDIR}/etc/locale"
> - sed -i '/en_US.UTF-8 UTF-8/s/^#//g'
> "${ROOTFSDIR}/etc/locale.gen"
> - chroot "${ROOTFSDIR}" /usr/sbin/locale-gen
> + sed -i '/en_US.UTF-8 UTF-8/s/^#//g'
> "${ROOTFSDIR}/etc/locale.gen"
> + chroot "${ROOTFSDIR}" /usr/sbin/locale-gen
>
> - # setup chroot
> - install -v -m755 "${WORKDIR}/chroot-setup.sh"
> "${ROOTFSDIR}/chroot-setup.sh"
> - "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
> + # setup chroot
> + install -v -m755 "${WORKDIR}/chroot-setup.sh"
> "${ROOTFSDIR}/chroot-setup.sh"
> + "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
>
> - # update APT
> - mount --rbind /dev ${ROOTFSDIR}/dev
> - mount --make-rslave ${ROOTFSDIR}/dev
> - mount -t proc none ${ROOTFSDIR}/proc
> - mount --rbind /sys ${ROOTFSDIR}/sys
> - mount --make-rslave ${ROOTFSDIR}/sys
> + # update APT
> + mount --rbind /dev ${ROOTFSDIR}/dev
> + mount --make-rslave ${ROOTFSDIR}/dev
> + mount -t proc none ${ROOTFSDIR}/proc
> + mount --rbind /sys ${ROOTFSDIR}/sys
> + mount --make-rslave ${ROOTFSDIR}/sys
>
> - export DEBIAN_FRONTEND=noninteractive
> + export DEBIAN_FRONTEND=noninteractive
>
> - if [ ${IS_HOST} ]; then
> - chroot "${ROOTFSDIR}" /usr/bin/dpkg
> --add-architecture ${DISTRO_ARCH}
> - fi
> + if [ ${IS_HOST} ]; then
> + chroot "${ROOTFSDIR}" /usr/bin/dpkg --add-architecture
> ${DISTRO_ARCH}
> + fi
>
> - if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
> - chroot "${ROOTFSDIR}" /usr/bin/dpkg
> --add-architecture ${COMPAT_DISTRO_ARCH}
> - fi
> + if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
> + chroot "${ROOTFSDIR}" /usr/bin/dpkg --add-architecture
> ${COMPAT_DISTRO_ARCH}
> + fi
>
> - chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
> - chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y -f
> - chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
> - -o Debug::pkgProblemResolver=yes
> + chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
> + chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y -f
> + chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
> + -o Debug::pkgProblemResolver=yes
>
> - umount -l "${ROOTFSDIR}/dev"
> - umount -l "${ROOTFSDIR}/proc"
> - umount -l "${ROOTFSDIR}/sys"
> - umount -l "${ROOTFSDIR}/base-apt" || true
> + umount -l "${ROOTFSDIR}/dev"
> + umount -l "${ROOTFSDIR}/proc"
> + umount -l "${ROOTFSDIR}/sys"
> + umount -l "${ROOTFSDIR}/base-apt" || true
>
> - # Finalize debootstrap by setting the link in deploy
> - ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
> + # Finalize debootstrap by setting the link in deploy
> + ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
> EOSUDO
> - fi
> if [ "${IS_HOST}" ];then
> deb_dl_dir_export "${ROOTFSDIR}" "${HOST_DISTRO}"
> else
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild
2021-08-11 11:52 ` Henning Schild
@ 2021-08-11 14:41 ` Jan Kiszka
2021-08-11 17:13 ` Henning Schild
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2021-08-11 14:41 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 11.08.21 13:52, Henning Schild wrote:
> Am Wed, 11 Aug 2021 13:34:44 +0200
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> This check dates back to the time isar-bootstrap could have run
>> multiple times for the same distro-arch and was lock-protected to
>> avoid this. Long history, locks were removed in 1cae951259b3.
>>
>> Now this check only prevented proper rebuilding when apt sources or
>> preferences changed.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> .../isar-bootstrap/isar-bootstrap.inc | 202
>> +++++++++--------- 1 file changed, 100 insertions(+), 102 deletions(-)
>>
>> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
>> 0edefc5..b858c8c 100644 ---
>> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -256,125
>> +256,123 @@ isar_bootstrap() { fi
>> E="${@ isar_export_proxies(d)}"
>> export IS_HOST debootstrap_args E
>> - if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
>
> Let me guess, you removed that line and the closing "fi", and the rest
> is git showing a pretty messy diff on the indentation that came with
> things?
>
> I am almost tempted to ask for two patches ... one that does
> "whitespace only" and the other one doing the real work. Because the
> diff presented here can not be reviewed.
Just apply and do a "git diff -b HEAD^":
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 0edefc5..b858c8c 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -256,7 +256,7 @@ isar_bootstrap() {
fi
E="${@ isar_export_proxies(d)}"
export IS_HOST debootstrap_args E
- if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
+
sudo rm -rf --one-file-system "${ROOTFSDIR}"
if [ "${IS_HOST}" ];then
deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
@@ -302,8 +302,7 @@ isar_bootstrap() {
install -v -m644 "${APTSRCS}" \
"${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
fi
- install -v -m644 "${APTSRCS_INIT}" \
- "${ROOTFSDIR}/etc/apt/sources-list"
+ install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
rm -f "${ROOTFSDIR}/etc/apt/sources.list"
rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
@@ -374,7 +373,6 @@ isar_bootstrap() {
# Finalize debootstrap by setting the link in deploy
ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
EOSUDO
- fi
if [ "${IS_HOST}" ];then
deb_dl_dir_export "${ROOTFSDIR}" "${HOST_DISTRO}"
else
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild
2021-08-11 14:41 ` Jan Kiszka
@ 2021-08-11 17:13 ` Henning Schild
2021-08-11 17:56 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2021-08-11 17:13 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users
Am Wed, 11 Aug 2021 16:41:09 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> On 11.08.21 13:52, Henning Schild wrote:
> > Am Wed, 11 Aug 2021 13:34:44 +0200
> > schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> >
> >> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>
> >> This check dates back to the time isar-bootstrap could have run
> >> multiple times for the same distro-arch and was lock-protected to
> >> avoid this. Long history, locks were removed in 1cae951259b3.
> >>
> >> Now this check only prevented proper rebuilding when apt sources or
> >> preferences changed.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >> ---
> >> .../isar-bootstrap/isar-bootstrap.inc | 202
> >> +++++++++--------- 1 file changed, 100 insertions(+), 102
> >> deletions(-)
> >>
> >> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
> >> 0edefc5..b858c8c 100644 ---
> >> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
> >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -256,125
> >> +256,123 @@ isar_bootstrap() { fi
> >> E="${@ isar_export_proxies(d)}"
> >> export IS_HOST debootstrap_args E
> >> - if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
> >
> > Let me guess, you removed that line and the closing "fi", and the
> > rest is git showing a pretty messy diff on the indentation that
> > came with things?
> >
> > I am almost tempted to ask for two patches ... one that does
> > "whitespace only" and the other one doing the real work. Because the
> > diff presented here can not be reviewed.
>
> Just apply and do a "git diff -b HEAD^":
>
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
> 0edefc5..b858c8c 100644 ---
> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -256,7
> +256,7 @@ isar_bootstrap() { fi
> E="${@ isar_export_proxies(d)}"
> export IS_HOST debootstrap_args E
> - if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
> +
> sudo rm -rf --one-file-system "${ROOTFSDIR}"
> if [ "${IS_HOST}" ];then
> deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
> @@ -302,8 +302,7 @@ isar_bootstrap() {
> install -v -m644 "${APTSRCS}" \
> "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
> fi
> - install -v -m644 "${APTSRCS_INIT}" \
> - "${ROOTFSDIR}/etc/apt/sources-list"
> + install -v -m644 "${APTSRCS_INIT}"
> "${ROOTFSDIR}/etc/apt/sources-list" rm -f
That might just be the culprit. You smuggle in an indent change that
has nothing to do with the commit message.
That alone calls for a second patch, even if the result will be "hard
to review" again.
Henning
> "${ROOTFSDIR}/etc/apt/sources.list" rm -rf
> "${ROOTFSDIR}/var/lib/apt/lists/"* mkdir -p
> "${ROOTFSDIR}/etc/apt/apt.conf.d" @@ -374,7 +373,6 @@
> isar_bootstrap() { # Finalize debootstrap by setting the link in
> deploy ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
> EOSUDO
> - fi
> if [ "${IS_HOST}" ];then
> deb_dl_dir_export "${ROOTFSDIR}" "${HOST_DISTRO}"
> else
>
>
> Jan
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild
2021-08-11 17:13 ` Henning Schild
@ 2021-08-11 17:56 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2021-08-11 17:56 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 11.08.21 19:13, Henning Schild wrote:
> Am Wed, 11 Aug 2021 16:41:09 +0200
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>
>> On 11.08.21 13:52, Henning Schild wrote:
>>> Am Wed, 11 Aug 2021 13:34:44 +0200
>>> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>>>
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> This check dates back to the time isar-bootstrap could have run
>>>> multiple times for the same distro-arch and was lock-protected to
>>>> avoid this. Long history, locks were removed in 1cae951259b3.
>>>>
>>>> Now this check only prevented proper rebuilding when apt sources or
>>>> preferences changed.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> ---
>>>> .../isar-bootstrap/isar-bootstrap.inc | 202
>>>> +++++++++--------- 1 file changed, 100 insertions(+), 102
>>>> deletions(-)
>>>>
>>>> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
>>>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
>>>> 0edefc5..b858c8c 100644 ---
>>>> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
>>>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -256,125
>>>> +256,123 @@ isar_bootstrap() { fi
>>>> E="${@ isar_export_proxies(d)}"
>>>> export IS_HOST debootstrap_args E
>>>> - if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
>>>
>>> Let me guess, you removed that line and the closing "fi", and the
>>> rest is git showing a pretty messy diff on the indentation that
>>> came with things?
>>>
>>> I am almost tempted to ask for two patches ... one that does
>>> "whitespace only" and the other one doing the real work. Because the
>>> diff presented here can not be reviewed.
>>
>> Just apply and do a "git diff -b HEAD^":
>>
>> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
>> 0edefc5..b858c8c 100644 ---
>> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -256,7
>> +256,7 @@ isar_bootstrap() { fi
>> E="${@ isar_export_proxies(d)}"
>> export IS_HOST debootstrap_args E
>> - if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
>> +
>> sudo rm -rf --one-file-system "${ROOTFSDIR}"
>> if [ "${IS_HOST}" ];then
>> deb_dl_dir_import "${ROOTFSDIR}" "${HOST_DISTRO}"
>> @@ -302,8 +302,7 @@ isar_bootstrap() {
>> install -v -m644 "${APTSRCS}" \
>> "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
>> fi
>> - install -v -m644 "${APTSRCS_INIT}" \
>> - "${ROOTFSDIR}/etc/apt/sources-list"
>> + install -v -m644 "${APTSRCS_INIT}"
>> "${ROOTFSDIR}/etc/apt/sources-list" rm -f
>
> That might just be the culprit. You smuggle in an indent change that
> has nothing to do with the commit message.
Read again (but not the version your client mangled on citing): This is
no functional change, just a removal of a no longer needed line wrap.
>
> That alone calls for a second patch, even if the result will be "hard
> to review" again.
I'll send v2, but only to bundle all patches - I've two more by now.
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-11 17:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 11:34 [PATCH] isar-bootstrap: Remove obsolete and incorrect skipping of rebuild Jan Kiszka
2021-08-11 11:52 ` Henning Schild
2021-08-11 14:41 ` Jan Kiszka
2021-08-11 17:13 ` Henning Schild
2021-08-11 17:56 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox