-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make EFI partition size configurable at install time #2105
Make EFI partition size configurable at install time #2105
Conversation
In addition to that we could also consider having way higher default value (what about 1G or even 2G?) So if we ever support systemd-boot or unified kernel image (which require having kernel and initrd within the EFI partition) we could eventually consider upgrades without having to reinstall from scratch. |
86f6bc3
to
07d4633
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only one minor remark to provide an example.
config.yaml.example
Outdated
@@ -19,7 +19,7 @@ install: | |||
# size: 300 | |||
|
|||
# default partitions | |||
# only 'oem', 'recovery', 'state' and 'persistent' objects allowed | |||
# only 'efi', 'oem', 'recovery', 'state' and 'persistent' objects allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nitpicking, but it would be best to also include an efi partition example, just to highlight the fact that the filesystem to use should be vfat
. Or can it be omitted even? I don't truly know if we use the defaults or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vfat filesystem is set by default and I was wondering to force it or not (error out if not set to vfat), but then I thought about better giving some flexibility as this is pretty hidden in the setup and if one is actually touching this is probably for a good reason. For instance I don't know if for RPi it is mandatory to boot from vfat or it can be another filesystem.
What we probably could consider in the future is renaming this EFI partition to some firmware neutral name (boot partition?), so there is no explicit assumption we are using EFI firmware. But I did not want to touch that at this time because it feels like a risky change, there might be some corner cases hard to foresee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not force it as well, but it could be an idea. What I missed is an example for the end-users to follow, let's say I do want to use this feature, then I would miss (without looking at the source code) how can I extend the partition size, and what do I need to configure in order to do that.
I was wondering is that fat
, fat32
, etc. before looking at the source, and if it's optional is even better, so I could just code:
efi:
size: 1000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this is the case you can provide only size and this will only modify the default size, but keep all other parameters. About partition sizes we definitely need some docs on that topic and we already have an issue for that rancher/elemental-docs#345
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or instance I don't know if for RPi it is mandatory to boot from vfat or it can be another filesystem.
It is mandatory. It cannot be another filesystem.
(At least for the firmware and bootloader files. Once GRUB takes over, things probably look a bit brighter.)
As said in #2104, calling it It might not matter implementation wise, but I'm somewhat concerned about mixing topics. |
All right, this is a fair point and probably we can start by exposing it with a different name but keep all variables and constants as they are now, which is probably already misleading. Lets start having a look. |
I also dislike the install:
partitions:
firmware:
size: 512
oem:
... We could easily name EFI to Note that in toolkit we are only effectively supporting EFI firmware. So to some extend it makes sense keeping the default constant literals referring to Shall we try to do such a rename? How far should we attempt to go. |
Yeah, naming is hard 😆 |
Probably |
Let's go for |
@@ -4,6 +4,9 @@ cloud-init-paths: | |||
- "some/alternate/path" | |||
|
|||
install: | |||
partitions: | |||
efi: | |||
size: 512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How/where do we document the size unit ? (I'd assume it's in megabytes ;-) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes everything is in megabytes, it is already added as a comment in the example config file and also in elemental-toolkit docs.
Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
43b37d3
to
4f6e8c1
Compare
@@ -19,7 +19,7 @@ install: | |||
# size: 300 | |||
|
|||
# default partitions | |||
# only 'oem', 'recovery', 'state' and 'persistent' objects allowed | |||
# only 'bootloader', 'oem', 'recovery', 'state' and 'persistent' objects allowed | |||
# size in MiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is were we document all sizes are in megabytes. It is also documented in elemental-toolkit docs.
@@ -4,6 +4,9 @@ cloud-init-paths: | |||
- "some/alternate/path" | |||
|
|||
install: | |||
partitions: | |||
efi: | |||
size: 512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes everything is in megabytes, it is already added as a comment in the example config file and also in elemental-toolkit docs.
EfiLabel = "COS_GRUB" | ||
EfiPartName = "efi" | ||
BootLabel = "COS_GRUB" | ||
BootPartName = "efi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this PR changes the variable and constant names, but none of the values. This to ensure no regressions are introduced. If we consider changes values to I'd do it in a separate and follow up PR.
@@ -502,7 +502,7 @@ func (pl PartitionList) GetByNameOrLabel(name, label string) *Partition { | |||
|
|||
type ElementalPartitions struct { | |||
BIOS *Partition | |||
EFI *Partition | |||
Boot *Partition `yaml:"bootloader,omitempty" mapstructure:"bootloader"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bootloader
partition is named as Boot
in the struct, just for the sake of short names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge 🚀
I cannot add
via the Rancher UI 😕 |
When trying to edit via
|
Confirmed working, thanks ! |
Fixes #2104