-
Notifications
You must be signed in to change notification settings - Fork 93
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
s390x: add support for IBM Z DASD disks #153
Conversation
Hi Colin. We had a short discussion in Brno (DevConf). Could you please review this patch? |
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.
Thanks for doing this! These are initial impressions; I haven't done a detailed review.
0abfd32
to
a4d8639
Compare
4a53f10
to
9a2f048
Compare
52a7b3a
to
e26949d
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.
OK so I only skimmed this, and I only have superficial knowledge of what we need for dasd; I know we've talked about it a few times and my recollection is that it boils down to the kernel needing to "activate" devices effectively?
Is there a good reference for this stuff? OK from a quick search the top two (here) results are:
- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-post-installation-configuration-s390
- https://www.kernel.org/doc/Documentation/s390/DASD
Which look useful. Though what would help me in this PR is perhaps a little bit more elaboration on what "support" here means. Perhaps a block comment in the s390x.rs
file or a README-s390x.md
?
Also, did you learn Rust just for this? If so (or actually regardless) it's excellent code and really well done!
Does this have any intersection with the discussions around coreos-installer and multipath? I think that one was going to end up on the legacy branch first? |
My overall feeling here is if you've tested this and the rest of the s390x team is happy with it, I'm inclined to merge. |
No intersection, Tuan is working on multipath for legacy branch. And i've started working on multipath for master branch |
Exactly, we have to prepare (format & make partitions) DASD device and then tell kernel about it
Yes, i read this.
Ok, makes sense
Yep, i've tried several times before, but was too busy with C++ projects and had no chance to do smth in Rust. thx )) |
0e900a5
to
7ccf76a
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.
OK I gave this another look; some optional changes to make some code more idiomatic/avoid unwraps.
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.
This one breaks the installation. I'm debugging it
I think this is ready for review! |
@jlebon proposed squashing this series down to one commit before merging. Any preferences? |
hmm, it's too big for one commit. maybe we can have smth like:
|
I'll let @jlebon chime in here, but I think his idea is to avoid leaking development history into the master branch. The merged commit would list you as the primary author, and me as a co-author. I think the prep changes that affect the rest of the codebase (e.g. adding a callback to |
4501977
to
aff9055
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.
No major issues, looks sane overall!
- rust: beta | ||
arch: s390x | ||
- rust: nightly | ||
arch: s390x |
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.
Wait, what? /me reads https://docs.travis-ci.com/user/multi-cpu-architectures/.
Travis CI can test on amd64, ppc64le (IBM Power CPUs), s390x (IBM Z CPUs) and arm64 (run on ARMv8 compliant CPUs) if the operating system is Linux.
Whoa, didn't realize this! We could use that in cosa at least to get some multi-arch coverage, even if just of ./build.sh
(though definitely worth checking if it also has virt support, but likely not).
@@ -10,6 +10,9 @@ PERSIST_KERNEL_NET_PARAMS=("ipv6.disable" "net.ifnames" "net.naming-scheme") | |||
# List from https://www.mankier.com/7/dracut.cmdline#Description-Network | |||
PERSIST_DRACUT_NET_PARAMS=("ip" "ifname" "rd.route" "bootdev" "BOOTIF" "rd.bootif" "nameserver" "rd.peerdns" "biosdevname" "vlan" "bond" "team" "bridge" "rd.net.timeout.carrier" "coreos.no_persist_ip") | |||
|
|||
# IBM S390X params to persist | |||
PERSIST_S390X_PARAMS=("rd.dasd" "rd.zfcp" "rd.znet" "zfcp.allow_lun_scan" "cio_ignore") |
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.
Hmm, do we really need this? There is a push in general to not add support for more kargs than we already have and instead direct users towards scripting coreos-installer via Ignition: #124.
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.
As I understand it:
rd.dasd
activates a DASD device, without which a DASD boot device won't show uprd.zfcp
activates a Fibre Channel device, without which an FC boot device won't show uprd.znet
activates a network device, without which it won't be available from the initramfszfcp.allow_lun_scan
might be needed to configure activation of certain FC devicescio_ignore
tells the kernel not to attach to specified devices on boot
So I suspect they might all be needed. @nikita-dubrovskii, is that correct? Any additional details?
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.
So I suspect they might all be needed.
Exactly, we have to persist those kargs.
fn get_boot_kargs<P: AsRef<Path>>(boot_config: P) -> Result<String> { | ||
let contents = read_to_string(&boot_config) | ||
.chain_err(|| format!("reading {}", boot_config.as_ref().display()))?; | ||
// read kargs from options line |
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.
Regex is fine, though it'd be cleaner and probably less lines overall to just iterate over the lines and find the one that starts with options
. See e.g. bls_entry_delete_and_append_kargs
.
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.
Eh, I find this cleaner than open-coding an iteration and starts_with()
. Can change it if there's a strong preference though.
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.
Not a strong preference. Regex just seemed like overkill for the task at hand, but meh...
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.
As i remember, some of you asked me to use regex for substring-search operations )
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.
Yup, that was me. 🙂
Yeah exactly. I think the rule of thumb I personally use is something like: any commit that's just changing content that's all new in the same PR should normally just be squashed in. To take a random example, is this commit valuable to have on its own on the master branch? It's just modifying a Commits which refactor existing code as prep should definitely still be kept. |
a9ea689
to
08d4764
Compare
@nikita-dubrovskii If you agree, I'll refactor into three commits:
I can do that in a new PR if you'd like the history to be preserved here. |
I don't mind, for me any approach is Ok. |
ca76ff0
to
6864523
Compare
Return the symlink target if a link, or the original path if not.
Allow callers to provide a custom callback for writing image data to disk.
Support formatting, creating partitions, and installing onto s390x DASD disks. Co-authored-by: Benjamin Gilbert <bgilbert@redhat.com>
Updated and squashed! |
Installation on s390 dasd disks is a bit tricky,
this patch makes coreos-installer able to format,
create partitions, and finally install CoreOS on s390.
Signed-off-by: Nikita Dubrovskii nikita@linux.ibm.com