Improved method for getting the name of a windows past Vista
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-prober (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: os-prober
The current method for finding out about a vindows version past vista depends upon a certain string being present in a BCD file for each version. This is unreliable because a) the string may be present even if the related version may not be the default (e.g. on a machine with more than one version of windows) yet it is taken as such and b) for every new version of windows a new test has to be added.
It would be far more reliable to parse the BCD file and take the name of the default entry therein.
Attached is a small tool that is capable of reading single values from NT-registry hives (which the BCD files are). After installing it the default entry can be found with shell code such as the following:
---CUT HERE---
#!/bin/sh
BCD=/windows/
# {9dea862c-
# 23000003 is the default boot option inside the boot manager
# 12000004 is the title of a boot option
BOOT_MGR=$(readhive $BCD \\Objects\
WIN_NAME=$(readhive $BCD \\Objects\
echo "Boots $WIN_NAME by default"
---CUT HERE---
I tested this on my machine with windows server 2008 r2 installed. It should still be tested with other versions of windows and in particular on machines with multiple versions of windows.
I am sorry if this should not be the right place for suggesting a new feature like this. I couldn't find any better.
Best,
Thorsten