Haiku Identification (BIOS and filesystem)

When I boot my system, I boot Linux as default.

When I wish to boot Haiku, I keep pressing Delete until I get the BIOS screen, then type ← once to get to the “Exit” tab and go down to “Boot Override” where I see these two options:

debian (ST3320311CS)

UEFI OS (ST3320311CS)

-It would be nice, if we could see “Haiku” (perhaps with href too) instead of “UEFI OS”.

Also, I’d love if the hrev would be visible when I do a lsblk under Linux (particular useful when I need to report a bug or discuss an issue).

I haven’t been able to find out how debian’s name is available in the BIOS yet, I’m still trying to find out.

However, the device label might be fairly easy to change.

Looks like the firmware boot manager. Mine says Haiku :slight_smile:

You can change that through the EFI vars, to which I think we don’t have access from Haiku yet. From your Debian have a look at efibootmgr. As root, run it to dump you entries. You can’t rename an entry, so you’ll have to delete the one you have and recreate it with the label you want. Or safer, the other way around, with a boot in between to test it.

There seems to exist GUIs to do the same, but I’ve never used those, so I can’t recommend any.

Do you see Debian’s kernel and libc versions with lsblk? I’d say the easiest is to just mount Haiku’s partition and see the name of system/packages/haiku-r1~whatever.hpkg. Assuming you don’t want your report to be about an older state.

2 Likes

… efibootmgr …

Thanks, I’ve now modified the boot entries and am about to reboot. =)

Regarding the lsblk; I should have been more clear.

When writing an image to one of the USB-sticks in the heap, I usually insert the USB-stick and do a lsblk on it, getting a result like …

sdc iso9660 haiku-nightly-x86_64 14.6G 2026-04-30-06-16-30-00
sdc1 650M
sdc2 2.8M

-Here it would be more useful to have something like ‘haiku-hrev59313-x86_64’ instead of 'haiku-nightly-x86_64 :wink:

Works. It now shows up as “Haiku” in the BIOS and even boots. Thank you. :slight_smile:

(For those, who want to do the same, here’s a short howto:)

First off: Be careful, this might smash your system so it won’t boot.

-d /dev/sdX is the block device, replace the X with what’s relevant for your system.

-p 7 is the partition number. As you can see below, I have debian’s EFI on partition 1 and Haiku’s EFI is on partition 7, so I am free to smash either whenever I want.

efibootmgr >efibootmgr-output.txt
efibootmgr
…
Boot0001* debian	HD(1,GPT,221349fe-d1fd-49a9-bbbc-6e392b515574,0x23800,0x1dd000)/File(\EFI\debian\shimx64.efi) File(.)
Boot0002* UEFI OS	HD(7,GPT,78b13a63-eebf-964f-ad77-16732ca11056,0x28,0x23000)/File(\EFI\BOOT\BOOTX64.EFI)0000424f
…
sudo efibootmgr -b 0002 -B
sudo efibootmgr -c -b 0002 -d /dev/sdb -p 7 -L "Haiku" -l "\EFI\BOOT\BOOTX64.EFI"
sudo efibootmgr -o 1,2,3,4,5

First thing I do is that I dump the current boot entries to a file. I then list them.

The boot entry Boot0002 is my Haiku boot entry.

The command containing -B will delete the boot entry.

The next command (containing -c) will create a new boot entry.

The final command will change the boot order.

4 Likes

So the iso images? Should be an easy change if the info fits in the label, may try later today.

You can still mount sdc1 and see what version the haiku package has. And, as the bootloader has been including the revision for some time, you can also do strings /dev/sdc2 | grep hrev.

1 Like

I really like that; I often operate on blkdev’s directly. :wink:

I wonder if …

grep -Po ‘\bhrev\d{5}\b’ /dev/sdc2

… would be quicker or slower. In theory it should be quicker, but it all depends on the regex handling.

You forgot -a, and maybe picking some suffixes like +[0-9]+ and -dirty.

Yes, of course it’s faster, like 6 to 1 for me. Anyway, it’s just a 3 MB file. Even my bad choice takes less than a tenth of a second for me.

1 Like

You can add -m1 to grep so that it stops at the first match. If you pipe strings to it, and use it in a script, watch out for pipe buffering that may make this fail (the netire result from strings will be stored in ram and sent in one block to grep when strings is done)

1 Like

That made it absolutely rapid, thank you.

I now have the following, in case anyone else find it useful:

$ cat bin/hrev
#!/bin/bash

sudo grep -m1 -oaP ‘\bhrev\d{5}(:?[-+][\da-zA-Z]+)?\b’ /dev/sdb7