close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
lgromero-new-oglive
| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | # Detects Haiku on BeFS partitions. |
|---|
| 3 | |
|---|
| 4 | . /usr/share/os-prober/common.sh |
|---|
| 5 | |
|---|
| 6 | partition="$1" |
|---|
| 7 | mpoint="$2" |
|---|
| 8 | type="$3" |
|---|
| 9 | |
|---|
| 10 | # Weed out stuff that doesn't apply to us |
|---|
| 11 | case "$type" in |
|---|
| 12 | befs|befs_be) debug "$partition is a BeFS partition" ;; |
|---|
| 13 | *) debug "$partition is not a BeFS partition: exiting"; exit 1 ;; |
|---|
| 14 | esac |
|---|
| 15 | |
|---|
| 16 | if head -c 512 "$partition" | grep -qs "system.haiku_loader"; then |
|---|
| 17 | debug "Stage 1 bootloader found" |
|---|
| 18 | else |
|---|
| 19 | debug "Stage 1 bootloader not found: exiting" |
|---|
| 20 | exit 1 |
|---|
| 21 | fi |
|---|
| 22 | |
|---|
| 23 | if system="$(item_in_dir "system" "$mpoint")" && |
|---|
| 24 | item_in_dir -q "haiku_loader" "$mpoint/$system" && |
|---|
| 25 | (item_in_dir -q "kernel_x86" "$mpoint/$system" || |
|---|
| 26 | item_in_dir -q "kernel_x86_64" "$mpoint/$system") |
|---|
| 27 | then |
|---|
| 28 | debug "Stage 2 bootloader and kernel found" |
|---|
| 29 | label="$(count_next_label Haiku)" |
|---|
| 30 | result "$partition:Haiku:$label:chain" |
|---|
| 31 | exit 0 |
|---|
| 32 | else |
|---|
| 33 | debug "Stage 2 bootloader and kernel not found: exiting" |
|---|
| 34 | exit 1 |
|---|
| 35 | fi |
|---|
Note: See
TracBrowser
for help on using the repository browser.
Download in other formats: