bugGNU GRUB - Bugs: bug #45010, CentOS7 minimal install fails with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #45010: CentOS7 minimal install fails with "error: invalid modinfo file"

Submitter:  Perry Ross <prr>
Submitted:  Mon 04 May 2015 05:24:25 PM UTC
   
 
Category:  Installation Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  prr
Open/Closed:  Open Release:  Git master
Release:  Reproducibility:  Every Time
Planned Release:  2.03+

Thu 07 May 2015 03:12:26 PM UTC, comment #3: 

What locale do you use? Please type "locale" and "set" in shell. This sounds like some weird local problem. Last time we had sth similar it was about [a-z] not matching u in Estonian due to different letter order. Also could you make it print the input and output? Then could you try using strstr with those inputs in astandalone program?

Vladimir Serbinenko <phcoder>
Group administrator
Wed 06 May 2015 09:54:58 PM UTC, comment #2: 

Agreed, as a guess I'd say there's something wrong with the strstr in the C library, although I can't imagine what.

I assumed there was a reason for having a private copy as grub_strstr(), and when I saw it was used everywhere else but these two spots, I decided to try it, and it worked.

But what the "correct fix" would be, I don't have a clue.

The problem was repeatable.  I used CentOS-7-x86_64-Minimal-1503-01.iso, and the kickstart is pasted in below.  It was installing under KVM with these settings:

1GB RAM
1 CPU
10GB qcow2 hd
no graphics

I'm happy to test fixes if that helps.

HTH! -- prr

kickstart:

text
skipx
cmdline
lang en_US
keyboard us
network --onboot=on --bootproto=dhcp
firewall --enabled --service=ssh,http,https,samba,samba-client
services --enabled=sshd,httpd,smb
eula --agreed
auth --useshadow --passalgo=sha512
rootpw XXXXXX!
selinux --disabled
timezone --utc UTC
bootloader --location=mbr --driveorder=sda --password=St0rnext!
zerombr
clearpart --all
part /boot --size=1000 --fstype=xfs
part swap  --size=2000
part /     --size=1000 --fstype=xfs --grow
firstboot --disable
poweroff

%pre

%end
%packages --ignoremissing
@core
samba
ntp
vim-enhanced
libguestfs-tools

%end
%post
# yum clean all
# ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
# cp -p -f --context=system_u:object_r:ssh_home_t:s0 /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
# chmod 600 /root/.ssh/authorized_keys

%end


Perry Ross <prr>
Wed 06 May 2015 05:39:49 PM UTC, comment #1: 

That really sounds more like CentOS issue and I would like to understand why it fails and fix root cause, not paper over.

Buffer size is not nice but we are really interested in two strings and they have always been at the same location in this file. Thanks for the hint.

Andrei Borzenkov <arvidjaar>
Group Member
Mon 04 May 2015 05:24:25 PM UTC, original submission:  

While doing CentOS7 minimal install with custom kickstart, I get:

grub2-install: error: invalid modinfo file '/usr/lib/grub/i386-pc/modinfo.sh'

For some reason, strstr is incorrectly returning null in 2 places in util/grub-install-common.c:

  c = strstr (buf, "grub_modinfo_target_cpu=");
  if (!c || (c != buf && !grub_isspace (*(c-1))))
    grub_util_error (_("invalid modinfo file `%s'"), fn);
  pl = strstr (buf, "grub_modinfo_platform=");
  if (!pl || (pl != buf && !grub_isspace (*(pl-1))))
    grub_util_error (_("invalid modinfo file `%s'"), fn);

Changing both strstr() to grub_strstr() fixes this.

As an aside, I also noted that the buffer for reading modinfo.sh is only 2048, while the file is 2251 (due to some recent additions, I think).  It works here, because the options we are looking for seem to be at the top of the file, but it could become  a problem later.

Perry Ross <prr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by rwp (Updated the item)
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by prr (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-06 phcoder Planned Release2.02 2.03+
    2016-03-02 phcoder Planned ReleaseNone 2.02
    2015-05-07 rwp PrivacyPrivate Public
    2015-05-07 rwp PrivacyPublic Private

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code