Bug#275882: addition to Bug#275882: os-prober: [patch]windows NT/2000/XP refinement
changes:
- added test for long to be non-empty in case boot.ini fails to be parsed
- added exit 0 at the end (more consistent with others)
- added '=' to the grep in evaloation of defaultmspart
--
Regards,
EddyP
--- 20microsoft_orig 2004-10-10 20:01:39.000000000 +0300
+++ 20microsoft 2004-10-10 23:33:55.000000000 +0300
@@ -19,6 +19,20 @@
if [ -e "$2/ntldr" -a -e "$2/NTDETECT.COM" ]; then
long="Windows NT/2000/XP"
short=Windows
+ if [ -e "$2/boot.ini" ]; then
+ multicount=`grep -q -e "^multi" boot.ini | wc -l`
+ scsicount=`grep -q -e "^scsi" boot.ini | wc -l`
+ msoscount=`expr ${multicount} + ${scsicount}`
+ if [ $msoscount -eq 1 ]; then
+ defaultmspart=`grep -e "^default=" $2/boot.ini | cut -d '=' -f2 | cut -d '\' -f1`
+ long=`grep -e "^$defaultmspart" $2/boot.ini | cut -d '"' -f2`
+ if [ -z $long ]; then
+ long='Windows NT/2000/XP'
+ fi
+ else
+ long='Windows NT/2000/XP (loader)'
+ fi
+ fi
# MS-DOS
elif [ -d "$2/dos" ]; then
long="MS-DOS 5.x/6.x/Win3.1"
@@ -33,3 +47,4 @@
label=$(count_next_label $short)
result "${partition}:${long}:${short}:chain"
+exit 0
Reply to: