Bug 1275105 - grub2-mkconfig fails in anaconda (pre) shell with '/etc/grub.d/30_os-prober: line 38: paste: command not found'
grub2-mkconfig fails in anaconda (pre) shell with '/etc/grub.d/30_os-prober: ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lorax (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Brian Lane
Release Test Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-25 18:44 EDT by Joseph Tingiris
Modified: 2016-11-03 19:44 EDT (History)
2 users (show)

See Also:
Fixed In Version: lorax-19.6.67-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 19:44:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joseph Tingiris 2015-10-25 18:44:35 EDT
Description of problem:

grub2-mkconfig fails if run from anaconda pre shell or used within pre script.

Version-Release number of selected component (if applicable):

anaconda 19.31.123-1

How reproducible:

run grub2-mkconfig when in anaconda 19.31.123-1 pre install shell

Steps to Reproduce:
1. kickstart or otherwise boot with install media
2. go to shell (alt+f2 or ssh)
3. execute grub2-mkconfig

Actual results:

[anaconda root@localhost grub.d]# grub2-mkconfig
Generating grub configuration file ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set pager=1

if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  3fda0d3e-61c5-40e8-8680-b57350488c5b
else
  search --no-floppy --fs-uuid --set=root 3fda0d3e-61c5-40e8-8680-b57350488c5b
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### BEGIN /etc/grub.d/30_os-prober ###
/etc/grub.d/30_os-prober: line 38: paste: command not found
[anaconda root@localhost grub.d]# 

Expected results:

paste command is found

or

30_os-prober should not rely on paste

Additional info:

Replacing paste with tr works;

[root@localhost /tmp]# diff 30_os-prober 30_os-prober.orig 
38c38
< OSPROBED="`os-prober | tr ' ' '^' | tr ' ' '\n'`"
---
> OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
189c189
<          LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid} ${BTRFSsubvol}  2> /dev/null | tr ' ' '^' | tr ' ' '\n'`"
---
>          LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid} ${BTRFSsubvol}  2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
191c191
<          LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | tr ' ' '\n'`"
---
>          LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
Comment 2 Brian Lane 2015-10-26 19:53:16 EDT
os-prober shouldn't need to be changed. lorax should stop removing paste.
Comment 3 Brian Lane 2015-11-06 14:24:36 EST
Proposed patch: https://github.com/rhinstaller/lorax/pull/65
Comment 7 errata-xmlrpc 2016-11-03 19:44:53 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2165.html

Note You need to log in before you can comment on or make changes to this bug.