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

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



Package: os-prober
Version: 1.63
Severity: important
Tags: patch

Haiku's new package management builds have changed the way the kernel
and boot
sector is laid out, and os-prober's detection routines no longer detect such
Haiku partitions.

Currently package management builds are only available in nightly
releases but
there should be an official release Real Soon Now, and package management
should become the norm. It'd be nice to get this fixed before this happens.

I enclose a patch which should fix this (to be applied to /usr/lib/os-
probes/mounted/83haiku).



-- System Information:
Debian Release: 7.2
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'sid'), (500, 'unstable'), (1,
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages os-prober depends on:
ii  libc6  2.17-97

os-prober recommends no packages.

os-prober suggests no packages.

-- no debconf information

--- /usr/lib/os-probes/mounted/83haiku	2012-08-22 19:21:32.000000000 +0100
+++ /tmp/83haiku	2013-12-20 12:17:29.143209425 +0000
@@ -13,18 +13,34 @@
 	*) 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.*haiku_loader'; then
 	debug "Stage 1 bootloader found"
 else
 	debug "Stage 1 bootloader not found: exiting"
 	exit 1
 fi
 
-if system="$(item_in_dir "system" "$mpoint")" &&
+system="$(item_in_dir "system" "$mpoint")"
+packages="$(item_in_dir "packages" "$mpoint/$system")"
+found=
+if [ "$system" != "" ] &&
 	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")
 then
+	found=1
+fi
+
+if [ "$found" = "" ] && [ "$packages" != "" ] &&
+	item_in_dir -q "haiku_loader\-.*" "$mpoint/$system/$packages" &&
+	(item_in_dir -q "haiku_x86\-.*" "$mpoint/$system/$packages" ||
+		item_in_dir -q "haiku_x86_64\-.*" "$mpoint/$system/$packages")
+then
+	found=1
+fi
+
+if [ "$found" != "" ]
+then
 	debug "Stage 2 bootloader and kernel found"
 	label="$(count_next_label Haiku)"
 	result "$partition:Haiku:$label:chain"

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: