[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting
From: |
Mathieu Desnoyers |
Subject: |
Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items |
Date: |
Fri, 20 May 2022 10:33:19 -0400 (EDT) |
----- On May 20, 2022, at 7:01 AM, Daniel Kiper dkiper@net-space.pl wrote:
> On Thu, May 19, 2022 at 04:52:54PM -0400, Mathieu Desnoyers wrote:
>> ----- On May 19, 2022, at 2:36 PM, Daniel Kiper dkiper@net-space.pl wrote:
>> [...]
>> >
>> > Could you do the same in util/grub.d/20_linux_xen.in? Both should be
>> > kept in sync. And you are not first one who updates 10_linux.in only.
>> > If you could make a patch which adds something like "Keep logic in sync
>> > with..." to the util/grub.d/10_linux.in and util/grub.d/20_linux_xen.in
>> > that would be perfect.
>>
>> AFAIU, 20_linux_xen.in does:
>>
>> while [ "x${xen_list}" != "x" ] ; do
>> list="${linux_list}"
>> current_xen=`version_find_latest $xen_list`
>> [....]
>> while [ "x$list" != "x" ] ; do
>> linux=`version_find_latest $list`
>> [...]
>> list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
>> done
>> if [ x"$is_top_level" != xtrue ]; then
>> echo ' }'
>> fi
>> xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr
>> '\n' ' '`
>> done
>>
>> Which adds yet another loop iterating on each item of "xen_list". For each of
>> those,
>> there is an iteration on "linux_list".
>>
>> I can do the change, like I can do the change for other OSes, but I don't
>> have
>> the environment to test those changes. Would you be OK if I submit an
>> untested
>> patch for someone else to try out ?
>
> In case of Xen I think you can CC xen-devel@lists.xenproject.org and ask
> for help there.
I'll do that.
>
>> I notice that 10_hurd.in and 10_kfreebsd.in also have the exact same
>> inefficient
>> pattern.
>
> I think Samuel, CC-ed, could help with Hurd. Samuel? Just CC him when
> you send next patch.
Will do.
>
> I am not sure who could help with FreeBSD.
I'll try debian-bsd@lists.debian.org
>
>> Would you be OK if I also change them and let the change be tested by those
>> who
>> have
>> those environments ?
>
> Yeah, it is OK.
>
> FYI, I am going to push at the beginning of next week Oskari's patch
> which updates both util/grub.d/10_linux.in and util/grub.d/20_linux_xen.in.
> So, please hold on with posting your patches until then to avoid
> conflicts later.
Considering that I'll take some vacation starting end of next week, and
hoping we can get Tested-by tags on the other environment, I would prefer
to send another round of RFC patches today. I don't mind rebasing next week
to submit a final version.
By the way, after taking care of linux, linux_xen, hurd, and kfreebsd, I notice
that I can remove the helper functions version_find_latest(), version_test_gt(),
and version_test_numeric() from grub-mkconfig_lib.in as a cleanup patch. I'll
queue that as well unless anyone objects.
Thanks!
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com