[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#983107: os-prober: generic subvolume support for btrfs



Hi,

Speaking of btrfs integration to grub, I noticed some strange cruft
code in /etc/grub.d/30_os-prober.  (grub-common package)  Maybe this is
some backward compatibility feature code to address older os-prober. 
We may need to be careful around here or this may be an non-issue.

In /etc/grub.d/30_os-prober
---
BTRFS="`echo ${OS} | cut -d ':' -f 5`"
if [ "x$BTRFS" = "xbtrfs" ]; then
      BTRFSuuid="`echo ${OS} | cut -d ':' -f 6`"
      BTRFSsubvol="`echo ${OS} | cut -d ':' -f 7`"
fi
---

${OS} is basically 's/\s/^/g' on os-prober output.  But there should be
only 4 fields.  So this yield BTRFS="" etc.

So the following code
---
    linux)
      if [ "x$BTRFS" = "xbtrfs" ]; then
         LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid}
${BTRFSsubvol}  2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      else
         LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr '
' '^' | paste -s -d ' '`"
      fi
---

So always *else* side is executed with the current os-prober.
Current linux-boot-prober in os-prober has its internal FS detection
for btrfs where Ubuntu's patch (and my improvement suggestion patch)
uses and make bind mount subvolume.


On Sat, 2021-02-20 at 07:19 +0100, Cyril Brulebois wrote:
> loop += Nicholas, who has been working on btrfs integration.
> 
> Cheers,


Reply to: