* [PATCH] dpkg: Add control over removal of built packages
@ 2020-10-08 17:13 Jan Kiszka
2020-11-04 7:44 ` vijaikumar....@gmail.com
2020-11-26 15:47 ` Anton Mikanovich
0 siblings, 2 replies; 4+ messages in thread
From: Jan Kiszka @ 2020-10-08 17:13 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
In almost all cases, the packages built by a recipe wasn't used yet and
will only be requested down the dependency chain. Then it is fine to
purge it from the buildchroots during partial rebuilds.
There are corner cases, though, when the packages will never be used in
the buildchroots, only in the target filesystem. That can affect core
packages rebuilt for the target but also used in their upstream variant
in the buildchroots. While buildchroot installation can be controlled
via preferences, purging can't this way. Add a variable that allows to
control it without having to overwrite deb_clean.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/dpkg-base.bbclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 7e12ab0a..01c6eb65 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -154,6 +154,8 @@ python do_dpkg_build() {
addtask dpkg_build before do_build
+KEEP_INSTALLED_ON_CLEAN ?= "0"
+
CLEANFUNCS += "deb_clean"
deb_clean() {
@@ -162,6 +164,9 @@ deb_clean() {
for d in ${DEBS}; do
repo_del_package "${REPO_ISAR_DIR}"/"${DISTRO}" \
"${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${d}"
+ if [ "${KEEP_INSTALLED_ON_CLEAN}" = "1" ]; then
+ continue;
+ fi
package=$(basename "${d}")
package_remove="/usr/bin/apt-get remove -y ${package%%_*}"
sudo -E chroot ${BUILDCHROOT_DIR} ${package_remove} || true
--
2.26.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dpkg: Add control over removal of built packages
2020-10-08 17:13 [PATCH] dpkg: Add control over removal of built packages Jan Kiszka
@ 2020-11-04 7:44 ` vijaikumar....@gmail.com
2020-11-21 7:43 ` Jan Kiszka
2020-11-26 15:47 ` Anton Mikanovich
1 sibling, 1 reply; 4+ messages in thread
From: vijaikumar....@gmail.com @ 2020-11-04 7:44 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 1764 bytes --]
Tested in a downstream project. Works fine.
Tested-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
On Thursday, October 8, 2020 at 10:43:37 PM UTC+5:30 Jan Kiszka wrote:
> From: Jan Kiszka <jan.k...@siemens.com>
>
> In almost all cases, the packages built by a recipe wasn't used yet and
> will only be requested down the dependency chain. Then it is fine to
> purge it from the buildchroots during partial rebuilds.
>
> There are corner cases, though, when the packages will never be used in
> the buildchroots, only in the target filesystem. That can affect core
> packages rebuilt for the target but also used in their upstream variant
> in the buildchroots. While buildchroot installation can be controlled
> via preferences, purging can't this way. Add a variable that allows to
> control it without having to overwrite deb_clean.
>
> Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
> ---
> meta/classes/dpkg-base.bbclass | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass
> index 7e12ab0a..01c6eb65 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -154,6 +154,8 @@ python do_dpkg_build() {
>
> addtask dpkg_build before do_build
>
> +KEEP_INSTALLED_ON_CLEAN ?= "0"
> +
> CLEANFUNCS += "deb_clean"
>
> deb_clean() {
> @@ -162,6 +164,9 @@ deb_clean() {
> for d in ${DEBS}; do
> repo_del_package "${REPO_ISAR_DIR}"/"${DISTRO}" \
> "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${d}"
> + if [ "${KEEP_INSTALLED_ON_CLEAN}" = "1" ]; then
> + continue;
> + fi
> package=$(basename "${d}")
> package_remove="/usr/bin/apt-get remove -y ${package%%_*}"
> sudo -E chroot ${BUILDCHROOT_DIR} ${package_remove} || true
> --
> 2.26.2
>
[-- Attachment #1.2: Type: text/html, Size: 2420 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dpkg: Add control over removal of built packages
2020-11-04 7:44 ` vijaikumar....@gmail.com
@ 2020-11-21 7:43 ` Jan Kiszka
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2020-11-21 7:43 UTC (permalink / raw)
To: isar-users, Baurzhan Ismagulov; +Cc: vijaikumar....@gmail.com
Ping - before applying this to the forth or so layer manually.
Jan
On 04.11.20 08:44, vijaikumar....@gmail.com wrote:
> Tested in a downstream project. Works fine.
>
> Tested-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
>
> On Thursday, October 8, 2020 at 10:43:37 PM UTC+5:30 Jan Kiszka wrote:
>
> From: Jan Kiszka <jan.k...@siemens.com>
>
> In almost all cases, the packages built by a recipe wasn't used yet and
> will only be requested down the dependency chain. Then it is fine to
> purge it from the buildchroots during partial rebuilds.
>
> There are corner cases, though, when the packages will never be used in
> the buildchroots, only in the target filesystem. That can affect core
> packages rebuilt for the target but also used in their upstream variant
> in the buildchroots. While buildchroot installation can be controlled
> via preferences, purging can't this way. Add a variable that allows to
> control it without having to overwrite deb_clean.
>
> Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
> ---
> meta/classes/dpkg-base.bbclass | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass
> index 7e12ab0a..01c6eb65 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -154,6 +154,8 @@ python do_dpkg_build() {
>
> addtask dpkg_build before do_build
>
> +KEEP_INSTALLED_ON_CLEAN ?= "0"
> +
> CLEANFUNCS += "deb_clean"
>
> deb_clean() {
> @@ -162,6 +164,9 @@ deb_clean() {
> for d in ${DEBS}; do
> repo_del_package "${REPO_ISAR_DIR}"/"${DISTRO}" \
> "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${d}"
> + if [ "${KEEP_INSTALLED_ON_CLEAN}" = "1" ]; then
> + continue;
> + fi
> package=$(basename "${d}")
> package_remove="/usr/bin/apt-get remove -y ${package%%_*}"
> sudo -E chroot ${BUILDCHROOT_DIR} ${package_remove} || true
> --
> 2.26.2
>
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dpkg: Add control over removal of built packages
2020-10-08 17:13 [PATCH] dpkg: Add control over removal of built packages Jan Kiszka
2020-11-04 7:44 ` vijaikumar....@gmail.com
@ 2020-11-26 15:47 ` Anton Mikanovich
1 sibling, 0 replies; 4+ messages in thread
From: Anton Mikanovich @ 2020-11-26 15:47 UTC (permalink / raw)
To: isar-users
08.10.2020 20:13, Jan Kiszka wrote:
> In almost all cases, the packages built by a recipe wasn't used yet and
> will only be requested down the dependency chain. Then it is fine to
> purge it from the buildchroots during partial rebuilds.
>
> There are corner cases, though, when the packages will never be used in
> the buildchroots, only in the target filesystem. That can affect core
> packages rebuilt for the target but also used in their upstream variant
> in the buildchroots. While buildchroot installation can be controlled
> via preferences, purging can't this way. Add a variable that allows to
> control it without having to overwrite deb_clean.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied to next, thanks.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-26 15:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 17:13 [PATCH] dpkg: Add control over removal of built packages Jan Kiszka
2020-11-04 7:44 ` vijaikumar....@gmail.com
2020-11-21 7:43 ` Jan Kiszka
2020-11-26 15:47 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox