Hello,

It was suggested to me to add this here, in hopes it helps someone get
started with hacking on Hurd.

Thanks,
Milos
From 29b79edccdceca3b2fc407ed4a905b1db53374db Mon Sep 17 00:00:00 2001
From: Milos Nikic <[email protected]>
Date: Sun, 22 Mar 2026 16:02:32 -0700
Subject: [PATCH] adding a small setup instructions and script for quick dev
 env.

---
 contributing/developer-workflows.mdwn | 64 +++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/contributing/developer-workflows.mdwn b/contributing/developer-workflows.mdwn
index 6e94661a..30a827a6 100644
--- a/contributing/developer-workflows.mdwn
+++ b/contributing/developer-workflows.mdwn
@@ -101,6 +101,70 @@ send my patches to the mailing list via:
 # Using vim-figitive
 vim users can use vim-fugitive, which is similiar to Magit.
 
+<a id="quick-start-script" name="quick-start-script"></a>
+# Quick Start Build Script
+
+If you are starting with a fresh Debian GNU/Hurd image, compiling MiG, GNU Mach, and the Hurd requires specific dependencies and a strict build order.
+
+The following script automates this process. It installs the necessary packages, clones the upstream repositories, and builds them in the correct sequence.
+
+Save this script as `setup-hurd.sh`, make it executable with `chmod +x setup-hurd.sh`, and run it:
+```
+#!/bin/bash
+set -e
+
+# Set up directory structure
+WORKDIR="$HOME/dev/hurd/upstream"
+GNU_PREFIX="$HOME/gnu"
+MIG_REPO="https://git.savannah.gnu.org/git/hurd/mig.git";
+MACH_REPO="https://git.savannah.gnu.org/git/hurd/gnumach.git";
+HURD_REPO="git://git.savannah.gnu.org/hurd/hurd.git"
+
+echo "==> Updating APT and installing base development tools..."
+sudo apt update
+sudo apt install -y vim git build-essential autoconf automake m4 bison flex texinfo xorriso libparted-dev pkg-config ncurses-term rsync ripgrep pip pipx
+
+mkdir -p "$WORKDIR"
+cd "$WORKDIR"
+
+echo "==> Cloning MiG, GNU Mach, and Hurd..."
+[ ! -d "mig" ] && git clone "$MIG_REPO"
+[ ! -d "gnumach" ] && git clone "$MACH_REPO"
+[ ! -d "hurd" ] && git clone "$HURD_REPO"
+
+echo "==> Building and installing MiG..."
+cd "$WORKDIR/mig"
+autoreconf --install
+rm -rf build && mkdir build && cd build
+mkdir -p "$GNU_PREFIX"
+TARGET_CPPFLAGS="-I$GNU_PREFIX/include" ../configure --prefix="$GNU_PREFIX"
+make -j$(nproc)
+make install
+
+# Persist PATH update
+if ! grep -q "$GNU_PREFIX/bin" ~/.bashrc; then
+    echo "export PATH=\"$GNU_PREFIX/bin:\$PATH\"" >> ~/.bashrc
+fi
+export PATH="$GNU_PREFIX/bin:$PATH"
+
+echo "==> Building GNU Mach..."
+cd "$WORKDIR/gnumach"
+autoreconf --install
+rm -rf build && mkdir build && cd build
+../configure --prefix=
+make gnumach.gz
+
+echo "==> Building Hurd..."
+cd "$WORKDIR/hurd"
+autoreconf -fi
+rm -rf build && mkdir build && cd build
+../configure
+make -j$(nproc)
+
+echo -e "\n All done. If this is your first run, do:"
+echo "source ~/.bashrc"
+```
+
 # Develop the Debian way
 
 You can develop the GNU/Hurd via Debian GNU/Hurd.  This [Hurd wiki
-- 
2.53.0

Reply via email to