Processed: Re: Bug#1142788: os-prober fails to detect Windows Boot Manager under tr_TR.UTF-8 locale

2026-07-30 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + pending
Bug #1142788 [os-prober] os-prober fails to detect Windows Boot Manager under 
tr_TR.UTF-8 locale
Added tag(s) pending.

-- 
1142788: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1142788
Debian Bug Tracking System
Contact [email protected] with problems



Bug#1142788: os-prober fails to detect Windows Boot Manager under tr_TR.UTF-8 locale

2026-07-30 Thread Holger Wansing
Control: tags -1 + pending


Hi,

Steve McIntyre  wrote (Thu, 30 Jul 2026 11:35:04 +0100):
> On Thu, Jul 30, 2026 at 12:29:43PM +0200, Holger Wansing wrote:
> >Subject to another/better ideas, and until a final fix arrives, my proposal
> >would be, to add "LC_ALL=C" to the command for now.
> >
> >Thoughts/objections anyone?
> 
> That's exactly the right thing, yeah.

Pushed to git.


Holger


-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#1142788: os-prober fails to detect Windows Boot Manager under tr_TR.UTF-8 locale

2026-07-30 Thread Cyril Brulebois
Hi,

Erol SANER  (2026-07-26):
> Under tr_TR.UTF-8:
> 
>     ls -1 /boot/efi | grep -i '^efi$'
> 
> returns no output.

This would:

echo EFI | grep -i '^efı$'

with the final character before the anchor on the right being:

U+0131 LATIN SMALL LETTER DOTLESS I

And this would:

echo EFİ | grep -i '^efi$'

with the final character in the echo being:

U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE

The presence/absence of the dot being significant in Turkish:
  https://en.wikipedia.org/wiki/Turkish_alphabet

And yes, as Steve hinted, setting LC_ALL=C is the way to go: we don't
want to have to know about (or be exposed to) locale-dependent fun here.


Cheers,
-- 
Cyril Brulebois ([email protected])
D-I release manager -- Release team member -- Freelance Consultant


signature.asc
Description: PGP signature


Bug#1142788: os-prober fails to detect Windows Boot Manager under tr_TR.UTF-8 locale

2026-07-30 Thread Steve McIntyre
On Thu, Jul 30, 2026 at 12:29:43PM +0200, Holger Wansing wrote:
>Hi Erol,
>
>Am 26. Juli 2026 02:23:34 MESZ schrieb Erol SANER :
>>
>>Additional testing showed:
>>
>>Under tr_TR.UTF-8:
>>
>>    ls -1 /boot/efi | grep -i '^efi$'
>>
>>returns no output.
>>
>>Under the C locale:
>>
>>    LC_ALL=C sh -c 'ls -1 /boot/efi | grep -i "^efi$"'
>>
>>correctly returns:
>>
>>    EFI
>
>Thanks for your exact analysis.
>
>Subject to another/better ideas, and until a final fix arrives, my proposal 
>would be, to add "LC_ALL=C" to the command for now.
>
>Thoughts/objections anyone?

That's exactly the right thing, yeah.

-- 
Steve McIntyre, Cambridge, [email protected]
"I've only once written 'SQL is my bitch' in a comment. But that code 
 is in use on a military site..." -- Simon Booth



Bug#1142788: os-prober fails to detect Windows Boot Manager under tr_TR.UTF-8 locale

2026-07-30 Thread Holger Wansing
Hi Erol,

Am 26. Juli 2026 02:23:34 MESZ schrieb Erol SANER :
>
>Additional testing showed:
>
>Under tr_TR.UTF-8:
>
>    ls -1 /boot/efi | grep -i '^efi$'
>
>returns no output.
>
>Under the C locale:
>
>    LC_ALL=C sh -c 'ls -1 /boot/efi | grep -i "^efi$"'
>
>correctly returns:
>
>    EFI

Thanks for your exact analysis.

Subject to another/better ideas, and until a final fix arrives, my proposal 
would be, to add "LC_ALL=C" to the command for now.

Thoughts/objections anyone?


Holger



-- 
Sent from /e/ OS on Fairphone3



Bug#1142788: os-prober fails to detect Windows Boot Manager under tr_TR.UTF-8 locale

2026-07-25 Thread Erol SANER

Package: os-prober
Version: 1.83
Severity: normal

Dear Debian os-prober maintainers,

I would like to report what appears to be a locale-dependent bug in
os-prober affecting Windows Boot Manager detection.

System
--

Distribution: Debian 13 (Trixie)
Package: os-prober 1.83
Locale: tr_TR.UTF-8
Boot mode: UEFI
Disk layout:
  - EFI System Partition (FAT32)
  - Windows Boot Manager
  - Debian GNU/Linux

Problem
---

Running:

    sudo update-grub

does not detect the existing Windows Boot Manager.

The generated GRUB configuration only contains Linux entries.

However, running:

    sudo LC_ALL=C update-grub

correctly reports:

    Found Windows Boot Manager on
    /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi

and Windows is added to the GRUB menu.

Investigation
-

The EFI System Partition was verified to be correct.

The following all succeed:

- EFI partition mounts correctly.
- /boot/efi/EFI exists.
- /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi exists.
- efibootmgr shows Windows Boot Manager.
- The Microsoft probe:

      /usr/lib/os-probes/mounted/efi/20microsoft /boot/efi/EFI

  correctly detects Windows.

Tracing os-prober using:

    sh -x /usr/bin/os-prober

showed that it executes:

    /usr/lib/os-probes/mounted/05efi

Tracing that script further shows that it exits with:

    /boot/efi does not have /EFI directory

even though the directory exists.

The relevant helper function is:

    item_in_dir()

defined in:

    /usr/share/os-prober/common.sh

which performs:

    ls -1 "$2" | grep -i "^$1$"

Additional testing showed:

Under tr_TR.UTF-8:

    ls -1 /boot/efi | grep -i '^efi$'

returns no output.

Under the C locale:

    LC_ALL=C sh -c 'ls -1 /boot/efi | grep -i "^efi$"'

correctly returns:

    EFI

This strongly suggests that the failure is locale-dependent.

Expected behaviour
--

Windows Boot Manager should be detected regardless of the user's locale.

Workaround
--

Running:

    sudo LC_ALL=C update-grub

correctly detects Windows and generates the expected GRUB entry.

Possible cause
--

The failure appears to be related to locale-sensitive case-insensitive
matching inside item_in_dir(). The helper should ideally perform the
comparison in a locale-independent manner.

Investigation performed by:

    Erol Saner
    ChatGPT (OpenAI)

Thank you for maintaining Debian and for your time reviewing this report.