~ubuntu-branches/ubuntu/trusty/grub2/trusty

« back to all changes in this revision

Viewing changes to .pc/mkconfig_loopback.patch/util/grub.d/20_linux_xen.in

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-01-16 15:18:04 UTC
  • mfrom: (17.6.38 experimental)
  • Revision ID: package-import@ubuntu.com-20140116151804-3foouk7fpqcq3sxx
Tags: 2.02~beta2-2
* Convert patch handling to git-dpm.
* Add bi-endian support to ELF parser (Tomohiro B Berry).
* Adjust restore_mkdevicemap.patch to mark get_kfreebsd_version as static,
  to appease "gcc -Werror=missing-prototypes".
* Cherry-pick from upstream:
  - Change grub-macbless' manual page section to 8.
* Install grub-glue-efi, grub-macbless, grub-render-label, and
  grub-syslinux2cfg.
* grub-shell: Pass -no-pad to xorriso when building floppy images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
  OS=GNU/Linux
33
33
else
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}"
36
36
fi
37
37
 
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}"
60
60
fi
61
61
 
62
 
GRUBFS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`"
63
 
 
64
 
if [ x"$GRUBFS" = x ]; then
65
 
    GRUBFS="$(stat -f --printf=%T /)"
66
 
fi
67
 
 
68
 
case x"$GRUBFS" in
 
62
case x"$GRUB_FS" in
69
63
    xbtrfs)
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/"
111
105
  fi
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/"
114
108
  fi
115
109
 
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)"
118
112
  fi
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
123
 
        echo    '$xmessage'
124
 
        multiboot       ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
125
 
        echo    '$lmessage'
 
117
        echo    '$(echo "$xmessage" | grub_quote)'
 
118
        if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
 
119
            xen_rm_opts=
 
120
        else
 
121
            xen_rm_opts="no-real-mode edd=off"
 
122
        fi
 
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}
127
126
EOF
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
132
 
        echo    '$message'
133
 
        module  ${rel_dirname}/${initrd}
 
131
        echo    '$(echo "$message" | grub_quote)'
 
132
        module  --nounzip   ${rel_dirname}/${initrd}
134
133
EOF
135
134
  fi
136
135
  sed "s/^/$submenu_indentation/" << EOF
174
173
 
175
174
title_correction_code=
176
175
 
 
176
machine=`uname -m`
 
177
 
177
178
case "$machine" in
178
179
    i?86) GENKERNEL_ARCH="x86" ;;
179
180
    mips|mips64) GENKERNEL_ARCH="mips" ;;
186
187
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
187
188
submenu_indentation=""
188
189
 
189
 
is_first_entry=true
 
190
is_top_level=true
190
191
 
191
192
while [ "x${xen_list}" != "x" ] ; do
192
193
    list="${linux_list}"
198
199
    if [ -z "$boot_device_id" ]; then
199
200
        boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
200
201
    fi
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' {"
203
204
    fi
204
205
    while [ "x$list" != "x" ] ; do
232
233
            linux_root_device_thisversion=${GRUB_DEVICE}
233
234
        fi
234
235
 
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}"
238
239
 
239
 
            submenu_indentation="\t\t"
 
240
            submenu_indentation="$grub_tab$grub_tab"
240
241
    
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' {"
 
248
           is_top_level=false
247
249
        fi
248
 
        is_first_entry=false
249
250
 
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}"
256
257
 
257
258
        list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
258
259
    done
259
 
    if [ x"$is_first_entry" != xtrue ]; then
 
260
    if [ x"$is_top_level" != xtrue ]; then
260
261
        echo '  }'
261
262
    fi
262
263
    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
264
265
 
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
268
269
  echo '}'
269
270
fi
270
271