Skip to content

fdasd: Add non-interactive script friendly interface#195

Draft
vojtechtrefny wants to merge 6 commits intoibm-s390-linux:masterfrom
vojtechtrefny:master_fdasd-script-mode-3
Draft

fdasd: Add non-interactive script friendly interface#195
vojtechtrefny wants to merge 6 commits intoibm-s390-linux:masterfrom
vojtechtrefny:master_fdasd-script-mode-3

Conversation

@vojtechtrefny
Copy link

This is just a work in progress patch, mostly giving you a chance to tell me you are not interested in this and/or suggest a better approach.
The idea is to provide a script friendly interface similar to parted --script. Calling this can look for example like

# fdasd --script "d 1 a 2 +100m w" /dev/dasdc

to remove an existing partition and add a new 100 MiB one.

I am trying to reuse as much of the existing code as possible so this hopefully shouldn't create more maintenance work in the future.
This is obviously missing other commands, documentation and needs some more testing etc, as I said, still work in progress and mostly looking for some early feedback now.

@steffen-eiden
Copy link
Member

Hey, this sounds good.I had a quick glance looks good.

I know this is just an early draft, but for the real deal please split up the patch into multiple and first do all the refactoring (e.g. move stuff to separate functions) ans then the actual feature addition.|

I am not soo fluent with the dasd tools but you may be able to reuse the CLI parser to parse you script.
(under the assumption that the script mode cannot do more than the interactive)

@hoeppnerj may provide more information and/or feedback

Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
This splits the add partition functionality into two functions so
the part that doesn't require user input can be reused.

Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
This splits the remove partition functionality into two functions
so the part that doesn't require user input can be reused.

Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
This is a work-in-progress implementation of scripting interface
similar to how 'parted --script' works, for now limited to adding
and removing partitions only.

Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
@vojtechtrefny vojtechtrefny force-pushed the master_fdasd-script-mode-3 branch from 72bb0e6 to af94f44 Compare December 18, 2025 16:26
@vojtechtrefny
Copy link
Author

I've pushed a new version. It's split into multiple commits, now includes the missing commands (like changing partition type), man page update and a simple (non-automated) test script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants