diff -u grub2-1.99/debian/build-efi-images grub2-1.99/debian/build-efi-images --- grub2-1.99/debian/build-efi-images +++ grub2-1.99/debian/build-efi-images @@ -47,10 +47,12 @@ # Skeleton configuration file which finds the real boot disk. cat >"$workdir/grub.cfg" < Thu, 05 Dec 2013 16:53:48 +0000 + +grub2 (1.99-21ubuntu3.13) precise; urgency=low + + * Revamp hidden timeout handling by adding a new timeout_style environment + variable and a corresponding GRUB_TIMEOUT_STYLE configuration key for + grub-mkconfig. This controls hidden-timeout handling more simply than + the previous arrangements, and pressing any hotkeys associated with menu + entries during the hidden timeout will now boot the corresponding menu + entry immediately (LP: #1178618). As part of merging this, radically + simplify /etc/grub.d/30_os-prober; if it finds other OSes it can now + just set timeout_style=menu and make sure the timeout is non-zero. + * Fix mismerge of GRUB_RECOVERY_TITLE option in 1.99-21ubuntu3.12. + + -- Colin Watson Wed, 04 Dec 2013 17:05:10 +0000 + +grub2 (1.99-21ubuntu3.12) precise; urgency=low + + * debian/build-efi-images: Where possible, make use of the device path + derived from the EFI Loaded Image Protocol to compute the prefix + (LP: #1097570). + * Add GRUB_RECOVERY_TITLE option, to allow the controversial "recovery + mode" text to be customised (LP: #1240360). + + -- Colin Watson Thu, 28 Nov 2013 12:15:06 +0000 + grub2 (1.99-21ubuntu3.11) precise; urgency=low * Backport from upstream: diff -u grub2-1.99/debian/patches/ubuntu_normal_quiet.patch grub2-1.99/debian/patches/ubuntu_normal_quiet.patch --- grub2-1.99/debian/patches/ubuntu_normal_quiet.patch +++ grub2-1.99/debian/patches/ubuntu_normal_quiet.patch @@ -8,7 +8,7 @@ first place. Author: Colin Watson Forwarded: http://lists.gnu.org/archive/html/grub-devel/2009-09/msg00056.html -Last-Update: 2011-01-05 +Last-Update: 2013-12-04 Index: b/grub-core/normal/main.c =================================================================== @@ -41,7 +41,7 @@ =================================================================== --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c -@@ -721,6 +721,7 @@ +@@ -876,6 +876,7 @@ int boot_entry; grub_menu_entry_t e; int auto_boot; @@ -49,7 +49,7 @@ boot_entry = run_menu (menu, nested, &auto_boot); if (boot_entry < 0) -@@ -730,7 +731,9 @@ +@@ -885,7 +886,9 @@ if (! e) continue; /* Menu is empty. */ diff -u grub2-1.99/debian/patches/ubuntu_probe_nonexistent_loopback.patch grub2-1.99/debian/patches/ubuntu_probe_nonexistent_loopback.patch --- grub2-1.99/debian/patches/ubuntu_probe_nonexistent_loopback.patch +++ grub2-1.99/debian/patches/ubuntu_probe_nonexistent_loopback.patch @@ -6,7 +6,7 @@ Origin: backport, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3824 Bug-Ubuntu: https://bugs.launchpad.net/bugs/938724 Forwarded: no -Last-Update: 2012-04-05 +Last-Update: 2013-12-04 Index: b/util/grub-probe.c =================================================================== @@ -38,7 +38,7 @@ =================================================================== --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in -@@ -224,14 +224,15 @@ +@@ -180,14 +180,15 @@ LINITRD="${LINITRD#/boot}" fi diff -u grub2-1.99/debian/patches/ubuntu_wubi_no_windows.patch grub2-1.99/debian/patches/ubuntu_wubi_no_windows.patch --- grub2-1.99/debian/patches/ubuntu_wubi_no_windows.patch +++ grub2-1.99/debian/patches/ubuntu_wubi_no_windows.patch @@ -6,13 +6,13 @@ https://blueprints.launchpad.net/ubuntu/+spec/foundations-o-wubi Author: Colin Watson Forwarded: not-needed -Last-Update: 2011-06-17 +Last-Update: 2013-12-04 Index: b/util/grub.d/30_os-prober.in =================================================================== --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in -@@ -147,6 +147,8 @@ +@@ -103,6 +103,8 @@ EOF } @@ -21,7 +21,7 @@ for OS in ${OSPROBED} ; do DEVICE="`echo ${OS} | cut -d ':' -f 1`" LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" -@@ -162,6 +164,23 @@ +@@ -118,6 +120,23 @@ case ${BOOT} in chain) diff -u grub2-1.99/debian/patches/ubuntu_really_quiet.patch grub2-1.99/debian/patches/ubuntu_really_quiet.patch --- grub2-1.99/debian/patches/ubuntu_really_quiet.patch +++ grub2-1.99/debian/patches/ubuntu_really_quiet.patch @@ -8,7 +8,7 @@ Bug-Ubuntu: https://bugs.launchpad.net/bugs/386922 Bug-Ubuntu: https://bugs.launchpad.net/bugs/861048 Forwarded: not-needed -Last-Update: 2011-01-05 +Last-Update: 2013-12-04 Index: b/grub-core/kern/main.c =================================================================== @@ -61,7 +61,7 @@ =================================================================== --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c -@@ -668,12 +668,9 @@ +@@ -823,12 +823,9 @@ /* Callback invoked immediately before a menu entry is executed. */ static void diff -u grub2-1.99/debian/patches/ubuntu_failed_boot_menu.patch grub2-1.99/debian/patches/ubuntu_failed_boot_menu.patch --- grub2-1.99/debian/patches/ubuntu_failed_boot_menu.patch +++ grub2-1.99/debian/patches/ubuntu_failed_boot_menu.patch @@ -3,7 +3,7 @@ runlevels. Author: Colin Watson Forwarded: no -Last-Update: 2011-01-05 +Last-Update: 2013-12-04 Index: b/util/grub.d/00_header.in =================================================================== @@ -29,19 +29,57 @@ function load_video { EOF if [ -n "${GRUB_VIDEO_BACKEND}" ]; then -@@ -226,7 +232,11 @@ +@@ -225,6 +231,11 @@ + make_timeout () { - cat << EOF --set timeout=${2} -+if [ "\${recordfail}" = 1 ]; then ++ cat << EOF ++if [ "\${recordfail}" = 1 ] ; then + set timeout=${GRUB_RECORDFAIL_TIMEOUT:--1} +else ++EOF + if [ "x${1}${3}" != "x" ] ; then + if [ "x${3}" != "x" ] ; then + timeout="${2}" +@@ -247,26 +258,29 @@ + verbose= + fi + cat << EOF +-if [ x\$feature_timeout_style = xy ] ; then +- set timeout_style=${style} +- set timeout=${timeout} ++ if [ x\$feature_timeout_style = xy ] ; then ++ set timeout_style=${style} ++ set timeout=${timeout} + EOF + if [ "x${style}" != "xmenu" ] ; then + cat << EOF +-# Fallback hidden-timeout code in case the timeout_style feature is +-# unavailable. +-elif sleep${verbose} --interruptible ${timeout} ; then +- set timeout=0 ++ # Fallback hidden-timeout code in case the timeout_style feature is ++ # unavailable. ++ elif sleep${verbose} --interruptible ${timeout} ; then ++ set timeout=0 + EOF + fi + cat << EOF +-fi ++ fi + EOF + else + cat << EOF +-set timeout=${2} + set timeout=${2} -+fi EOF + fi ++ cat << EOF ++fi ++EOF } + if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then Index: b/util/grub.d/10_linux.in =================================================================== --- a/util/grub.d/10_linux.in @@ -60,7 +98,7 @@ =================================================================== --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -1250,6 +1250,12 @@ +@@ -1258,6 +1258,12 @@ Each module will be loaded as early as possible, at the start of @file{grub.cfg}. @@ -72,12 +110,12 @@ + @end table - For more detailed customisation of @command{grub-mkconfig}'s output, you may + The following options are still accepted for compatibility with existing Index: b/util/grub-mkconfig.in =================================================================== --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in -@@ -258,7 +258,8 @@ +@@ -260,7 +260,8 @@ GRUB_DISABLE_OS_PROBER \ GRUB_INIT_TUNE \ GRUB_SAVEDEFAULT \ diff -u grub2-1.99/debian/patches/ubuntu_sleep_shift.patch grub2-1.99/debian/patches/ubuntu_sleep_shift.patch --- grub2-1.99/debian/patches/ubuntu_sleep_shift.patch +++ grub2-1.99/debian/patches/ubuntu_sleep_shift.patch @@ -1,10 +1,10 @@ -Description: Allow Shift to interrupt 'sleep --interruptible' +Description: Allow Shift to interrupt hidden timeouts Upstream would like to consider this at more length. See http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00718.html, and the rest of the thread for context. Author: Colin Watson Forwarded: http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00694.html -Last-Update: 2011-01-05 +Last-Update: 2013-12-04 Index: b/grub-core/commands/sleep.c =================================================================== @@ -53,0 +54,32 @@ +Index: b/grub-core/normal/menu.c +=================================================================== +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -608,8 +608,27 @@ + saved_time = grub_get_time_ms (); + while (1) + { ++ int mods = 0; ++ grub_term_input_t term; + int key; + ++ if (grub_term_poll_usb) ++ grub_term_poll_usb (); ++ ++ FOR_ACTIVE_TERM_INPUTS(term) ++ { ++ if (term->getkeystatus) ++ mods |= term->getkeystatus (term); ++ } ++ ++ if (mods >= 0 && ++ (mods & (GRUB_TERM_STATUS_LSHIFT ++ | GRUB_TERM_STATUS_RSHIFT)) != 0) ++ { ++ timeout = -1; ++ break; ++ } ++ + if (grub_checkkey () >= 0) + key = grub_getkey (); + else diff -u grub2-1.99/debian/patches/ubuntu_linux_submenus.patch grub2-1.99/debian/patches/ubuntu_linux_submenus.patch --- grub2-1.99/debian/patches/ubuntu_linux_submenus.patch +++ grub2-1.99/debian/patches/ubuntu_linux_submenus.patch @@ -9,7 +9,7 @@ --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -177,6 +177,7 @@ - if [ "\$linux_gfx_mode" != "text" ]; then load_video; fi + if [ "\${linux_gfx_mode}" != "text" ]; then load_video; fi EOF +in_submenu=false diff -u grub2-1.99/debian/patches/ubuntu_vbe_autodetect.patch grub2-1.99/debian/patches/ubuntu_vbe_autodetect.patch --- grub2-1.99/debian/patches/ubuntu_vbe_autodetect.patch +++ grub2-1.99/debian/patches/ubuntu_vbe_autodetect.patch @@ -1,7 +1,7 @@ Description: Preferred resolution detection for VBE Author: Colin Watson Forwarded: http://lists.gnu.org/archive/html/grub-devel/2010-12/msg00051.html -Last-Update: 2010-12-15 +Last-Update: 2013-12-04 Index: b/ChangeLog.vbe-autodetect =================================================================== @@ -45,7 +45,7 @@ =================================================================== --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -1206,7 +1206,8 @@ +@@ -1214,7 +1214,8 @@ Set the resolution used on the @samp{gfxterm} graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be diff -u grub2-1.99/debian/patches/series grub2-1.99/debian/patches/series --- grub2-1.99/debian/patches/series +++ grub2-1.99/debian/patches/series @@ -42,6 +42,7 @@ efi_disk_cache.patch ubuntu_grub_standards.patch ubuntu_crashkernel.patch +ubuntu_timeout_style.patch ubuntu_quick_boot.patch ubuntu_sleep_shift.patch ubuntu_normal_quiet.patch @@ -81,0 +83,4 @@ +ubuntu_mkconfig_recovery_title.patch +ubuntu_fat_non_512_sectors.patch +ubuntu_probe_fusionio.patch +ubuntu_sysfs_partition_start.patch diff -u grub2-1.99/debian/patches/ubuntu_quick_boot.patch grub2-1.99/debian/patches/ubuntu_quick_boot.patch --- grub2-1.99/debian/patches/ubuntu_quick_boot.patch +++ grub2-1.99/debian/patches/ubuntu_quick_boot.patch @@ -10,114 +10,33 @@ https://wiki.ubuntu.com/DesktopExperienceTeam/KarmicBootExperienceDesignSpec#Bootloader. Author: Colin Watson Forwarded: no -Last-Update: 2011-01-05 +Last-Update: 2013-12-04 -Index: b/util/grub.d/00_header.in -=================================================================== ---- a/util/grub.d/00_header.in -+++ b/util/grub.d/00_header.in -@@ -225,22 +225,9 @@ - - make_timeout () - { -- if [ "x${1}" != "x" ] ; then -- if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then -- verbose= -- else -- verbose=" --verbose" -- fi -- cat << EOF --if sleep$verbose --interruptible ${1} ; then -- set timeout=${2} --fi --EOF -- else -- cat << EOF -+ cat << EOF - set timeout=${2} - EOF -- fi - } - - if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then Index: b/util/grub.d/30_os-prober.in =================================================================== --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in -@@ -23,22 +23,80 @@ +@@ -23,6 +23,19 @@ . "@datadir@/grub/grub-mkconfig_lib" +found_other_os= + -+make_timeout () { -+ if [ "x${found_other_os}" = "x" ] ; then -+ if [ "x${1}" != "x" ] ; then -+ if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then -+ verbose= -+ else -+ verbose=" --verbose" -+ fi -+ -+ if [ "x${1}" = "x0" ] ; then -+ cat < /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then - # missing os-prober and/or linux-boot-prober -+ adjust_timeout - exit 0 - fi - - OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`" - if [ -z "${OSPROBED}" ] ; then - # empty os-prober output, nothing doing -+ adjust_timeout - exit 0 +@@ -39,6 +52,7 @@ fi osx_entry() { @@ -125,7 +44,7 @@ cat << EOF menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" --class osx --class darwin --class os { EOF -@@ -104,6 +162,7 @@ +@@ -104,6 +118,7 @@ case ${BOOT} in chain) @@ -133,7 +52,7 @@ cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os { EOF -@@ -146,6 +205,7 @@ +@@ -146,6 +161,7 @@ LINITRD="${LINITRD#/boot}" fi @@ -141,7 +60,7 @@ cat << EOF menuentry "${LLABEL} (on ${DEVICE})" --class gnu-linux --class gnu --class os { EOF -@@ -173,6 +233,7 @@ +@@ -173,6 +189,7 @@ osx_entry xnu_kernel64 64 ;; hurd) @@ -149,7 +68,7 @@ cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" --class hurd --class gnu --class os { EOF -@@ -202,3 +263,5 @@ +@@ -202,3 +219,5 @@ ;; esac done only in patch2: unchanged: --- grub2-1.99.orig/debian/patches/ubuntu_fat_non_512_sectors.patch +++ grub2-1.99/debian/patches/ubuntu_fat_non_512_sectors.patch @@ -0,0 +1,38 @@ +Description: Handle FAT file systems on non-512B disks +Author: Vladimir Serbinenko +Origin: upstream, http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=daa59f47f6818d2a2c90526be5b2b38a11770dc1 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1065281 +Applied-Upstream: http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=daa59f47f6818d2a2c90526be5b2b38a11770dc1 +Forwarded: not-needed +Last-Update: 2013-12-05 + +Index: b/grub-core/fs/fat.c +=================================================================== +--- a/grub-core/fs/fat.c ++++ b/grub-core/fs/fat.c +@@ -241,7 +241,7 @@ + + data->cluster_sector = data->root_sector + data->num_root_sectors; + data->num_clusters = (((data->num_sectors - data->cluster_sector) +- >> (data->cluster_bits + data->logical_sector_bits)) ++ >> data->cluster_bits) + + 2); + + if (data->num_clusters <= 2) +@@ -372,7 +372,6 @@ + + /* Calculate the logical cluster number and offset. */ + logical_cluster_bits = (data->cluster_bits +- + data->logical_sector_bits + + GRUB_DISK_SECTOR_BITS); + logical_cluster = offset >> logical_cluster_bits; + offset &= (1 << logical_cluster_bits) - 1; +@@ -446,7 +445,7 @@ + /* Read the data here. */ + sector = (data->cluster_sector + + ((data->cur_cluster - 2) +- << (data->cluster_bits + data->logical_sector_bits))); ++ << data->cluster_bits)); + size = (1 << logical_cluster_bits) - offset; + if (size > len) + size = len; only in patch2: unchanged: --- grub2-1.99.orig/debian/patches/ubuntu_mkconfig_recovery_title.patch +++ grub2-1.99/debian/patches/ubuntu_mkconfig_recovery_title.patch @@ -0,0 +1,142 @@ +Description: Add GRUB_RECOVERY_TITLE option + This allows the controversial "recovery mode" text to be customised. +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1240360 +Forwarded: no +Last-Update: 2013-12-04 + +Index: b/docs/grub.texi +=================================================================== +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1265,6 +1265,11 @@ + should be set on headless and appliance systems where access to a console is + restricted or limited. + ++@item GRUB_RECOVERY_TITLE ++This option sets the English text of the string that will be displayed in ++parentheses to indicate that a boot option is provided to help users recover ++a broken system. The default is "recovery mode". ++ + @end table + + The following options are still accepted for compatibility with existing +Index: b/util/grub-mkconfig.in +=================================================================== +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -206,6 +206,10 @@ + esac + done + ++if [ "x${GRUB_RECOVERY_TITLE}" = "x" ]; then ++ GRUB_RECOVERY_TITLE="recovery mode" ++fi ++ + # These are defined in this script, export them here so that user can + # override them. + export GRUB_DEVICE \ +@@ -253,7 +257,8 @@ + GRUB_INIT_TUNE \ + GRUB_SAVEDEFAULT \ + GRUB_BADRAM \ +- GRUB_RECORDFAIL_TIMEOUT ++ GRUB_RECORDFAIL_TIMEOUT \ ++ GRUB_RECOVERY_TITLE + + if test "x${grub_cfg}" != "x"; then + rm -f ${grub_cfg}.new +Index: b/util/grub.d/10_hurd.in +=================================================================== +--- a/util/grub.d/10_hurd.in ++++ b/util/grub.d/10_hurd.in +@@ -102,7 +102,7 @@ + EOF + + cat << EOF +-menuentry "${OS} ${KERNEL} (recovery mode)" ${CLASS} { ++menuentry "${OS} ${KERNEL} (${GRUB_RECOVERY_TITLE})" ${CLASS} { + EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + message="$(gettext_printf "Loading GNU Mach ...")" +Index: b/util/grub.d/10_kfreebsd.in +=================================================================== +--- a/util/grub.d/10_kfreebsd.in ++++ b/util/grub.d/10_kfreebsd.in +@@ -70,11 +70,12 @@ + recovery="$3" + args="$4" + if ${recovery} ; then +- title="$(gettext_quoted "%s, with kFreeBSD %s (recovery mode)")" ++ title="$(gettext_quoted "%s, with kFreeBSD %s (%s)")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")" + else + title="$(gettext_quoted "%s, with kFreeBSD %s")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" + fi +- printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" + if ! ${recovery} ; then + save_default_entry | sed -e "s/^/\t/" + fi +Index: b/util/grub.d/10_linux.in +=================================================================== +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -83,11 +83,12 @@ + recovery="$3" + args="$4" + if ${recovery} ; then +- title="$(gettext_quoted "%s, with Linux %s (recovery mode)")" ++ title="$(gettext_quoted "%s, with Linux %s (%s)")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")" + else + title="$(gettext_quoted "%s, with Linux %s")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" + fi +- printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" + cat << EOF + recordfail + EOF +Index: b/util/grub.d/10_netbsd.in +=================================================================== +--- a/util/grub.d/10_netbsd.in ++++ b/util/grub.d/10_netbsd.in +@@ -94,13 +94,16 @@ + + kroot_device="$(echo ${GRUB_DEVICE} | sed -e 's,^/dev/r,,')" + if ${recovery} ; then +- title="$(gettext_quoted "%s, with kernel %s (via %s, recovery mode)")" ++ title="$(gettext_quoted "%s, with kernel %s (via %s, %s)")" ++ printf "menuentry \"${title}\" {\n" \ ++ "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}" \ ++ "$(gettext "${GRUB_RECOVERY_TITLE}")" + else + title="$(gettext_quoted "%s, with kernel %s (via %s)")" ++ printf "menuentry \"${title}\" {\n" \ ++ "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}" + fi + +- printf "menuentry \"${title}\" {\n" \ +- "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}" + printf "%s\n" "${prepare_boot_cache}" + case "${loader}" in + knetbsd) +Index: b/util/grub.d/20_linux_xen.in +=================================================================== +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -82,11 +82,12 @@ + args="$5" + xen_args="$6" + if ${recovery} ; then +- title="$(gettext_quoted "%s, with Xen %s and Linux %s (recovery mode)")" ++ title="$(gettext_quoted "%s, with Xen %s and Linux %s (%s)")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")" + else + title="$(gettext_quoted "%s, with Xen %s and Linux %s")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}" + fi +- printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}" + if ! ${recovery} ; then + save_default_entry | sed -e "s/^/\t/" + fi only in patch2: unchanged: --- grub2-1.99.orig/debian/patches/ubuntu_probe_fusionio.patch +++ grub2-1.99/debian/patches/ubuntu_probe_fusionio.patch @@ -0,0 +1,65 @@ +Description: Probe FusionIO devices +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1237519 +Forwarded: no +Last-Update: 2013-12-05 + +Index: b/grub-core/kern/emu/hostdisk.c +=================================================================== +--- a/grub-core/kern/emu/hostdisk.c ++++ b/grub-core/kern/emu/hostdisk.c +@@ -1389,6 +1389,17 @@ + return path; + } + ++ /* If this is a FusionIO disk. */ ++ if ((strncmp ("fio", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z') ++ { ++ char *pp = p + 3; ++ while (*pp >= 'a' && *pp <= 'z') ++ pp++; ++ /* /dev/fio[a-z]+[0-9]* */ ++ *pp = '\0'; ++ return path; ++ } ++ + #ifdef HAVE_DEVICE_MAPPER + /* If this is a DM-RAID device. + Compare os_dev rather than path here, since nodes under +Index: b/util/deviceiter.c +=================================================================== +--- a/util/deviceiter.c ++++ b/util/deviceiter.c +@@ -364,6 +364,12 @@ + { + sprintf (name, "/dev/xvd%c", unit + 'a'); + } ++ ++static void ++get_fio_disk_name (char *name, int unit) ++{ ++ sprintf (name, "/dev/fio%c", unit + 'a'); ++} + #endif + + static struct seen_device +@@ -850,6 +856,19 @@ + if (check_device_readable_unique (name)) + { + if (hook (name, 0)) ++ goto out; ++ } ++ } ++ ++ /* FusionIO. */ ++ for (i = 0; i < 26; i++) ++ { ++ char name[16]; ++ ++ get_fio_disk_name (name, i); ++ if (check_device_readable_unique (name)) ++ { ++ if (hook (name, 0)) + goto out; + } + } only in patch2: unchanged: --- grub2-1.99.orig/debian/patches/ubuntu_sysfs_partition_start.patch +++ grub2-1.99/debian/patches/ubuntu_sysfs_partition_start.patch @@ -0,0 +1,152 @@ +Description: On Linux, read partition start offsets from sysfs if possible +Author: Colin Watson +Origin: backport, http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=0480665b9de31aefc7f1d95448efdf8349997fe9 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1237519 +Applied-Upstream: http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=0480665b9de31aefc7f1d95448efdf8349997fe9 +Forwarded: not-needed +Last-Update: 2013-12-05 + +Index: b/grub-core/kern/emu/hostdisk.c +=================================================================== +--- a/grub-core/kern/emu/hostdisk.c ++++ b/grub-core/kern/emu/hostdisk.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -430,10 +431,119 @@ + return out; + } + #elif defined(__linux__) || defined(__CYGWIN__) || defined(HAVE_DIOCGDINFO) ++#ifdef __linux__ ++static char * ++sysfs_partition_path (const char *dev, const char *entry) ++{ ++ const char *argv[7]; ++ int pipe_fd[2]; ++ pid_t pid; ++ FILE *udevadm; ++ char *buf = NULL; ++ size_t len = 0; ++ char *path = NULL; ++ ++ argv[0] = "udevadm"; ++ argv[1] = "info"; ++ argv[2] = "--query"; ++ argv[3] = "path"; ++ argv[4] = "--name"; ++ argv[5] = dev; ++ argv[6] = NULL; ++ ++ if (pipe (pipe_fd) < 0) ++ { ++ grub_util_warn (_("Unable to create pipe: %s"), strerror (errno)); ++ return NULL; ++ } ++ pid = fork (); ++ if (pid < 0) ++ grub_util_error (_("Unable to fork: %s"), strerror (errno)); ++ else if (pid == 0) ++ { ++ /* Child. */ ++ /* Ensure child is not localised. */ ++ setenv ("LC_ALL", "C", 1); ++ ++ close (pipe_fd[0]); ++ dup2 (pipe_fd[1], STDOUT_FILENO); ++ close (pipe_fd[1]); ++ ++ execvp ((char *) argv[0], (char **) argv); ++ exit (127); ++ } ++ else ++ { ++ /* Parent. Read udevadm's output. */ ++ close (pipe_fd[1]); ++ ++ udevadm = fdopen (pipe_fd[0], "r"); ++ if (!udevadm) ++ { ++ grub_util_warn (_("Unable to open stream from %s: %s"), ++ "udevadm", strerror (errno)); ++ close (pipe_fd[0]); ++ goto out; ++ } ++ ++ if (getline (&buf, &len, udevadm) > 0) ++ { ++ char *newline; ++ ++ newline = strchr (buf, '\n'); ++ if (newline) ++ *newline = '\0'; ++ path = xasprintf ("/sys%s/%s", buf, entry); ++ } ++ ++out: ++ if (udevadm) ++ fclose (udevadm); ++ waitpid (pid, NULL, 0); ++ free (buf); ++ ++ return path; ++ } ++} ++ ++static int ++sysfs_partition_start (const char *dev, grub_disk_addr_t *start) ++{ ++ char *path; ++ FILE *fp; ++ unsigned long long val; ++ int ret = 0; ++ ++ path = sysfs_partition_path (dev, "start"); ++ if (!path) ++ return 0; ++ ++ fp = fopen (path, "r"); ++ if (!fp) ++ goto out; ++ ++ if (fscanf (fp, "%llu", &val) == 1) ++ { ++ *start = (grub_disk_addr_t) val; ++ ret = 1; ++ } ++ ++out: ++ free (path); ++ if (fp) ++ fclose (fp); ++ ++ return ret; ++} ++#endif /* __linux__ */ ++ + static grub_disk_addr_t + find_partition_start (const char *dev) + { + int fd; ++#ifdef __linux__ ++ grub_disk_addr_t sysfs_start = 0; ++#endif /* __linux__ */ + # if !defined(HAVE_DIOCGDINFO) + struct hd_geometry hdg; + # else /* defined(HAVE_DIOCGDINFO) */ +@@ -515,6 +625,11 @@ + } + # endif /* HAVE_DEVICE_MAPPER */ + ++# ifdef __linux__ ++ if (sysfs_partition_start (dev, &sysfs_start)) ++ return sysfs_start; ++# endif /* __linux__ */ ++ + fd = open (dev, O_RDONLY); + if (fd == -1) + { only in patch2: unchanged: --- grub2-1.99.orig/debian/patches/ubuntu_timeout_style.patch +++ grub2-1.99/debian/patches/ubuntu_timeout_style.patch @@ -0,0 +1,509 @@ +Description: Revamp hidden timeout handling + Add a new timeout_style environment variable and a corresponding + GRUB_TIMEOUT_STYLE configuration key for grub-mkconfig. This controls + hidden-timeout handling more simply than the previous arrangements, and + pressing any hotkeys associated with menu entries during the hidden timeout + will now boot the corresponding menu entry immediately. + . + GRUB_HIDDEN_TIMEOUT= + GRUB_TIMEOUT= now generates a + warning, and if it shows the menu it will do so as if the second timeout + were not present. Other combinations are translated into reasonable + equivalents. +Author: Colin Watson +Origin: backport, http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=44d488477902f0786d6bce44b74713f1713a34a9;hp=9e4e6ddfbfaad73e0c0f542c818c247135961c48 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1178618 +Forwarded: https://lists.gnu.org/archive/html/grub-devel/2013-11/msg00388.html +Applied-Upstream: http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=44d488477902f0786d6bce44b74713f1713a34a9;hp=9e4e6ddfbfaad73e0c0f542c818c247135961c48 +Last-Update: 2013-12-04 + +Index: b/docs/grub.texi +=================================================================== +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1100,18 +1100,26 @@ + immediately without displaying the menu, or to @samp{-1} to wait + indefinitely. + +-@item GRUB_HIDDEN_TIMEOUT +-Wait this many seconds for a key to be pressed before displaying the menu. +-If no key is pressed during that time, boot immediately. Unset by default. ++If @samp{GRUB_TIMEOUT_STYLE} is set to @samp{countdown} or @samp{hidden}, ++the timeout is instead counted before the menu is displayed. + +-@item GRUB_HIDDEN_TIMEOUT_QUIET +-In conjunction with @samp{GRUB_HIDDEN_TIMEOUT}, set this to @samp{true} to +-suppress the verbose countdown while waiting for a key to be pressed before +-displaying the menu. Unset by default. ++@item GRUB_TIMEOUT_STYLE ++If this option is unset or set to @samp{menu}, then GRUB will display the ++menu and then wait for the timeout set by @samp{GRUB_TIMEOUT} to expire ++before booting the default entry. Pressing a key interrupts the timeout. ++ ++If this option is set to @samp{countdown} or @samp{hidden}, then, before ++displaying the menu, GRUB will wait for the timeout set by ++@samp{GRUB_TIMEOUT} to expire. If @key{ESC} is pressed during that time, it ++will display the menu and wait for input. If a hotkey associated with a ++menu entry is pressed, it will boot the associated menu entry immediately. ++If the timeout expires before either of these happens, it will boot the ++default entry. In the @samp{countdown} case, it will show a one-line ++indication of the remaining time. + + @item GRUB_DEFAULT_BUTTON + @itemx GRUB_TIMEOUT_BUTTON +-@itemx GRUB_HIDDEN_TIMEOUT_BUTTON ++@itemx GRUB_TIMEOUT_STYLE_BUTTON + @itemx GRUB_BUTTON_CMOS_ADDRESS + Variants of the corresponding variables without the @samp{_BUTTON} suffix, + used to support vendor-specific power buttons. @xref{Vendor power-on keys}. +@@ -1252,6 +1260,44 @@ + + @end table + ++The following options are still accepted for compatibility with existing ++configurations, but have better replacements: ++ ++@table @samp ++@item GRUB_HIDDEN_TIMEOUT ++Wait this many seconds before displaying the menu. If @key{ESC} is pressed ++during that time, display the menu and wait for input according to ++@samp{GRUB_TIMEOUT}. If a hotkey associated with a menu entry is pressed, ++boot the associated menu entry immediately. If the timeout expires before ++either of these happens, display the menu for the number of seconds ++specified in @samp{GRUB_TIMEOUT} before booting the default entry. ++ ++If you set @samp{GRUB_HIDDEN_TIMEOUT}, you should also set ++@samp{GRUB_TIMEOUT=0} so that the menu is not displayed at all unless ++@key{ESC} is pressed. ++ ++This option is unset by default, and is deprecated in favour of the less ++confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or ++@samp{GRUB_TIMEOUT_STYLE=hidden}. ++ ++@item GRUB_HIDDEN_TIMEOUT_QUIET ++In conjunction with @samp{GRUB_HIDDEN_TIMEOUT}, set this to @samp{true} to ++suppress the verbose countdown while waiting for a key to be pressed before ++displaying the menu. ++ ++This option is unset by default, and is deprecated in favour of the less ++confusing @samp{GRUB_TIMEOUT_STYLE=countdown}. ++ ++@item GRUB_HIDDEN_TIMEOUT_BUTTON ++Variant of @samp{GRUB_HIDDEN_TIMEOUT}, used to support vendor-specific power ++buttons. @xref{Vendor power-on keys}. ++ ++This option is unset by default, and is deprecated in favour of the less ++confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or ++@samp{GRUB_TIMEOUT_STYLE=hidden}. ++ ++@end table ++ + For more detailed customisation of @command{grub-mkconfig}'s output, you may + edit the scripts in @file{/etc/grub.d} directly. + @file{/etc/grub.d/40_custom} is particularly useful for adding entire custom +@@ -2008,15 +2054,16 @@ + @node Vendor power-on keys + @chapter Using GRUB with vendor power-on keys + +-Some laptop vendors provide an additional power-on button which boots another +-OS. GRUB supports such buttons with the @samp{GRUB_TIMEOUT_BUTTON}, +-@samp{GRUB_DEFAULT_BUTTON}, @samp{GRUB_HIDDEN_TIMEOUT_BUTTON} and ++Some laptop vendors provide an additional power-on button which boots ++another OS. GRUB supports such buttons with the @samp{GRUB_TIMEOUT_BUTTON}, ++@samp{GRUB_TIMEOUT_STYLE_BUTTON}, @samp{GRUB_DEFAULT_BUTTON}, and + @samp{GRUB_BUTTON_CMOS_ADDRESS} variables in default/grub (@pxref{Simple +-configuration}). @samp{GRUB_TIMEOUT_BUTTON}, @samp{GRUB_DEFAULT_BUTTON} and +-@samp{GRUB_HIDDEN_TIMEOUT_BUTTON} are used instead of the corresponding +-variables without the @samp{_BUTTON} suffix when powered on using the special +-button. @samp{GRUB_BUTTON_CMOS_ADDRESS} is vendor-specific and partially +-model-specific. Values known to the GRUB team are: ++configuration}). @samp{GRUB_TIMEOUT_BUTTON}, ++@samp{GRUB_TIMEOUT_STYLE_BUTTON}, and @samp{GRUB_DEFAULT_BUTTON} are used ++instead of the corresponding variables without the @samp{_BUTTON} suffix ++when powered on using the special button. @samp{GRUB_BUTTON_CMOS_ADDRESS} ++is vendor-specific and partially model-specific. Values known to the GRUB ++team are: + + @table @key + @item Dell XPS M1530 +@@ -2471,6 +2518,7 @@ + * superusers:: + * theme:: + * timeout:: ++* timeout_style:: + @end menu + + +@@ -2808,8 +2856,21 @@ + means to boot the default entry immediately without displaying the menu; a + timeout of @samp{-1} (or unset) means to wait indefinitely. + +-This variable is often set by @samp{GRUB_TIMEOUT} or +-@samp{GRUB_HIDDEN_TIMEOUT} (@pxref{Simple configuration}). ++If @samp{timeout_style} (@pxref{timeout_style}) is set to @samp{countdown} ++or @samp{hidden}, the timeout is instead counted before the menu is ++displayed. ++ ++This variable is often set by @samp{GRUB_TIMEOUT} (@pxref{Simple ++configuration}). ++ ++ ++@node timeout_style ++@subsection timeout_style ++ ++This variable may be set to @samp{menu}, @samp{countdown}, or @samp{hidden} ++to control the way in which the timeout (@pxref{timeout}) interacts with ++displaying the menu. See the documentation of @samp{GRUB_TIMEOUT_STYLE} ++(@pxref{Simple configuration}) for details. + + + @node Environment block +Index: b/grub-core/normal/main.c +=================================================================== +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -474,8 +474,14 @@ + + static void (*grub_xputs_saved) (const char *str); + ++static const char *features[] = { ++ "feature_timeout_style" ++}; ++ + GRUB_MOD_INIT(normal) + { ++ unsigned i; ++ + /* Previously many modules depended on gzio. Be nice to user and load it. */ + grub_dl_load ("gzio"); + +@@ -517,6 +523,12 @@ + /* Set default color names. */ + grub_env_set ("color_normal", "white/black"); + grub_env_set ("color_highlight", "black/white"); ++ ++ for (i = 0; i < ARRAY_SIZE (features); i++) ++ { ++ grub_env_set (features[i], "y"); ++ grub_env_export (features[i]); ++ } + } + + GRUB_MOD_FINI(normal) +Index: b/grub-core/normal/menu.c +=================================================================== +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -40,6 +40,22 @@ + grub_err_t (*grub_gfxmenu_try_hook) (int entry, grub_menu_t menu, + int nested) = NULL; + ++enum timeout_style { ++ TIMEOUT_STYLE_MENU, ++ TIMEOUT_STYLE_COUNTDOWN, ++ TIMEOUT_STYLE_HIDDEN ++}; ++ ++struct timeout_style_name { ++ const char *name; ++ enum timeout_style style; ++} timeout_style_names[] = { ++ {"menu", TIMEOUT_STYLE_MENU}, ++ {"countdown", TIMEOUT_STYLE_COUNTDOWN}, ++ {"hidden", TIMEOUT_STYLE_HIDDEN}, ++ {NULL, 0} ++}; ++ + /* Wait until the user pushes any key so that the user + can see what happened. */ + void +@@ -74,6 +90,40 @@ + return e; + } + ++/* Get the index of a menu entry associated with a given hotkey, or -1. */ ++static int ++get_entry_index_by_hotkey (grub_menu_t menu, int hotkey) ++{ ++ grub_menu_entry_t entry; ++ int i; ++ ++ for (i = 0, entry = menu->entry_list; i < menu->size; ++ i++, entry = entry->next) ++ if (entry->hotkey == hotkey) ++ return i; ++ ++ return -1; ++} ++ ++/* Return the timeout style. If the variable "timeout_style" is not set or ++ invalid, default to TIMEOUT_STYLE_MENU. */ ++static enum timeout_style ++get_timeout_style (void) ++{ ++ const char *val; ++ struct timeout_style_name *style_name; ++ ++ val = grub_env_get ("timeout_style"); ++ if (!val) ++ return TIMEOUT_STYLE_MENU; ++ ++ for (style_name = timeout_style_names; style_name->name; style_name++) ++ if (grub_strcmp (style_name->name, val) == 0) ++ return style_name->style; ++ ++ return TIMEOUT_STYLE_MENU; ++} ++ + /* Return the current timeout. If the variable "timeout" is not set or + invalid, return -1. */ + int +@@ -481,6 +531,33 @@ + return entry; + } + ++/* Check whether a second has elapsed since the last tick. If so, adjust ++ the timer and return 1; otherwise, return 0. */ ++static int ++has_second_elapsed (grub_uint64_t *saved_time) ++{ ++ grub_uint64_t current_time; ++ ++ current_time = grub_get_time_ms (); ++ if (current_time - *saved_time >= 1000) ++ { ++ *saved_time = current_time; ++ return 1; ++ } ++ else ++ return 0; ++} ++ ++static void ++print_countdown (grub_uint16_t *pos, int n) ++{ ++ grub_term_restore_pos (pos); ++ /* NOTE: Do not remove the trailing space characters. ++ They are required to clear the line. */ ++ grub_printf ("%d ", n); ++ grub_refresh (); ++} ++ + #define GRUB_MENU_PAGE_SIZE 10 + + /* Show the menu and handle menu entry selection. Returns the menu entry +@@ -495,6 +572,7 @@ + grub_uint64_t saved_time; + int default_entry, current_entry; + int timeout; ++ enum timeout_style timeout_style; + + default_entry = get_entry_number (menu, "default"); + +@@ -503,8 +581,74 @@ + if (default_entry < 0 || default_entry >= menu->size) + default_entry = 0; + ++ timeout = grub_menu_get_timeout (); ++ if (timeout < 0) ++ /* If there is no timeout, the "countdown" and "hidden" styles result in ++ the system doing nothing and providing no or very little indication ++ why. Technically this is what the user asked for, but it's not very ++ useful and likely to be a source of confusion, so we disallow this. */ ++ grub_env_unset ("timeout_style"); ++ ++ timeout_style = get_timeout_style (); ++ ++ if (timeout_style == TIMEOUT_STYLE_COUNTDOWN ++ || timeout_style == TIMEOUT_STYLE_HIDDEN) ++ { ++ static grub_uint16_t *pos; ++ int entry = -1; ++ ++ if (timeout_style == TIMEOUT_STYLE_COUNTDOWN && timeout) ++ { ++ pos = grub_term_save_pos (); ++ print_countdown (pos, timeout); ++ } ++ ++ /* Enter interruptible sleep until Escape or a menu hotkey is pressed, ++ or the timeout expires. */ ++ saved_time = grub_get_time_ms (); ++ while (1) ++ { ++ int key; ++ ++ if (grub_checkkey () >= 0) ++ key = grub_getkey (); ++ else ++ key = GRUB_TERM_NO_KEY; ++ if (key != GRUB_TERM_NO_KEY) ++ { ++ entry = get_entry_index_by_hotkey (menu, key); ++ if (entry >= 0) ++ break; ++ } ++ if (key == GRUB_TERM_ESC) ++ { ++ timeout = -1; ++ break; ++ } ++ ++ if (timeout > 0 && has_second_elapsed (&saved_time)) ++ { ++ timeout--; ++ if (timeout_style == TIMEOUT_STYLE_COUNTDOWN) ++ print_countdown (pos, timeout); ++ } ++ ++ if (timeout == 0) ++ /* We will fall through to auto-booting the default entry. */ ++ break; ++ } ++ ++ grub_env_unset ("timeout"); ++ grub_env_unset ("timeout_style"); ++ if (entry >= 0) ++ { ++ *auto_boot = 0; ++ return entry; ++ } ++ } ++ + /* If timeout is 0, drawing is pointless (and ugly). */ +- if (grub_menu_get_timeout () == 0) ++ if (timeout == 0) + { + *auto_boot = 1; + return default_entry; +@@ -533,18 +677,11 @@ + if (grub_normal_exit_level) + return -1; + +- if (timeout > 0) ++ if (timeout > 0 && has_second_elapsed (&saved_time)) + { +- grub_uint64_t current_time; +- +- current_time = grub_get_time_ms (); +- if (current_time - saved_time >= 1000) +- { +- timeout--; +- grub_menu_set_timeout (timeout); +- saved_time = current_time; +- menu_print_timeout (timeout); +- } ++ timeout--; ++ grub_menu_set_timeout (timeout); ++ menu_print_timeout (timeout); + } + + if (timeout == 0) +@@ -646,16 +783,15 @@ + + default: + { +- grub_menu_entry_t entry; +- int i; +- for (i = 0, entry = menu->entry_list; i < menu->size; +- i++, entry = entry->next) +- if (entry->hotkey == c) +- { +- menu_fini (); +- *auto_boot = 0; +- return i; +- } ++ int entry; ++ ++ entry = get_entry_index_by_hotkey (menu, c); ++ if (entry >= 0) ++ { ++ menu_fini (); ++ *auto_boot = 0; ++ return entry; ++ } + } + break; + } +Index: b/util/grub-mkconfig.in +=================================================================== +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -230,9 +230,11 @@ + GRUB_HIDDEN_TIMEOUT \ + GRUB_HIDDEN_TIMEOUT_QUIET \ + GRUB_TIMEOUT \ ++ GRUB_TIMEOUT_STYLE \ + GRUB_DEFAULT_BUTTON \ + GRUB_HIDDEN_TIMEOUT_BUTTON \ + GRUB_TIMEOUT_BUTTON \ ++ GRUB_TIMEOUT_STYLE_BUTTON \ + GRUB_BUTTON_CMOS_ADDRESS \ + GRUB_BUTTON_CMOS_CLEAN \ + GRUB_DISTRIBUTOR \ +Index: b/util/grub.d/00_header.in +=================================================================== +--- a/util/grub.d/00_header.in ++++ b/util/grub.d/00_header.in +@@ -225,15 +225,41 @@ + + make_timeout () + { +- if [ "x${1}" != "x" ] ; then +- if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then +- verbose= ++ if [ "x${1}${3}" != "x" ] ; then ++ if [ "x${3}" != "x" ] ; then ++ timeout="${2}" ++ style="${3}" + else ++ # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme. ++ timeout="${1}" ++ if [ "x${2}" != "x0" ] ; then ++ grub_warn "$(gettext "Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.")" ++ fi ++ if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then ++ style="hidden" ++ else ++ style="countdown" ++ fi ++ fi ++ if [ "x${style}" = "xcountdown" ] ; then + verbose=" --verbose" ++ else ++ verbose= ++ fi ++ cat << EOF ++if [ x\$feature_timeout_style = xy ] ; then ++ set timeout_style=${style} ++ set timeout=${timeout} ++EOF ++ if [ "x${style}" != "xmenu" ] ; then ++ cat << EOF ++# Fallback hidden-timeout code in case the timeout_style feature is ++# unavailable. ++elif sleep${verbose} --interruptible ${timeout} ; then ++ set timeout=0 ++EOF + fi + cat << EOF +-if sleep$verbose --interruptible ${1} ; then +- set timeout=${2} + fi + EOF + else +@@ -247,12 +273,12 @@ + cat <