Skip to content

Commit 9018bfc

Browse files
committed
Allow .iso creation from local omarchy code
1 parent 7598e58 commit 9018bfc

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Example usage:
2222
OMARCHY_INSTALLER_REPO="myuser/omarchy-fork" OMARCHY_INSTALLER_REF="some-feature" ./bin/omarchy-iso-make
2323
```
2424

25+
Alternatively, you can create a .iso with local code instead of pulling down a Github repository:
26+
```bash
27+
./bin/omarchy-iso-make --local-omarchy path/to/your/local/clone
28+
```
29+
2530
## Testing the ISO
2631

2732
Run `./bin/omarchy-iso-boot [release/omarchy.iso]`.

bin/omarchy-iso-make

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55

66
# Parse command line arguments
77
NO_CACHE=""
8+
LOCAL_OMARCHY_PATH=""
89
while [[ $# -gt 0 ]]; do
910
case $1 in
1011
--no-cache)
@@ -15,9 +16,13 @@ while [[ $# -gt 0 ]]; do
1516
NO_BOOT_OFFER=1
1617
shift
1718
;;
19+
--local-omarchy)
20+
LOCAL_OMARCHY_PATH="$2"
21+
shift 2
22+
;;
1823
*)
1924
echo "Unknown option: $1"
20-
echo "Usage: $0 [--no-cache] [--no-boot-offer]"
25+
echo "Usage: $0 [--no-cache] [--no-boot-offer] [--local-omarchy PATH]"
2126
exit 1
2227
;;
2328
esac
@@ -47,6 +52,16 @@ DOCKER_ARGS=(
4752
-v "$BUILD_ROOT/configs:/configs:ro"
4853
)
4954

55+
# Mount local omarchy directory if provided
56+
if [[ -n "$LOCAL_OMARCHY_PATH" ]]; then
57+
if [[ ! -d "$LOCAL_OMARCHY_PATH" ]]; then
58+
echo "Error: Local omarchy path '$LOCAL_OMARCHY_PATH' does not exist"
59+
exit 1
60+
fi
61+
DOCKER_ARGS+=(-v "$(realpath "$LOCAL_OMARCHY_PATH"):/local-omarchy:ro")
62+
DOCKER_ARGS+=(-e "USE_LOCAL_OMARCHY=1")
63+
fi
64+
5065
# Use local pacman cache if you already have one on host to speed up repeat runs
5166
if [ -d "/var/cache/pacman/pkg" ]; then
5267
DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg")

builder/build-iso.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ rm -rf "$build_cache_dir/airootfs/etc/xdg/reflector"
2525
# Bring in our configs
2626
cp -r /configs/* $build_cache_dir/
2727

28-
# Clone Omarchy itself
29-
git clone -b $OMARCHY_INSTALLER_REF https://github.com/$OMARCHY_INSTALLER_REPO.git "$build_cache_dir/airootfs/root/omarchy"
28+
# Clone or copy Omarchy itself
29+
if [[ "$USE_LOCAL_OMARCHY" == "1" ]]; then
30+
echo "Using local omarchy from /local-omarchy"
31+
cp -r /local-omarchy "$build_cache_dir/airootfs/root/omarchy"
32+
else
33+
echo "Cloning omarchy from https://github.com/$OMARCHY_INSTALLER_REPO.git (ref: $OMARCHY_INSTALLER_REF)"
34+
git clone -b $OMARCHY_INSTALLER_REF https://github.com/$OMARCHY_INSTALLER_REPO.git "$build_cache_dir/airootfs/root/omarchy"
35+
fi
3036

3137
# Make log uploader available in the ISO too
3238
mkdir -p "$build_cache_dir/airootfs/usr/local/bin/"

0 commit comments

Comments
 (0)