mirror of
https://github.com/kairos-io/immucore.git
synced 2025-09-02 07:05:27 +00:00
Workaround for kairos sdk not detecting netboot
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
14
Earthfile
14
Earthfile
@@ -62,7 +62,19 @@ build-immucore:
|
|||||||
ARG LDFLAGS="-s -w -X github.com/kairos-io/immucore/internal/version.version=$VERSION"
|
ARG LDFLAGS="-s -w -X github.com/kairos-io/immucore/internal/version.version=$VERSION"
|
||||||
RUN echo ${LDFLAGS}
|
RUN echo ${LDFLAGS}
|
||||||
RUN CGO_ENABLED=0 go build -o immucore -ldflags "${LDFLAGS}"
|
RUN CGO_ENABLED=0 go build -o immucore -ldflags "${LDFLAGS}"
|
||||||
SAVE ARTIFACT /work/immucore AS LOCAL build/immucore-$VERSION
|
SAVE ARTIFACT /work/immucore immucore AS LOCAL build/immucore-$VERSION
|
||||||
|
|
||||||
|
dracut-artifacts:
|
||||||
|
FROM $BASE_IMAGE
|
||||||
|
WORKDIR /build
|
||||||
|
COPY --dir dracut/28immucore .
|
||||||
|
COPY dracut/02-kairos-setup-initramfs.conf .
|
||||||
|
COPY dracut/10-immucore.conf .
|
||||||
|
COPY dracut/50-kairos-initrd.conf .
|
||||||
|
SAVE ARTIFACT 28immucore 28immucore
|
||||||
|
SAVE ARTIFACT 02-kairos-setup-initramfs.conf 02-kairos-setup-initramfs.conf
|
||||||
|
SAVE ARTIFACT 10-immucore.conf 10-immucore.conf
|
||||||
|
SAVE ARTIFACT 50-kairos-initrd.conf 50-kairos-initrd.conf
|
||||||
|
|
||||||
build-dracut:
|
build-dracut:
|
||||||
FROM $BASE_IMAGE
|
FROM $BASE_IMAGE
|
||||||
|
@@ -343,6 +343,17 @@ func (s *State) WriteSentinelDagStep(g *herd.Graph) error {
|
|||||||
default:
|
default:
|
||||||
sentinel = string(state.Unknown)
|
sentinel = string(state.Unknown)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround for runtime not detecting netboot as live_mode
|
||||||
|
// Needs changes to the kairos sdk
|
||||||
|
// TODO: drop once the netboot detection change is on the kairos sdk
|
||||||
|
cmdline, err := os.ReadFile("/proc/cmdline")
|
||||||
|
cmdlineS := string(cmdline)
|
||||||
|
if strings.Contains(cmdlineS, "netboot") {
|
||||||
|
sentinel = "live_mode"
|
||||||
|
}
|
||||||
|
|
||||||
|
s.Logger.Info().Str("to", sentinel).Msg("Setting sentinel file")
|
||||||
err = os.WriteFile(filepath.Join("/run/cos/", sentinel), []byte("1"), os.ModePerm)
|
err = os.WriteFile(filepath.Join("/run/cos/", sentinel), []byte("1"), os.ModePerm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user