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

Bug#590897: (Extended) Haiku detection for os-prober



Package: os-prober
Version: 1.39
Severity: normal
Tags: patch

I made an extended version of the Haiku os-prober module. It will also detect
if the partition was "makebootable'd".

Do note that util-linux v1.18 or higher has to be installed for the detection
to work. As before, 'blkid' wouldn't detect BeFS partitions.

- Jeroen



-- System Information:
Debian Release: squeeze/sid
  APT prefers maverick-updates
  APT policy: (500, 'maverick-updates'), (500, 'maverick-security'), (500, 'maverick')
Architecture: i386 (i686)

Kernel: Linux 2.6.35-25-generic (SMP w/1 CPU core)
Locale: LANG=en_IE.utf8, LC_CTYPE=en_IE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages os-prober depends on:
ii  libc6                 2.12.1-0ubuntu10.2 Embedded GNU C Library: Shared lib

os-prober recommends no packages.

os-prober suggests no packages.

-- no debconf information
#!/bin/sh
# Detects Haiku on BeFS partitions.

.. /usr/share/os-prober/common.sh

partition="$1"
mpoint="$2"
type="$3"

# Weed out stuff that doesn't apply to us
case "$type" in
	befs) debug "$partition is a BeFS partition" ;;
	*) debug "$partition is not a BeFS partition: exiting"; exit 1 ;;
esac

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" "$2")" &&
	item_in_dir -q "haiku_loader" "$mpoint/$system" &&
	item_in_dir -q "kernel_x86" "$mpoint/$system"
then
	debug "Stage 2 bootloader and kernel found"
	label="$(count_next_label Haiku)"
	result "$partition:Haiku:$label:chain"
	exit 0
else
	debug "Stage 2 bootloader and kernel not found: exiting"
	exit 1
fi

Reply to: