Probed linux entries not bootable if original initrd line has more than one file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-prober (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have Manjaro Linux 18.0.4 installed and then recently installed Ubuntu 19.04 on another partition. After the Ubuntu install the Ubuntu created GRUB boot menu includes entries for booting Manjaro but they aren't functional. It is repeatable after install too, If I run update-grub2 from Ubuntu the prober finds Manjaro and adds boot entries but they are flawed in the same way. Namely the entries for booting Manjaro in the original Manjaro created grub.cfg contain:
but the entries in the Ubuntu created grub.cfg contain:
The second initrd file goes missing. Thus if I try to boot using the Ubuntu created entry for Manjaro I hit
"Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)"
... immediately at the beginning of boot.
I tracked the problem down to /usr/lib/
initrd=
From what I can tell the purpose of this is to strip GRUB style partition specifier prefix like "(hd0,1)" however it makes the assumption that the original initrd line it discovered in probing only contains a single file.
I am able to fix this behavior and make the Manjaro entry of the Ubuntu generate GRUB menu bootable if I change the "40grub2" prober and "30_os-prober" code as follows...
(borrows from the Manjaro version)
$ diff /usr/lib/
81,82d80
< initrd="$(echo "$2" | sed 's/(.*)//')"
< # Initrd same.
84c82,84
< initrd=
---
> initrd="$(echo "$line" | sed 's/initrd/
> else
> initrd="$(echo "$line" | sed 's/initrd/
$ diff /etc/grub.
246c246
< LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
---
> LINITRD="`echo ${LINUX} | cut -d ':' -f 5 | tr '^' ' '`"
ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: os-prober 1.74ubuntu1 [modified: usr/bin/
ProcVersionSign
Uname: Linux 5.0.0-25-generic x86_64
ApportVersion: 2.20.10-0ubuntu27.1
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Aug 16 10:03:03 2019
InstallationDate: Installed on 2019-08-15 (1 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: os-prober
UpgradeStatus: No upgrade log present (probably fresh install)
My apologies, I just realized I did have to change one more line to make the generated grub menu work for me, the diff of 30_os-prober should really be:
diff /etc/grub. d/30_os- prober. original /etc/grub. d/30_os- prober "${LINITRD# /boot}"
246c246
< LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
---
> LINITRD="`echo ${LINUX} | cut -d ':' -f 5 | tr '^' ' '`"
255c255
< LINITRD=
---
> LINITRD="$(echo $LINITRD | sed 's|/boot/|/|g')"
--Matt