Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 669232

Summary: sys-kernel/genkernel-next-68 fails to create grub.conf in gen_bootlader.sh when fstab is tab delimited.
Product: Gentoo Linux Reporter: Donald R. Gray Jr <donald.r.gray>
Component: Current packagesAssignee: Ettore Di Giacinto (RETIRED) <mudler>
Status: RESOLVED OBSOLETE    
Severity: normal CC: lssndrbarbieri
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to change cut to awk.
gen_bootloader_awk_fstab_v2.diff

Description Donald R. Gray Jr 2018-10-21 19:42:51 UTC
The offending code is the script is expecting fstab to be space delimited:
GRUB_BOOTFS=$(set_bootloader_read_fstab | cut -d' ' -f2)

Using awk will work for both space and tab delimited fstab entries:
GRUB_BOOTFS=$(set_bootloader_read_fstab | awk '{print $2}')


Reproducible: Always

Steps to Reproduce:
1.genkernel all with a new kernel and tab delimited fstab.
2.
3.
Comment 1 Donald R. Gray Jr 2018-10-21 19:49:34 UTC
Created attachment 552172 [details, diff]
patch to change cut to awk.

Patches cleanly on my local install.
Comment 2 Donald R. Gray Jr 2018-10-22 20:33:46 UTC
Error output:

awk: fatal: cannot open file `/var/tmp/genkernel/19937.521.11369.21055/grub.map' for reading (No such file or directory)
/usr/share/genkernel/gen_bootloader.sh: line 75: UUID="1b0b578b-a164-41b2-8c1c-61f1a37eecd6" - 1: syntax error: operand expected (error token is ""1b0b578b-a164-41b2-8c1c-61f1a37eecd6" - 1")
Comment 3 Donald R. Gray Jr 2018-10-28 16:13:17 UTC
Created attachment 553522 [details, diff]
gen_bootloader_awk_fstab_v2.diff

Previous path was selecting the mountpoint, not the filesystem type.
Comment 4 Alessandro Barbieri 2020-03-08 07:39:41 UTC
Ping?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-08-20 12:51:03 UTC
Package removed.