You are not logged in.

#1 2023-01-20 19:37:55

InvisibleRasta
Member
Registered: 2017-04-12
Posts: 111

grub-mkconfig detecting os but not adding it to grub.cfg

Hello guys, I have been having a weir bug with grub-mkconfig and os-prober, it seems like grub-mkconfig detects all the installed os's but it is not adding Fedora the the grub.cfg file. This is a UEFI install with both distros installed in their respective subvolume @arch @fedora.


sudo grub-mkconfig -o /boot/grub/grub.cfg

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Found Fedora Linux 37 (Workstation Edition) on /dev/sda5
Adding boot menu entry for UEFI Firmware Settings ...
done

sudo cat  /boot/grub/grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod btrfs
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  abadf235-d80f-4d5e-b85e-5cd82c828d92
else
  search --no-floppy --fs-uuid --set=root abadf235-d80f-4d5e-b85e-5cd82c828d92
fi
    font="/@arch/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-abadf235-d80f-4d5e-b85e-5cd82c828d92' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod btrfs
	set root='hd0,gpt5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  abadf235-d80f-4d5e-b85e-5cd82c828d92
	else
	  search --no-floppy --fs-uuid --set=root abadf235-d80f-4d5e-b85e-5cd82c828d92
	fi
	echo	'Loading Linux linux ...'
	linux	/@arch/boot/vmlinuz-linux root=UUID=abadf235-d80f-4d5e-b85e-5cd82c828d92 rw rootflags=subvol=@arch  loglevel=3 quiet
	echo	'Loading initial ramdisk ...'
	initrd	/@arch/boot/intel-ucode.img /@arch/boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-abadf235-d80f-4d5e-b85e-5cd82c828d92' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-abadf235-d80f-4d5e-b85e-5cd82c828d92' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod btrfs
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  abadf235-d80f-4d5e-b85e-5cd82c828d92
		else
		  search --no-floppy --fs-uuid --set=root abadf235-d80f-4d5e-b85e-5cd82c828d92
		fi
		echo	'Loading Linux linux ...'
		linux	/@arch/boot/vmlinuz-linux root=UUID=abadf235-d80f-4d5e-b85e-5cd82c828d92 rw rootflags=subvol=@arch  loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/@arch/boot/intel-ucode.img /@arch/boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-abadf235-d80f-4d5e-b85e-5cd82c828d92' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod btrfs
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  abadf235-d80f-4d5e-b85e-5cd82c828d92
		else
		  search --no-floppy --fs-uuid --set=root abadf235-d80f-4d5e-b85e-5cd82c828d92
		fi
		echo	'Loading Linux linux ...'
		linux	/@arch/boot/vmlinuz-linux root=UUID=abadf235-d80f-4d5e-b85e-5cd82c828d92 rw rootflags=subvol=@arch  loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/@arch/boot/intel-ucode.img /@arch/boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-244D-A310' {
	insmod part_gpt
	insmod fat
	set root='hd0,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  244D-A310
	else
	  search --no-floppy --fs-uuid --set=root 244D-A310
	fi
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
	fwsetup --is-supported
	if [ "$?" = 0 ]; then
		menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
			fwsetup
		}
	fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

Offline

#2 2023-01-20 22:08:00

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: grub-mkconfig detecting os but not adding it to grub.cfg

F37 came out 4 month after current os-prober release. Its probably not yet prepared.
You could try to debug it. Maybe modify '/usr/bin/os-prober' with this:

#!/bin/sh
set -e
set -x
exec &> /tmp/osprober.log

Last edited by Maniaxx (2023-01-20 22:29:05)


sys2064

Offline

#3 2023-01-20 22:21:43

InvisibleRasta
Member
Registered: 2017-04-12
Posts: 111

Re: grub-mkconfig detecting os but not adding it to grub.cfg

ok, here is the output of the debug:

cat /tmp/osprober.log
+ export fd_result=3
+ fd_result=3
+ export fd_logger=9
+ fd_logger=9
+ . /usr/share/os-prober/common.sh
++ cleanup_tmpdir=false
++ progname=
++ eval '
  log() {
    cache_progname
    echo "$progname: $@"  1>&9
  }
'
++ export fd_logger
++ eval '
  result() {
    log "result:" "$@"
    echo "$@"  1>&3
  }
'
++ export fd_result
++ type mapdevfs
+++ which umount
++ umount_exec=/usr/bin/umount
+ newns
+ '[' 1 ']'
+ require_tmpdir
+ '[' -z '' ']'
+ type mktemp
++ mktemp -d /tmp/os-prober.XXXXXX
+ export OS_PROBER_TMP=/tmp/os-prober.NPZe15
+ OS_PROBER_TMP=/tmp/os-prober.NPZe15
+ cleanup_tmpdir=:
+ trap cleanup EXIT HUP INT QUIT TERM
+ :
++ type dmraid
+ DMRAID=
+ '[' '' ']'
+ rm -f /var/lib/os-prober/labels
+ for prog in /usr/lib/os-probes/init/*
+ '[' -x /usr/lib/os-probes/init/10filesystems ']'
+ '[' -f /usr/lib/os-probes/init/10filesystems ']'
+ /usr/lib/os-probes/init/10filesystems
+ grep '^/dev/' /proc/mounts
+ parse_proc_mounts
+ read -r line
+ set -f
+ set -- /dev/sda5 / btrfs rw,noatime,ssd,space_cache=v2,subvolid=441,subvol=/@arch 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 / btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /.snapshots btrfs rw,noatime,ssd,space_cache=v2,subvolid=463,subvol=/@arch/.snapshots 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /.snapshots btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /home btrfs rw,noatime,ssd,space_cache=v2,subvolid=732,subvol=/@arch/home 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /home btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /home/.snapshots btrfs rw,noatime,ssd,space_cache=v2,subvolid=739,subvol=/@arch/home/.snapshots 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /home/.snapshots btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /home/invra/.dotfiles btrfs rw,noatime,ssd,space_cache=v2,subvolid=755,subvol=/@dotfiles 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /home/invra/.dotfiles btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /var/cache btrfs rw,noatime,ssd,space_cache=v2,subvolid=452,subvol=/@arch/var/cache 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /var/cache btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /swap btrfs rw,noatime,ssd,space_cache=v2,subvolid=476,subvol=/@swap 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /swap btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /var/log btrfs rw,noatime,ssd,space_cache=v2,subvolid=451,subvol=/@arch/var/log 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /var/log btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda5 /var/tmp btrfs rw,noatime,ssd,space_cache=v2,subvolid=453,subvol=/@arch/var/tmp 0 0
+ set +f
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ printf '%s %s %s %s\n' /dev/sda5 /var/tmp btrfs /dev/sda5
+ read -r line
+ set -f
+ set -- /dev/sda1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,utf8,errors=remount-ro 0 0
+ set +f
++ mapdevfs /dev/sda1
++ readlink -f /dev/sda1
+ printf '%s %s %s %s\n' /dev/sda1 /boot/efi vfat /dev/sda1
+ read -r line
+ set -f
+ set -- /dev/sdd1 /mnt/Downloads fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
+ set +f
++ mapdevfs /dev/sdd1
++ readlink -f /dev/sdd1
+ printf '%s %s %s %s\n' /dev/sdd1 /mnt/Downloads fuseblk /dev/sdd1
+ read -r line
+ set -f
+ set -- /dev/md126p1 /mnt/Raid0 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
+ set +f
++ mapdevfs /dev/md126p1
++ readlink -f /dev/md126p1
+ printf '%s %s %s %s\n' /dev/md126p1 /mnt/Raid0 fuseblk /dev/md126p1
+ read -r line
+ :
+ '[' -f /proc/swaps ']'
+ grep '^/dev/' /proc/swaps
+ parse_proc_swaps
+ read line
+ :
+ '[' -f /proc/mdstat ']'
+ grep '^md' /proc/mdstat
+ cut -d: -f2-
+ parse_proc_mdstat
+ type udevadm
+ read line
+ for word in $line
+ dev=active
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/active
+ grep -q '/.*/.*/'
+ continue
+ for word in $line
+ dev=raid0
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/raid0
+ grep -q '/.*/.*/'
+ continue
+ for word in $line
+ dev=sdb
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/sdb
+ grep -q '/.*/.*/'
+ raidpart=/dev/sdb
++ mapdevfs /dev/sdb
++ readlink -f /dev/sdb
+ echo /dev/sdb
+ for word in $line
+ dev=sdc
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/sdc
+ grep -q '/.*/.*/'
+ raidpart=/dev/sdc
++ mapdevfs /dev/sdc
++ readlink -f /dev/sdc
+ echo /dev/sdc
+ read line
+ for word in $line
+ dev=inactive
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/inactive
+ grep -q '/.*/.*/'
+ continue
+ for word in $line
+ dev=sdb
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/sdb
+ grep -q '/.*/.*/'
+ raidpart=/dev/sdb
++ mapdevfs /dev/sdb
++ readlink -f /dev/sdb
+ echo /dev/sdb
+ for word in $line
+ dev=sdc
+ '[' -d /sys/block ']'
+ type udevinfo
+ udevinfo -q path -n /dev/sdc
+ grep -q '/.*/.*/'
+ raidpart=/dev/sdc
++ mapdevfs /dev/sdc
++ readlink -f /dev/sdc
+ echo /dev/sdc
+ read line
+ :
+ logger
++ partitions
+++ uname -s
++ os_name=Linux
++ '[' -d /sys/block ']'
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/md126/md126p1/start ']'
++ '[' '!' -f /sys/block/md126/md126p1/whole_disk ']'
++ on_sataraid /sys/block/md126/md126p1
++ local parent=/sys/block/md126
++ local device=/dev/md126
++ grep -q /dev/md126 /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo md126p1
+++ sed 's,[!.],/,g'
++ name=md126p1
++ '[' -e /dev/md126p1 ']'
++ echo /dev/md126p1
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/sda/sda1/start ']'
++ '[' '!' -f /sys/block/sda/sda1/whole_disk ']'
++ on_sataraid /sys/block/sda/sda1
++ local parent=/sys/block/sda
++ local device=/dev/sda
++ grep -q /dev/sda /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo sda1
+++ sed 's,[!.],/,g'
++ name=sda1
++ '[' -e /dev/sda1 ']'
++ echo /dev/sda1
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/sda/sda2/start ']'
++ '[' '!' -f /sys/block/sda/sda2/whole_disk ']'
++ on_sataraid /sys/block/sda/sda2
++ local parent=/sys/block/sda
++ local device=/dev/sda
++ grep -q /dev/sda /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo sda2
+++ sed 's,[!.],/,g'
++ name=sda2
++ '[' -e /dev/sda2 ']'
++ echo /dev/sda2
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/sda/sda3/start ']'
++ '[' '!' -f /sys/block/sda/sda3/whole_disk ']'
++ on_sataraid /sys/block/sda/sda3
++ local parent=/sys/block/sda
++ local device=/dev/sda
++ grep -q /dev/sda /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo sda3
+++ sed 's,[!.],/,g'
++ name=sda3
++ '[' -e /dev/sda3 ']'
++ echo /dev/sda3
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/sda/sda4/start ']'
++ '[' '!' -f /sys/block/sda/sda4/whole_disk ']'
++ on_sataraid /sys/block/sda/sda4
++ local parent=/sys/block/sda
++ local device=/dev/sda
++ grep -q /dev/sda /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo sda4
+++ sed 's,[!.],/,g'
++ name=sda4
++ '[' -e /dev/sda4 ']'
++ echo /dev/sda4
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/sda/sda5/start ']'
++ '[' '!' -f /sys/block/sda/sda5/whole_disk ']'
++ on_sataraid /sys/block/sda/sda5
++ local parent=/sys/block/sda
++ local device=/dev/sda
++ grep -q /dev/sda /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo sda5
+++ sed 's,[!.],/,g'
++ name=sda5
++ '[' -e /dev/sda5 ']'
++ echo /dev/sda5
++ for part in /sys/block/*/*[0-9]
++ '[' -f /sys/block/sdd/sdd1/start ']'
++ '[' '!' -f /sys/block/sdd/sdd1/whole_disk ']'
++ on_sataraid /sys/block/sdd/sdd1
++ local parent=/sys/block/sdd
++ local device=/dev/sdd
++ grep -q /dev/sdd /tmp/os-prober.NPZe15/dmraid-map
++ return 1
+++ echo sdd1
+++ sed 's,[!.],/,g'
++ name=sdd1
++ '[' -e /dev/sdd1 ']'
++ echo /dev/sdd1
++ type dmraid
++ dmraid -s -c
+++ dmraid -sa -c
++ '[' -f /proc/mdstat ']'
++ awk '/^md/ {printf "/dev/"$1"\n"}' /proc/mdstat
++ type lvs
+++ LVM_SUPPRESS_FD_WARNINGS=1
+++ log_output lvs --noheadings --separator : -o vg_name,lv_name
+++ sed 's|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|'
++ echo ''
++ blkid
++ grep 'TYPE="btrfs"'
++ cut -d : -f 1
+ for partition in $(partitions)
++ mapdevfs /dev/md126p1
++ readlink -f /dev/md126p1
+ mapped=/dev/md126p1
+ grep -q '^/dev/md126p1' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/md126p1 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/md126p1
+ type=ntfs
+ '[' ntfs = btrfs ']'
+ grep -q '^/dev/md126p1 ' /tmp/os-prober.NPZe15/mounted-map
++ grep '^/dev/md126p1 ' /tmp/os-prober.NPZe15/mounted-map
++ head -n1
++ cut -d ' ' -f 2
+ mpoint=/mnt/Raid0
++ unescape_mount /mnt/Raid0
++ printf %s /mnt/Raid0
++ sed 's/\\011/	/g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
+ mpoint=/mnt/Raid0
+ '[' /mnt/Raid0 '!=' /target/boot ']'
+ '[' /mnt/Raid0 '!=' /target ']'
+ '[' /mnt/Raid0 '!=' / ']'
++ grep '^/dev/md126p1 ' /tmp/os-prober.NPZe15/mounted-map
++ head -n1
++ cut -d ' ' -f 3
+ type=fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/05efi ']'
+ '[' -x /usr/lib/os-probes/mounted/05efi ']'
+ debug 'running /usr/lib/os-probes/mounted/05efi on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ progname=os-prober
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/05efi /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/10freedos ']'
+ '[' -x /usr/lib/os-probes/mounted/10freedos ']'
+ debug 'running /usr/lib/os-probes/mounted/10freedos on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/10freedos on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/10freedos on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/10freedos /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/10qnx ']'
+ '[' -x /usr/lib/os-probes/mounted/10qnx ']'
+ debug 'running /usr/lib/os-probes/mounted/10qnx on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/10qnx on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/10qnx on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/10qnx /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/20macosx ']'
+ '[' -x /usr/lib/os-probes/mounted/20macosx ']'
+ debug 'running /usr/lib/os-probes/mounted/20macosx on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/20macosx on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/20macosx on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/20macosx /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/20microsoft ']'
+ '[' -x /usr/lib/os-probes/mounted/20microsoft ']'
+ debug 'running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/20microsoft /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/30utility ']'
+ '[' -x /usr/lib/os-probes/mounted/30utility ']'
+ debug 'running /usr/lib/os-probes/mounted/30utility on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/30utility on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/30utility on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/30utility /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/40lsb ']'
+ '[' -x /usr/lib/os-probes/mounted/40lsb ']'
+ debug 'running /usr/lib/os-probes/mounted/40lsb on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/40lsb on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/40lsb on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/40lsb /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/70hurd ']'
+ '[' -x /usr/lib/os-probes/mounted/70hurd ']'
+ debug 'running /usr/lib/os-probes/mounted/70hurd on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/70hurd on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/70hurd on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/70hurd /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/80minix ']'
+ '[' -x /usr/lib/os-probes/mounted/80minix ']'
+ debug 'running /usr/lib/os-probes/mounted/80minix on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/80minix on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/80minix on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/80minix /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/83haiku ']'
+ '[' -x /usr/lib/os-probes/mounted/83haiku ']'
+ debug 'running /usr/lib/os-probes/mounted/83haiku on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/83haiku on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/83haiku on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/83haiku /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/90linux-distro ']'
+ '[' -x /usr/lib/os-probes/mounted/90linux-distro ']'
+ debug 'running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/90linux-distro /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/90linux-distro.orig ']'
+ '[' -x /usr/lib/os-probes/mounted/90linux-distro.orig ']'
+ debug 'running /usr/lib/os-probes/mounted/90linux-distro.orig on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/90linux-distro.orig on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/90linux-distro.orig on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/90linux-distro.orig /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/90solaris ']'
+ '[' -x /usr/lib/os-probes/mounted/90solaris ']'
+ debug 'running /usr/lib/os-probes/mounted/90solaris on mounted /dev/md126p1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/90solaris on mounted /dev/md126p1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/90solaris on mounted /dev/md126p1'
+ /usr/lib/os-probes/mounted/90solaris /dev/md126p1 /mnt/Raid0 fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/efi ']'
+ for partition in $(partitions)
++ mapdevfs /dev/sda1
++ readlink -f /dev/sda1
+ mapped=/dev/sda1
+ grep -q '^/dev/sda1' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sda1 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sda1
+ type=vfat
+ '[' vfat = btrfs ']'
+ grep -q '^/dev/sda1 ' /tmp/os-prober.NPZe15/mounted-map
++ grep '^/dev/sda1 ' /tmp/os-prober.NPZe15/mounted-map
++ head -n1
++ cut -d ' ' -f 2
+ mpoint=/boot/efi
++ unescape_mount /boot/efi
++ printf %s /boot/efi
++ sed 's/\\011/	/g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
+ mpoint=/boot/efi
+ '[' /boot/efi '!=' /target/boot ']'
+ '[' /boot/efi '!=' /target ']'
+ '[' /boot/efi '!=' / ']'
++ grep '^/dev/sda1 ' /tmp/os-prober.NPZe15/mounted-map
++ head -n1
++ cut -d ' ' -f 3
+ type=vfat
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/05efi ']'
+ '[' -x /usr/lib/os-probes/mounted/05efi ']'
+ debug 'running /usr/lib/os-probes/mounted/05efi on mounted /dev/sda1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/sda1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/sda1'
+ /usr/lib/os-probes/mounted/05efi /dev/sda1 /boot/efi vfat
/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
+ debug 'os detected by /usr/lib/os-probes/mounted/05efi'
+ '[' -z '' ']'
+ log 'debug: os detected by /usr/lib/os-probes/mounted/05efi'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: os detected by /usr/lib/os-probes/mounted/05efi'
+ break
+ for partition in $(partitions)
++ mapdevfs /dev/sda2
++ readlink -f /dev/sda2
+ mapped=/dev/sda2
+ grep -q '^/dev/sda2' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sda2 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sda2
+ type=
+ '[' '' = btrfs ']'
+ grep -q '^/dev/sda2 ' /tmp/os-prober.NPZe15/mounted-map
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests on /dev/sda2'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda2'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda2'
+ /usr/lib/os-probes/50mounted-tests /dev/sda2
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests.orig ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests.orig ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda2'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda2'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda2'
+ /usr/lib/os-probes/50mounted-tests.orig /dev/sda2
+ debug 'os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ '[' -z '' ']'
+ log 'debug: os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ break
+ for partition in $(partitions)
++ mapdevfs /dev/sda3
++ readlink -f /dev/sda3
+ mapped=/dev/sda3
+ grep -q '^/dev/sda3' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sda3 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sda3
+ type=ntfs
+ '[' ntfs = btrfs ']'
+ grep -q '^/dev/sda3 ' /tmp/os-prober.NPZe15/mounted-map
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests on /dev/sda3'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda3'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda3'
+ /usr/lib/os-probes/50mounted-tests /dev/sda3
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests.orig ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests.orig ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda3'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda3'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda3'
+ /usr/lib/os-probes/50mounted-tests.orig /dev/sda3
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/init ']'
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/mounted ']'
+ for partition in $(partitions)
++ mapdevfs /dev/sda4
++ readlink -f /dev/sda4
+ mapped=/dev/sda4
+ grep -q '^/dev/sda4' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sda4 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sda4
+ type=ntfs
+ '[' ntfs = btrfs ']'
+ grep -q '^/dev/sda4 ' /tmp/os-prober.NPZe15/mounted-map
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests on /dev/sda4'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda4'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda4'
+ /usr/lib/os-probes/50mounted-tests /dev/sda4
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests.orig ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests.orig ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda4'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda4'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/sda4'
+ /usr/lib/os-probes/50mounted-tests.orig /dev/sda4
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/init ']'
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/mounted ']'
+ for partition in $(partitions)
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ mapped=/dev/sda5
+ grep -q '^/dev/sda5' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sda5 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sda5
+ type=btrfs
+ '[' btrfs = btrfs ']'
++ blkid -o value -s UUID /dev/sda5
+ uuid=abadf235-d80f-4d5e-b85e-5cd82c828d92
+ grep -q '^abadf235-d80f-4d5e-b85e-5cd82c828d92' /tmp/os-prober.NPZe15/btrfs-vols
+ debug 'btrfs volume uuid=abadf235-d80f-4d5e-b85e-5cd82c828d92 partition=/dev/sda5'
+ '[' -z '' ']'
+ log 'debug: btrfs volume uuid=abadf235-d80f-4d5e-b85e-5cd82c828d92 partition=/dev/sda5'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: btrfs volume uuid=abadf235-d80f-4d5e-b85e-5cd82c828d92 partition=/dev/sda5'
+ echo abadf235-d80f-4d5e-b85e-5cd82c828d92
+ test=/usr/lib/os-probes/50mounted-tests
+ '[' -f /usr/lib/os-probes/50mounted-tests ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests on btrfs /dev/sda5'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests on btrfs /dev/sda5'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests on btrfs /dev/sda5'
+ /usr/lib/os-probes/50mounted-tests btrfs abadf235-d80f-4d5e-b85e-5cd82c828d92 /dev/sda5
/dev/sda5:Fedora Linux 37 (Workstation Edition):Fedora:linux:btrfs:UUID=abadf235-d80f-4d5e-b85e-5cd82c828d92:subvol=@fedora
+ debug 'os detected by /usr/lib/os-probes/50mounted-tests'
+ '[' -z '' ']'
+ log 'debug: os detected by /usr/lib/os-probes/50mounted-tests'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: os detected by /usr/lib/os-probes/50mounted-tests'
+ continue
+ for partition in $(partitions)
++ mapdevfs /dev/sdd1
++ readlink -f /dev/sdd1
+ mapped=/dev/sdd1
+ grep -q '^/dev/sdd1' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sdd1 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sdd1
+ type=ntfs
+ '[' ntfs = btrfs ']'
+ grep -q '^/dev/sdd1 ' /tmp/os-prober.NPZe15/mounted-map
++ grep '^/dev/sdd1 ' /tmp/os-prober.NPZe15/mounted-map
++ head -n1
++ cut -d ' ' -f 2
+ mpoint=/mnt/Downloads
++ unescape_mount /mnt/Downloads
++ printf %s /mnt/Downloads
++ sed 's/\\011/	/g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
+ mpoint=/mnt/Downloads
+ '[' /mnt/Downloads '!=' /target/boot ']'
+ '[' /mnt/Downloads '!=' /target ']'
+ '[' /mnt/Downloads '!=' / ']'
++ grep '^/dev/sdd1 ' /tmp/os-prober.NPZe15/mounted-map
++ head -n1
++ cut -d ' ' -f 3
+ type=fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/05efi ']'
+ '[' -x /usr/lib/os-probes/mounted/05efi ']'
+ debug 'running /usr/lib/os-probes/mounted/05efi on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/05efi /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/10freedos ']'
+ '[' -x /usr/lib/os-probes/mounted/10freedos ']'
+ debug 'running /usr/lib/os-probes/mounted/10freedos on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/10freedos on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/10freedos on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/10freedos /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/10qnx ']'
+ '[' -x /usr/lib/os-probes/mounted/10qnx ']'
+ debug 'running /usr/lib/os-probes/mounted/10qnx on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/10qnx on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/10qnx on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/10qnx /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/20macosx ']'
+ '[' -x /usr/lib/os-probes/mounted/20macosx ']'
+ debug 'running /usr/lib/os-probes/mounted/20macosx on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/20macosx on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/20macosx on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/20macosx /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/20microsoft ']'
+ '[' -x /usr/lib/os-probes/mounted/20microsoft ']'
+ debug 'running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/20microsoft /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/30utility ']'
+ '[' -x /usr/lib/os-probes/mounted/30utility ']'
+ debug 'running /usr/lib/os-probes/mounted/30utility on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/30utility on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/30utility on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/30utility /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/40lsb ']'
+ '[' -x /usr/lib/os-probes/mounted/40lsb ']'
+ debug 'running /usr/lib/os-probes/mounted/40lsb on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/40lsb on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/40lsb on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/40lsb /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/70hurd ']'
+ '[' -x /usr/lib/os-probes/mounted/70hurd ']'
+ debug 'running /usr/lib/os-probes/mounted/70hurd on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/70hurd on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/70hurd on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/70hurd /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/80minix ']'
+ '[' -x /usr/lib/os-probes/mounted/80minix ']'
+ debug 'running /usr/lib/os-probes/mounted/80minix on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/80minix on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/80minix on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/80minix /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/83haiku ']'
+ '[' -x /usr/lib/os-probes/mounted/83haiku ']'
+ debug 'running /usr/lib/os-probes/mounted/83haiku on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/83haiku on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/83haiku on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/83haiku /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/90linux-distro ']'
+ '[' -x /usr/lib/os-probes/mounted/90linux-distro ']'
+ debug 'running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/90linux-distro /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/90linux-distro.orig ']'
+ '[' -x /usr/lib/os-probes/mounted/90linux-distro.orig ']'
+ debug 'running /usr/lib/os-probes/mounted/90linux-distro.orig on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/90linux-distro.orig on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/90linux-distro.orig on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/90linux-distro.orig /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/90solaris ']'
+ '[' -x /usr/lib/os-probes/mounted/90solaris ']'
+ debug 'running /usr/lib/os-probes/mounted/90solaris on mounted /dev/sdd1'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/mounted/90solaris on mounted /dev/sdd1'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/mounted/90solaris on mounted /dev/sdd1'
+ /usr/lib/os-probes/mounted/90solaris /dev/sdd1 /mnt/Downloads fuseblk
+ for test in /usr/lib/os-probes/mounted/*
+ '[' -f /usr/lib/os-probes/mounted/efi ']'
+ for partition in $(partitions)
++ mapdevfs /dev/md126
++ readlink -f /dev/md126
+ mapped=/dev/md126
+ grep -q '^/dev/md126' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/md126 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/md126
+ type=
+ '[' '' = btrfs ']'
+ grep -q '^/dev/md126 ' /tmp/os-prober.NPZe15/mounted-map
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests on /dev/md126'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests on /dev/md126'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/md126'
+ /usr/lib/os-probes/50mounted-tests /dev/md126
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests.orig ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests.orig ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests.orig on /dev/md126'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/md126'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/md126'
+ /usr/lib/os-probes/50mounted-tests.orig /dev/md126
+ debug 'os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ '[' -z '' ']'
+ log 'debug: os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ break
+ for partition in $(partitions)
++ mapdevfs /dev/md127
++ readlink -f /dev/md127
+ mapped=/dev/md127
+ grep -q '^/dev/md127' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/md127 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/md127
++ true
+ type=
+ '[' '' = btrfs ']'
+ grep -q '^/dev/md127 ' /tmp/os-prober.NPZe15/mounted-map
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests on /dev/md127'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests on /dev/md127'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/md127'
+ /usr/lib/os-probes/50mounted-tests /dev/md127
+ for test in /usr/lib/os-probes/*
+ '[' -f /usr/lib/os-probes/50mounted-tests.orig ']'
+ '[' -x /usr/lib/os-probes/50mounted-tests.orig ']'
+ debug 'running /usr/lib/os-probes/50mounted-tests.orig on /dev/md127'
+ '[' -z '' ']'
+ log 'debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/md127'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: running /usr/lib/os-probes/50mounted-tests.orig on /dev/md127'
+ /usr/lib/os-probes/50mounted-tests.orig /dev/md127
+ debug 'os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ '[' -z '' ']'
+ log 'debug: os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ cache_progname
+ case $progname in
+ echo 'os-prober: debug: os detected by /usr/lib/os-probes/50mounted-tests.orig'
+ break
+ for partition in $(partitions)
++ mapdevfs /dev/sda5
++ readlink -f /dev/sda5
+ mapped=/dev/sda5
+ grep -q '^/dev/sda5' /tmp/os-prober.NPZe15/raided-map
+ grep -q '^/dev/sda5 ' /tmp/os-prober.NPZe15/swaps-map
++ blkid -o value -s TYPE /dev/sda5
+ type=btrfs
+ '[' btrfs = btrfs ']'
++ blkid -o value -s UUID /dev/sda5
+ uuid=abadf235-d80f-4d5e-b85e-5cd82c828d92
+ grep -q '^abadf235-d80f-4d5e-b85e-5cd82c828d92' /tmp/os-prober.NPZe15/btrfs-vols
+ continue
+ cleanup
+ :
+ rm -rf /tmp/os-prober.NPZe15

Offline

#4 2023-01-20 23:02:55

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: grub-mkconfig detecting os but not adding it to grub.cfg

Looks like it already writes debug output to the logger (journalctl -t os-prober).
I don't see anything obvious though. Further, one could remove the 'rm -rf' in the script to look up the intermediate files and/or set up more debug hooks in the sub-scripts. But this probably goes too far. No one knows how long the rabbit hole really is.
Best solution probably is to create the grub entry manually for now until os-prober got fixed.


sys2064

Offline

#5 2023-01-20 23:16:41

InvisibleRasta
Member
Registered: 2017-04-12
Posts: 111

Re: grub-mkconfig detecting os but not adding it to grub.cfg

in fedora the os-prober works as intended.
this is os-prober on fedora @fedora/usr/bin/os-prober

#!/usr/bin/sh
set -e

# dash shell does not have "{varname}>&1" feature that bash shell has
# for auto-assignment of new filedescriptors.
# It is cumbersome to write the 'eval' to use our own variables in redirections.
# Therefore use fixed numbers.
export fd_result=3  # file descriptor for external results
export fd_logger=9  # file descriptor for input to logger

 . /usr/share/os-prober/common.sh

newns "$@"
require_tmpdir

log_output () {
	if type log-output >/dev/null 2>&1; then
		log-output -t os-prober --pass-stdout $@
	else
		$@
	fi
}

: >"$OS_PROBER_TMP/dmraid-map"
if type dmraid >/dev/null 2>&1; then
	dmraid -r -c >"$OS_PROBER_TMP/dmraid-map" || true
fi

on_sataraid () {
	local parent="${1%/*}"
	local device="/dev/${parent##*/}"
	if grep -q "$device" "$OS_PROBER_TMP/dmraid-map"; then
		return 0
	fi
	return 1
}

partitions () {
	os_name="$(uname -s)"
	# Exclude partitions that have whole_disk sysfs attribute set.
	if [ -d /sys/block ]; then
		# Exclude partitions on physical disks that are part of a
		# Serial ATA RAID disk.
		for part in /sys/block/*/*[0-9]; do
			if [ -f "$part/start" ] && \
			   [ ! -f "$part/whole_disk" ] && ! on_sataraid $part; then
				name="$(echo "${part##*/}" | sed 's,[!.],/,g')"
				if [ -e "/dev/$name" ]; then
					echo "/dev/$name"
				fi
			fi
		done

		# Add Serial ATA RAID devices
		if type dmraid >/dev/null 2>&1 && \
		   dmraid -s -c >/dev/null 2>&1; then
			for raidset in $(dmraid -sa -c); do
				for part in /dev/mapper/"$raidset"*[0-9]; do
					echo "$part"
				done
			done
		fi
	elif [ "$os_name" = Linux ]; then
		echo "Cannot find list of partitions!  (Try mounting /sys.)" >&2
		exit 1
	elif [ "$os_name" = GNU ]; then
		for part in /dev/hd*s*[0-9] /dev/sd*s*[0-9]; do
			if [ -s "$part" ]; then
				echo "$part"
			fi
		done
	else
		# We don't know how to probe OSes on non-Linux and non-GNU kernels.
		# For now, just don't get in the way.
		exit 0
	fi

	# Add MD RAID devices
	if [ -f /proc/mdstat ] ; then
		awk '/^md/ {printf "/dev/"$1"\n"}' /proc/mdstat
	fi

	# Also detect OSes on LVM volumes (assumes LVM is active)
	if type lvs >/dev/null 2>&1; then
		echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name 2>/dev/null |
			sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")"
	fi

	# now lets make sure we got all of the btrfs partitions and disks
	blkid | grep 'TYPE="btrfs"' | cut -d ':' -f 1
}

parse_proc_swaps () {
	while read line; do
		set -f
		set -- $line
		set +f
		echo "$(mapdevfs $1) swap"
	done
}

parse_proc_mdstat () {
	if type udevadm >/dev/null 2>&1; then
		udevinfo () {
			udevadm info "$@"
		}
	fi
	while read line; do
		for word in $line; do
			dev="${word%%\[*}"
			# TODO: factor this out to something in di-utils if
			# it's needed elsewhere
			if [ -d /sys/block ] && type udevinfo >/dev/null 2>&1; then
				if ! udevinfo -q path -n "/dev/$dev" 2>/dev/null | \
				     grep -q '/.*/.*/'; then
					continue
				fi
			elif ! echo "$dev" | grep -q "/part"; then
				continue
			fi
			raidpart="/dev/$dev"
			echo "$(mapdevfs "$raidpart")"
		done
	done
}

# Needed for idempotency
rm -f /var/lib/os-prober/labels

for prog in /usr/libexec/os-probes/init/*; do
	if [ -x "$prog" ] && [ -f "$prog" ]; then
		"$prog" || true
	fi
done

# We need to properly canonicalize partitions with mount points and partitions
# used in RAID
grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
: >"$OS_PROBER_TMP/swaps-map"
if [ -f /proc/swaps ]; then
	grep "^/dev/" /proc/swaps | parse_proc_swaps >"$OS_PROBER_TMP/swaps-map" || true
fi
: >"$OS_PROBER_TMP/raided-map"
if [ -f /proc/mdstat ] ; then
	grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
fi

: >"$OS_PROBER_TMP/btrfs-vols"

( (
for partition in $(partitions); do
	if ! mapped="$(mapdevfs "$partition")"; then
		log "Device '$partition' does not exist; skipping"
		continue
	fi

	# Skip partitions used in software RAID arrays
	if grep -q "^$mapped" "$OS_PROBER_TMP/raided-map" ; then
		debug "$partition: part of software raid array"
		continue
	fi

	# Skip partitions used as active swap
	if grep -q "^$mapped " "$OS_PROBER_TMP/swaps-map" ; then
		debug "$partition: is active swap"
		continue
	fi

	# do btrfs processing here; both mounted and unmounted will
	# be handled by 50mounted-tests so we can do a subvol only once.
	type=$(blkid -o value -s TYPE $mapped || true)
	if [ "$type" = btrfs ]; then
		uuid=$(blkid -o value -s UUID $mapped)
		if grep -q "^$uuid" "$OS_PROBER_TMP/btrfs-vols" ; then
			continue
		fi
		debug "btrfs volume uuid=$uuid partition=$partition"
		echo "$uuid" >>"$OS_PROBER_TMP/btrfs-vols"
		test="/usr/libexec/os-probes/50mounted-tests"
		if [ -f "$test" ] && [ -x "$test" ]; then
			debug "running $test on btrfs $partition"
			if "$test" btrfs "$uuid" "$partition"; then
				debug "os detected by $test"
				continue
			fi
		fi

	elif ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map" ; then
		for test in /usr/libexec/os-probes/*; do
			if [ -f "$test" ] && [ -x "$test" ]; then
				debug "running $test on $partition"
				if "$test" "$partition"; then
					debug "os detected by $test"
			   		break
				fi
			fi
		done
	else
		mpoint=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 2)
		mpoint="$(unescape_mount "$mpoint")"
		if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/" ]; then
			type=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 3)
			for test in /usr/libexec/os-probes/mounted/*; do
				if [ -f "$test" ] && [ -x "$test" ]; then
					debug "running $test on mounted $partition"
					if "$test" "$partition" "$mpoint" "$type"; then
						debug "os detected by $test"
						break
					fi
				fi
			done
		fi
	fi
done
) 9>&1 | logger 1>&-  # fd_logger
) 3>&1  # fd_result

cat /usr/share/os-prober/common.sh on fedora

newns () {
  [ "$OS_PROBER_NEWNS" ] || exec /usr/lib/os-prober/newns "$0" "$@"
}

cleanup_tmpdir=false
cleanup () {
  if $cleanup_tmpdir; then
    rm -rf "$OS_PROBER_TMP"
  fi
}

require_tmpdir() {
  if [ -z "$OS_PROBER_TMP" ]; then
    if type mktemp >/dev/null 2>&1; then
      export OS_PROBER_TMP="$(mktemp -d /tmp/os-prober.XXXXXX)"
      cleanup_tmpdir=:
      trap cleanup EXIT HUP INT QUIT TERM
    else
      export OS_PROBER_TMP=/tmp
    fi
  fi
}

count_for() {
  _labelprefix="$1"
  _result=$(grep "^${_labelprefix} " /var/lib/os-prober/labels 2>/dev/null || true)

  if [ -z "$_result" ]; then
    return
  else
    echo "$_result" | cut -d' ' -f2
  fi
}

count_next_label() {
  require_tmpdir

  _labelprefix="$1"
  _cfor="$(count_for "${_labelprefix}")"

  if [ -z "$_cfor" ]; then
    echo "${_labelprefix} 1" >> /var/lib/os-prober/labels
  else
    sed "s/^${_labelprefix} ${_cfor}/${_labelprefix} $(($_cfor + 1))/" /var/lib/os-prober/labels > "$OS_PROBER_TMP/os-prober.tmp"
    mv "$OS_PROBER_TMP/os-prober.tmp" /var/lib/os-prober/labels
  fi
  
  echo "${_labelprefix}${_cfor}"
}

progname=
cache_progname() {
  case $progname in
    '')
      progname="${0##*/}"
      ;;
  esac
}

# fd_logger: bind value now, possibly after assigning default. 
eval '
  log() {
    cache_progname
    echo "$progname: $@"  1>&'${fd_logger:=9}'
  }
'
export fd_logger  # so subshells inherit current value by default

error() {
  log "error: $@"
}

warn() {
  log "warning: $@"
}

debug() {
  if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
    log "debug: $@"
  fi
}

# fd_result: bind value now, possibly after assigning default.
eval '
  result() {
    log "result:" "$@"
    echo "$@"  1>&'${fd_result:=1}'
  }
'
export fd_result  # so subshells inherit current value by default

# shim to make it easier to use os-prober outside d-i
if ! type mapdevfs >/dev/null 2>&1; then
  mapdevfs () {
    readlink -f "$1"
  }
fi

item_in_dir () {
	if [ "$1" = "-q" ]; then
		q="-q"
		shift 1
	else
		q=""
	fi
	[ -d "$2" ] || return 1
	# find files with any case
	ls -1 "$2" | grep $q -i "^$1$"
}

# We can't always tell the filesystem type up front, but if we have the
# information then we should use it. Note that we can't use block-attr here
# as it's only available in udebs.
# If not detected after different attempts then "NOT-DETECTED" will be printed
# because function is not supposed to exit error codes.
fs_type () {
	local fstype=""
	if (export PATH="/lib/udev:$PATH"; type vol_id) >/dev/null 2>&1; then
		PATH="/lib/udev:$PATH" \
			fstype=$(vol_id --type "$1" 2>/dev/null || true)
		[ -z "$fstype" ] || { echo "$fstype"; return; }
	fi
	if type lsblk >/dev/null 2>&1 ; then
		fstype=$(lsblk --nodeps --noheading --output FSTYPE -- "$1" || true)
		[ -z "$fstype" ] || { echo "$fstype"; return; }
	fi
	if type /sbin/blkid >/dev/null 2>&1; then
		fstype=$(/sbin/blkid -o value -s TYPE "$1" 2>/dev/null || true)
		[ -z "$fstype" ] || { echo "$fstype"; return; }
	fi
	echo "NOT-DETECTED"
}

is_dos_extended_partition() {
	if type /sbin/blkid >/dev/null 2>&1; then
		local output

		output="$(/sbin/blkid -o export $1)"

		# old blkid (util-linux << 2.24) errors out on extended p.
		if [ "$?" = "2" ]; then
			return 0
		fi

		# dos partition type and no filesystem type?...
		if echo $output | grep -q ' PTTYPE=dos ' &&
				! echo $output | grep -q ' TYPE='; then
			return 0
		else
			return 1
		fi
	fi

	return 1
}

parse_proc_mounts () {
	while read -r line; do
		set -f
		set -- $line
		set +f
		printf '%s %s %s %s\n' "$(mapdevfs "$1")" "$2" "$3" "$1"
	done
}

# add forth parameter to pickup btrfs subvol info
parsefstab () {
	while read -r line; do
		case "$line" in
			"#"*)
				:	
			;;
			*)
				set -f
				set -- $line
				set +f
				printf '%s %s %s %s\n' "$1" "$2" "$3" "$4"
			;;
		esac
	done
}

#check_btrfs_mounted $bootsv $bootuuid)
check_btrfs_mounted () {
	bootsv="$1"
	bootuuid="$2"
	bootdev=$(blkid | grep "$bootuuid" | cut -d ':' -f  1)
	bindfrom=$(grep " btrfs " /proc/self/mountinfo |
		   grep " $bootdev " | grep " /$bootsv " | cut -d ' ' -f 5)
	printf "%s" "$bindfrom"
}

unescape_mount () {
	printf %s "$1" | \
		sed 's/\\011/	/g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
}

find_label () {
	local output
	if type /sbin/blkid >/dev/null 2>&1; then
		# Hopefully everyone has blkid by now
		output="$(/sbin/blkid -o device -t LABEL="$1")" || return 1
		echo "$output" | head -n1
	elif [ -h "/dev/disk/by-label/$1" ]; then
		# Last-ditch fallback
		readlink -f "/dev/disk/by-label/$1"
	else
		return 1
	fi
}

find_uuid () {
	local output
	if type /sbin/blkid >/dev/null 2>&1; then
		# Hopefully everyone has blkid by now
		output="$(/sbin/blkid -o device -t UUID="$1")" || return 1
		echo "$output" | head -n1
	elif [ -h "/dev/disk/by-uuid/$1" ]; then
		# Last-ditch fallback
		readlink -f "/dev/disk/by-uuid/$1"
	else
		return 1
	fi
}

# Sets $mountboot as output variables.  This is very messy, but POSIX shell
# isn't really up to the task of doing it more cleanly.
linux_mount_boot () {
	partition="$1"
	tmpmnt="$2"

	bootpart=""
	mounted=""
	if [ -e "$tmpmnt/etc/fstab" ]; then
		# Try to mount any /boot partition.
		bootmnt=$(parsefstab < "$tmpmnt/etc/fstab" | grep " /boot ") || true
		if [ -n "$bootmnt" ]; then
			set -f
			set -- $bootmnt
			set +f
			boottomnt=""

			# Try to map labels and UUIDs ourselves if possible,
			# so that we can check whether they're already
			# mounted somewhere else.
			tmppart="$1"
			if echo "$1" | grep -q "LABEL="; then
				label="$(echo "$1" | cut -d = -f 2)"
				if tmppart="$(find_label "$label")"; then
					debug "mapped LABEL=$label to $tmppart"
				else
					debug "found boot partition LABEL=$label for Linux system on $partition, but cannot map to existing device"
					mountboot="$partition 0"
					return
				fi
			elif echo "$1" | grep -q "UUID="; then
				uuid="$(echo "$1" | cut -d = -f 2)"
				if tmppart="$(find_uuid "$uuid")"; then
					debug "mapped UUID=$uuid to $tmppart"
				else
					debug "found boot partition UUID=$uuid for Linux system on $partition, but cannot map to existing device"
					mountboot="$partition 0"
					return
				fi
			fi
			shift
			set -- "$(mapdevfs "$tmppart")" "$@"

			if grep -q "^$1 " "$OS_PROBER_TMP/mounted-map"; then
				bindfrom="$(grep "^$1 " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 2)"
				bindfrom="$(unescape_mount "$bindfrom")"
				if [ "$bindfrom" != "$tmpmnt/boot" ]; then
					if mount --bind "$bindfrom" "$tmpmnt/boot"; then
						mounted=1
						bootpart="$tmppart"
					else
						debug "failed to bind-mount $bindfrom onto $tmpmnt/boot"
					fi
				fi
			fi
			if [ "$mounted" ]; then
				:
			elif [ -e "$tmppart" ]; then
				bootpart="$tmppart"
				boottomnt="$tmppart"
			elif [ -e "$tmpmnt/$tmppart" ]; then
				bootpart="$tmppart"
				boottomnt="$tmpmnt/$tmppart"
			elif [ -e "/target/$tmppart" ]; then
				bootpart="$tmppart"
				boottomnt="/target/$tmppart"
			elif [ -e "$1" ]; then
				bootpart="$1"
				boottomnt="$1"
			elif [ -e "$tmpmnt/$1" ]; then
				bootpart="$1"
				boottomnt="$tmpmnt/$1"
			elif [ -e "/target/$1" ]; then
				bootpart="$1"
				boottomnt="/target/$1"
			else
				bootpart=""
			fi

			if [ ! "$mounted" ]; then
				if [ -z "$bootpart" ]; then
					debug "found boot partition $1 for linux system on $partition, but cannot map to existing device"
				else
					debug "found boot partition $bootpart for linux system on $partition"
					if type grub-mount >/dev/null 2>&1 && \
					   grub-mount "$boottomnt" "$tmpmnt/boot" 2>/dev/null; then
						mounted=1
					fi
				fi
			fi
		fi
	fi
	if [ -z "$bootpart" ]; then
		bootpart="$partition"
	fi
	if [ -z "$mounted" ]; then
		mounted=0
	fi

	mountboot="$bootpart $mounted"
}

umount_exec=$(which umount)
umount() {
	if ! $umount_exec $@ 2> /dev/null; then
		error "umount error, retrying after 1 sec"
		sleep 1
		$umount_exec $@
	fi
}

Last edited by InvisibleRasta (2023-01-20 23:20:08)

Offline

#6 2023-01-21 11:57:19

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: grub-mkconfig detecting os but not adding it to grub.cfg

Using diff(1) on those files along with the Arch equivalents shows some added parts for dealing with btrfs so it looks like you'll have to either use Fedora's GRUB instead or request that Fedora's changes be upstreamed so that Arch gets them as well.

Reference: https://src.fedoraproject.org/rpms/os-p … sfix.patch

Note that os-prober is maintained by the debian-installer team.

Offline

#7 2023-01-21 23:35:18

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: grub-mkconfig detecting os but not adding it to grub.cfg

I doubt upstream doesn't know about after 9 years the bug is known the patch is available.

But fear not, there is a custom os-prober in AUR that should hold the patch.
https://aur.archlinux.org/packages/os-prober-btrfs

Last edited by Maniaxx (2023-01-22 00:54:52)


sys2064

Offline

Board footer

Powered by FluxBB