Message ID | 20250312065027.566489-1-kasturi.shekar@siemens.com |
---|---|
State | Superseded, archived |
Headers | show |
Series | [v2] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm) | expand |
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
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 >
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 \
- 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