grub-mkconfig (running as update-grub) gives scary message "grep: input file '/tmp/grub.cfg.new' is also the output"

Bug #934269 reported by James Hunt
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Medium
Adam Conrad

Bug Description

Running update-grub gives the error:

    grep: input file '/tmp/grub.cfg.new' is also the output

This problem is caused by a combination of...

    250 exec > ${grub_cfg}.new

and ...

    285 if [ "x${grub_cfg}" != "x" ] && ! grep -q "^password " ${grub_cfg}.new ; then

effectively resulting in:

grep -q "^password" /tmp/grub.cfg.new > /tmp/grub.cfg.new

Problem is in patch debian/patches/grub.cfg_400.patch.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: grub2 (not installed)
ProcVersionSignature: Ubuntu 3.2.0-16.25-generic-pae 3.2.6
Uname: Linux 3.2.0-16-generic-pae i686
NonfreeKernelModules: nvidia
ApportVersion: 1.91-0ubuntu1
Architecture: i386
Date: Fri Feb 17 15:17:54 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: Upgraded to precise on 2012-01-12 (36 days ago)

Related branches

Revision history for this message
Sam_ (and-sam) wrote :

Similar bug 915008

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Changed in grub2 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Adam Conrad (adconrad) wrote :

Fixed in bzr.

Changed in grub2 (Ubuntu):
assignee: nobody → Adam Conrad (adconrad)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.0 KiB)

This bug was fixed in the package grub2 - 1.99-16ubuntu1

---------------
grub2 (1.99-16ubuntu1) precise; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Adjust for default Ubuntu boot options ("quiet splash").
    - Default to hiding the menu; holding down Shift at boot will show it.
    - Set a monochromatic theme and an appropriate background for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script.
    - Fix backslash-escaping in merge_debconf_into_conf.
    - Remove "GNU/Linux" from default distributor string.
    - Add crashkernel option.
    - Bypass menu unless other OSes are installed or Shift is pressed.
    - Allow Shift to interrupt 'sleep --interruptible'.
    - Reduce visual clutter in normal mode.
    - Remove verbose messages printed before reading configuration.
    - Suppress kernel/initrd progress messages, except in recovery mode.
    - Show the boot menu if the previous boot failed.
    - Don't generate device.map during grub-install or grub-mkconfig.
    - Adjust upgrade version checks for Ubuntu.
    - Suppress "GRUB loading" message unless Shift is held down.
    - Adjust versions of grub-doc and grub-legacy-doc conflicts.
    - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
    - Look for .mo files in /usr/share/locale-langpack first.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - Check hardware support before using gfxpayload=keep.
    - Put second and subsequent Linux menu entries in a submenu.
    - Preferred resolution detection for VBE.
    - Set vt.handoff=7 for smooth handoff to kernel graphical mode.
    - Update default/grub.md5sum to include maverick's default md5sum.
    - In recovery mode, add nomodeset to the Linux kernel arguments, and
      remove the 'set gfxpayload=keep' command.
    - Skip Windows os-prober entries on Wubi systems, and suppress the menu
      by default if those are the only other-OS entries.
    - Handle probing striped DM-RAID devices.
    - Replace 'single' by 'recovery' when friendly-recovery is installed.
  * Use qemu -no-kvm in tests for now to work around LP #947597.
  * Disable cursor as early as possible in grub_main (LP: #861048).

grub2 (1.99-16) unstable; urgency=low

  * Backport from upstream:
    - Build with -fno-asynchronous-unwind-tables to save space (closes:
      #662787).

grub2 (1.99-15) unstable; urgency=low

  [ Adam Conrad ]
  * grub.cfg_400.patch: Redirect grep stdout to /dev/null since
    grub-mkconfig is "exec > grub.cfg.new", which causes grep's input
    and output to be the same FD (LP: #934269) (closes: #652972)
  * efi_disk_cache.patch: Bump the disk cache on EFI systems to
    dramatically reduce load times for vmlinux/initrd (LP: #944347)

  [ Colin Watson ]
  * no_libzfs.patch: Use xasprintf rather than asprintf.
  * Backport from upstream:
    - Rewrite XFS btree parsing; fixes invalid BMAP (closes: #657776).
    - Handle newer autotools, and add some missing quotes in the process.
      (Note that this moves grub-mkconfig_lib and update-grub_lib to
      /usr/share/grub; I added links in /usr/lib/grub for compatibility.)
    - Fix incorrect identifiers ...

Read more...

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.