mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-27 14:31:11 +01:00
fix: handle overlay partition options
Handling of Overlay PartitionOpts was missed in the previous code. Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
parent
465b9a4e6c
commit
952801d8b2
@ -764,14 +764,12 @@ RUN apk add --no-cache --update --no-scripts grub
|
|||||||
|
|
||||||
FROM scratch AS install-artifacts-amd64
|
FROM scratch AS install-artifacts-amd64
|
||||||
COPY --from=pkg-kernel-amd64 /boot/vmlinuz /usr/install/amd64/vmlinuz
|
COPY --from=pkg-kernel-amd64 /boot/vmlinuz /usr/install/amd64/vmlinuz
|
||||||
COPY --from=pkg-kernel-amd64 /dtb /usr/install/amd64/dtb
|
|
||||||
COPY --from=initramfs-archive-amd64 /initramfs.xz /usr/install/amd64/initramfs.xz
|
COPY --from=initramfs-archive-amd64 /initramfs.xz /usr/install/amd64/initramfs.xz
|
||||||
COPY --from=pkg-sd-boot-amd64 /linuxx64.efi.stub /usr/install/amd64/systemd-stub.efi
|
COPY --from=pkg-sd-boot-amd64 /linuxx64.efi.stub /usr/install/amd64/systemd-stub.efi
|
||||||
COPY --from=pkg-sd-boot-amd64 /systemd-bootx64.efi /usr/install/amd64/systemd-boot.efi
|
COPY --from=pkg-sd-boot-amd64 /systemd-bootx64.efi /usr/install/amd64/systemd-boot.efi
|
||||||
|
|
||||||
FROM scratch AS install-artifacts-arm64
|
FROM scratch AS install-artifacts-arm64
|
||||||
COPY --from=pkg-kernel-arm64 /boot/vmlinuz /usr/install/arm64/vmlinuz
|
COPY --from=pkg-kernel-arm64 /boot/vmlinuz /usr/install/arm64/vmlinuz
|
||||||
COPY --from=pkg-kernel-arm64 /dtb /usr/install/arm64/dtb
|
|
||||||
COPY --from=initramfs-archive-arm64 /initramfs.xz /usr/install/arm64/initramfs.xz
|
COPY --from=initramfs-archive-arm64 /initramfs.xz /usr/install/arm64/initramfs.xz
|
||||||
COPY --from=pkg-sd-boot-arm64 /linuxaa64.efi.stub /usr/install/arm64/systemd-stub.efi
|
COPY --from=pkg-sd-boot-arm64 /linuxaa64.efi.stub /usr/install/arm64/systemd-stub.efi
|
||||||
COPY --from=pkg-sd-boot-arm64 /systemd-bootaa64.efi /usr/install/arm64/systemd-boot.efi
|
COPY --from=pkg-sd-boot-arm64 /systemd-bootaa64.efi /usr/install/arm64/systemd-boot.efi
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import (
|
|||||||
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board"
|
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board"
|
||||||
"github.com/siderolabs/talos/internal/pkg/mount"
|
"github.com/siderolabs/talos/internal/pkg/mount"
|
||||||
"github.com/siderolabs/talos/internal/pkg/partition"
|
"github.com/siderolabs/talos/internal/pkg/partition"
|
||||||
|
"github.com/siderolabs/talos/pkg/imager/quirks"
|
||||||
"github.com/siderolabs/talos/pkg/machinery/constants"
|
"github.com/siderolabs/talos/pkg/machinery/constants"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ type Device struct {
|
|||||||
|
|
||||||
// NewManifest initializes and returns a Manifest.
|
// NewManifest initializes and returns a Manifest.
|
||||||
//
|
//
|
||||||
//nolint:gocyclo
|
//nolint:gocyclo,cyclop
|
||||||
func NewManifest(mode Mode, uefiOnlyBoot bool, bootLoaderPresent bool, opts *Options) (manifest *Manifest, err error) {
|
func NewManifest(mode Mode, uefiOnlyBoot bool, bootLoaderPresent bool, opts *Options) (manifest *Manifest, err error) {
|
||||||
manifest = &Manifest{
|
manifest = &Manifest{
|
||||||
Devices: map[string]Device{},
|
Devices: map[string]Device{},
|
||||||
@ -58,7 +59,7 @@ func NewManifest(mode Mode, uefiOnlyBoot bool, bootLoaderPresent bool, opts *Opt
|
|||||||
Printf: opts.Printf,
|
Printf: opts.Printf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.Board != constants.BoardNone {
|
if opts.Board != constants.BoardNone && !quirks.New(opts.Version).SupportsOverlay() {
|
||||||
if uefiOnlyBoot {
|
if uefiOnlyBoot {
|
||||||
return nil, errors.New("board option can't be used with uefi-only-boot")
|
return nil, errors.New("board option can't be used with uefi-only-boot")
|
||||||
}
|
}
|
||||||
@ -73,6 +74,19 @@ func NewManifest(mode Mode, uefiOnlyBoot bool, bootLoaderPresent bool, opts *Opt
|
|||||||
manifest.PartitionOptions = b.PartitionOptions()
|
manifest.PartitionOptions = b.PartitionOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if opts.OverlayInstaller != nil {
|
||||||
|
overlayOpts, getOptsErr := opts.OverlayInstaller.GetOptions(opts.ExtraOptions)
|
||||||
|
if getOptsErr != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get overlay installer options: %w", getOptsErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
if overlayOpts.PartitionOptions.Offset != 0 {
|
||||||
|
manifest.PartitionOptions = &runtime.PartitionOptions{
|
||||||
|
PartitionsOffset: overlayOpts.PartitionOptions.Offset,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: legacy, to support old Talos initramfs, assume force if boot partition not found
|
// TODO: legacy, to support old Talos initramfs, assume force if boot partition not found
|
||||||
if !bootLoaderPresent {
|
if !bootLoaderPresent {
|
||||||
opts.Force = true
|
opts.Force = true
|
||||||
|
|||||||
@ -13,11 +13,14 @@ type Installer[T any] interface {
|
|||||||
|
|
||||||
// Options for the overlay installer.
|
// Options for the overlay installer.
|
||||||
type Options struct {
|
type Options struct {
|
||||||
Name string `yaml:"name"`
|
Name string `yaml:"name"`
|
||||||
KernelArgs []string `yaml:"kernelArgs,omitempty"`
|
KernelArgs []string `yaml:"kernelArgs,omitempty"`
|
||||||
PartitionOptions struct {
|
PartitionOptions PartitionOptions `yaml:"partitionOptions,omitempty"`
|
||||||
Offset uint64
|
}
|
||||||
} `yaml:"partitionOptions,omitempty"`
|
|
||||||
|
// PartitionOptions for the overlay installer.
|
||||||
|
type PartitionOptions struct {
|
||||||
|
Offset uint64 `yaml:"offset,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallOptions for the overlay installer.
|
// InstallOptions for the overlay installer.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user