summaryrefslogtreecommitdiff
path: root/os-prober/os-prober-1.79-efi-chroot-blkid-fallback.patch
blob: b5b90b2214daa685d5fb7956a1dcee1d37b0c6ee (plain)
    1 Fixes missing entries when os-prober is run in a chroot environment by falling back
    2 to blkid if udev isn't available or if /run/udev isn't bind mounted. Modified from
    3 https://build.opensuse.org/package/view_file/Base:System/os-prober/os-prober-05efi-blkid.patch?rev=103
    4 
    5 Bug: https://bugs.gentoo.org/761475
    6      https://bugzilla.opensuse.org/1076779
    7 
    8 --- a/os-probes/mounted/x86/05efi
    9 +++ b/os-probes/mounted/x86/05efi
   10 @@ -46,6 +46,14 @@ if type udevinfo > /dev/null 2>&1; then
   11  	fi
   12  
   13  	eval "$(udevinfo -q property -n "$partition" | grep -E '^ID_PART_ENTRY_(TYPE|SCHEME)=')"
   14 +
   15 +	# udev may not work in chroot as its db may not be there, bailout that by blkid (bsc#1076779)
   16 +	if [ -z "$ID_PART_ENTRY_TYPE" -a -z "$ID_PART_ENTRY_SCHEME" ] &&
   17 +		type blkid > /dev/null 2>&1; then
   18 +		debug "fallback to blkid"
   19 +		eval "$(blkid -p -o udev "$partition" | grep -E '^(ID_PART_ENTRY_(TYPE|SCHEME))=')"
   20 +	fi
   21 +
   22  	debug "$partition partition scheme is $ID_PART_ENTRY_SCHEME"
   23  	debug "$partition partition type is $ID_PART_ENTRY_TYPE"
   24  

Generated by cgit