|
Lines 16-26
Link Here
|
| 16 |
# You should have received a copy of the GNU General Public License |
16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with GRUB. If not, see <http://www.gnu.org/licenses/>. |
17 |
# along with GRUB. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
|
18 |
|
| 19 |
if [ -d /sys/firmware/efi ]; then |
|
|
| 20 |
echo "Skipping memtest image in EFI mode" >&2 |
| 21 |
exit 0 |
| 22 |
fi |
| 23 |
|
| 24 |
prefix=/ |
19 |
prefix=/ |
| 25 |
exec_prefix=/usr |
20 |
exec_prefix=/usr |
| 26 |
bindir=/usr/bin |
21 |
bindir=/usr/bin |
|
Lines 66-71
find /boot -name "memtest-*.bin" -printf "$FMT\\n" | while read memtest ; do
Link Here
|
| 66 |
|
61 |
|
| 67 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g" | sed -e "s,\.bin$,,g"` |
62 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g" | sed -e "s,\.bin$,,g"` |
| 68 |
|
63 |
|
|
|
64 |
echo "if [ \"\$grub_platform\" = \"pc\" ]; then" |
| 69 |
printf "menuentry \"Memtest86+-$version\" {\n" |
65 |
printf "menuentry \"Memtest86+-$version\" {\n" |
| 70 |
if [ -z "${prepare_boot_cache}" ]; then |
66 |
if [ -z "${prepare_boot_cache}" ]; then |
| 71 |
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" |
67 |
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" |
|
Lines 75-79
find /boot -name "memtest-*.bin" -printf "$FMT\\n" | while read memtest ; do
Link Here
|
| 75 |
cat << EOF |
71 |
cat << EOF |
| 76 |
} |
72 |
} |
| 77 |
EOF |
73 |
EOF |
|
|
74 |
echo "fi" |
| 75 |
done |
| 76 |
|
| 77 |
find /boot -name "memtest-*.efi" -printf "$FMT\\n" | while read memtest ; do |
| 78 |
prepare_boot_cache= |
| 79 |
echo "Found memtest image: $memtest" >&2 |
| 80 |
|
| 81 |
basename=`basename $memtest` |
| 82 |
dirname=`dirname $memtest` |
| 83 |
if [ "$dirname" = "." ]; then dirname=""; fi |
| 84 |
|
| 85 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g" | sed -e "s,\.efi$,,g"` |
| 78 |
|
86 |
|
|
|
87 |
echo "if [ \"\$grub_platform\" = \"efi\" ]; then" |
| 88 |
printf "menuentry \"Memtest86+-$version (may not work with Secure Boot)\" {\n" |
| 89 |
if [ -z "${prepare_boot_cache}" ]; then |
| 90 |
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" |
| 91 |
fi |
| 92 |
printf '%s\n' "${prepare_boot_cache}" |
| 93 |
echo " linux $dirname/$basename" |
| 94 |
cat << EOF |
| 95 |
} |
| 96 |
EOF |
| 97 |
echo "fi" |
| 79 |
done |
98 |
done |
| 80 |
- |
|
|