diff --git a/cmd/osctl/cmd/install_linux.go b/cmd/osctl/cmd/install_linux.go index 218e42459..5779ca95c 100644 --- a/cmd/osctl/cmd/install_linux.go +++ b/cmd/osctl/cmd/install_linux.go @@ -37,7 +37,7 @@ var installCmd = &cobra.Command{ Install: &userdata.Install{ Force: true, ExtraKernelArgs: extraKernelArgs, - Data: &userdata.InstallDevice{ + Ephemeral: &userdata.InstallDevice{ Device: device, Size: 16 * 1024 * 1024, }, diff --git a/docs/content/configuration/userdata.md b/docs/content/configuration/userdata.md index 672b85905..c8f95e12b 100644 --- a/docs/content/configuration/userdata.md +++ b/docs/content/configuration/userdata.md @@ -1,5 +1,5 @@ --- -title: User Data +title: User ephemeral date: 2019-06-21T19:40:55-07:00 draft: false weight: 20 @@ -369,7 +369,8 @@ install: **Note** The asset name **must** be named `initramfs.xz`. -### Data +### Ephemeral + #### Device ``Device`` specifies the device name to use for the `/var` partition. This should be specified as the @@ -377,7 +378,7 @@ unpartitioned block device. If this parameter is omitted, the value of `install. ```yaml install: - data: + ephemeral: device: ``` @@ -388,7 +389,7 @@ value of 1GB will be used. This partition will auto extend to consume the remain ```yaml install: - data: + ephemeral: size: ``` diff --git a/internal/app/machined/internal/platform/iso/iso.go b/internal/app/machined/internal/platform/iso/iso.go index c1ee25bf9..2f8dd3ae0 100644 --- a/internal/app/machined/internal/platform/iso/iso.go +++ b/internal/app/machined/internal/platform/iso/iso.go @@ -51,7 +51,7 @@ func (i *ISO) UserData() (data *userdata.UserData, err error) { Size: 512 * 1000 * 1000, }, }, - Data: &userdata.InstallDevice{ + Ephemeral: &userdata.InstallDevice{ Device: "/dev/sda", Size: 2048 * 1000 * 1000, }, diff --git a/internal/pkg/installer/installer.go b/internal/pkg/installer/installer.go index 7f8bb5e40..64e3db428 100644 --- a/internal/pkg/installer/installer.go +++ b/internal/pkg/installer/installer.go @@ -127,7 +127,7 @@ func (i *Installer) Install() (err error) { if err = syslinux.Prepare(target.Device); err != nil { return err } - case constants.DataPartitionLabel: + case constants.EphemeralPartitionLabel: continue } diff --git a/internal/pkg/installer/installer_test.go b/internal/pkg/installer/installer_test.go index 4e92d60d1..9611bed2c 100644 --- a/internal/pkg/installer/installer_test.go +++ b/internal/pkg/installer/installer_test.go @@ -33,7 +33,7 @@ func (suite *validateSuite) TestVerifyDevice() { // defaults. data.Install.Boot = nil suite.Require().NoError(VerifyBootDevice(data)) - data.Install.Data = &userdata.InstallDevice{ + data.Install.Ephemeral = &userdata.InstallDevice{ Device: "/dev/sda", } suite.Require().NoError(VerifyDataDevice(data)) @@ -101,7 +101,7 @@ install: boot: device: /dev/sda size: 1024000000 - data: + ephemeral: device: /dev/sda size: 1024000000 ` diff --git a/internal/pkg/installer/manifest/manifest.go b/internal/pkg/installer/manifest/manifest.go index 4ef90f598..0fcb8358c 100644 --- a/internal/pkg/installer/manifest/manifest.go +++ b/internal/pkg/installer/manifest/manifest.go @@ -62,8 +62,8 @@ func NewManifest(data *userdata.UserData) (manifest *Manifest) { // Initialize any slices we need. Note that a boot paritition is not // required. - if manifest.Targets[data.Install.Data.Device] == nil { - manifest.Targets[data.Install.Data.Device] = []*Target{} + if manifest.Targets[data.Install.Ephemeral.Device] == nil { + manifest.Targets[data.Install.Ephemeral.Device] = []*Target{} } var bootTarget *Target @@ -89,12 +89,12 @@ func NewManifest(data *userdata.UserData) (manifest *Manifest) { } dataTarget := &Target{ - Device: data.Install.Data.Device, - Label: constants.DataPartitionLabel, - Size: data.Install.Data.Size, + Device: data.Install.Ephemeral.Device, + Label: constants.EphemeralPartitionLabel, + Size: data.Install.Ephemeral.Size, Force: data.Install.Force, Test: false, - MountPoint: constants.DataMountPoint, + MountPoint: constants.EphemeralMountPoint, } for _, target := range []*Target{bootTarget, dataTarget} { @@ -171,8 +171,8 @@ func (t *Target) Partition(bd *blockdevice.BlockDevice) (err error) { // EFI System Partition typeID := "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" opts = append(opts, partition.WithPartitionType(typeID), partition.WithPartitionName(t.Label), partition.WithLegacyBIOSBootableAttribute(true)) - case constants.DataPartitionLabel: - // Data Partition + case constants.EphemeralPartitionLabel: + // Ephemeral Partition typeID := "AF3DC60F-8384-7247-8E79-3D69D8477DE4" opts = append(opts, partition.WithPartitionType(typeID), partition.WithPartitionName(t.Label)) default: diff --git a/internal/pkg/installer/manifest/manifest_test.go b/internal/pkg/installer/manifest/manifest_test.go index 17770524f..c5904e2c6 100644 --- a/internal/pkg/installer/manifest/manifest_test.go +++ b/internal/pkg/installer/manifest/manifest_test.go @@ -147,7 +147,7 @@ install: boot: device: /dev/sda size: 1024000000 - data: + ephemeral: device: /dev/sda size: 1024000000 ` diff --git a/internal/pkg/installer/verify.go b/internal/pkg/installer/verify.go index 1c5fb44be..54d096a75 100644 --- a/internal/pkg/installer/verify.go +++ b/internal/pkg/installer/verify.go @@ -14,16 +14,16 @@ import ( // VerifyDataDevice verifies the supplied data device options. func VerifyDataDevice(data *userdata.UserData) (err error) { // Set data device to root device if not specified - if data.Install.Data == nil { - data.Install.Data = &userdata.InstallDevice{} + if data.Install.Ephemeral == nil { + data.Install.Ephemeral = &userdata.InstallDevice{} } - if data.Install.Data.Device == "" { - return errors.New("a data device is required") + if data.Install.Ephemeral.Device == "" { + return errors.New("an ephemeral device is required") } if !data.Install.Force { - if err = VerifyDiskAvailability(constants.DataPartitionLabel); err != nil { + if err = VerifyDiskAvailability(constants.EphemeralPartitionLabel); err != nil { return errors.Wrap(err, "failed to verify disk availability") } } @@ -41,7 +41,7 @@ func VerifyBootDevice(data *userdata.UserData) (err error) { // We can safely assume data device is defined at this point // because VerifyDataDevice should have been called first in // in the chain - data.Install.Boot.Device = data.Install.Data.Device + data.Install.Boot.Device = data.Install.Ephemeral.Device } if data.Install.Boot.Size == 0 { diff --git a/internal/pkg/mount/manager/owned/owned.go b/internal/pkg/mount/manager/owned/owned.go index 1306cf22c..e67cf6fe1 100644 --- a/internal/pkg/mount/manager/owned/owned.go +++ b/internal/pkg/mount/manager/owned/owned.go @@ -21,11 +21,11 @@ import ( // filesystems. func MountPointsForDevice(devpath string) (mountpoints *mount.Points, err error) { mountpoints = mount.NewMountPoints() - for _, name := range []string{constants.DataPartitionLabel, constants.BootPartitionLabel} { + for _, name := range []string{constants.EphemeralPartitionLabel, constants.BootPartitionLabel} { var target string switch name { - case constants.DataPartitionLabel: - target = constants.DataMountPoint + case constants.EphemeralPartitionLabel: + target = constants.EphemeralMountPoint case constants.BootPartitionLabel: target = constants.BootMountPoint } @@ -51,12 +51,12 @@ func MountPointsForDevice(devpath string) (mountpoints *mount.Points, err error) // we want to grow the data filesystem. func MountPointsFromLabels() (mountpoints *mount.Points, err error) { mountpoints = mount.NewMountPoints() - for _, name := range []string{constants.DataPartitionLabel, constants.BootPartitionLabel} { + for _, name := range []string{constants.EphemeralPartitionLabel, constants.BootPartitionLabel} { opts := []mount.Option{} var target string switch name { - case constants.DataPartitionLabel: - target = constants.DataMountPoint + case constants.EphemeralPartitionLabel: + target = constants.EphemeralMountPoint opts = append(opts, mount.WithResize(true)) case constants.BootPartitionLabel: target = constants.BootMountPoint diff --git a/internal/pkg/mount/mount.go b/internal/pkg/mount/mount.go index c11b9ea82..e1b55ccf0 100644 --- a/internal/pkg/mount/mount.go +++ b/internal/pkg/mount/mount.go @@ -188,7 +188,7 @@ func (p *Point) ResizePartition() (err error) { } for _, partition := range pt.Partitions() { - if partition.(*gptpartition.Partition).Name == constants.DataPartitionLabel { + if partition.(*gptpartition.Partition).Name == constants.EphemeralPartitionLabel { if err := pt.Resize(partition); err != nil { return err } diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 6271b55e8..385889f52 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -44,13 +44,13 @@ const ( // the boot path. BootMountPoint = "/boot" - // DataPartitionLabel is the label of the partition to use for mounting at - // the data path. - DataPartitionLabel = "DATA" + // EphemeralPartitionLabel is the label of the partition to use for + // mounting at the data path. + EphemeralPartitionLabel = "EPHEMERAL" - // DataMountPoint is the label of the partition to use for mounting at + // EphemeralMountPoint is the label of the partition to use for mounting at // the data path. - DataMountPoint = "/var" + EphemeralMountPoint = "/var" // RootMountPoint is the label of the partition to use for mounting at // the root path. diff --git a/pkg/userdata/install.go b/pkg/userdata/install.go index ee1bc6f67..6dffe86ed 100644 --- a/pkg/userdata/install.go +++ b/pkg/userdata/install.go @@ -7,7 +7,7 @@ package userdata // Install represents the installation options for preparing a node. type Install struct { Boot *BootDevice `yaml:"boot,omitempty"` - Data *InstallDevice `yaml:"data,omitempty"` + Ephemeral *InstallDevice `yaml:"ephemeral,omitempty"` ExtraDevices []*ExtraDevice `yaml:"extraDevices,omitempty"` ExtraKernelArgs []string `yaml:"extraKernelArgs,omitempty"` Wipe bool `yaml:"wipe"` diff --git a/pkg/userdata/userdata_test.go b/pkg/userdata/userdata_test.go index 6c2bbee0b..c7d8736d5 100644 --- a/pkg/userdata/userdata_test.go +++ b/pkg/userdata/userdata_test.go @@ -141,11 +141,7 @@ install: force: true device: /dev/sda size: 1024000000 - root: - force: true - device: /dev/sda - size: 1024000000 - data: + ephemeral: force: true device: /dev/sda size: 1024000000