Hello, As the writer of the original probe [1], I will try to answer some questions.
David Given wrote: >>> I enclose a patch which should fix this (to be applied to /usr/lib/os- >>> probes/mounted/83haiku). >> >> Did that get tested against said release if it's published? > > Against a nightly build (currently the only place where you can get the > Package Management kernels). Current nightly builds have different package names, so the patch doesn't work anymore. Cyril Brulebois wrote: >> -if system="$(item_in_dir "system" "$mpoint")" && >> +system="$(item_in_dir "system" "$mpoint")" >> +packages="$(item_in_dir "packages" "$mpoint/$system")" >> +found= >> +if [ "$system" != "" ] && [...] > Do we need to hardcode checking both version? Looking at item_in_dir's > implementation, the pattern is passed to grep, so we could use > 'kernel_.*' instead? This code was added by Alex Smith [2] when the 64-bit builds of Haiku arrived. I agree that 'kernel_.*' could have been used instead. David Given wrote: > TBH if this were mine I'd be inclined to remove most of this logic. The > prober doesn't do anything with the files other than to look to see if > they're there. Simply checking the boot loader for 'haiku' would be a > lot simpler and more robust. Yes, but that could give false-positives: When the user has 'makebootable'd' a partition, but then removed all the files to use it for something else. The stage 1 bootloader would then still be present, but not the stage 2 bootloader and the kernel. The partition would then still be detected as containing an OS. That's why the probe checks if the stage 1 bootloader, stage 2 bootloader and kernel are all present. Because David's patch doesn't work anymore, I have created a new patch. See attached file. This patch can also be found at my bazaar branch [3]. The resulting packages can be found in my PPA [4]. I removed the detection of the non package management builds of Haiku, because I don't think there will be a lot of non-PM versions installed when the next Haiku release is out. Haiku releases currently are in alpha phase, so a lot can still be changed. Though from now on all releases will be package management based. Kind regards, Jeroen Oortwijn [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590897 [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685228 [3] http://bazaar.launchpad.net/~idefix/ubuntu/trusty/os-prober/HaikuPM/revision/36 [4] https://launchpad.net/~idefix/+archive/ubuntu/befs-support/+packages?field.name_filter=os-prober&field.status_filter=published&field.series_filter=trusty
--- old/os-probes/mounted/x86/83haiku 2012-09-18 00:05:11 +0000 +++ new/os-probes/mounted/x86/83haiku 2014-07-09 16:09:12 +0000 @@ -13,7 +13,7 @@ *) debug "$partition is not a BeFS partition: exiting"; exit 1 ;; esac -if head -c 512 "$partition" | grep -qs "system.haiku_loader"; then +if head -c 512 "$partition" | grep -qs "system.packages.haiku_loader"; then debug "Stage 1 bootloader found" else debug "Stage 1 bootloader not found: exiting" @@ -21,9 +21,9 @@ fi if system="$(item_in_dir "system" "$mpoint")" && - item_in_dir -q "haiku_loader" "$mpoint/$system" && - (item_in_dir -q "kernel_x86" "$mpoint/$system" || - item_in_dir -q "kernel_x86_64" "$mpoint/$system") + packages="$(item_in_dir "packages" "$mpoint/$system")" && + item_in_dir -q "haiku_loader-.*\.hpkg" "$mpoint/$system/$packages" && + item_in_dir -q "haiku-.*\.hpkg" "$mpoint/$system/$packages" then debug "Stage 2 bootloader and kernel found" label="$(count_next_label Haiku)"