Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:

on:
push:
branches: '*'
branches: '**'
tags: 'v*'
pull_request:
branches:
Expand All @@ -15,11 +15,21 @@ jobs:
build:
name: ${{ matrix.version.name }}, ${{ matrix.architecture.name }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
version:
- name: 'r1beta6'
uname_version: hrev59866_53

# The Haiku project removed the R1/beta5 package repositories when
# releasing R1/beta6, which makes `pkgman` fail during
# provisioning. The image can no longer be built, so reuse the one
# from the last release that could build it.
- name: 'r1beta5'
uname_version: hrev57937
copy_from_previous_release: v0.1.0

architecture:
- name: x86-64
Expand Down Expand Up @@ -64,12 +74,22 @@ jobs:
# limit-access-to-actor: true

- name: Build Image
if: '!matrix.version.copy_from_previous_release'
run: |
PACKER_LOG=1 ./build.sh \
'${{ matrix.version.name }}' \
'${{ matrix.architecture.name }}' \
-var 'headless=true'

- name: Copy from previous release
if: matrix.version.copy_from_previous_release
run: |
curl -O -L \
--retry 3 \
--create-dirs \
--output-dir output \
https://github.com/cross-platform-actions/haiku-builder/releases/download/${{ matrix.version.copy_from_previous_release }}/haiku-${{ matrix.version.name }}-${{ matrix.architecture.name }}.qcow2

- name: Start Local HTTP Server
run: python3 -m http.server 8080 --directory output &

Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add support for Haiku R1/beta6. Since it has not been officially released
yet, the image is built from the official test build, `hrev59866_53`
- Add an `iso_urls` variable, which overrides where the installation ISO is
downloaded from. This makes it possible to build versions that are not
available on the release mirrors yet

### Changed
- The R1/beta5 image is copied from the `v0.1.0` release instead of being
rebuilt. The Haiku project removed the R1/beta5 package repositories when
releasing R1/beta6, which makes `pkgman` fail during provisioning. The
image is still tested on every build

## [0.1.0] - 2026-04-29
### Changed
Expand Down
29 changes: 21 additions & 8 deletions main.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,29 @@ variable "acceleration" {
description = "Indicates if hardware acceleration should be enabled or not"
}

variable "iso_urls" {
default = []
type = list(string)
description = "Where to download the installation ISO from. When empty, the release mirrors are used. Set this for versions that haven't been released yet, since those are not available on the mirrors"
}

locals {
iso_target_extension = "iso"
iso_target_path = "packer_cache"
iso_full_target_path = "${local.iso_target_path}/${sha1(var.checksum)}.${local.iso_target_extension}"

vm_name = "haiku-${var.os_version}-${var.architecture.name}.qcow2"
iso_path = "${var.os_version}/haiku-${var.os_version}-${var.architecture.image}-anyboot.iso"

release_iso_urls = [
"http://mirror.rit.edu/haiku/${local.iso_path}",
"https://ftp.osuosl.org/pub/haiku/${local.iso_path}",
"https://s3.us-east-1.wasabisys.com/haiku-release/${local.iso_path}",
"https://cloudflare-ipfs.com/ipns/hpkg.haiku-os.org/release/${local.iso_path}",
"https://mirror.aarnet.edu.au/pub/haiku/${local.iso_path}",
]

iso_urls = length(var.iso_urls) > 0 ? var.iso_urls : local.release_iso_urls
}

source "qemu" "qemu" {
Expand All @@ -103,7 +119,10 @@ source "qemu" "qemu" {

ssh_username = "user"
ssh_password = var.root_password
ssh_timeout = "10000s"
# The installation takes around six minutes to reach SSH. When the boot
# steps don't match what the installer actually shows, SSH never becomes
# available, so keep the timeout just long enough to absorb a slow runner.
ssh_timeout = "15m"

qemuargs = concat(
[
Expand All @@ -128,13 +147,7 @@ source "qemu" "qemu" {
iso_checksum = var.checksum
iso_target_extension = local.iso_target_extension
iso_target_path = local.iso_target_path
iso_urls = [
"http://mirror.rit.edu/haiku/${local.iso_path}",
"https://ftp.osuosl.org/pub/haiku/${local.iso_path}",
"https://s3.us-east-1.wasabisys.com/haiku-release/${local.iso_path}",
"https://cloudflare-ipfs.com/ipns/hpkg.haiku-os.org/release/${local.iso_path}",
"https://mirror.aarnet.edu.au/pub/haiku/${local.iso_path}",
]
iso_urls = local.iso_urls

http_directory = "."
output_directory = "output"
Expand Down
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@ The following architectures and versions are supported:

| Version | x86-64 |
|---------|--------|
| r1beta6 | ✓ |
| r1beta5 | ✓ |

Note, R1/beta6 has not been officially released yet. The image is built from
the official test build, `hrev59866_53`, until the release is out.

Note, the R1/beta5 image is no longer built. The Haiku project removed the
R1/beta5 package repositories when releasing R1/beta6, which makes `pkgman`
fail during provisioning. The image from the `v0.1.0` release, the last one
that could be built, is reused for every release instead. It's still tested on
every build, just not rebuilt.

## Building Locally

### Prerequisite
Expand Down
9 changes: 9 additions & 0 deletions var_files/r1beta6/x86-64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
checksum = "sha256:f3b498dfd506c546cb7a3f04b869a6d63cd2e6b9e84612fdb47c15a3952adeae"

# R1/beta6 has not been released yet, so the ISO is not available on the
# release mirrors. Build from the official test build in the meantime. Once the
# release is out, remove `iso_urls` and replace the checksum above with the
# checksum of the released ISO.
iso_urls = [
"https://haiku-release.cdn.haiku-os.org/testing/r1beta6/x86_64/haiku-r1beta6-hrev59866_53-x86_64-anyboot.iso"
]
Loading