Skip to content

Add create-device subcommand to ghostdog#963

Merged
arnaldo2792 merged 1 commit into
bottlerocket-os:developfrom
arnaldo2792:gdrcopy/core-kit
Jul 2, 2026
Merged

Add create-device subcommand to ghostdog#963
arnaldo2792 merged 1 commit into
bottlerocket-os:developfrom
arnaldo2792:gdrcopy/core-kit

Conversation

@arnaldo2792

Copy link
Copy Markdown
Contributor

Description of changes:

Some out-of-tree kernel modules (e.g. those with licensing restrictions) do not create their own device nodes. Add a create-device subcommand to ghostdog to provide a helper for creating device nodes on behalf of such modules.

Testing done:

In combination with bottlerocket-os/bottlerocket-kernel-kit#462, I confirmed that the device /dev/gdrdrv was created after the kernel module was loaded:

bash-5.2# ls /dev/gdrdrv
/dev/gdrdrv
bash-5.2#

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Some out-of-tree kernel modules (e.g. those with licensing restrictions)
do not create their own device nodes.  Add a create-device subcommand to
ghostdog to provide a helper for creating device nodes on behalf of such
modules.

Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
Comment thread sources/ghostdog/src/create_device.rs

@piyush-jena piyush-jena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

}

/// Look up a device name in the parsed /proc/devices and return (major, type)
fn lookup_device(devices: &ProcDevices, name: &str) -> Result<(u32, DeviceType)> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not impl on ProcDevices ?

@arnaldo2792 arnaldo2792 merged commit edd26ec into bottlerocket-os:develop Jul 2, 2026
2 checks passed
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.

3 participants