diff --git a/3rdparty/os_probe/83haiku b/3rdparty/os_probe/83haiku index bd94ad00fe..ea1db246e5 100755 --- a/3rdparty/os_probe/83haiku +++ b/3rdparty/os_probe/83haiku @@ -1,7 +1,11 @@ -#!/bin/sh -# Detects Haiku on BeFS partitions and FUSE mounted BeFS too. -# Discussion at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732696 -# From version 42 (dated 20150811) updated by Jeroen Oortwijn at https://bazaar.launchpad.net/~idefix/ubuntu/trusty/os-prober/HaikuPM/files/head:/os-probes/mounted/x86 +#!/usr/bin/sh +# Detects bootable Haiku OS on BeFS partitions and FUSE mounted BeFS too. +# If it doesn't find anything, try mounting the BeFS volumes in Linux. +# Discussion of improvements and development history at +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732696 +# Adapted from version 42 (dated 20150811) updated by Jeroen Oortwijn at +# https://bazaar.launchpad.net/~idefix/ubuntu/trusty/os-prober/HaikuPM/files/head:/os-probes/mounted/x86 +# Latest version now at https://git.haiku-os.org/haiku/tree/3rdparty/os_probe . /usr/share/os-prober/common.sh @@ -9,15 +13,15 @@ partition="$1" mpoint="$2" type="$3" -# Weed out stuff that doesn't apply to us +# Weed out stuff that doesn't apply to us, needs to be a Be file system. case "$type" in - bfs|befs) debug "$partition is a BeFS partition" ;; - fuse|fuseblk) debug "$partition is a FUSE partition" ; mpoint="$mpoint/myfs" ;; # might be befs-fuse - *) debug "$partition is not a BeFS partition: exiting"; exit 1 ;; + bfs|befs) debug "$partition is a BeFS partition." ;; + fuse|fuseblk) debug "$partition is a FUSE partition, maybe with BeFS on it." ; mpoint="$mpoint/myfs" ;; + *) exit 1 ;; # Be quiet and just quit for irrelevant partitions. esac if head -c 512 "$partition" | grep -qs "haiku_loader"; then - debug "Haiku stage 1 bootloader found" + debug "Haiku stage 1 bootloader found." else debug "Haiku stage 1 bootloader not found: exiting" exit 1 @@ -25,12 +29,16 @@ fi if system="$(item_in_dir "system" "$mpoint")" && packages="$(item_in_dir "packages" "$mpoint/$system")" && - item_in_dir -q "haiku_loader-.*\.hpkg" "$mpoint/$system/$packages" && - rev="$(item_in_dir "haiku-.*\.hpkg" "$mpoint/$system/$packages")" + item_in_dir -q "haiku_loader-r[0-9].*\.hpkg" "$mpoint/$system/$packages" && + rev="$(item_in_dir "haiku-r[0-9].*\.hpkg" "$mpoint/$system/$packages")" then - debug "Haiku PM stage 2 bootloader and kernel found" + debug "Haiku Package Manager stage 2 bootloader and kernel ($rev) found." label="$(count_next_label Haiku)" - rev="$(echo "$rev" | sed 's/haiku-//;s/^\(r[0-9]\+\)./\U\1\E /;s/ \([a-z]\+[0-9]\+\)[_-]/ \1 /;s/ [a-z]*_\?\(hrev[0-9]\+\)\+-/ (\1) /;s/[^ ]\+.hpkg//;s/ $//')" + # Convert kernel file name like haiku-r1~beta3_hrev55181_56-1-x86_64.hpkg + # or haiku-r1~alpha4_pm_hrev49856-1-x86_gcc2.hpkg into a readable version, + # like "Haiku R1 beta3 (hrev55181_56) 64". Seems to use a travelling space + # technique in the sed stream editor. + rev="$(echo "$rev" | sed 's/haiku-//;s/^\(r[0-9]\+\)./\U\1\E /;s/ \([a-z]\+[0-9]\+\)[_-]/ \1 /;s/ [a-z]*_\?\(hrev[0-9_]\+\)\+-/ (\1) /;s/) [^_]\+_\([a-z0-9]\+\)\.hpkg/) \1 /;s/[^ ]\+.hpkg//;s/ $//')" long="Haiku $rev" result "$partition:$long:$label:chain" exit 0 @@ -38,7 +46,7 @@ elif system="$(item_in_dir "system" "$mpoint")" && item_in_dir -q "haiku_loader" "$mpoint/$system" && item_in_dir -q "kernel_.*" "$mpoint/$system" then - debug "Haiku non-PM stage 2 bootloader and kernel found" + debug "Older non-package manager Haiku stage 2 bootloader and kernel found." label="$(count_next_label Haiku)" result "$partition:Haiku:$label:chain" exit 0 diff --git a/3rdparty/os_probe/README.md b/3rdparty/os_probe/README.md index cc4804815d..af982c4d7b 100644 --- a/3rdparty/os_probe/README.md +++ b/3rdparty/os_probe/README.md @@ -1,19 +1,19 @@ # os-probe for the Haiku Computer Operating System This is the Linux "os-probes" file to detect Haiku OS and to automatically add -it to the GRUB boot menu. +it to the GRUB boot menu. Mostly relevant for x86 BIOS based computers. -First make sure the Haiku volumes you want to boot are mounted in Linux -(otherwise nothing gets detected). Then copy the 83haiku file to your Linux -system in the os-probes subdirectory, usually (in Fedora at least) it will be -/usr/libexec/os-probes/mounted/83haiku You can find older 83haiku versions in -the repository history, though the latest should be able to detect older -(pre-package manager) Haiku too. +Copy the 83haiku file to your Linux system in the os-probes subdirectory, +usually (in Fedora at least) it will be /usr/libexec/os-probes/mounted/83haiku +You can find older 83haiku versions in the repository history, though the +latest should be able to detect older (pre-package manager) Haiku too. Then regenerate the GRUB boot configuration file. This will happen automatically the next time your kernel is updated. To do it manually, for old school MBR BIOS boot computers, the command is `grub2-mkconfig --output /boot/grub2/grub.cfg` +If it doesn't find the Haiku partitions, try manually mounting them in Linux +and rerun the grub command. Computers using the newer UEFI boot system have a EFI/HAIKU/BOOTX64.EFI file that you manually install to your EFI partition, and booting is done @@ -25,6 +25,6 @@ It's in the [Debian os-prober package](https://packages.debian.org/search?keywords=os-prober). There's also a big discussion about updating it in [Debian Bug Report #732696](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732696). +Latest version is now at https://git.haiku-os.org/haiku/tree/3rdparty/os_probe -_AGMS20210921_ - +_AGMS20210927_