Skip to content

Commit

Permalink
add stylus_uki.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Nianyu Shen <[email protected]>
  • Loading branch information
nianyush committed Mar 7, 2024
1 parent ae38875 commit a277e0c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,6 @@ internal-slink:
RUN chmod +x /slink
SAVE ARTIFACT /slink

stylus-image-pack:
COPY +luet/luet /usr/bin/luet
COPY --platform=linux/${ARCH} +stylus-image/ /stylus
RUN tar -czf /stylus.tar.gz /stylus
RUN luet util pack $STYLUS_BASE /stylus.tar.gz /stylus-image.tar
SAVE ARTIFACT stylus-image.tar

build-uki-iso:
ARG ISO_NAME

Expand All @@ -222,7 +215,7 @@ build-uki-iso:
COPY overlay/files-iso/ /overlay/
COPY --if-exists user-data /overlay/config.yaml
IF [ "$IS_UKI" = "true" ]
COPY --platform=linux/${ARCH} +stylus-image-pack/ /overlay/data/stylus
COPY --platform=linux/${ARCH} +stylus-image/ /overlay/data/stylus/
END
COPY --if-exists content-*/*.zst /overlay/opt/spectrocloud/content/
#check if clusterconfig is passed in
Expand All @@ -244,7 +237,7 @@ build-uki-iso:
COPY keys /keys
RUN ls -liah /keys
RUN mkdir /iso
RUN enki --config-dir /config build-uki dir:/build/image --cmdline "stylus.registration install-mode" --overlay-iso /overlay -t iso -d /iso -k /keys
RUN enki --config-dir /config build-uki dir:/build/image --cmdline "stylus.registration install-mode" --overlay-iso /overlay --overlay-iso /overlay/data -t iso -d /iso -k /keys
RUN enki --config-dir /config build-uki dir:/build/image -t uki -d /iso -k /keys --cmdline "stylus.registration install-mode"
RUN enki --config-dir /config build-uki dir:/build/image -t container -d /iso -k /keys --cmdline "stylus.registration install-mode"
END
Expand Down Expand Up @@ -390,9 +383,13 @@ base-image:
--build-arg OS_DISTRIBUTION=$OS_DISTRIBUTION --build-arg HTTP_PROXY=$HTTP_PROXY --build-arg HTTPS_PROXY=$HTTPS_PROXY \
--build-arg NO_PROXY=$NO_PROXY .

IF [ "$IS_JETSON" = "true" ]
COPY mount.yaml /system/oem/mount.yaml
END
IF [ "$IS_JETSON" = "true" ]
COPY mount.yaml /system/oem/mount.yaml
END

IF [ "$IS_UKI" = "true" ]
COPY stylus_uki.yaml /system/oem/stylus_uki.yaml
END

IF [ "$ARCH" = "arm64" ]
RUN mkdir -p /etc/luet/repos.conf.d && \
Expand Down Expand Up @@ -515,6 +512,9 @@ iso-image:
FROM --platform=linux/${ARCH} +base-image
IF [ "$IS_UKI" = "false" ]
COPY --platform=linux/${ARCH} +stylus-image/ /
ELSE
COPY +luet/luet /usr/bin/luet
COPY --platform=linux/${ARCH} +stylus-image/system /system
END
COPY overlay/files/ /

Expand Down
11 changes: 11 additions & 0 deletions stylus_uki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#cloud-config
stages:
after-install:
- commands:
- echo "Copying files to persistent path"
- /usr/lib/systemd/systemd-cryptsetup attach persistent $(findfs PARTLABEL=persistent) - tpm2-device=auto
- mount /dev/mapper/persistent /usr/local
- mountpoint="/usr/local" && ! findmnt -rno TARGET "$mountpoint" > /dev/null && mount /dev/mapper/persistent "$mountpoint" || echo "Already mounted."
- mkdir -p /usr/local/.state/opt.bind/stylus
- cp -rfv /run/initramfs/live/stylus/* /usr/local/.state/opt.bind/stylus/
- rsync --partial --human-readable --archive --xattrs --acls --progress /usr/local/.state/opt.bind/stylus/ /

0 comments on commit a277e0c

Please sign in to comment.