public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] Fix ZeroDivisionError for kernels without modules
@ 2026-04-17 11:40 'Stefan Koch' via isar-users
  2026-04-17 12:10 ` 'MOESSBAUER, Felix' via isar-users
  2026-04-22 10:27 ` Zhihang Wei
  0 siblings, 2 replies; 3+ messages in thread
From: 'Stefan Koch' via isar-users @ 2026-04-17 11:40 UTC (permalink / raw)
  To: isar-users
  Cc: stefan-koch, jan.kiszka, christian.storm, michael.adler,
	daniel.schertler, becker, felix.moessbauer, ubely

Ensure that `num_pkgs` is at least 1 to avoid division by zero.

Fixes: 938dab36 ("Report approximate progress during initrd generation")

Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
---
 meta/lib/rootfs_progress.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/rootfs_progress.py b/meta/lib/rootfs_progress.py
index 6feed9df..58d16574 100644
--- a/meta/lib/rootfs_progress.py
+++ b/meta/lib/rootfs_progress.py
@@ -77,7 +77,7 @@ class InitrdProgressHandler(PkgsProgressHandler):
         m = re.search(r'^Total number of modules: ([0-9]+)', line)
         if m:
             # in MODULES=most mode, we install ~half of all modules
-            self._num_pkgs = int(m.group(1)) // 2
+            self._num_pkgs = max(1, int(m.group(1)) // 2)
             self._stage = 'post-prepare'
 
     def process_line(self, line):
-- 
2.47.3

-- 
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/20260417114032.1255396-1-stefan-koch%40siemens.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Fix ZeroDivisionError for kernels without modules
  2026-04-17 11:40 [PATCH v2] Fix ZeroDivisionError for kernels without modules 'Stefan Koch' via isar-users
@ 2026-04-17 12:10 ` 'MOESSBAUER, Felix' via isar-users
  2026-04-22 10:27 ` Zhihang Wei
  1 sibling, 0 replies; 3+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2026-04-17 12:10 UTC (permalink / raw)
  To: Koch, Stefan, isar-users
  Cc: Kiszka, Jan, Storm, Christian, Adler, Michael, Schertler, Daniel,
	Becker, Sascha, ubely

On Fri, 2026-04-17 at 13:40 +0200, Stefan Koch wrote:
> Ensure that `num_pkgs` is at least 1 to avoid division by zero.
> 
> Fixes: 938dab36 ("Report approximate progress during initrd generation")

Thanks!

Reviewed-by: Felix Moessbauer <felix.moessbauer@siemens.com>

This should also go into the v1.0.1 release.

Felix

> 
> Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
> ---
>  meta/lib/rootfs_progress.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/lib/rootfs_progress.py b/meta/lib/rootfs_progress.py
> index 6feed9df..58d16574 100644
> --- a/meta/lib/rootfs_progress.py
> +++ b/meta/lib/rootfs_progress.py
> @@ -77,7 +77,7 @@ class InitrdProgressHandler(PkgsProgressHandler):
>          m = re.search(r'^Total number of modules: ([0-9]+)', line)
>          if m:
>              # in MODULES=most mode, we install ~half of all modules
> -            self._num_pkgs = int(m.group(1)) // 2
> +            self._num_pkgs = max(1, int(m.group(1)) // 2)
>              self._stage = 'post-prepare'
>  
>      def process_line(self, line):
> -- 
> 2.47.3

-- 
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/90eddff3bc46d2f426843c8adeb9b354f7e5cc5f.camel%40siemens.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Fix ZeroDivisionError for kernels without modules
  2026-04-17 11:40 [PATCH v2] Fix ZeroDivisionError for kernels without modules 'Stefan Koch' via isar-users
  2026-04-17 12:10 ` 'MOESSBAUER, Felix' via isar-users
@ 2026-04-22 10:27 ` Zhihang Wei
  1 sibling, 0 replies; 3+ messages in thread
From: Zhihang Wei @ 2026-04-22 10:27 UTC (permalink / raw)
  To: Stefan Koch, isar-users
  Cc: jan.kiszka, christian.storm, michael.adler, daniel.schertler,
	becker, felix.moessbauer, ubely

Applied to next, thanks.

Zhihang

On 4/17/26 13:40, 'Stefan Koch' via isar-users wrote:
> Ensure that `num_pkgs` is at least 1 to avoid division by zero.
>
> Fixes: 938dab36 ("Report approximate progress during initrd generation")
>
> Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
> ---
>   meta/lib/rootfs_progress.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/lib/rootfs_progress.py b/meta/lib/rootfs_progress.py
> index 6feed9df..58d16574 100644
> --- a/meta/lib/rootfs_progress.py
> +++ b/meta/lib/rootfs_progress.py
> @@ -77,7 +77,7 @@ class InitrdProgressHandler(PkgsProgressHandler):
>           m = re.search(r'^Total number of modules: ([0-9]+)', line)
>           if m:
>               # in MODULES=most mode, we install ~half of all modules
> -            self._num_pkgs = int(m.group(1)) // 2
> +            self._num_pkgs = max(1, int(m.group(1)) // 2)
>               self._stage = 'post-prepare'
>   
>       def process_line(self, line):

-- 
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/2ee995cf-88b4-4d84-98ba-4429ac37e254%40ilbers.de.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-22 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-17 11:40 [PATCH v2] Fix ZeroDivisionError for kernels without modules 'Stefan Koch' via isar-users
2026-04-17 12:10 ` 'MOESSBAUER, Felix' via isar-users
2026-04-22 10:27 ` Zhihang Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox