Skip to content
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

Test-Layout s390x #483

Closed
wants to merge 8 commits into from
Closed

Conversation

madhu-pillai
Copy link
Contributor

@madhu-pillai madhu-pillai commented Aug 7, 2023

See: #453

Madhu added 8 commits August 2, 2023 21:38
…ate the layout feature to existing encrypted root partition function. Updated the Documentation

 updated email address
…ate the layout feature to existing encrypted root partition function. Updated the Documentation
… accomodate the layout feature to existing encrypted root partition function. Updated the Documentation"

This reverts commit a054be9.

reverts
…mmit and accomodate the layout feature to existing encrypted root partition function. Updated the Documentation""

This reverts commit c3c1000.

reverting - test
Copy link
Contributor Author

@madhu-pillai madhu-pillai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@travier , I am finding difficulty in co-operating statement with s390x layout with eckd and zfcp disk.

@madhu-pillai madhu-pillai marked this pull request as ready for review August 8, 2023 14:58
Copy link
Contributor

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey firstly thank you so much for working on this. Could we get a issue link as well attached to your commit.

I took a quick look over the PR and I have a few comments, I will have to revisit this once your commits are cleaned up and are easier to follow. Please be sure to include a issue link as well to help my understanding of these changes.

Notably I noticed your commit messages were a bit lengthy and duplicated. It would help me quite a bit if you could do some fixup commits to your changes so that your commits are more appropriate for the changes they entail and not duplicated.

Additionally I did notice your CI is failing on quite a few things that will need to be looked at.


switch {
case wantMBR && len(sd) != 0:
luksDevice = sd + strconv.Itoa(2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a comment explaining the luks device value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also why strconv.Itoa()? and not "2" and is there a better way so there is not string magic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add the comment explaining the luks device value..

Also why strconv.Itoa()? and not "2" and is there a better way so there is not string magic?
Yes will add, sd + "2"

@@ -32,6 +32,7 @@ type BootDevice struct {

type BootDeviceLuks struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 561ce19 should be amended with a724048

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a new PR with less clutter on spaces and new line. This PR was not supposed to raised, As i need some assistance is some of the logic in coding which i am not able to meet. I'll work upon.

return r

if wantLuksDevice && wantLuks {
panic("can't happen")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a very useful panic. Lets add more detail on why this can't happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove and add another logic to check.

@@ -144,11 +143,11 @@ func (c Config) processBootDevice(config *types.Config, ts *translate.Translatio
wantEFIPart = true
case *layout == "ppc64le":
wantPRePPart = true
case *layout == "s390x-zfcp":
case *layout == "s390x-zfcp" && wantLuksDevice:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes is "&& wantLuksDevice" relevant to the layout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention is as per the design validation in github issue #453 (comment) by Benjamin. The concern is Sometimes user forgot to provide the device like dasda or sd in luks.device and tend to use the label. For that purpose i made a condition. So that User must provide the device corresponding to the layout.

I'll re-write with another logic as if the wantLuksDevice could not found it panics and crashes rather than just giving an error message like device is must for s390x layouts.

wantMBR = true
case *layout == "s390x-eckd":
case *layout == "s390x-eckd" && wantLuksDevice:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

}
// luksDevice := "/dev/disk/by-partlabel/root"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code is a no no.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove the commented out code.

}

// create root filesystem
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove the extra line.

@@ -326,9 +299,6 @@ func (c Config) processBootDevice(config *types.Config, ts *translate.Translatio
case wantMirror:
// RAID without LUKS
rootDevice = "/dev/md/md-root"
case wantLuksDevice:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we added a case and then removed it. This makes reviewing this a bit confusing, this change should have been amended to the originating commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make sure that i create a new branch with PR and update without any re-write on existing code.

@@ -198,7 +198,7 @@ The Fedora CoreOS configuration is a YAML document conforming to the following s
* **_should_exist_** (boolean): whether or not the group with the specified `name` should exist. If omitted, it defaults to true. If false, then Ignition will delete the specified group.
* **_system_** (boolean): whether or not the group should be a system group. This only has an effect if the group doesn't exist yet.
* **_boot_device_** (object): describes the desired boot device configuration. At least one of `luks` or `mirror` must be specified.
* **_layout_** (string): the disk layout of the target OS image. Supported values are `aarch64`, `ppc64le`, and `x86_64`. Defaults to `x86_64`.
* **_layout_** (string): the disk layout of the target OS image. Supported values are `aarch64`, `ppc64le`, `s390x-zfcp`, `s390x-eckd`, `s390x-virt` and `x86_64`. Defaults to `x86_64`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"aarch64, ppc64le, and x86_64"

ie : "aarch64, ppc64le,s390x-eckd, s390x-virt, s390x-zfcp, and x86_64. Defaults to x86_64".

I think these were alphabetical lets keep it that way :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update that.

* **_luks_** (object): describes the clevis configuration for encrypting the root filesystem.
* **_tang_** (list of objects): describes a tang server. Every server must have a unique `url`.
* **url** (string): url of the tang server.
* **thumbprint** (string): thumbprint of a trusted signing key.
* **_advertisement_** (string): the advertisement JSON. If not specified, the advertisement is fetched from the tang server during provisioning.
* **_tpm2_** (boolean): whether or not to use a tpm2 device.
* **device** (string): Specifically for s390x `eckd` and `zfcp` disk without `mirror`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If "device" is specifically for s390x maybe we can name it more explicitly rather then "device"? wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about luks.device-s390x ?

@madhu-pillai
Copy link
Contributor Author

Hi @prestist , Here is the issue link. #453. I'll come back with rest of the correction.

@madhu-pillai madhu-pillai changed the title Layout s390x Test-Layout s390x Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants