Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Add missing stuff for enki sysext
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <itxaka@kairos.io>
  • Loading branch information
Itxaka committed Sep 16, 2024
1 parent 8e2321e commit be20a4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ RUN cp /tmp/luet-${TARGETARCH}.yaml /etc/luet/luet.yaml
RUN luet install -y system/systemd-boot

RUN dnf install -y binutils mtools efitools shim openssl dosfstools xorriso rsync
# for sysext creation
RUN dnf install -y erofs-utils

COPY --from=builder /enki /enki

Expand Down
10 changes: 8 additions & 2 deletions cmd/sysext.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ func NewSysextCmd() *cobra.Command {

cfg.Logger.Logger.Info().Msg("📦 Packing sysext into raw image")
// Call systemd-repart to create the sysext based off the files
output := fmt.Sprintf("%s.sysext.raw", name)
if viper.GetString("output") != "" {
output = filepath.Join(viper.GetString("output"), output)
}
// Call systemd-repart to create the sysext based off the files
command := exec.Command(
"systemd-repart",
"--make-ddi=sysext",
Expand All @@ -106,7 +111,7 @@ func NewSysextCmd() *cobra.Command {
// Another layer to verify images, even if its a manual check, we make it easier
fmt.Sprintf("--seed=%s", uuid.NewV5(uuid.NamespaceDNS, "kairos-sysext")),
fmt.Sprintf("--copy-source=%s", dir),
fmt.Sprintf("%s.sysext.raw", name), // output sysext image
output, // output sysext image
fmt.Sprintf("--private-key=%s", viper.Get("private-key")),
fmt.Sprintf("--certificate=%s", viper.Get("certificate")),
)
Expand All @@ -117,14 +122,15 @@ func NewSysextCmd() *cobra.Command {
return err
}

cfg.Logger.Logger.Info().Str("output", fmt.Sprintf("%s.sysext.raw", name)).Msg("🎉 Done sysext creation")
cfg.Logger.Logger.Info().Str("output", output).Msg("🎉 Done sysext creation")
return nil
},
}
c.Flags().String("private-key", "", "Private key to sign the sysext with")
c.Flags().String("certificate", "", "Certificate to sign the sysext with")
c.Flags().Bool("service-reload", false, "Make systemctl reload the service when loading the sysext. This is useful for sysext that provide systemd service files.")
c.Flags().String("arch", "amd64", "Arch to get the image from and build the sysext for. Accepts amd64 and arm64 values.")
c.Flags().String("output", "", "Output dir")
_ = c.MarkFlagRequired("private-key")
_ = c.MarkFlagRequired("certificate")

Expand Down

0 comments on commit be20a4a

Please sign in to comment.