[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#732696: Re: Bug#732696: os-prober: Fails to detect new package-management Haiku builds



Hello,

On 15/07/2014 13:09, Jeroen Oortwijn wrote:
> Hello,
> 
> As the writer of the original probe [1], I will try to answer some questions.

As the original writer of the original probe (:D), let me comment on
this as well...

>> 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.

+1

Although OTOH in theory GRUB2 is able to load haiku_loader directly so
it might work without makebootable, but nobody knows and uses it, and I
never finished multiboot support so it always asks where its boot
partition is.

> 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 added some sed to add the version info, I noticed at least the windows
probe did this, and I saw no reason not to do it.
First version was quite naive, but it should now be robust enough to
handle future official releases I think, degrading partially with
missing hrev and other parts.

Some tests here:
http://pastebin.com/KsseypUb

Currently my menu ends up like:
Haiku R1 alpha4 (hrev47000)
which is much nicer than just the OS name.

Patch against your branch attached, hopefully with correct format, I'm
not used to bzr.

> 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.

Well the last official release is still alpha4 though, which is non-PM.

And I still have a pre-PM partition on at least one machine to compare
until I fix several regressions.

But I copied the existing probe as a different name and it just works
for me.


François.
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: revol@free.fr-20140806181508-8ewigskp1r29yybv
# target_branch: http://bazaar.launchpad.net/~idefix/ubuntu/trusty/os-\
#   prober/HaikuPM/
# testament_sha1: e5e1cf1cc481796312c43938b873f8ebed3731dd
# timestamp: 2014-08-06 20:33:38 +0200
# base_revision_id: oortwijn@gmail.com-20140713175637-ciywgnvjqwou9vq9
# 
# Begin patch
=== modified file 'os-probes/mounted/x86/83haiku'
--- os-probes/mounted/x86/83haiku	2014-07-13 17:56:37 +0000
+++ os-probes/mounted/x86/83haiku	2014-08-06 18:15:08 +0000
@@ -23,11 +23,13 @@
 if system="$(item_in_dir "system" "$mpoint")" &&
 	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"
+		rev="$(item_in_dir "haiku-.*\.hpkg" "$mpoint/$system/$packages")"
 then
 	debug "Stage 2 bootloader and kernel found"
 	label="$(count_next_label Haiku)"
-	result "$partition:Haiku:$label:chain"
+	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/ $//')"
+	long="Haiku $rev"
+	result "$partition:$long:$label:chain"
 	exit 0
 else
 	debug "Stage 2 bootloader and kernel not found: exiting"

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWfqPiDkABK/flAAwVPv//9di
Ug+////1AIAIAGAHfeF923EpR6Ta7zqV0SkrrVQkpNAp4TU2U2k9JoyB6mTJkYnpNGgAAMlGiehH
oPUJMhiDIDRkYgwQGmgcwBGCYgGATBNGQ0MAmCMTCSaop6nqNHpqYTQ9QNNGm1AD1AAAGgIpE0TE
ZGiPSNFHqeT1R+kjQeoPUNNHk1D1AIpIAmRoMk2glNtTIjaj0mIAAZHqECiiUgpsuPBrqYIXh8k3
xEYB1K1q2mJ1QRedIDXWTwLWjVwrk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