]> git.ipfire.org Git - thirdparty/grub.git/commit
templates/kfreebsd: Fix quadratic algorithm for sorting menu items
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Jun 2022 14:08:25 +0000 (10:08 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 4 Jul 2022 12:43:26 +0000 (14:43 +0200)
commit709c19794428d36fa58464299839f1095bcbf285
tree520ca09b197b9b2882b09ab6286a13e5f44d23a8
parent6f27d70a720e4a175ed2cebaaa6f62f3a39e062f
templates/kfreebsd: Fix quadratic algorithm for sorting menu items

The current implementation of the 10_kfreebsd script implements its menu
items sorting in bash with a quadratic algorithm, calling "sed", "sort",
"head", and "grep" to compare versions between individual lines, which
is annoyingly slow for kernel developers who can easily end up with
50-100 kernels in their boot partition.

This fix is ported from the 10_linux script, which has a similar
quadratic code pattern.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: debian-bsd@lists.debian.org
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub.d/10_kfreebsd.in