| 28 |
28 |
|
# build/build-iso.sh --update-target host:5000/alloy:43 # updates come from there
|
| 29 |
29 |
|
# build/build-iso.sh --host astra # mint with astra's recipe, arch included
|
| 30 |
30 |
|
# build/build-iso.sh --arch aarch64 # override the detected architecture
|
|
31 |
+ |
# build/build-iso.sh --nvidia # install the derived alloy-nvidia image
|
|
32 |
+ |
# build/build-iso.sh --no-nvidia # ...even if the recipe asks for it
|
| 31 |
33 |
|
# build/build-iso.sh --write /dev/sdX # build, then write to a device
|
| 32 |
34 |
|
# build/build-iso.sh --write-only --write /dev/sdX # write the ISO already built
|
| 33 |
35 |
|
#
|
| 83 |
85 |
|
# Empty means no per-machine recipe: the Containerfile's own defaults, which
|
| 84 |
86 |
|
# carry no compiler and no database. See build/host-recipe.sh.
|
| 85 |
87 |
|
HOST=""
|
|
88 |
+ |
# Empty means the recipe decides, and a recipe that says nothing means no. See
|
|
89 |
+ |
# --nvidia below and the NVIDIA key in build/host-recipe.sh.
|
|
90 |
+ |
NVIDIA=""
|
| 86 |
91 |
|
|
| 87 |
92 |
|
BUILD_ARGS=()
|
| 88 |
93 |
|
|
| 126 |
131 |
|
--arch)
|
| 127 |
132 |
|
[ $# -ge 2 ] || die "--arch needs x86_64 or aarch64"
|
| 128 |
133 |
|
ARCH="$2"; shift 2 ;;
|
|
134 |
+ |
# Build the derived alloy-nvidia image after Alloy itself and put THAT on
|
|
135 |
+ |
# the medium -- as the live system and as the install source, since they are
|
|
136 |
+ |
# one image here and the derived one is a superset. astra's recipe asks for
|
|
137 |
+ |
# it; the flags are how a one-off says otherwise in either direction.
|
|
138 |
+ |
#
|
|
139 |
+ |
# The card is astra's and the module is compiled against one kernel, so this
|
|
140 |
+ |
# only makes sense on the machine whose medium it is. build/build-nvidia.sh
|
|
141 |
+ |
# refuses a non-aarch64 host, which is where that is enforced.
|
|
142 |
+ |
--nvidia) NVIDIA=yes; shift ;;
|
|
143 |
+ |
--no-nvidia) NVIDIA=no; shift ;;
|
| 129 |
144 |
|
# The device write. Same two flags build-image.sh takes, because the
|
| 130 |
145 |
|
# console emits one spelling for both artifacts.
|
| 131 |
146 |
|
--write) WRITE_DEV="${2:?--write needs a device path}"; shift 2 ;;
|
| 141 |
156 |
|
host_recipe_args "$HOST" BUILD_ARGS
|
| 142 |
157 |
|
# --arch wins over the recipe: the flag is how a one-off test of the boot
|
| 143 |
158 |
|
# chain asks for the other architecture, and the recipe is what the machine
|
| 144 |
|
- |
# normally takes.
|
|
159 |
+ |
# normally takes. Same rule for --nvidia.
|
| 145 |
160 |
|
[ -n "$ARCH" ] || ARCH="$HOST_ARCH"
|
|
161 |
+ |
[ -n "$NVIDIA" ] || NVIDIA="$HOST_NVIDIA"
|
| 146 |
162 |
|
fi
|
| 147 |
163 |
|
|
| 148 |
164 |
|
ARTIFACT="$OUTPUT/install.iso"
|
| 177 |
193 |
|
say "reusing $IMAGE"
|
| 178 |
194 |
|
fi
|
| 179 |
195 |
|
|
|
196 |
+ |
# 1b. The NVIDIA module, as a thin image over the one just built.
|
|
197 |
+ |
#
|
|
198 |
+ |
# Everything below reads $IMAGE -- the builder's base, the install source, the
|
|
199 |
+ |
# squashfs -- so pointing it at the derived tag here is the whole change. The
|
|
200 |
+ |
# derived image is Alloy plus RPM Fusion's kmod and userspace, `FROM` the exact
|
|
201 |
+ |
# digest of the image above, so the live system and the installed one carry the
|
|
202 |
+ |
# same kernel as the module by construction.
|
|
203 |
+ |
#
|
|
204 |
+ |
# After the build and not before: build/build-nvidia.sh resolves the digest of
|
|
205 |
+ |
# what it derives from, so deriving from a stale localhost/alloy:local would
|
|
206 |
+ |
# produce a medium whose module was built for a different kernel than the one
|
|
207 |
+ |
# it ships. Deriving here means the two cannot come apart.
|
|
208 |
+ |
if [ "$NVIDIA" = yes ]; then
|
|
209 |
+ |
say "deriving alloy-nvidia from $IMAGE"
|
|
210 |
+ |
"$REPO_ROOT/build/build-nvidia.sh" --base "$IMAGE"
|
|
211 |
+ |
IMAGE="localhost/alloy-nvidia:aarch64"
|
|
212 |
+ |
privc podman image exists "$IMAGE" \
|
|
213 |
+ |
|| die "build/build-nvidia.sh reported success and left no $IMAGE"
|
|
214 |
+ |
fi
|
|
215 |
+ |
|
| 180 |
216 |
|
# 2. The builder, derived from it so the initramfs matches the shipped kernel.
|
| 181 |
217 |
|
say "building $BUILDER"
|
| 182 |
218 |
|
priv podman build -t "$BUILDER" \
|