From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 1/1] add var to configure apt rate limits
Date: Mon, 22 Jul 2024 12:39:17 +0200 [thread overview]
Message-ID: <20240722103917.628994-1-felix.moessbauer@siemens.com> (raw)
This patch introduces the variable ISAR_APT_DL_LIMIT which is used to
control the rate limit of apt.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
RECIPE-API-CHANGELOG.md | 5 +++++
doc/user_manual.md | 1 +
meta/classes/rootfs.bbclass | 4 ++++
3 files changed, 10 insertions(+)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 12ea93ec..65cd98b3 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -629,3 +629,8 @@ into kernel kbuild package.
Only the "host" specific package is built automatically at cross builds.
* Support emulated module build with cross-compiled kernel for linux-module
+
+### Rate-Limit apt fetching
+
+When downloading from debian snapshot mirrors, rate limits might apply.
+To limit the amount of parallel fetching to n kB / s, you can set `ISAR_APT_DL_LIMIT="<n>`.
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 776ae52c..22d39073 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -433,6 +433,7 @@ Some other variables include:
- `HOST_DISTRO_BOOTSTRAP_KEYS` - Analogously to DISTRO_BOOTSTRAP_KEYS: List of gpg key URIs used to verify apt bootstrap repo for the host.
- `DISTRO_APT_PREMIRRORS` - The preferred mirror (append it to the default URI in the format `ftp.debian.org my.preferred.mirror`. This variable is optional. PREMIRRORS will be used only for the build. The final images will have the sources list as mentioned in DISTRO_APT_SOURCES.
- `ISAR_USE_APT_SNAPSHOT` - Use a frozen apt snapshot instead of the live mirror. Optional.
+ `ISAR_APT_DL_LIMIT` - Rate limit the apt fetching to n kB / s. Optional.
- `DISTRO_APT_SNAPSHOT_PREMIRROR` - Similar to `DISTRO_APT_PREMIRRORS` but for a snapshot, pre-defined for supported distros.
- `ISAR_APT_SNAPSHOT_TIMESTAMP` - Timestamp of the apt snapshot. Automatically derived from `SOURCE_DATE_EPOCH` if not overwritten.
- `THIRD_PARTY_APT_KEYS` - List of gpg key URIs used to verify apt repos for apt installation after bootstrapping.
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 2e091e0c..fdb25eaa 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -111,6 +111,10 @@ rootfs_configure_apt() {
mkdir -p '${ROOTFSDIR}/etc/apt/apt.conf.d'
{
echo 'Acquire::Retries "3";'
+ if [ -n "${ISAR_APT_DL_LIMIT}" ]; then
+ echo 'Acquire::http::Dl-Limit "${ISAR_APT_DL_LIMIT}";'
+ echo 'Acquire::https::Dl-Limit "${ISAR_APT_DL_LIMIT}";'
+ fi
echo 'APT::Install-Recommends "0";'
echo 'APT::Install-Suggests "0";'
} > '${ROOTFSDIR}/etc/apt/apt.conf.d/50isar'
--
2.39.2
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240722103917.628994-1-felix.moessbauer%40siemens.com.
next reply other threads:[~2024-07-22 10:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 10:39 'Felix Moessbauer' via isar-users [this message]
2024-07-31 6:45 ` Uladzimir Bely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240722103917.628994-1-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=felix.moessbauer@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox