Bug 228062 - sysutils/grub2: error when running grub-mkconfig
Summary: sysutils/grub2: error when running grub-mkconfig
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks: 229925
  Show dependency treegraph
 
Reported: 2018-05-08 09:06 UTC by Victor Sudakov
Modified: 2018-12-30 08:49 UTC (History)
2 users (show)

See Also:


Attachments
grub2 says "please file a bug report with /mnt/boot/grub.new file attached" (4.44 KB, text/plain)
2018-05-08 09:06 UTC, Victor Sudakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Sudakov 2018-05-08 09:06:05 UTC
Created attachment 193176 [details]
grub2 says "please file a bug report with /mnt/boot/grub.new file attached"

Script started on Tue May  8 09:46:18 2018
root@grub2:~ # grub-mkconfig -o /mnt/boot/grub/grub.cfg 

Generating grub.cfg ...
Found kernel of FreeBSD: /boot/kernel/kernel
Found kernel module directory: /boot/kernel
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 67
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/mnt/boot/grub.new file attached.done
root@grub2:~ # 

Script done on Tue May  8 09:51:46 2018

grub2 says "please file a bug report with /mnt/boot/grub.new file attached" and I comply.
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2018-12-28 06:19:05 UTC
tinsmod part_gpt
tinsmod ufs2
tif [ x$feature_platform_search_hint = xy ]; then
t  search --no-floppy --fs-uuid --set=root  5af030d15d17915d
telse
t  search --no-floppy --fs-uuid --set=root 5af030d15d17915d
tfi

The 't's in the first column here are wrong.  It sounds like it's related to
bug #229925.

grub-mkconfig and helpers use things like sed -e "s/^/\t/" which only really
work as intended with gsed.
Comment 2 Kyle Evans freebsd_committer freebsd_triage 2018-12-28 06:31:56 UTC
(In reply to Tobias Kortkamp from comment #1)

I don't know that my input is requested/necessary, but your diagnosis is correct and this would have eventually been snared by the work done in PR 229925, though post-mortem if it's really only runtime breakage.

For what it's worth, teaching sed these escape sequences is high on my priority list after that exp-run. Forcing this to gsed will likely not be needed for more than 3-6 months.
Comment 3 Tobias Kortkamp freebsd_committer freebsd_triage 2018-12-28 06:59:00 UTC
(In reply to Kyle Evans from comment #2)
> I don't know that my input is requested/necessary, but your diagnosis is
> correct and this would have eventually been snared by the work done in PR
> 229925, though post-mortem if it's really only runtime breakage.

Thanks.  Additional input to confirm/refute something is always welcomed.
:-)

> For what it's worth, teaching sed these escape sequences is high on my
> priority list after that exp-run. Forcing this to gsed will likely not be
> needed for more than 3-6 months.

The port is slated for removal in about a month, so I'll try to
switch it over to gsed for the remainder of its life.
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-12-28 08:22:50 UTC
A commit references this bug:

Author: tobik
Date: Fri Dec 28 08:22:31 UTC 2018
New revision: 488585
URL: https://svnweb.freebsd.org/changeset/ports/488585

Log:
  sysutils/grub2: Fix grub-mkconfig

  Currently grub-mkconfig creates a bogus grub.cfg with lines like

  tinsmod part_gpt
  tinsmod ufs2

  grub-mkconfig and helpers use sed expressions like "s/^/\t/" or
  similar to indent grub.cfg with tabs which only really work as
  intended with gsed at the moment and currently just prefixes lines
  with a 't'.  Switch grub-mkconfig and other scripts over to gsed.

  help2man calls some scripts at build time, so add gsed as a build
  dependency too.

  PR:		228062
  Reported by:	vas@mpeks.tomsk.su

Changes:
  head/sysutils/grub2/Makefile
Comment 5 Victor Sudakov 2018-12-30 08:32:13 UTC
(In reply to Tobias Kortkamp from comment #3)
> The port is slated for removal in about a month

Which port is slated for removal? sysutils/grub2 ? What will it be replaced by?
Comment 6 Tobias Kortkamp freebsd_committer freebsd_triage 2018-12-30 08:49:00 UTC
(In reply to vas from comment #5)
> (In reply to Tobias Kortkamp from comment #3)
> > The port is slated for removal in about a month
> 
> Which port is slated for removal? sysutils/grub2 ?

Yes...