This file is indexed.

/usr/sbin/grub-install is in lupin-support 0.55.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#! /bin/sh
set -e

# grub-install replacement for use in Wubi installations. This arranges for
# the grub bootloader installed on the host (wubildr) to be reinstalled
# rather than installing it to a boot sector.
#
# To get at the real MBR if you wish to do so, use grub-install.real
# instead.
#
# Copyright (C) 2009, 2013 Canonical Ltd.
#
# Lupin is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Lupin 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 Lupin; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.

want_passthrough () {
    while [ $# -gt 0 ]; do
	option="$1"
	shift

	case $option in
	    -h|--help|-v|--version)
		return 0
		;;
	    --debug-image)
		debug_image="$1"
		shift
		;;
	    --debug-image=*)
		debug_image="${option#--debug-image=}"
		;;
	esac
    done
    return 1
}

if want_passthrough "$@" || ! /usr/share/lupin-support/grub-mkimage --test; then
    grub-install.real "$@"
    exit $?
fi

# The C rewrite of grub-install no longer offers --grub-probe or
# --grub-mkimage options, so we now have to roll our own installation.  This
# is arguably clearer anyway, although it's unfortunately verbose and it
# will only work on BIOS.  On the other hand, there is relatively little
# need to track the real grub-install code, as it's now in a different
# language and most of it is unused here anyway.

source_dir=/usr/lib/grub/i386-pc
if [ ! -d "$source_dir" ]; then
    echo "$source_dir doesn't exist; GRUB cannot be installed." >&2
    exit 1
fi

pkgdatadir=/usr/share/grub
localedir=/usr/share/locale
grubdir=/boot/grub

mkdir -p "$grubdir/i386-pc"

for dir in "$grubdir" "$grubdir/i386-pc"; do
    for file in "$dir"/*.mod "$dir"/*.lst "$dir"/*.img "$dir"/efiemu??.o; do
	if [ -f "$file" ] && [ "$(basename "$file")" != menu.lst ]; then
	    rm -f "$file"
	fi
    done
done
for file in "$source_dir"/*.mod "$source_dir"/*.lst "$source_dir"/*.img "$source_dir"/efiemu??.o; do
    cp -f "$file" "$grubdir/i386-pc/"
done

mkdir -p "$grubdir/locale"
for dir in "$localedir"/* "$localedir-langpack"/*; do
    if [ -f "$dir/LC_MESSAGES/grub.mo" ]; then
	cp -f "$dir/LC_MESSAGES/grub.mo" "$grubdir/locale/${dir##*/}.mo"
    fi
done

if [ -f "$pkgdatadir/themes/starfield/theme.txt" ]; then
    mkdir -p "$grubdir/themes/starfield"
    cp "$pkgdatadir/themes/starfield"/* "$grubdir/themes/starfield/"
fi

if [ -f "$pkgdatadir/unicode.pf2" ]; then
    mkdir -p "$grubdir/fonts"
    cp "$pkgdatadir/unicode.pf2" "$grubdir/fonts/"
fi

if [ ! -f "$grubdir/grubenv" ]; then
    grub-editenv "$grubdir/grubenv" create
fi

/usr/share/lupin-support/grub-mkimage

# If vestiges of GRUB Legacy still exist, tell the Debian packaging that
# they can ignore them.
if [ -e /boot/grub/stage2 ] && [ -e /boot/grub/menu.lst ]; then
    touch /boot/grub/grub2-installed
fi

echo "Installation finished. No error reported." >&2
echo >&2

exit 0