34
34
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
35
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
35
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
38
38
# loop-AES arranges things so that /dev/loop/X can be our root device, but
59
59
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
62
GRUBFS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`"
64
if [ x"$GRUBFS" = x ]; then
65
GRUBFS="$(stat -f --printf=%T /)"
70
64
rootsubvol="`make_system_path_relative_to_its_root /`"
71
65
rootsubvol="${rootsubvol#/}"
110
104
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
112
106
if [ x$type != xrecovery ] ; then
113
save_default_entry | sed -e "s/^/\t/" | sed "s/^/$submenu_indentation/"
107
save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
116
110
if [ -z "${prepare_boot_cache}" ]; then
117
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
111
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
119
113
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
120
114
xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
121
115
lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
122
116
sed "s/^/$submenu_indentation/" << EOF
124
multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
117
echo '$(echo "$xmessage" | grub_quote)'
118
if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
121
xen_rm_opts="no-real-mode edd=off"
123
multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
124
echo '$(echo "$lmessage" | grub_quote)'
126
125
module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
128
127
if test -n "${initrd}" ; then
129
128
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
130
129
message="$(gettext_printf "Loading initial ramdisk ...")"
131
130
sed "s/^/$submenu_indentation/" << EOF
133
module ${rel_dirname}/${initrd}
131
echo '$(echo "$message" | grub_quote)'
132
module --nounzip ${rel_dirname}/${initrd}
136
135
sed "s/^/$submenu_indentation/" << EOF
198
199
if [ -z "$boot_device_id" ]; then
199
200
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
201
if [ "x$is_first_entry" != xtrue ]; then
202
if [ "x$is_top_level" != xtrue ]; then
202
203
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
204
205
while [ "x$list" != "x" ] ; do
232
233
linux_root_device_thisversion=${GRUB_DEVICE}
235
if [ "x$is_first_entry" = xtrue ]; then
236
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
236
237
linux_entry "${OS}" "${version}" "${xen_version}" simple \
237
238
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
239
submenu_indentation="\t\t"
240
submenu_indentation="$grub_tab$grub_tab"
241
242
if [ -z "$boot_device_id" ]; then
242
243
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
244
245
# TRANSLATORS: %s is replaced with an OS name
245
246
echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
246
247
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
250
251
linux_entry "${OS}" "${version}" "${xen_version}" advanced \
251
252
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
257
258
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
259
if [ x"$is_first_entry" != xtrue ]; then
260
if [ x"$is_top_level" != xtrue ]; then
262
263
xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
265
266
# If at least one kernel was found, then we need to
266
267
# add a closing '}' for the submenu command.
267
if [ x"$is_first_entry" != xtrue ]; then
268
if [ x"$is_top_level" != xtrue ]; then