max / alloy
- Co-Authored-By
- Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 file changed,
+19 insertions,
-14 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | #!/usr/bin/env bash | |
| 2 | 2 | # | |
| 3 | - | # build-image.sh — build the Alloy bootc image and a bootable artifact | |
| 4 | - | # (installer ISO by default) with bootc-image-builder. | |
| 3 | + | # build-image.sh — build the Alloy bootc image and a disk image | |
| 4 | + | # (raw by default) with bootc-image-builder. | |
| 5 | 5 | # | |
| 6 | 6 | # Alloy re-brands os-release (ID=alloy, VERSION_ID=0.0). Two consequences | |
| 7 | 7 | # are handled in the Containerfile (pinned $releasever, disabled build-only | |
| @@ -12,18 +12,16 @@ | |||
| 12 | 12 | # container store, so bib finds the image at /var/lib/containers/storage | |
| 13 | 13 | # without a rootless->rootful copy. | |
| 14 | 14 | # | |
| 15 | - | # NOTE: the ISO this produces boots Anaconda, not `alloy install`. Every ISO | |
| 16 | - | # type bib offers ends in Anaconda (verified by generating the manifests; see | |
| 17 | - | # GO task a1d037f8), and the installer binary lives in the bootc image rather | |
| 18 | - | # than in the ISO's live root, which bib composes separately from the | |
| 19 | - | # anaconda-iso package set in build/alloy-0.0.yaml. An install from this ISO | |
| 20 | - | # leaves root locked and no account, because the Anaconda flow has no | |
| 21 | - | # user-creation spoke. Booting straight into the Alloy installer needs an ISO | |
| 22 | - | # built outside bib, and that retires build/alloy-0.0.yaml with it. | |
| 15 | + | # This script builds disk images only. It does not build ISOs, and asking it | |
| 16 | + | # for one is an error rather than a surprise: every ISO type bib offers ends in | |
| 17 | + | # Anaconda (verified by generating the manifests; see GO task a1d037f8), and an | |
| 18 | + | # install from such an ISO leaves root locked and no account, because the | |
| 19 | + | # Anaconda flow has no user-creation spoke. The installer ISO that boots into | |
| 20 | + | # `alloy install` is built outside bib by build/build-iso.sh. | |
| 23 | 21 | # | |
| 24 | 22 | # Usage: | |
| 25 | - | # build/build-image.sh # build image + installer ISO | |
| 26 | - | # build/build-image.sh --type raw # build image + raw disk image | |
| 23 | + | # build/build-image.sh # build image + raw disk image | |
| 24 | + | # build/build-image.sh --type qcow2 # build image + qcow2 disk image | |
| 27 | 25 | # build/build-image.sh --skip-build # reuse the current image, just run bib | |
| 28 | 26 | # build/build-image.sh --skip-bib --write /dev/sdX # write what is already built | |
| 29 | 27 | # build/build-image.sh --write /dev/sdX # also dd the artifact to a device | |
| @@ -40,7 +38,7 @@ | |||
| 40 | 38 | DEF="$REPO_ROOT/build/alloy-0.0.yaml" | |
| 41 | 39 | OUTPUT="$REPO_ROOT/output" | |
| 42 | 40 | ||
| 43 | - | TYPE="iso" | |
| 41 | + | TYPE="raw" | |
| 44 | 42 | WRITE_DEV="" | |
| 45 | 43 | SKIP_BUILD=0 | |
| 46 | 44 | SKIP_BIB=0 | |
| @@ -63,6 +61,14 @@ | |||
| 63 | 61 | esac | |
| 64 | 62 | done | |
| 65 | 63 | ||
| 64 | + | # Refuse the ISO types outright. Both of bib's spellings compose Anaconda, and | |
| 65 | + | # an artifact from either one installs a machine nobody can log into, so the | |
| 66 | + | # failure has to land here at the argument rather than an hour later at a boot. | |
| 67 | + | case "$TYPE" in | |
| 68 | + | iso|bootc-installer) | |
| 69 | + | die "$TYPE builds an Anaconda ISO, which installs an unloginable machine; use build/build-iso.sh for the Alloy installer ISO" ;; | |
| 70 | + | esac | |
| 71 | + | ||
| 66 | 72 | command -v podman >/dev/null || die "podman not found" | |
| 67 | 73 | [ -f "$DEF" ] || die "missing distro def: $DEF" | |
| 68 | 74 | [ -f "$REPO_ROOT/Containerfile" ] || die "no Containerfile at $REPO_ROOT" | |
| @@ -123,7 +129,6 @@ | |||
| 123 | 129 | ||
| 124 | 130 | # 4. Locate the produced artifact. | |
| 125 | 131 | case "$TYPE" in | |
| 126 | - | iso) ARTIFACT="$OUTPUT/bootiso/install.iso" ;; | |
| 127 | 132 | raw) ARTIFACT="$OUTPUT/image/disk.raw" ;; | |
| 128 | 133 | qcow2) ARTIFACT="$OUTPUT/qcow2/disk.qcow2" ;; | |
| 129 | 134 | *) ARTIFACT="$(sudo find "$OUTPUT" -type f ! -name '*.json' | head -1)" ;; |