Skip to content

Commit

Permalink
feat: update os-prober to 1.82
Browse files Browse the repository at this point in the history
  • Loading branch information
deepin-community-bot[bot] committed Aug 8, 2024
1 parent 5d1acfa commit 9c91531
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 54 deletions.
17 changes: 0 additions & 17 deletions debian/.gitlab-ci.yml

This file was deleted.

61 changes: 61 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
os-prober (1.82) unstable; urgency=medium

* Team upload

[ Philip Hands ]
* Switch to using default branch2repo for salsa-CI.
* Refactor windows version detection (+ adding ver 12).

[ Samuel Thibault ]
* Make gbp tag produce the right tag format.

-- Holger Wansing <[email protected]> Thu, 06 Jun 2024 22:08:08 +0200

os-prober (1.81) unstable; urgency=medium

* Team upload

[ Pascal Hambourg ]
* Add Windows 11 detection.

-- Holger Wansing <[email protected]> Mon, 18 Jul 2022 14:32:39 +0200

os-prober (1.80) unstable; urgency=medium

* Team upload

[ Samuel Thibault ]
* control: Enable mount dependency only on linux, enable freebsd-utils on
kfreebsd instead. (Closes: #1006590)

[ General Chaos ]
* Handle multiple initrd paths, as used in some distros

[ Gaël PORTAY ]
* Fix "os-prober: call dmraid -r *once*".

[ Timo Gurr ]
* Add Exherbo Linux detection (Closes: #755804)

[ Pascal Hambourg ]
* Sort Linux kernels in reverse version order if no boot loader config file
found (Closes: #741889)

[ Sergei Galkin ]
* Add ntfs3 for 5.15 kernel.

[ rakslice ]
* detect alpine initramfs files

[ Luke Shumaker ]
* Fall back to looking for /usr/lib/os-release.

[ Debian Janitor ]
* Bump debhelper from deprecated 9 to 13.
* Set debhelper-compat version in Build-Depends.
* Remove constraints unnecessary since buster:
+ Build-Depends: Drop versioned constraint on dpkg-dev.
+ os-prober-udeb: Drop versioned constraint on anna in Depends.

-- Holger Wansing <[email protected]> Thu, 26 May 2022 23:16:53 +0200

os-prober (1.79) unstable; urgency=medium

* Team upload
Expand Down
1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

6 changes: 3 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Section: debian-installer
Priority: optional
Maintainer: Debian Install System Team <[email protected]>
Uploaders: Colin Watson <[email protected]>, Steve McIntyre <[email protected]>
Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.15.7)
Build-Depends: debhelper-compat (= 13)
Standards-Version: 3.9.4
Vcs-Browser: https://salsa.debian.org/installer-team/os-prober
Vcs-Git: https://salsa.debian.org/installer-team/os-prober.git

Package: os-prober-udeb
Package-Type: udeb
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, di-utils-mapdevfs, anna (>= 1.16), grub-mount-udeb [linux-any kfreebsd-any]
Depends: ${misc:Depends}, ${shlibs:Depends}, di-utils-mapdevfs, anna, grub-mount-udeb [linux-any kfreebsd-any]
Provides: os-prober
Description: utility to detect other OSes on a set of drives
This package is to be used by boot loader installers to detect other OSes
Expand All @@ -21,7 +21,7 @@ Description: utility to detect other OSes on a set of drives
Package: os-prober
Architecture: any
Section: utils
Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common [linux-any kfreebsd-any], mount
Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common [linux-any kfreebsd-any], mount [linux-any], freebsd-utils [kfreebsd-any]
Description: utility to detect other OSes on a set of drives
This package detects other OSes available on a system and outputs the
results in a generic machine-readable format.
2 changes: 2 additions & 0 deletions debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[DEFAULT]
debian-tag=%(version)s
3 changes: 3 additions & 0 deletions debian/salsa-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
include:
- https://salsa.debian.org/installer-team/branch2repo/raw/main/trigger_b2r.yml
20 changes: 15 additions & 5 deletions linux-boot-probes/mounted/common/40grub2
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,21 @@ parse_grub_menu () {
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
Expand Down
6 changes: 4 additions & 2 deletions linux-boot-probes/mounted/common/90fallback
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \
else
kernbootpart="$partition"
fi
for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do
for kernfile in $(eval ls -vr "$mpoint$kernpat" 2>/dev/null); do
kernbasefile=$(echo "$kernfile" | sed "s!^$mpoint!!")
if [ -f "$kernfile" ] && [ ! -L "$kernfile" ]; then
initrdname=$(echo "$kernfile" | sed "s/vmlinu[zx]/initrd\*/")
Expand All @@ -34,8 +34,10 @@ for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \
initrdname3=$(echo "$kernfile" | sed "s/vmlinu[zx]/initramfs\*/" | sed 's/$/.img/')
# And Gentoo's also
initrdname4=$(echo "$kernfile" | sed "s/kernel/initramfs\*/")
# Also Alpine
initrdname5=$(echo "$kernfile" | sed "s/vmlinu[zx]/initramfs\*/")
foundinitrd=0
for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" 2>/dev/null); do
for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" "$initrdname5" 2>/dev/null); do
if [ "$initrd" != "$kernfile" ] && [ -f "$initrd" ] && [ ! -L "$initrd" ]; then
initrd=$(echo "$initrd" | sed "s!^$mpoint!!")
result "$partition:$kernbootpart::$kernbasefile:$initrd:root=$mappedpartition"
Expand Down
5 changes: 2 additions & 3 deletions os-prober
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ log_output () {
}

: >"$OS_PROBER_TMP/dmraid-map"
DMRAID=$(type dmraid >/dev/null 2>&1 || true)
if [ "$DMRAID" ]; then
dmraid -r -c >"$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 () {
Expand Down
2 changes: 1 addition & 1 deletion os-probes/mounted/arm64/20microsoft
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi

# Weed out stuff that doesn't apply to us
case "$type" in
ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;
ntfs3|ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;
vfat) debug "$1 is a FAT32 partition" ;;
msdos) debug "$1 is a FAT16 partition" ;;
fat) debug "$1 is a FAT partition (mounted by GRUB)" ;;
Expand Down
6 changes: 6 additions & 0 deletions os-probes/mounted/common/90linux-distro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
if [ -e "$dir/etc/os-release" ]; then
short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')"
long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')"
elif [ -e "$dir/usr/lib/os-release" ]; then
short="$(grep ^NAME= "$dir/usr/lib/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')"
long="$(grep ^PRETTY_NAME= "$dir/usr/lib/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')"
elif [ -e "$dir/etc/debian_version" ]; then
short="Debian"
long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")"
Expand Down Expand Up @@ -137,6 +140,9 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
elif [ -e "$dir/etc/devuan_version" ]; then
short="Devuan"
long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")"
elif [ -e "$dir/etc/exherbo-release" ]; then
short="Exherbo"
long="Exherbo Linux"
else
short="Linux"
long="unknown Linux distribution"
Expand Down
41 changes: 19 additions & 22 deletions os-probes/mounted/x86/20microsoft
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ partition="$1"
mpoint="$2"
type="$3"

# this function interleaves a string with dots, thus:
# "Windows 11" --> "W.i.n.d.o.w.s. .1.1"
dotify() {
echo $1 | sed 's/./&./g;s/.$//'
}

# This script looks for legacy BIOS bootloaders only. Skip if running UEFI
if [ -d /sys/firmware/efi ] && [ ! -f /var/lib/partman/ignore_uefi ]; then
debug "Skipping legacy bootloaders on UEFI system"
Expand All @@ -15,7 +21,7 @@ fi

# Weed out stuff that doesn't apply to us
case "$type" in
ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;
ntfs3|ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;
vfat) debug "$1 is a FAT32 partition" ;;
msdos) debug "$1 is a FAT16 partition" ;;
fat) debug "$1 is a FAT partition (mounted by GRUB)" ;;
Expand All @@ -31,29 +37,20 @@ if item_in_dir -q bootmgr "$2"; then
for boot in $(item_in_dir boot "$2"); do
bcd=$(item_in_dir bcd "$2/$boot")
if [ -n "$bcd" ]; then
if grep -aqs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
long="Windows 10"
elif grep -aqs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
long="Windows 8"
elif grep -aqs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
long="Windows 7"
elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then
long="Windows Vista"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then
long="Windows Server 2008 R2"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then
long="Windows Server 2008"
elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
long="Windows Recovery Environment"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
long="Windows Recovery Environment"
else
long="Windows Vista"
fi
short=Windows

found=true
short=Windows

for v in 12 11 10 8 7 Vista "Server 2008 R2" "Server 2008" "Recovery Environment" "Setup"; do
win_v="Windows $v"
if grep -aqs "$(dotify "$win_v")" "$2/$boot/$bcd"; then
long="$win_v"
# Windows Setup is a special case, rename it:
[ "$v" != "Setup" ] || long="Windows Recovery Environment"
break
fi
done
# if no match found, call it Vista
: ${long:="Windows Vista"}
break
fi
done
Expand Down

0 comments on commit 9c91531

Please sign in to comment.