sys-boot/os-prober: version bump to 1.79

pull/1/head
Alexander Tratsevskiy 2 years ago
parent 6b409c06ac
commit b7953b027d

@ -0,0 +1 @@
DIST os-prober_1.79.tar.xz 27028 BLAKE2B b3efacce9d7fce3708f5ec727a219e872e8d1de6dea15540cfbc0a0e8372c1033098230d3ddb9066fb5474d44e5584ee28631e0e5ab981e8fb1dc29ee3cbd89d SHA512 89b827b9b90a1d3bc11e0090ec04d808502cc1883ab10997b6d9edbe6005dcf8a0acdd7d200102c9dccde56297bda6087d68fb6dec419f0920090c2655c9c7d8

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

@ -0,0 +1,21 @@
Fixes errors like "umount: /var/lib/os-prober/mount: target is busy."
which can appear in some corner-cases.
Bug: https://bugzilla.redhat.com/903906
--- a/common.sh
+++ b/common.sh
@@ -336,3 +336,13 @@ linux_mount_boot () {
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
+}
+

@ -0,0 +1,35 @@
Backport handling of multiple initrd paths, like those needed by Manjaro
installations. Note, it still requires resolution of
https://savannah.gnu.org/bugs/index.php?47681 on grub's end.
Commit: https://salsa.debian.org/installer-team/os-prober/-/commit/53b920e106f13acf87ef8a275161e20f94feeb8a
--- a/linux-boot-probes/mounted/common/40grub2
+++ b/linux-boot-probes/mounted/common/40grub2
@@ -78,11 +78,21 @@
fi
;;
initrd)
- initrd="$(echo "$2" | sed 's/(.*)//')"
- # Initrd same.
- if [ "$partition" != "$bootpart" ]; then
- initrd="/boot$initrd"
- fi
+ shift
+ initrd=""
+ for initrd_path in "$@"; do
+ # sed hack, as above
+ initrd_path="$(echo "$initrd_path" | sed 's/(.*)//')"
+ # Initrd same.
+ if [ "$partition" != "$bootpart" ]; then
+ initrd_path="/boot$initrd_path"
+ fi
+ if [ -z "$initrd" ]; then
+ initrd="$initrd_path"
+ else
+ initrd="$initrd $initrd_path"
+ fi
+ done
;;
"}")
entry_result

@ -0,0 +1,28 @@
Fixes OS detection on mdraid devices
Bug: https://bugs.debian.org/648251
https://bugzilla.redhat.com/752402
--- a/os-prober
+++ b/os-prober
@@ -64,6 +64,11 @@ partitions () {
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 |
@@ -123,7 +128,7 @@ if [ -f /proc/swaps ]; then
fi
: >"$OS_PROBER_TMP/raided-map"
if [ -f /proc/mdstat ] ; then
- grep "^md" /proc/mdstat | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
+ grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
fi
for partition in $(partitions); do

@ -0,0 +1,17 @@
Fixes the problem of the root partition being returned instead of the boot
partition when both are already mounted somewhere.
Bug: https://bugs.debian.org/699840
https://bugzilla.redhat.com/906886
--- a/linux-boot-prober
+++ b/linux-boot-prober
@@ -167,7 +167,7 @@ else
bootpart="${mountboot%% *}"
bootmounted="${mountboot#* }"
else
- bootpart="$partition"
+ bootpart="$(grep " $mpoint/boot " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 4)"
bootmounted=0
fi
for test in /usr/lib/linux-boot-probes/mounted/*; do

@ -0,0 +1,34 @@
For symlinks to partions in fstab, returns the partition name from fstab instead
of the name of its resolved destination, eg., for /dev/mapper/mylvmvol in fstab,
linked to /dev/dm-2, return "mylvmvol" instead of "dm-2".
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699839
https://bugzilla.redhat.com/show_bug.cgi?id=893472
--- a/common.sh
+++ b/common.sh
@@ -269,7 +269,7 @@ linux_mount_boot () {
if [ "$bindfrom" != "$tmpmnt/boot" ]; then
if mount --bind "$bindfrom" "$tmpmnt/boot"; then
mounted=1
- bootpart="$1"
+ bootpart="$tmppart"
else
debug "failed to bind-mount $bindfrom onto $tmpmnt/boot"
fi
@@ -277,6 +277,15 @@ linux_mount_boot () {
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"

@ -0,0 +1,103 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit readme.gentoo-r1 toolchain-funcs
DESCRIPTION="Utility to detect other OSs on a set of drives"
HOMEPAGE="https://salsa.debian.org/installer-team/os-prober"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://salsa.debian.org/installer-team/${PN}.git"
else
SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${PN}_${PV}.tar.xz"
KEYWORDS="amd64"
S="${WORKDIR}"/${PN}
fi
LICENSE="GPL-3"
SLOT="0"
# grub-mount needed per bug #607518
RDEPEND="sys-boot/grub:2[mount]"
# bug 594250
QA_MULTILIB_PATHS="usr/lib/os-prober/.*"
PATCHES=(
"${FILESDIR}"/${PN}-1.79-mdraid-detection.patch
"${FILESDIR}"/${PN}-1.79-handle-multiple-initrd-paths.patch
"${FILESDIR}"/${PN}-1.79-use-fstab-name.patch
"${FILESDIR}"/${PN}-1.79-mounted-boot-partition-fix.patch
"${FILESDIR}"/${PN}-1.79-fix-busy-umount-message.patch
"${FILESDIR}"/${PN}-1.79-efi-chroot-blkid-fallback.patch
)
DOC_CONTENTS="
If you intend for os-prober to detect versions of Windows installed on
NTFS-formatted partitions, your system must be capable of reading the
NTFS filesystem. One way to do this is by installing sys-fs/ntfs3g.
NOTE: Since sys-boot/grub-2.06-rc1, grub-mkconfig disables os-prober by default.
To enable it, add GRUB_DISABLE_OS_PROBER=false to /etc/default/grub.
"
src_prepare() {
default
# use default GNU rules
rm Makefile || die 'rm Makefile failed'
}
src_compile() {
tc-export CC
emake newns
}
src_install() {
dobin os-prober linux-boot-prober
# Note: as no shared libraries are installed, /usr/lib is correct
exeinto /usr/lib/os-prober
doexe newns
insinto /usr/share/os-prober
doins common.sh
keepdir /var/lib/os-prober
local debarch=${ARCH%-*} dir
case ${debarch} in
amd64) debarch=x86 ;;
ppc|ppc64) debarch=powerpc ;;
esac
for dir in os-probes{,/mounted,/init} linux-boot-probes{,/mounted}; do
exeinto /usr/lib/${dir}
doexe ${dir}/common/*
if [[ -d ${dir}/${debarch} ]]; then
for exe in ${dir}/${debarch}/*; do
[[ ! -d "${exe}" ]] && doexe "${exe}"
done
fi
if [[ -d ${dir}/${debarch}/efi ]]; then
exeinto /usr/lib/${dir}/efi
doexe ${dir}/${debarch}/efi/*
fi
done
if use amd64 || use x86; then
exeinto /usr/lib/os-probes/mounted
doexe os-probes/mounted/powerpc/20macosx
fi
einstalldocs
dodoc debian/changelog
readme.gentoo_create_doc
}
pkg_postinst() {
readme.gentoo_print_elog
}
Loading…
Cancel
Save