* [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
[not found] <rBT7pjX7j20>
@ 2025-03-12 6:50 ` 'Kasturi Shekar' via isar-users
2025-03-12 6:51 ` 'Shekar, Kasturi' via isar-users
2025-03-12 9:07 ` [PATCH v3] " 'Kasturi Shekar' via isar-users
1 sibling, 1 reply; 8+ messages in thread
From: 'Kasturi Shekar' via isar-users @ 2025-03-12 6:50 UTC (permalink / raw)
To: isar-users; +Cc: Kasturi Shekar
- Fixed the issue where the --psplash-pipe flag was not working in
bmap-tools version 3.6 (Bookworm).
- Added a patch to ensure the correct handling of the --psplash-pipe
flag and avoid skipping the _psplash_pipe section when _progress_file
is null.
- With this fix, psplash can now be used with bmap-tools(v3.6) to properly
display progress updates.
Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
---
.../bmap-tools/bmap-tools.bb | 21 +++++
...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++
...e-part-was-skipped-when-_progress_fi.patch | 78 +++++++++++++++++++
.../deploy-image/deploy-image_0.1.bb | 1 +
4 files changed, 128 insertions(+)
create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
new file mode 100644
index 00000000..376ab433
--- /dev/null
+++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
@@ -0,0 +1,21 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2025
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg
+
+SRC_URI = "apt://${BPN}"
+PN = "bmap-tools"
+CHANGELOG_V="<orig-version>+isar"
+
+SRC_URI += "file://0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch;apply=no \
+ file://0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch;apply=no"
+
+do_prepare_build:append() {
+ deb_add_changelog
+
+ cd ${S}
+ quilt import -f ${WORKDIR}/*.patch
+ quilt push -a
+}
diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
new file mode 100644
index 00000000..a45bcbc4
--- /dev/null
+++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
@@ -0,0 +1,28 @@
+From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17 00:00:00 2001
+From: Jason <zxcv1884@gmail.com>
+Date: Wed, 26 Jan 2022 16:26:47 +0800
+Subject: [PATCH] Fix path parameter passing error of set_psplash_pipe function
+
+---
+ bmaptools/BmapCopy.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
+index c6a2603..dba24a5 100644
+--- a/bmaptools/BmapCopy.py
++++ b/bmaptools/BmapCopy.py
+@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path):
+ a best effort.
+ """
+
+- if os.path.exists(pipe) and stat.S_ISFIFO(os.stat(pipe).st_mode):
+- self._psplash_pipe = pipe
++ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode):
++ self._psplash_pipe = path
+ else:
+ _log.warning("'%s' is not a pipe, so psplash progress will not be "
+- "updated" % pipe)
++ "updated" % path)
+
+ def set_progress_indicator(self, file_obj, format_string):
+ """
diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
new file mode 100644
index 00000000..bf17a7d1
--- /dev/null
+++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
@@ -0,0 +1,78 @@
+From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17 00:00:00 2001
+From: Jason <zxcv1884@gmail.com>
+Date: Mon, 7 Feb 2022 17:55:16 +0800
+Subject: [PATCH] Fix _psplash_pipe part was skipped when _progress_file is
+ null
+
+---
+ bmaptools/BmapCopy.py | 56 +++++++++++++++++++++----------------------
+ 1 file changed, 27 insertions(+), 29 deletions(-)
+
+diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
+index dba24a5..ca22aba 100644
+--- a/bmaptools/BmapCopy.py
++++ b/bmaptools/BmapCopy.py
+@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written):
+ else:
+ _log.debug("wrote %d blocks" % blocks_written)
+
+- if not self._progress_file:
+- return
+-
+- if self.mapped_cnt:
+- progress = '\r' + self._progress_format % percent + '\n'
+- else:
+- # Do not rotate the wheel too fast
+- now = datetime.datetime.now()
+- min_delta = datetime.timedelta(milliseconds=250)
+- if now - self._progress_time < min_delta:
+- return
+- self._progress_time = now
+-
+- progress_wheel = ('-', '\\', '|', '/')
+- progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
+- self._progress_index += 1
+-
+- # This is a little trick we do in order to make sure that the next
+- # message will always start from a new line - we switch to the new
+- # line after each progress update and move the cursor up. As an
+- # example, this is useful when the copying is interrupted by an
+- # exception - the error message will start form new line.
+- if self._progress_started:
+- # The "move cursor up" escape sequence
+- self._progress_file.write('\033[1A') # pylint: disable=W1401
+- else:
+- self._progress_started = True
++ if self._progress_file:
++ if self.mapped_cnt:
++ progress = '\r' + self._progress_format % percent + '\n'
++ else:
++ # Do not rotate the wheel too fast
++ now = datetime.datetime.now()
++ min_delta = datetime.timedelta(milliseconds=250)
++ if now - self._progress_time < min_delta:
++ return
++ self._progress_time = now
++
++ progress_wheel = ('-', '\\', '|', '/')
++ progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
++ self._progress_index += 1
++
++ # This is a little trick we do in order to make sure that the next
++ # message will always start from a new line - we switch to the new
++ # line after each progress update and move the cursor up. As an
++ # example, this is useful when the copying is interrupted by an
++ # exception - the error message will start form new line.
++ if self._progress_started:
++ # The "move cursor up" escape sequence
++ self._progress_file.write('\033[1A') # pylint: disable=W1401
++ else:
++ self._progress_started = True
+
+- self._progress_file.write(progress)
+- self._progress_file.flush()
++ self._progress_file.write(progress)
++ self._progress_file.flush()
+
+ # Update psplash progress when configured. This is using a best effort
+ # strategy to not affect the writing process when psplash breaks, is
diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
index 242ca88e..54e521b5 100644
--- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
+++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
@@ -10,6 +10,7 @@ inherit dpkg-raw
SRC_URI = "file://usr/bin/deploy-image-wic.sh \
file://usr/lib/deploy-image-wic/handle-config.sh \
"
+DEPENDS:bookworm += "bmap-tools"
DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk, gdisk, pigz, xz-utils, pbzip2, zstd"
do_install[cleandirs] = "${D}/usr/bin/ \
${D}/usr/lib/deploy-image-wic \
--
2.39.5
--
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 visit https://groups.google.com/d/msgid/isar-users/20250312065027.566489-1-kasturi.shekar%40siemens.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
2025-03-12 6:50 ` [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm) 'Kasturi Shekar' via isar-users
@ 2025-03-12 6:51 ` 'Shekar, Kasturi' via isar-users
2025-03-12 7:35 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 8+ messages in thread
From: 'Shekar, Kasturi' via isar-users @ 2025-03-12 6:51 UTC (permalink / raw)
To: isar-users
Hi,
It seems that Debian will not be fixing the issue with the --psplash-pipe option in bmap-tools (version 3.6 in Debian Bookworm) at this time. I reported the bug, but it was deemed not a serious issue by the Debian maintainers.
To address this, I have proposed a fix within ISAR.
For reference, here is the link to the reported bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100092
Thanks,
Kasturi
Siemens AG
> -----Original Message-----
> From: Shekar, Kasturi (FT FDS CES LX PBU 2) <kasturi.shekar@siemens.com>
> Sent: 12 March 2025 12:20
> To: isar-users@googlegroups.com
> Cc: Shekar, Kasturi (FT FDS CES LX PBU 2) <kasturi.shekar@siemens.com>
> Subject: [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools
> 3.6 (bookworm)
>
> - Fixed the issue where the --psplash-pipe flag was not working in
> bmap-tools version 3.6 (Bookworm).
> - Added a patch to ensure the correct handling of the --psplash-pipe
> flag and avoid skipping the _psplash_pipe section when _progress_file
> is null.
> - With this fix, psplash can now be used with bmap-tools(v3.6) to properly
> display progress updates.
>
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
> .../bmap-tools/bmap-tools.bb | 21 +++++
> ...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++ ...e-part-was-
> skipped-when-_progress_fi.patch | 78 +++++++++++++++++++
> .../deploy-image/deploy-image_0.1.bb | 1 +
> 4 files changed, 128 insertions(+)
> create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0001-Fix-
> path-parameter-passing-error-of-set_psplash_pipe.patch
> create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0002-Fix-
> _psplash_pipe-part-was-skipped-when-_progress_fi.patch
>
> diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb b/meta-
> isar/recipes-installer/bmap-tools/bmap-tools.bb
> new file mode 100644
> index 00000000..376ab433
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> @@ -0,0 +1,21 @@
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2025
> +#
> +# SPDX-License-Identifier: MIT
> +
> +inherit dpkg
> +
> +SRC_URI = "apt://${BPN}"
> +PN = "bmap-tools"
> +CHANGELOG_V="<orig-version>+isar"
> +
> +SRC_URI += "file://0001-Fix-path-parameter-passing-error-of-
> set_psplash_pipe.patch;apply=no \
> + file://0002-Fix-_psplash_pipe-part-was-skipped-when-
> _progress_fi.patch;apply=no"
> +
> +do_prepare_build:append() {
> + deb_add_changelog
> +
> + cd ${S}
> + quilt import -f ${WORKDIR}/*.patch
> + quilt push -a
> +}
> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-
> parameter-passing-error-of-set_psplash_pipe.patch b/meta-isar/recipes-
> installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-
> set_psplash_pipe.patch
> new file mode 100644
> index 00000000..a45bcbc4
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-paramet
> +++ er-passing-error-of-set_psplash_pipe.patch
> @@ -0,0 +1,28 @@
> +From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17
> 00:00:00 2001
> +From: Jason <zxcv1884@gmail.com>
> +Date: Wed, 26 Jan 2022 16:26:47 +0800
> +Subject: [PATCH] Fix path parameter passing error of set_psplash_pipe
> +function
> +
> +---
> + bmaptools/BmapCopy.py | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index
> +c6a2603..dba24a5 100644
> +--- a/bmaptools/BmapCopy.py
> ++++ b/bmaptools/BmapCopy.py
> +@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path):
> + a best effort.
> + """
> +
> +- if os.path.exists(pipe) and stat.S_ISFIFO(os.stat(pipe).st_mode):
> +- self._psplash_pipe = pipe
> ++ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode):
> ++ self._psplash_pipe = path
> + else:
> + _log.warning("'%s' is not a pipe, so psplash progress will not be "
> +- "updated" % pipe)
> ++ "updated" % path)
> +
> + def set_progress_indicator(self, file_obj, format_string):
> + """
> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-
> _psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-
> isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-
> skipped-when-_progress_fi.patch
> new file mode 100644
> index 00000000..bf17a7d1
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pip
> +++ e-part-was-skipped-when-_progress_fi.patch
> @@ -0,0 +1,78 @@
> +From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17
> 00:00:00 2001
> +From: Jason <zxcv1884@gmail.com>
> +Date: Mon, 7 Feb 2022 17:55:16 +0800
> +Subject: [PATCH] Fix _psplash_pipe part was skipped when _progress_file
> +is null
> +
> +---
> + bmaptools/BmapCopy.py | 56 +++++++++++++++++++++---------------------
> -
> + 1 file changed, 27 insertions(+), 29 deletions(-)
> +
> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index
> +dba24a5..ca22aba 100644
> +--- a/bmaptools/BmapCopy.py
> ++++ b/bmaptools/BmapCopy.py
> +@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written):
> + else:
> + _log.debug("wrote %d blocks" % blocks_written)
> +
> +- if not self._progress_file:
> +- return
> +-
> +- if self.mapped_cnt:
> +- progress = '\r' + self._progress_format % percent + '\n'
> +- else:
> +- # Do not rotate the wheel too fast
> +- now = datetime.datetime.now()
> +- min_delta = datetime.timedelta(milliseconds=250)
> +- if now - self._progress_time < min_delta:
> +- return
> +- self._progress_time = now
> +-
> +- progress_wheel = ('-', '\\', '|', '/')
> +- progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
> +- self._progress_index += 1
> +-
> +- # This is a little trick we do in order to make sure that the next
> +- # message will always start from a new line - we switch to the new
> +- # line after each progress update and move the cursor up. As an
> +- # example, this is useful when the copying is interrupted by an
> +- # exception - the error message will start form new line.
> +- if self._progress_started:
> +- # The "move cursor up" escape sequence
> +- self._progress_file.write('\033[1A') # pylint: disable=W1401
> +- else:
> +- self._progress_started = True
> ++ if self._progress_file:
> ++ if self.mapped_cnt:
> ++ progress = '\r' + self._progress_format % percent + '\n'
> ++ else:
> ++ # Do not rotate the wheel too fast
> ++ now = datetime.datetime.now()
> ++ min_delta = datetime.timedelta(milliseconds=250)
> ++ if now - self._progress_time < min_delta:
> ++ return
> ++ self._progress_time = now
> ++
> ++ progress_wheel = ('-', '\\', '|', '/')
> ++ progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
> ++ self._progress_index += 1
> ++
> ++ # This is a little trick we do in order to make sure that the next
> ++ # message will always start from a new line - we switch to the new
> ++ # line after each progress update and move the cursor up. As an
> ++ # example, this is useful when the copying is interrupted by an
> ++ # exception - the error message will start form new line.
> ++ if self._progress_started:
> ++ # The "move cursor up" escape sequence
> ++ self._progress_file.write('\033[1A') # pylint: disable=W1401
> ++ else:
> ++ self._progress_started = True
> +
> +- self._progress_file.write(progress)
> +- self._progress_file.flush()
> ++ self._progress_file.write(progress)
> ++ self._progress_file.flush()
> +
> + # Update psplash progress when configured. This is using a best effort
> + # strategy to not affect the writing process when psplash
> + breaks, is
> diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> index 242ca88e..54e521b5 100644
> --- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> @@ -10,6 +10,7 @@ inherit dpkg-raw
> SRC_URI = "file://usr/bin/deploy-image-wic.sh \
> file://usr/lib/deploy-image-wic/handle-config.sh \
> "
> +DEPENDS:bookworm += "bmap-tools"
> DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk, gdisk,
> pigz, xz-utils, pbzip2, zstd"
> do_install[cleandirs] = "${D}/usr/bin/ \
> ${D}/usr/lib/deploy-image-wic \
> --
> 2.39.5
--
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 visit https://groups.google.com/d/msgid/isar-users/SG2PR06MB53110A3939493E963353738D94D02%40SG2PR06MB5311.apcprd06.prod.outlook.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
2025-03-12 6:51 ` 'Shekar, Kasturi' via isar-users
@ 2025-03-12 7:35 ` 'Jan Kiszka' via isar-users
0 siblings, 0 replies; 8+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-03-12 7:35 UTC (permalink / raw)
To: Shekar, Kasturi, isar-users
On 12.03.25 07:51, 'Shekar, Kasturi' via isar-users wrote:
> Hi,
>
> It seems that Debian will not be fixing the issue with the --psplash-pipe option in bmap-tools (version 3.6 in Debian Bookworm) at this time. I reported the bug, but it was deemed not a serious issue by the Debian maintainers.
>
> To address this, I have proposed a fix within ISAR.
>
> For reference, here is the link to the reported bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100092
>
And https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034290
Those links belong into the commit message, not as a follow-up message
that will only be in the ML archives.
Jan
> Thanks,
> Kasturi
> Siemens AG
>
>> -----Original Message-----
>> From: Shekar, Kasturi (FT FDS CES LX PBU 2) <kasturi.shekar@siemens.com>
>> Sent: 12 March 2025 12:20
>> To: isar-users@googlegroups.com
>> Cc: Shekar, Kasturi (FT FDS CES LX PBU 2) <kasturi.shekar@siemens.com>
>> Subject: [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools
>> 3.6 (bookworm)
>>
>> - Fixed the issue where the --psplash-pipe flag was not working in
>> bmap-tools version 3.6 (Bookworm).
>> - Added a patch to ensure the correct handling of the --psplash-pipe
>> flag and avoid skipping the _psplash_pipe section when _progress_file
>> is null.
>> - With this fix, psplash can now be used with bmap-tools(v3.6) to properly
>> display progress updates.
>>
>> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
>> ---
>> .../bmap-tools/bmap-tools.bb | 21 +++++
>> ...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++ ...e-part-was-
>> skipped-when-_progress_fi.patch | 78 +++++++++++++++++++
>> .../deploy-image/deploy-image_0.1.bb | 1 +
>> 4 files changed, 128 insertions(+)
>> create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
>> create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0001-Fix-
>> path-parameter-passing-error-of-set_psplash_pipe.patch
>> create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0002-Fix-
>> _psplash_pipe-part-was-skipped-when-_progress_fi.patch
>>
>> diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb b/meta-
>> isar/recipes-installer/bmap-tools/bmap-tools.bb
>> new file mode 100644
>> index 00000000..376ab433
>> --- /dev/null
>> +++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
>> @@ -0,0 +1,21 @@
>> +# This software is a part of ISAR.
>> +# Copyright (c) Siemens AG, 2025
>> +#
>> +# SPDX-License-Identifier: MIT
>> +
>> +inherit dpkg
>> +
>> +SRC_URI = "apt://${BPN}"
>> +PN = "bmap-tools"
>> +CHANGELOG_V="<orig-version>+isar"
>> +
>> +SRC_URI += "file://0001-Fix-path-parameter-passing-error-of-
>> set_psplash_pipe.patch;apply=no \
>> + file://0002-Fix-_psplash_pipe-part-was-skipped-when-
>> _progress_fi.patch;apply=no"
>> +
>> +do_prepare_build:append() {
>> + deb_add_changelog
>> +
>> + cd ${S}
>> + quilt import -f ${WORKDIR}/*.patch
>> + quilt push -a
>> +}
>> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-
>> parameter-passing-error-of-set_psplash_pipe.patch b/meta-isar/recipes-
>> installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-
>> set_psplash_pipe.patch
>> new file mode 100644
>> index 00000000..a45bcbc4
>> --- /dev/null
>> +++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-paramet
>> +++ er-passing-error-of-set_psplash_pipe.patch
>> @@ -0,0 +1,28 @@
>> +From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17
>> 00:00:00 2001
>> +From: Jason <zxcv1884@gmail.com>
>> +Date: Wed, 26 Jan 2022 16:26:47 +0800
>> +Subject: [PATCH] Fix path parameter passing error of set_psplash_pipe
>> +function
>> +
>> +---
>> + bmaptools/BmapCopy.py | 6 +++---
>> + 1 file changed, 3 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index
>> +c6a2603..dba24a5 100644
>> +--- a/bmaptools/BmapCopy.py
>> ++++ b/bmaptools/BmapCopy.py
>> +@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path):
>> + a best effort.
>> + """
>> +
>> +- if os.path.exists(pipe) and stat.S_ISFIFO(os.stat(pipe).st_mode):
>> +- self._psplash_pipe = pipe
>> ++ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode):
>> ++ self._psplash_pipe = path
>> + else:
>> + _log.warning("'%s' is not a pipe, so psplash progress will not be "
>> +- "updated" % pipe)
>> ++ "updated" % path)
>> +
>> + def set_progress_indicator(self, file_obj, format_string):
>> + """
>> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-
>> _psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-
>> isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-
>> skipped-when-_progress_fi.patch
>> new file mode 100644
>> index 00000000..bf17a7d1
>> --- /dev/null
>> +++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pip
>> +++ e-part-was-skipped-when-_progress_fi.patch
>> @@ -0,0 +1,78 @@
>> +From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17
>> 00:00:00 2001
>> +From: Jason <zxcv1884@gmail.com>
>> +Date: Mon, 7 Feb 2022 17:55:16 +0800
>> +Subject: [PATCH] Fix _psplash_pipe part was skipped when _progress_file
>> +is null
>> +
>> +---
>> + bmaptools/BmapCopy.py | 56 +++++++++++++++++++++---------------------
>> -
>> + 1 file changed, 27 insertions(+), 29 deletions(-)
>> +
>> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index
>> +dba24a5..ca22aba 100644
>> +--- a/bmaptools/BmapCopy.py
>> ++++ b/bmaptools/BmapCopy.py
>> +@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written):
>> + else:
>> + _log.debug("wrote %d blocks" % blocks_written)
>> +
>> +- if not self._progress_file:
>> +- return
>> +-
>> +- if self.mapped_cnt:
>> +- progress = '\r' + self._progress_format % percent + '\n'
>> +- else:
>> +- # Do not rotate the wheel too fast
>> +- now = datetime.datetime.now()
>> +- min_delta = datetime.timedelta(milliseconds=250)
>> +- if now - self._progress_time < min_delta:
>> +- return
>> +- self._progress_time = now
>> +-
>> +- progress_wheel = ('-', '\\', '|', '/')
>> +- progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
>> +- self._progress_index += 1
>> +-
>> +- # This is a little trick we do in order to make sure that the next
>> +- # message will always start from a new line - we switch to the new
>> +- # line after each progress update and move the cursor up. As an
>> +- # example, this is useful when the copying is interrupted by an
>> +- # exception - the error message will start form new line.
>> +- if self._progress_started:
>> +- # The "move cursor up" escape sequence
>> +- self._progress_file.write('\033[1A') # pylint: disable=W1401
>> +- else:
>> +- self._progress_started = True
>> ++ if self._progress_file:
>> ++ if self.mapped_cnt:
>> ++ progress = '\r' + self._progress_format % percent + '\n'
>> ++ else:
>> ++ # Do not rotate the wheel too fast
>> ++ now = datetime.datetime.now()
>> ++ min_delta = datetime.timedelta(milliseconds=250)
>> ++ if now - self._progress_time < min_delta:
>> ++ return
>> ++ self._progress_time = now
>> ++
>> ++ progress_wheel = ('-', '\\', '|', '/')
>> ++ progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
>> ++ self._progress_index += 1
>> ++
>> ++ # This is a little trick we do in order to make sure that the next
>> ++ # message will always start from a new line - we switch to the new
>> ++ # line after each progress update and move the cursor up. As an
>> ++ # example, this is useful when the copying is interrupted by an
>> ++ # exception - the error message will start form new line.
>> ++ if self._progress_started:
>> ++ # The "move cursor up" escape sequence
>> ++ self._progress_file.write('\033[1A') # pylint: disable=W1401
>> ++ else:
>> ++ self._progress_started = True
>> +
>> +- self._progress_file.write(progress)
>> +- self._progress_file.flush()
>> ++ self._progress_file.write(progress)
>> ++ self._progress_file.flush()
>> +
>> + # Update psplash progress when configured. This is using a best effort
>> + # strategy to not affect the writing process when psplash
>> + breaks, is
>> diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
>> b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
>> index 242ca88e..54e521b5 100644
>> --- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
>> +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
>> @@ -10,6 +10,7 @@ inherit dpkg-raw
>> SRC_URI = "file://usr/bin/deploy-image-wic.sh \
>> file://usr/lib/deploy-image-wic/handle-config.sh \
>> "
>> +DEPENDS:bookworm += "bmap-tools"
>> DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk, gdisk,
>> pigz, xz-utils, pbzip2, zstd"
>> do_install[cleandirs] = "${D}/usr/bin/ \
>> ${D}/usr/lib/deploy-image-wic \
>> --
>> 2.39.5
>
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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 visit https://groups.google.com/d/msgid/isar-users/86991447-e7ec-44c5-b7d2-2027f0ac66fe%40siemens.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
[not found] <rBT7pjX7j20>
2025-03-12 6:50 ` [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm) 'Kasturi Shekar' via isar-users
@ 2025-03-12 9:07 ` 'Kasturi Shekar' via isar-users
2025-03-13 9:58 ` 'Jan Kiszka' via isar-users
2025-03-27 10:32 ` Uladzimir Bely
1 sibling, 2 replies; 8+ messages in thread
From: 'Kasturi Shekar' via isar-users @ 2025-03-12 9:07 UTC (permalink / raw)
To: isar-users; +Cc: Kasturi Shekar
- Fixed the issue where the --psplash-pipe flag was not working in
bmap-tools version 3.6 (Bookworm).
- Added a patch to ensure the correct handling of the --psplash-pipe
flag and avoid skipping the _psplash_pipe section when _progress_file
is null.
- With this fix, psplash can now be used with bmap-tools(v3.6) to properly
display progress updates.
Debian is not going to fix it in bookworm, Reference:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034290
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100092
Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
---
.../bmap-tools/bmap-tools.bb | 21 +++++
...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++
...e-part-was-skipped-when-_progress_fi.patch | 78 +++++++++++++++++++
.../deploy-image/deploy-image_0.1.bb | 1 +
4 files changed, 128 insertions(+)
create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
new file mode 100644
index 00000000..376ab433
--- /dev/null
+++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
@@ -0,0 +1,21 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2025
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg
+
+SRC_URI = "apt://${BPN}"
+PN = "bmap-tools"
+CHANGELOG_V="<orig-version>+isar"
+
+SRC_URI += "file://0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch;apply=no \
+ file://0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch;apply=no"
+
+do_prepare_build:append() {
+ deb_add_changelog
+
+ cd ${S}
+ quilt import -f ${WORKDIR}/*.patch
+ quilt push -a
+}
diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
new file mode 100644
index 00000000..a45bcbc4
--- /dev/null
+++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
@@ -0,0 +1,28 @@
+From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17 00:00:00 2001
+From: Jason <zxcv1884@gmail.com>
+Date: Wed, 26 Jan 2022 16:26:47 +0800
+Subject: [PATCH] Fix path parameter passing error of set_psplash_pipe function
+
+---
+ bmaptools/BmapCopy.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
+index c6a2603..dba24a5 100644
+--- a/bmaptools/BmapCopy.py
++++ b/bmaptools/BmapCopy.py
+@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path):
+ a best effort.
+ """
+
+- if os.path.exists(pipe) and stat.S_ISFIFO(os.stat(pipe).st_mode):
+- self._psplash_pipe = pipe
++ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode):
++ self._psplash_pipe = path
+ else:
+ _log.warning("'%s' is not a pipe, so psplash progress will not be "
+- "updated" % pipe)
++ "updated" % path)
+
+ def set_progress_indicator(self, file_obj, format_string):
+ """
diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
new file mode 100644
index 00000000..bf17a7d1
--- /dev/null
+++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
@@ -0,0 +1,78 @@
+From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17 00:00:00 2001
+From: Jason <zxcv1884@gmail.com>
+Date: Mon, 7 Feb 2022 17:55:16 +0800
+Subject: [PATCH] Fix _psplash_pipe part was skipped when _progress_file is
+ null
+
+---
+ bmaptools/BmapCopy.py | 56 +++++++++++++++++++++----------------------
+ 1 file changed, 27 insertions(+), 29 deletions(-)
+
+diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
+index dba24a5..ca22aba 100644
+--- a/bmaptools/BmapCopy.py
++++ b/bmaptools/BmapCopy.py
+@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written):
+ else:
+ _log.debug("wrote %d blocks" % blocks_written)
+
+- if not self._progress_file:
+- return
+-
+- if self.mapped_cnt:
+- progress = '\r' + self._progress_format % percent + '\n'
+- else:
+- # Do not rotate the wheel too fast
+- now = datetime.datetime.now()
+- min_delta = datetime.timedelta(milliseconds=250)
+- if now - self._progress_time < min_delta:
+- return
+- self._progress_time = now
+-
+- progress_wheel = ('-', '\\', '|', '/')
+- progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
+- self._progress_index += 1
+-
+- # This is a little trick we do in order to make sure that the next
+- # message will always start from a new line - we switch to the new
+- # line after each progress update and move the cursor up. As an
+- # example, this is useful when the copying is interrupted by an
+- # exception - the error message will start form new line.
+- if self._progress_started:
+- # The "move cursor up" escape sequence
+- self._progress_file.write('\033[1A') # pylint: disable=W1401
+- else:
+- self._progress_started = True
++ if self._progress_file:
++ if self.mapped_cnt:
++ progress = '\r' + self._progress_format % percent + '\n'
++ else:
++ # Do not rotate the wheel too fast
++ now = datetime.datetime.now()
++ min_delta = datetime.timedelta(milliseconds=250)
++ if now - self._progress_time < min_delta:
++ return
++ self._progress_time = now
++
++ progress_wheel = ('-', '\\', '|', '/')
++ progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
++ self._progress_index += 1
++
++ # This is a little trick we do in order to make sure that the next
++ # message will always start from a new line - we switch to the new
++ # line after each progress update and move the cursor up. As an
++ # example, this is useful when the copying is interrupted by an
++ # exception - the error message will start form new line.
++ if self._progress_started:
++ # The "move cursor up" escape sequence
++ self._progress_file.write('\033[1A') # pylint: disable=W1401
++ else:
++ self._progress_started = True
+
+- self._progress_file.write(progress)
+- self._progress_file.flush()
++ self._progress_file.write(progress)
++ self._progress_file.flush()
+
+ # Update psplash progress when configured. This is using a best effort
+ # strategy to not affect the writing process when psplash breaks, is
diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
index 242ca88e..54e521b5 100644
--- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
+++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
@@ -10,6 +10,7 @@ inherit dpkg-raw
SRC_URI = "file://usr/bin/deploy-image-wic.sh \
file://usr/lib/deploy-image-wic/handle-config.sh \
"
+DEPENDS:bookworm += "bmap-tools"
DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk, gdisk, pigz, xz-utils, pbzip2, zstd"
do_install[cleandirs] = "${D}/usr/bin/ \
${D}/usr/lib/deploy-image-wic \
--
2.39.5
--
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 visit https://groups.google.com/d/msgid/isar-users/20250312090753.566643-1-kasturi.shekar%40siemens.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
2025-03-12 9:07 ` [PATCH v3] " 'Kasturi Shekar' via isar-users
@ 2025-03-13 9:58 ` 'Jan Kiszka' via isar-users
2025-03-14 6:58 ` 'Shekar, Kasturi' via isar-users
2025-03-27 10:32 ` Uladzimir Bely
1 sibling, 1 reply; 8+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-03-13 9:58 UTC (permalink / raw)
To: Kasturi Shekar, isar-users
On 12.03.25 10:07, 'Kasturi Shekar' via isar-users wrote:
> - Fixed the issue where the --psplash-pipe flag was not working in
> bmap-tools version 3.6 (Bookworm).
> - Added a patch to ensure the correct handling of the --psplash-pipe
> flag and avoid skipping the _psplash_pipe section when _progress_file
> is null.
> - With this fix, psplash can now be used with bmap-tools(v3.6) to properly
> display progress updates.
>
> Debian is not going to fix it in bookworm, Reference:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034290
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100092
>
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
> .../bmap-tools/bmap-tools.bb | 21 +++++
> ...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++
> ...e-part-was-skipped-when-_progress_fi.patch | 78 +++++++++++++++++++
> .../deploy-image/deploy-image_0.1.bb | 1 +
> 4 files changed, 128 insertions(+)
> create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
> create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
>
> diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> new file mode 100644
> index 00000000..376ab433
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> @@ -0,0 +1,21 @@
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2025
> +#
> +# SPDX-License-Identifier: MIT
> +
> +inherit dpkg
> +
> +SRC_URI = "apt://${BPN}"
> +PN = "bmap-tools"
> +CHANGELOG_V="<orig-version>+isar"
> +
> +SRC_URI += "file://0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch;apply=no \
> + file://0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch;apply=no"
> +
> +do_prepare_build:append() {
> + deb_add_changelog
> +
> + cd ${S}
> + quilt import -f ${WORKDIR}/*.patch
> + quilt push -a
> +}
> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
> new file mode 100644
> index 00000000..a45bcbc4
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch
> @@ -0,0 +1,28 @@
> +From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17 00:00:00 2001
> +From: Jason <zxcv1884@gmail.com>
> +Date: Wed, 26 Jan 2022 16:26:47 +0800
> +Subject: [PATCH] Fix path parameter passing error of set_psplash_pipe function
> +
> +---
> + bmaptools/BmapCopy.py | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
> +index c6a2603..dba24a5 100644
> +--- a/bmaptools/BmapCopy.py
> ++++ b/bmaptools/BmapCopy.py
> +@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path):
> + a best effort.
> + """
> +
> +- if os.path.exists(pipe) and stat.S_ISFIFO(os.stat(pipe).st_mode):
> +- self._psplash_pipe = pipe
> ++ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode):
> ++ self._psplash_pipe = path
> + else:
> + _log.warning("'%s' is not a pipe, so psplash progress will not be "
> +- "updated" % pipe)
> ++ "updated" % path)
> +
> + def set_progress_indicator(self, file_obj, format_string):
> + """
> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
> new file mode 100644
> index 00000000..bf17a7d1
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch
> @@ -0,0 +1,78 @@
> +From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17 00:00:00 2001
> +From: Jason <zxcv1884@gmail.com>
> +Date: Mon, 7 Feb 2022 17:55:16 +0800
> +Subject: [PATCH] Fix _psplash_pipe part was skipped when _progress_file is
> + null
> +
> +---
> + bmaptools/BmapCopy.py | 56 +++++++++++++++++++++----------------------
> + 1 file changed, 27 insertions(+), 29 deletions(-)
> +
> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
> +index dba24a5..ca22aba 100644
> +--- a/bmaptools/BmapCopy.py
> ++++ b/bmaptools/BmapCopy.py
> +@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written):
> + else:
> + _log.debug("wrote %d blocks" % blocks_written)
> +
> +- if not self._progress_file:
> +- return
> +-
> +- if self.mapped_cnt:
> +- progress = '\r' + self._progress_format % percent + '\n'
> +- else:
> +- # Do not rotate the wheel too fast
> +- now = datetime.datetime.now()
> +- min_delta = datetime.timedelta(milliseconds=250)
> +- if now - self._progress_time < min_delta:
> +- return
> +- self._progress_time = now
> +-
> +- progress_wheel = ('-', '\\', '|', '/')
> +- progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
> +- self._progress_index += 1
> +-
> +- # This is a little trick we do in order to make sure that the next
> +- # message will always start from a new line - we switch to the new
> +- # line after each progress update and move the cursor up. As an
> +- # example, this is useful when the copying is interrupted by an
> +- # exception - the error message will start form new line.
> +- if self._progress_started:
> +- # The "move cursor up" escape sequence
> +- self._progress_file.write('\033[1A') # pylint: disable=W1401
> +- else:
> +- self._progress_started = True
> ++ if self._progress_file:
> ++ if self.mapped_cnt:
> ++ progress = '\r' + self._progress_format % percent + '\n'
> ++ else:
> ++ # Do not rotate the wheel too fast
> ++ now = datetime.datetime.now()
> ++ min_delta = datetime.timedelta(milliseconds=250)
> ++ if now - self._progress_time < min_delta:
> ++ return
> ++ self._progress_time = now
> ++
> ++ progress_wheel = ('-', '\\', '|', '/')
> ++ progress = '\r' + progress_wheel[self._progress_index % 4] + '\n'
> ++ self._progress_index += 1
> ++
> ++ # This is a little trick we do in order to make sure that the next
> ++ # message will always start from a new line - we switch to the new
> ++ # line after each progress update and move the cursor up. As an
> ++ # example, this is useful when the copying is interrupted by an
> ++ # exception - the error message will start form new line.
> ++ if self._progress_started:
> ++ # The "move cursor up" escape sequence
> ++ self._progress_file.write('\033[1A') # pylint: disable=W1401
> ++ else:
> ++ self._progress_started = True
> +
> +- self._progress_file.write(progress)
> +- self._progress_file.flush()
> ++ self._progress_file.write(progress)
> ++ self._progress_file.flush()
> +
> + # Update psplash progress when configured. This is using a best effort
> + # strategy to not affect the writing process when psplash breaks, is
> diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> index 242ca88e..54e521b5 100644
> --- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> @@ -10,6 +10,7 @@ inherit dpkg-raw
> SRC_URI = "file://usr/bin/deploy-image-wic.sh \
> file://usr/lib/deploy-image-wic/handle-config.sh \
> "
> +DEPENDS:bookworm += "bmap-tools"
Missed that so far: This should be limited to Debian versions what it is
needed and where it fits. Definitely excludes anything > bookworm. Best
would be opt-in here.
Jan
> DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk, gdisk, pigz, xz-utils, pbzip2, zstd"
> do_install[cleandirs] = "${D}/usr/bin/ \
> ${D}/usr/lib/deploy-image-wic \
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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 visit https://groups.google.com/d/msgid/isar-users/1c9611b3-7e67-4079-86b6-543d3125b17f%40siemens.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v3] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
2025-03-13 9:58 ` 'Jan Kiszka' via isar-users
@ 2025-03-14 6:58 ` 'Shekar, Kasturi' via isar-users
2025-03-14 7:01 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 8+ messages in thread
From: 'Shekar, Kasturi' via isar-users @ 2025-03-14 6:58 UTC (permalink / raw)
To: Kiszka, Jan, isar-users
Jan,
The patches will only work with bookworm and above as implementation of psplash is done in version 3.6 and bullseye has version 3.5
Thanks
Kasturi
--
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 visit https://groups.google.com/d/msgid/isar-users/SG2PR06MB5311704F3802EE332A2880EC94D22%40SG2PR06MB5311.apcprd06.prod.outlook.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
2025-03-14 6:58 ` 'Shekar, Kasturi' via isar-users
@ 2025-03-14 7:01 ` 'Jan Kiszka' via isar-users
0 siblings, 0 replies; 8+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-03-14 7:01 UTC (permalink / raw)
To: Shekar, Kasturi (FT FDS CES LX PBU 2), isar-users
On 14.03.25 07:58, Shekar, Kasturi (FT FDS CES LX PBU 2) wrote:
> Jan,
>
> The patches will only work with bookworm and above as implementation of psplash is done in version 3.6 and bullseye has version 3.5
>
Ah, right, overread that you already had ":bookworm". All fine then!
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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 visit https://groups.google.com/d/msgid/isar-users/d35a3df8-f7b6-4933-9caa-e8adbf0c5e8b%40siemens.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm)
2025-03-12 9:07 ` [PATCH v3] " 'Kasturi Shekar' via isar-users
2025-03-13 9:58 ` 'Jan Kiszka' via isar-users
@ 2025-03-27 10:32 ` Uladzimir Bely
1 sibling, 0 replies; 8+ messages in thread
From: Uladzimir Bely @ 2025-03-27 10:32 UTC (permalink / raw)
To: Kasturi Shekar, isar-users
On Wed, 2025-03-12 at 14:37 +0530, 'Kasturi Shekar' via isar-users
wrote:
> - Fixed the issue where the --psplash-pipe flag was not working in
> bmap-tools version 3.6 (Bookworm).
> - Added a patch to ensure the correct handling of the --psplash-pipe
> flag and avoid skipping the _psplash_pipe section when
> _progress_file
> is null.
> - With this fix, psplash can now be used with bmap-tools(v3.6) to
> properly
> display progress updates.
>
> Debian is not going to fix it in bookworm, Reference:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034290
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100092
>
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
> .../bmap-tools/bmap-tools.bb | 21 +++++
> ...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++
> ...e-part-was-skipped-when-_progress_fi.patch | 78
> +++++++++++++++++++
> .../deploy-image/deploy-image_0.1.bb | 1 +
> 4 files changed, 128 insertions(+)
> create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-
> tools.bb
> create mode 100644 meta-isar/recipes-installer/bmap-
> tools/files/0001-Fix-path-parameter-passing-error-of-
> set_psplash_pipe.patch
> create mode 100644 meta-isar/recipes-installer/bmap-
> tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-
> _progress_fi.patch
>
> diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> new file mode 100644
> index 00000000..376ab433
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb
> @@ -0,0 +1,21 @@
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2025
> +#
> +# SPDX-License-Identifier: MIT
> +
> +inherit dpkg
> +
> +SRC_URI = "apt://${BPN}"
> +PN = "bmap-tools"
> +CHANGELOG_V="<orig-version>+isar"
> +
> +SRC_URI +=
> "file://0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.pat
> ch;apply=no \
> +
> file://0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch;apply=no
> "
> +
> +do_prepare_build:append() {
> + deb_add_changelog
> +
> + cd ${S}
> + quilt import -f ${WORKDIR}/*.patch
> + quilt push -a
> +}
> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-
> path-parameter-passing-error-of-set_psplash_pipe.patch b/meta-
> isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-
> passing-error-of-set_psplash_pipe.patch
> new file mode 100644
> index 00000000..a45bcbc4
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-
> parameter-passing-error-of-set_psplash_pipe.patch
> @@ -0,0 +1,28 @@
> +From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17 00:00:00
> 2001
> +From: Jason <zxcv1884@gmail.com>
> +Date: Wed, 26 Jan 2022 16:26:47 +0800
> +Subject: [PATCH] Fix path parameter passing error of
> set_psplash_pipe function
> +
> +---
> + bmaptools/BmapCopy.py | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
> +index c6a2603..dba24a5 100644
> +--- a/bmaptools/BmapCopy.py
> ++++ b/bmaptools/BmapCopy.py
> +@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path):
> + a best effort.
> + """
> +
> +- if os.path.exists(pipe) and
> stat.S_ISFIFO(os.stat(pipe).st_mode):
> +- self._psplash_pipe = pipe
> ++ if os.path.exists(path) and
> stat.S_ISFIFO(os.stat(path).st_mode):
> ++ self._psplash_pipe = path
> + else:
> + _log.warning("'%s' is not a pipe, so psplash progress
> will not be "
> +- "updated" % pipe)
> ++ "updated" % path)
> +
> + def set_progress_indicator(self, file_obj, format_string):
> + """
> diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-
> _psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-
> isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-
> was-skipped-when-_progress_fi.patch
> new file mode 100644
> index 00000000..bf17a7d1
> --- /dev/null
> +++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-
> _psplash_pipe-part-was-skipped-when-_progress_fi.patch
> @@ -0,0 +1,78 @@
> +From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17 00:00:00
> 2001
> +From: Jason <zxcv1884@gmail.com>
> +Date: Mon, 7 Feb 2022 17:55:16 +0800
> +Subject: [PATCH] Fix _psplash_pipe part was skipped when
> _progress_file is
> + null
> +
> +---
> + bmaptools/BmapCopy.py | 56 +++++++++++++++++++++-------------------
> ---
> + 1 file changed, 27 insertions(+), 29 deletions(-)
> +
> +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
> +index dba24a5..ca22aba 100644
> +--- a/bmaptools/BmapCopy.py
> ++++ b/bmaptools/BmapCopy.py
> +@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written):
> + else:
> + _log.debug("wrote %d blocks" % blocks_written)
> +
> +- if not self._progress_file:
> +- return
> +-
> +- if self.mapped_cnt:
> +- progress = '\r' + self._progress_format % percent +
> '\n'
> +- else:
> +- # Do not rotate the wheel too fast
> +- now = datetime.datetime.now()
> +- min_delta = datetime.timedelta(milliseconds=250)
> +- if now - self._progress_time < min_delta:
> +- return
> +- self._progress_time = now
> +-
> +- progress_wheel = ('-', '\\', '|', '/')
> +- progress = '\r' + progress_wheel[self._progress_index %
> 4] + '\n'
> +- self._progress_index += 1
> +-
> +- # This is a little trick we do in order to make sure that
> the next
> +- # message will always start from a new line - we switch to
> the new
> +- # line after each progress update and move the cursor up.
> As an
> +- # example, this is useful when the copying is interrupted
> by an
> +- # exception - the error message will start form new line.
> +- if self._progress_started:
> +- # The "move cursor up" escape sequence
> +- self._progress_file.write('\033[1A') # pylint:
> disable=W1401
> +- else:
> +- self._progress_started = True
> ++ if self._progress_file:
> ++ if self.mapped_cnt:
> ++ progress = '\r' + self._progress_format % percent +
> '\n'
> ++ else:
> ++ # Do not rotate the wheel too fast
> ++ now = datetime.datetime.now()
> ++ min_delta = datetime.timedelta(milliseconds=250)
> ++ if now - self._progress_time < min_delta:
> ++ return
> ++ self._progress_time = now
> ++
> ++ progress_wheel = ('-', '\\', '|', '/')
> ++ progress = '\r' +
> progress_wheel[self._progress_index % 4] + '\n'
> ++ self._progress_index += 1
> ++
> ++ # This is a little trick we do in order to make sure
> that the next
> ++ # message will always start from a new line - we switch
> to the new
> ++ # line after each progress update and move the cursor
> up. As an
> ++ # example, this is useful when the copying is
> interrupted by an
> ++ # exception - the error message will start form new
> line.
> ++ if self._progress_started:
> ++ # The "move cursor up" escape sequence
> ++ self._progress_file.write('\033[1A') # pylint:
> disable=W1401
> ++ else:
> ++ self._progress_started = True
> +
> +- self._progress_file.write(progress)
> +- self._progress_file.flush()
> ++ self._progress_file.write(progress)
> ++ self._progress_file.flush()
> +
> + # Update psplash progress when configured. This is using a
> best effort
> + # strategy to not affect the writing process when psplash
> breaks, is
> diff --git a/meta-isar/recipes-installer/deploy-image/deploy-
> image_0.1.bb b/meta-isar/recipes-installer/deploy-image/deploy-
> image_0.1.bb
> index 242ca88e..54e521b5 100644
> --- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> @@ -10,6 +10,7 @@ inherit dpkg-raw
> SRC_URI = "file://usr/bin/deploy-image-wic.sh \
> file://usr/lib/deploy-image-wic/handle-config.sh \
> "
> +DEPENDS:bookworm += "bmap-tools"
> DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk,
> gdisk, pigz, xz-utils, pbzip2, zstd"
> do_install[cleandirs] = "${D}/usr/bin/ \
> ${D}/usr/lib/deploy-image-wic \
> --
> 2.39.5
Applied to next, thanks.
--
Best regards,
Uladzimir.
--
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 visit https://groups.google.com/d/msgid/isar-users/3ee7daaf2a5de6690c8cc4b3a6789d4ea0ba3309.camel%40ilbers.de.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-03-27 10:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <rBT7pjX7j20>
2025-03-12 6:50 ` [PATCH v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm) 'Kasturi Shekar' via isar-users
2025-03-12 6:51 ` 'Shekar, Kasturi' via isar-users
2025-03-12 7:35 ` 'Jan Kiszka' via isar-users
2025-03-12 9:07 ` [PATCH v3] " 'Kasturi Shekar' via isar-users
2025-03-13 9:58 ` 'Jan Kiszka' via isar-users
2025-03-14 6:58 ` 'Shekar, Kasturi' via isar-users
2025-03-14 7:01 ` 'Jan Kiszka' via isar-users
2025-03-27 10:32 ` Uladzimir Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox