/usr/share/grub-installer/otheros.sh is in ubiquity 2.18.7.
This file is owned by root:root, with mode 0o644.
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | grub_write_chain() {
cat >> $tmpfile <<EOF
# This entry automatically added by the Debian installer for a non-linux OS
# on $partition
title $title
EOF
# DOS/Windows often needs rootnoverify so that GRUB doesn't rely on
# mounting the filesystem
case $shortname in
MS*|Win*)
cat >> $tmpfile <<EOF
rootnoverify $grubdrive
EOF
;;
*)
cat >> $tmpfile <<EOF
root $grubdrive
EOF
;;
esac
cat >> $tmpfile <<EOF
savedefault
EOF
# Only set makeactive if grub is installed in the mbr
if [ "$bootdev" = "(hd0)" ]; then
cat >> $tmpfile <<EOF
makeactive
EOF
fi
# DOS/Windows can't deal with booting from a non-first hard drive
case $shortname in
MS*|Win*)
grubdisk="$(echo "$grubdrive" | sed 's/^(//; s/)$//; s/,.*//')"
case $grubdisk in
hd0) ;;
hd*)
case $title in
Windows\ Vista*|Windows\ 7*)
;;
*)
cat >> $tmpfile <<EOF
map (hd0) ($grubdisk)
map ($grubdisk) (hd0)
EOF
;;
esac
;;
esac
;;
esac
cat >> $tmpfile <<EOF
chainloader +1
EOF
} # grub_write_chain end
grub2_write_chain() {
uuid="$($chroot $ROOT grub-probe --target fs_uuid --device $partition)"
cat >> $tmpfile <<EOF
# This entry automatically added by the Debian installer for a non-linux OS
# on $partition
menuentry "$title" {
set root=$grubdrive
EOF
if [ -n "$uuid" ] ; then
cat >> $tmpfile <<EOF
search $no_floppy --fs-uuid --set $uuid
EOF
fi
# DOS/Windows can't deal with booting from a non-first hard drive
case $shortname in
MS*|Win*)
if $chroot $ROOT dpkg --compare-versions $grub_debian_version gt 1.96+20090609-1 && \
[ "$title" != "Windows Vista (loader)" ]; then
cat >> $tmpfile <<EOF
drivemap -s (hd0) \$root
EOF
fi
;;
esac
cat >> $tmpfile <<EOF
chainloader +1
}
EOF
} # grub2_write_chain end
grub_write_linux() {
cat >> $tmpfile <<EOF
# This entry automatically added by the Debian installer for an existing
# linux installation on $mappedpartition.
title $label (on $mappedpartition)
root $grubdrive
kernel $kernel $params
EOF
if [ -n "$initrd" ]; then
cat >> $tmpfile <<EOF
initrd $initrd
EOF
fi
cat >> $tmpfile <<EOF
savedefault
boot
EOF
} # grub_write_linux end
grub2_write_linux() {
cat >> $tmpfile <<EOF
# This entry automatically added by the Debian installer for an existing
# linux installation on $mappedpartition.
menuentry "$label (on $mappedpartition)" {
set root=$grubdrive
EOF
uuid="$($chroot $ROOT grub-probe --target fs_uuid --device $partition)"
if [ -n "$uuid" ] ; then
cat >> $tmpfile <<EOF
search $no_floppy --fs-uuid --set $uuid
EOF
fi
cat >> $tmpfile <<EOF
linux $kernel $params
EOF
if [ -n "$initrd" ]; then
cat >> $tmpfile <<EOF
initrd $initrd
EOF
fi
cat >> $tmpfile <<EOF
}
EOF
} # grub2_write_linux end
grub_write_hurd() {
cat >> $tmpfile <<EOF
# This entry automatically added by the Debian installer for an existing
# hurd installation on $partition.
title $title (on $partition)
root $grubdrive
kernel /boot/gnumach.gz root=device:$hurddrive
module /hurd/ext2fs.static --readonly \\
--multiboot-command-line=\${kernel-command-line} \\
--host-priv-port=\${host-port} \\
--device-master-port=\${device-port} \\
--exec-server-task=\${exec-task} -T typed \${root} \\
\$(task-create) \$(task-resume)
module /lib/ld.so.1 /hurd/exec \$(exec-task=task-create)
savedefault
boot
EOF
} # grub_write_hurd end
grub2_write_hurd() {
cat >> $tmpfile <<EOF
# This entry automatically added by the Debian installer for an existing
# hurd installation on $partition.
menuentry "$title (on $partition)" {
set root=$grubdrive
EOF
uuid="$($chroot $ROOT grub-probe --target fs_uuid --device $partition)"
if [ -n "$uuid" ] ; then
cat >> $tmpfile <<EOF
search $no_floppy --fs-uuid --set $uuid
EOF
fi
cat >> $tmpfile <<EOF
multiboot /boot/gnumach.gz root=device:$hurddrive
module /hurd/ext2fs.static ext2fs --readonly \\
--multiboot-command-line=\${kernel-command-line} \\
--host-priv-port=\${host-port} \\
--device-master-port=\${device-port} \\
--exec-server-task=\${exec-task} -T typed \${root} \\
\$(task-create) \$(task-resume)
module /lib/ld.so.1 exec /hurd/exec \$(exec-task=task-create)
}
EOF
} # grub2_write_hurd end
grub_write_divider() {
cat >> $ROOT/boot/grub/$menu_file << EOF
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
EOF
} # grub_write_divider end
|