Update to upstream version 1.74 thanks to Neal Gompa

Drop merged patches
Rediff remaining patches
Move newns to /usr/libexec/os-prober (debuginfo generation works)
Mark copyright file as license file
This commit is contained in:
Hedayat Vatankhah 2017-03-28 00:07:29 +04:30
parent 33eec41746
commit 4f972d5e7e
9 changed files with 73 additions and 201 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@
/os-prober_1.68.tar.xz
/os-prober_1.70.tar.xz
/os-prober_1.71.tar.xz
/os-prober_1.74.tar.xz

View File

@ -1,8 +1,8 @@
Index: os-prober/common.sh
===================================================================
--- os-prober.orig/common.sh
+++ os-prober/common.sh
@@ -150,6 +150,7 @@ parse_proc_mounts () {
diff --git a/common.sh b/common.sh
index c2c5f46..8fb3c5f 100644
--- a/common.sh
+++ b/common.sh
@@ -155,6 +155,7 @@ parse_proc_mounts () {
done
}
@ -10,7 +10,7 @@ Index: os-prober/common.sh
parsefstab () {
while read -r line; do
case "$line" in
@@ -160,12 +161,22 @@ parsefstab () {
@@ -165,12 +166,22 @@ parsefstab () {
set -f
set -- $line
set +f
@ -26,7 +26,7 @@ Index: os-prober/common.sh
+ bootsv="$1"
+ bootuuid="$2"
+ bootdev=$(blkid | grep "$bootuuid" | cut -d ':' -f 1)
+ bindfrom=$(grep " btrfs " /proc/self/mountinfo |
+ bindfrom=$(grep " btrfs " /proc/self/mountinfo |
+ grep " $bootdev " | grep " /$bootsv " | cut -d ' ' -f 5)
+ printf "%s" "$bindfrom"
+}
@ -34,10 +34,10 @@ Index: os-prober/common.sh
unescape_mount () {
printf %s "$1" | \
sed 's/\\011/ /g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
Index: os-prober/linux-boot-prober
===================================================================
--- os-prober.orig/linux-boot-prober
+++ os-prober/linux-boot-prober
diff --git a/linux-boot-prober b/linux-boot-prober
index e32dc84..2a60fa2 100755
--- a/linux-boot-prober
+++ b/linux-boot-prober
@@ -5,16 +5,143 @@ set -e
newns "$@"
@ -66,7 +66,7 @@ Index: os-prober/linux-boot-prober
+elif [ "$1" = btrfs ]; then
+ type=btrfs
+ echo "$2" | grep -q "^UUID=" || ERR=y
+ echo "$3" | grep -q "^subvol=" || ERR=y
+ echo "$3" | grep -q "^subvol=" || ERR=y
+ export "$2"
+ export "$3"
+ partition=$(blkid | grep "$UUID" | cut -d ':' -f 1 | tr '\n' ' ' | cut -d ' ' -f 1)
@ -164,7 +164,7 @@ Index: os-prober/linux-boot-prober
+ bootpart="${mountboot%% *}"
+ bootsv=
+ fi
+
+
+ test="/usr/lib/linux-boot-probes/mounted/40grub2"
+ if [ -f $test ] && [ -x $test ]; then
+ debug "running $test $partition $bootpart $tmpmnt $type $subvol $bootsv"
@ -194,10 +194,10 @@ Index: os-prober/linux-boot-prober
if $test "$partition"; then
debug "linux detected by $test"
break
Index: os-prober/linux-boot-probes/mounted/common/40grub2
===================================================================
--- os-prober.orig/linux-boot-probes/mounted/common/40grub2
+++ os-prober/linux-boot-probes/mounted/common/40grub2
diff --git a/linux-boot-probes/mounted/common/40grub2 b/linux-boot-probes/mounted/common/40grub2
index 885614e..db5cbfd 100755
--- a/linux-boot-probes/mounted/common/40grub2
+++ b/linux-boot-probes/mounted/common/40grub2
@@ -2,17 +2,30 @@
. /usr/share/os-prober/common.sh
set -e
@ -230,11 +230,11 @@ Index: os-prober/linux-boot-probes/mounted/common/40grub2
result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters"
found_item=1
fi
Index: os-prober/os-prober
===================================================================
--- os-prober.orig/os-prober
+++ os-prober/os-prober
@@ -71,9 +71,12 @@ partitions () {
diff --git a/os-prober b/os-prober
index 8852887..482c3c2 100755
--- a/os-prober
+++ b/os-prober
@@ -76,9 +76,12 @@ partitions () {
# Also detect OSes on LVM volumes (assumes LVM is active)
if type lvs >/dev/null 2>&1; then
@ -248,7 +248,7 @@ Index: os-prober/os-prober
}
parse_proc_swaps () {
@@ -131,6 +134,8 @@ if [ -f /proc/mdstat ] ; then
@@ -136,6 +139,8 @@ if [ -f /proc/mdstat ] ; then
grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
fi
@ -257,7 +257,7 @@ Index: os-prober/os-prober
for partition in $(partitions); do
if ! mapped="$(mapdevfs "$partition")"; then
log "Device '$partition' does not exist; skipping"
@@ -149,7 +154,26 @@ for partition in $(partitions); do
@@ -154,7 +159,26 @@ for partition in $(partitions); do
continue
fi
@ -277,7 +277,7 @@ Index: os-prober/os-prober
+ debug "running $test on btrfs $partition"
+ if "$test" btrfs "$uuid" "$partition"; then
+ debug "os detected by $test"
+ continue
+ continue
+ fi
+ fi
+
@ -285,19 +285,15 @@ Index: os-prober/os-prober
for test in /usr/lib/os-probes/*; do
if [ -f "$test" ] && [ -x "$test" ]; then
debug "running $test on $partition"
Index: os-prober/os-probes/common/50mounted-tests
===================================================================
--- os-prober.orig/os-probes/common/50mounted-tests
+++ os-prober/os-probes/common/50mounted-tests
@@ -1,20 +1,36 @@
#!/bin/sh
# Sub-tests that require a mounted partition.
set -e
-partition="$1"
diff --git a/os-probes/common/50mounted-tests b/os-probes/common/50mounted-tests
index 2951ef9..e33eb82 100755
--- a/os-probes/common/50mounted-tests
+++ b/os-probes/common/50mounted-tests
@@ -19,19 +19,31 @@ do_unmount() {
rmdir "$tmpmnt" || true
}
. /usr/share/os-prober/common.sh
-types="$(fs_type "$partition")" || types=NOT-DETECTED
-types="$(fs_type "$partition")"
+if [ "x$1" = xbtrfs ]; then
+ types=btrfs
+ if [ -z "$2" -o -z "$3" ]; then
@ -314,11 +310,6 @@ Index: os-prober/os-probes/common/50mounted-tests
if [ "$types" = NOT-DETECTED ]; then
debug "$1 type not recognised; skipping"
- exit 0
+ exit 1
+elif [ "x$types" = "x" ]; then
+ exit 1
+elif [ "$types" = LVM2_member ]; then
+ debug "skipping LVM2 Volume Group on $partition"
+ exit 1
elif [ "$types" = swap ]; then
debug "$1 is a swap partition; skipping"
@ -327,11 +318,15 @@ Index: os-prober/os-probes/common/50mounted-tests
elif [ "$types" = crypto_LUKS ]; then
debug "$1 is a LUKS partition; skipping"
- exit 0
+ exit 1
elif [ "$types" = LVM2_member ]; then
debug "$1 is an LVM member; skipping"
- exit 0
+ exit 1
elif [ "$types" = ntfs ]; then
if type ntfs-3g >/dev/null 2>&1; then
types='ntfs-3g ntfs'
@@ -23,7 +39,7 @@ elif [ -z "$types" ]; then
@@ -40,7 +52,7 @@ elif [ -z "$types" ]; then
if type cryptsetup >/dev/null 2>&1 && \
cryptsetup luksDump "$partition" >/dev/null 2>&1; then
debug "$1 is a LUKS partition; skipping"
@ -340,7 +335,7 @@ Index: os-prober/os-probes/common/50mounted-tests
fi
for type in $(grep -v nodev /proc/filesystems); do
# hfsplus filesystems are mountable as hfs. Try hfs last so
@@ -46,6 +62,108 @@ if [ ! -d "$tmpmnt" ]; then
@@ -63,6 +75,108 @@ if [ ! -d "$tmpmnt" ]; then
fi
mounted=
@ -449,10 +444,10 @@ Index: os-prober/os-probes/common/50mounted-tests
if type grub-mount >/dev/null 2>&1 && \
type grub-probe >/dev/null 2>&1 && \
grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
Index: os-prober/os-probes/mounted/common/90linux-distro
===================================================================
--- os-prober.orig/os-probes/mounted/common/90linux-distro
+++ os-prober/os-probes/mounted/common/90linux-distro
diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro
index badfbb1..9bc5154 100755
--- a/os-probes/mounted/common/90linux-distro
+++ b/os-probes/mounted/common/90linux-distro
@@ -7,6 +7,8 @@ set -e
partition="$1"
dir="$2"
@ -462,7 +457,7 @@ Index: os-prober/os-probes/mounted/common/90linux-distro
# This test is inaccurate, but given separate / and /boot partitions and the
# fact that only some architectures have ld-linux.so, I can't see anything
@@ -135,7 +137,11 @@ if [ -L "$dir"/lib ] || (ls "$dir"/lib*/
@@ -143,7 +145,11 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
fi
label="$(count_next_label "$short")"
@ -475,23 +470,3 @@ Index: os-prober/os-probes/mounted/common/90linux-distro
exit 0
else
exit 1
Index: os-prober/README.btrfs
===================================================================
--- /dev/null
+++ os-prober/README.btrfs
@@ -0,0 +1,15 @@
+BTRFS is a new filesystem which combines the filesystem with logical volume
+management (subvolumes). For further information, see:
+ https://btrfs.wiki.kernel.org/index.php/Main_Page
+ https://btrfs.wiki.kernel.org/index.php/FAQ
+
+In order to support BTRFS, a number of changes were necessary to os-prober,
+os-probes/common/50mounted-tests, os-probes/mounted/common/90linux-distro,
+linux-boot-prober, and linux-boot-probes/common/50mounted-tests.
+
+The biggest impact will be to grub2 where there is additional information
+output by os-prober and where, if a BTRFS subvolume is being used for root,
+the parameters for linux-boot-prober have changed.
+
+Sun 30 Dec 2012 11:49:52 AM EST Gene Czarcinski <gene@czarc.net>
+

View File

@ -1,30 +0,0 @@
Index: os-prober-1.58/common.sh
===================================================================
--- os-prober-1.58.orig/common.sh
+++ os-prober-1.58/common.sh
@@ -76,7 +76,9 @@ warn() {
}
debug() {
- log "debug: $@"
+ if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
+ log "debug: $@"
+ fi
}
result () {
Index: os-prober-1.58/os-probes/mounted/powerpc/20macosx
===================================================================
--- os-prober-1.58.orig/os-probes/mounted/powerpc/20macosx
+++ os-prober-1.58/os-probes/mounted/powerpc/20macosx
@@ -7,7 +7,9 @@ mpoint="$2"
type="$3"
debug() {
- logger -t macosx-prober "debug: $@"
+ if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
+ logger -t macosx-prober "debug: $@"
+ fi
}
# Weed out stuff that doesn't apply to us

View File

@ -1,10 +0,0 @@
diff -up os-prober-1.46/common.sh.newnsmove os-prober-1.46/common.sh
--- os-prober-1.46/common.sh.newnsmove 2011-04-10 05:30:57.000000000 +0430
+++ os-prober-1.46/common.sh 2011-05-04 04:08:09.603020037 +0430
@@ -1,5 +1,5 @@
newns () {
- [ "$OS_PROBER_NEWNS" ] || exec /usr/lib/os-prober/newns "$0" "$@"
+ [ "$OS_PROBER_NEWNS" ] || exec /usr/lib/newns "$0" "$@"
}
cleanup_tmpdir=false

View File

@ -1,24 +0,0 @@
diff -up os-prober-1.57/common.sh.remove-basename os-prober-1.57/common.sh
--- os-prober-1.57/common.sh.remove-basename 2013-01-23 01:06:50.023992389 +0330
+++ os-prober-1.57/common.sh 2013-01-23 02:01:09.435244141 +0330
@@ -57,7 +57,7 @@ progname=
cache_progname() {
case $progname in
'')
- progname="$(basename "$0")"
+ progname="${0##*/}"
;;
esac
}
diff -up os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot.remove-basename os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot
--- os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot.remove-basename 2013-01-23 02:04:03.855063593 +0330
+++ os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot 2013-01-23 02:02:34.876175982 +0330
@@ -27,7 +27,7 @@ recordstanza () {
fi
if [ -z "$title" ]; then
- title="$(basename "$kernel")"
+ title="${kernel##*/}"
fi
if [ "$read_only" ]; then
parameters="ro $parameters"

View File

@ -1,28 +0,0 @@
diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro
index 9544531..bee48b3 100755
--- a/os-probes/mounted/common/90linux-distro
+++ b/os-probes/mounted/common/90linux-distro
@@ -17,7 +17,7 @@ type="$3"
# symlinks we need to also check in $dir/usr/lib* for distributions that
# moved /lib* to /usr and only left symlinks behind.
# TODO: look for ld-linux.so on arches that have it
-if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
+if [ -L "$dir"/lib ] || (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
if [ -e "$dir/etc/debian_version" ]; then
short="Debian"
long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")"
@@ -128,9 +128,13 @@ if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null
elif [ -e "$dir/etc/4MLinux-version" ]; then
short="4MLinux"
long="4MLinux $(head -1 "$dir/etc/4MLinux-version")"
- else
+ elif (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
+ # Don't report 'Linux distribution' if only a /lib symlink is found or if this is
+ # a partition without /boot (should be /usr partition)
short="Linux"
long="unknown Linux distribution"
+ else
+ exit 1
fi
label="$(count_next_label "$short")"

View File

@ -1,14 +0,0 @@
diff -up os-prober-1.53/linux-boot-probes/mounted/powerpc/40yaboot.parsefix os-prober-1.53/linux-boot-probes/mounted/powerpc/40yaboot
--- os-prober-1.53/linux-boot-probes/mounted/powerpc/40yaboot.parsefix 2012-05-25 15:57:13.477647064 +0430
+++ os-prober-1.53/linux-boot-probes/mounted/powerpc/40yaboot 2012-05-25 16:16:58.844827933 +0430
@@ -74,8 +74,8 @@ parse_yaboot_conf () {
kernel="$(dequote "$2")"
;;
append)
- shift 1
- parameters="$(dequote "${line#append=}")"
+ cleanappend=`printf %s "$line" | sed -E 's/append(\s)*=(\s)*//'`
+ parameters="$(dequote "$cleanappend")"
;;
initrd)
initrd="$(dequote "$2")"

View File

@ -1,36 +1,30 @@
Name: os-prober
Version: 1.71
Release: 2%{?dist}
Version: 1.74
Release: 1%{?dist}
Summary: Probes disks on the system for installed operating systems
Group: System Environment/Base
# For more information about licensing, see copyright file.
License: GPLv2+ and GPL+
URL: http://kitenet.net/~joey/code/os-prober/
Source0: http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.tar.xz
# move newns binary outside of os-prober subdirectory, so that debuginfo
# can be automatically generated for it
Patch0: os-prober-newnsdirfix.patch
Patch1: os-prober-no-dummy-mach-kernel.patch
Source0: http://ftp.us.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.tar.xz
Patch0: os-prober-no-dummy-mach-kernel.patch
# Sent upstream
Patch2: os-prober-mdraidfix.patch
Patch3: os-prober-yaboot-parsefix.patch
Patch4: os-prober-usrmovefix.patch
Patch5: os-prober-remove-basename.patch
Patch6: os-prober-disable-debug-test.patch
Patch7: os-prober-btrfsfix.patch
Patch8: os-prober-bootpart-name-fix.patch
Patch9: os-prober-mounted-partitions-fix.patch
Patch10: os-prober-factor-out-logger.patch
Patch1: os-prober-mdraidfix.patch
Patch2: os-prober-btrfsfix.patch
Patch3: os-prober-bootpart-name-fix.patch
Patch4: os-prober-mounted-partitions-fix.patch
Patch5: os-prober-factor-out-logger.patch
# To be sent upstream
Patch11: os-prober-factored-logger-efi-fix.patch
Patch12: os-prober-umount-fix.patch
Patch13: os-prober-grub2-parsefix.patch
Patch14: os-prober-grepfix.patch
Patch15: os-prober-gentoo-fix.patch
Patch6: os-prober-factored-logger-efi-fix.patch
Patch7: os-prober-umount-fix.patch
Patch8: os-prober-grub2-parsefix.patch
Patch9: os-prober-grepfix.patch
Patch10: os-prober-gentoo-fix.patch
Requires: udev coreutils util-linux
Requires: grep /bin/sed /sbin/modprobe
Requires: device-mapper
BuildRequires: git
@ -40,21 +34,21 @@ in a generic machine-readable format. Support for new OSes and Linux
distributions can be added easily.
%prep
%autosetup -S git
%autosetup -n %{name} -S git
find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \;
sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \
linux-boot-probes/common/50mounted-tests
%build
make %{?_smp_mflags} CFLAGS="%{optflags}"
%make_build CFLAGS="%{optflags}"
%install
install -m 0755 -d %{buildroot}%{_bindir}
install -m 0755 -d %{buildroot}%{_var}/lib/%{name}
install -m 0755 -p os-prober linux-boot-prober %{buildroot}%{_bindir}
install -m 0755 -Dp newns %{buildroot}%{_libexecdir}/newns
install -m 0755 -Dp newns %{buildroot}%{_libexecdir}/os-prober/newns
install -m 0644 -Dp common.sh %{buildroot}%{_datadir}/%{name}/common.sh
%ifarch m68k
@ -84,13 +78,21 @@ if [ "$ARCH" = x86 ]; then
fi
%files
%doc README TODO debian/copyright debian/changelog
%doc README TODO debian/changelog
%license debian/copyright
%{_bindir}/*
%{_libexecdir}/*
%{_datadir}/%{name}
%{_var}/lib/%{name}
%changelog
* Mon Mar 27 2017 Neal Gompa <ngompa13@gmail.com> - 1.74-1
- Update to upstream version 1.74
- Drop merged patches
- Rediff remaining patches
- Move newns to /usr/libexec/os-prober (debuginfo generation works)
- Mark copyright file as license file
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.71-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View File

@ -1 +1 @@
7c1a149d076ac10af31043ffb33ba658 os-prober_1.71.tar.xz
SHA512 (os-prober_1.74.tar.xz) = 5407fb3c782ae0532120995d60cfc307028de9bea52ce5534baaf940a99269b735c1174ef0f7a5316be485a1e8bfd097108c2819eadf00e2e38595bfc2c22245