-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple NVMe module for NVMe Fabrics support
For now we want to support only NVMe Fabrics devices that don't require manual configuration so we need to just make sure the config files in /etc/nvme are fully populated before the installer starts and after the installation copied to the installed system. This is covered by calling the 'startup' and 'write' functions of the Blivet's NVMe module.
- Loading branch information
1 parent
1c1cce6
commit c62fc2d
Showing
10 changed files
with
147 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published | ||
# by the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pkgpyexecdir = $(pyexecdir)/py$(PACKAGE_NAME) | ||
nvme_moduledir = $(pkgpyexecdir)/modules/storage/nvme | ||
nvme_module_PYTHON = $(srcdir)/*.py | ||
|
||
MAINTAINERCLEANFILES = Makefile.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
from pyanaconda.modules.storage.nvme.nvme import NVMEModule | ||
|
||
__all__ = ["NVMEModule"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# | ||
# The NVMe module | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
from blivet.nvme import nvme | ||
|
||
from pyanaconda.anaconda_loggers import get_module_logger | ||
from pyanaconda.core.configuration.anaconda import conf | ||
from pyanaconda.core.signal import Signal | ||
from pyanaconda.core.dbus import DBus | ||
from pyanaconda.modules.common.base import KickstartBaseModule | ||
from pyanaconda.modules.common.constants.objects import NVME | ||
from pyanaconda.modules.storage.nvme.nvme_interface import NVMEInterface | ||
|
||
log = get_module_logger(__name__) | ||
|
||
|
||
class NVMEModule(KickstartBaseModule): | ||
"""The NVMe module.""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.reload_module() | ||
|
||
self.initiator_changed = Signal() | ||
|
||
def publish(self): | ||
"""Publish the module.""" | ||
DBus.publish_object(NVME.object_path, NVMEInterface(self)) | ||
|
||
def reload_module(self): | ||
"""Reload the NVMe module.""" | ||
log.debug("Start up the NVMe module.") | ||
nvme.startup() | ||
|
||
def write_configuration(self): | ||
"""Write the configuration to sysroot.""" | ||
log.debug("Write NVMe configuration.") | ||
nvme.write(conf.target.system_root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# DBus interface for the NVMe module. | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
from dasbus.server.interface import dbus_interface | ||
from dasbus.typing import * # pylint: disable=wildcard-import | ||
from pyanaconda.modules.common.base import KickstartModuleInterfaceTemplate | ||
from pyanaconda.modules.common.constants.objects import NVME | ||
|
||
|
||
@dbus_interface(NVME.interface_name) | ||
class NVMEInterface(KickstartModuleInterfaceTemplate): | ||
"""DBus interface for the NVMe module.""" | ||
|
||
def WriteConfiguration(self): | ||
"""Write the configuration to sysroot. | ||
FIXME: This is just a temporary method. | ||
""" | ||
self.implementation.write_configuration() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters