[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#741889: os-prober: The 90fallback script lists the least recent kernels first



Hi,

well, there is no perfect solution. Someone may want to install an
older kernel for testing or something, but keep the new one as a
default, for other users of the system for example. In this case time
based ordering would not be accurate.

I have no experience with other distros, but the debian based ones
have a numbering schema allowing alphabetical ordering, not
accidentally I guess ;) So, this should be safe. If someone plays with
the numbering - well, aren't they asking for trouble?

Also, grub's behaviour in general is to favor more recent kernels over
older ones, as any update makes the freshly installed one default, so
this is what I would expect.

Maybe adding an option is the best solution here, if it is possible?

Regards,

WG

2014-03-17 1:41 GMT+01:00 Cyril Brulebois <kibi@debian.org>:
> Wojciech Górski <wgorski1@gmail.com> (2014-03-17):
>> Package: os-prober
>> Version: 1.63
>> Severity: normal
>> Tags: patch
>>
>> Hi,
>>
>> when detecting kernels on a linux system without grub/lilo, the 90fallback
>> script is used, which looks for kernel/image files in a few well-known
>> locations using 'ls'. This makes the output least-recent-first ordered, causing
>> grub to use the oldest kernel as default, making it necessary to use a submenu
>> to boot the most recent one.
>>
>> Attaching a patch reversing the ordering.
>
> Thanks.
>
> If we're going to fix that, don't we want to be sorting based on time
> (-t), instead sorting alphabetically (the default). Ideally we could
> do version-based sorting, but then people might come up with funny
> versioning schemes, so time-based looks better to me at first glance.
>
> Thoughts?
>
>> --- linux-boot-probes/mounted/common/90fallback       2011-02-10 03:00:20.000000000 +0100
>> +++ linux-boot-probes/mounted/common/90fallback.new   2014-03-17 00:56:49.001460861 +0100
>> @@ -19,7 +19,7 @@
>>       else
>>               kernbootpart="$partition"
>>       fi
>> -     for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do
>> +     for kernfile in $(eval ls -r "$mpoint$kernpat" 2>/dev/null); do
>>               kernbasefile=$(echo "$kernfile" | sed "s!^$mpoint!!")
>>               if [ -f "$kernfile" ] && [ ! -L "$kernfile" ]; then
>>                       initrdname=$(echo "$kernfile" | sed "s/vmlinu[zx]/initrd\*/")
>
> Mraw,
> KiBi.


Reply to: