set -e
# grub-mkconfig helper script.
# Copyright (C) 2008,2009,2010 Free Software Foundation, Inc.
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
CYGWIN*) ;;
*) exit 0 ;;
esac
# Try C: even if current system is on other partition.
case "$SYSTEMDRIVE" in
*) exit 0 ;;
esac
{
# Fail if no or more than one partition.
# Search 'default=PARTITION'
# Search 'PARTITION="NAME" ...'
get_os_name_from_boot_ini_name=`sed -n 's,\\\\,/,g;s,^'"$get_os_name_from_boot_ini_part"'="\([^"]*\)".*$,\1,p' "$1" | sed 1q`
}
# Convert to Cygwin path.
test -n "$dir" || continue
# Check for Vista bootmgr.
OS="Windows Vista bootmgr"
# Check for NTLDR.
needmap=t
else
continue
fi
cat << EOF
menuentry "$OS" {
EOF
drivemap -s (hd0) \$root
EOF
cat << EOF
chainloader +1
}
EOF
done