diff --git a/docs/configuration.md b/docs/configuration.md index 1fcc1d9d..ad850746 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -41,7 +41,7 @@ Modules write to a shared config dict that is accessible by other modules. * `build_dir` (initramfs_build) If relative, it will be placed under `tmpdir`, defines the build directory. * `random_build_dir` (false) Adds a uuid to the end of the build dir name when true. * `build_logging` (false) Enables additional logging during the build process. -* `make_nodes` (false) Create real device nodes in the build dir. +* `make_nodes` (false) Create real device nodes in the build dir. Otherwise they are created in the CPIO archive. * `find_libgcc` (true) Automatically locates libgcc using ldconfig -p and adds it to the initramfs. * `musl_libc` (false) Disable ldconfig -p usage for libgcc detection, skip ld.so.cache regeneration. * `out_dir` (initramfs_out) If relative, it will be placed under `tmpdir`, defines the output directory. @@ -296,7 +296,6 @@ This module can be enabled by adding `ugrd.fs.fakeudev` to the `modules` list. This module handles CPIO creation. -* `mknod_cpio` (true) Only create device nodes within the CPIO. * `cpio_compression` (xz) Sets the compression method for the CPIO file, passed to PyCPIO. * `cpio_rotate` (true) Rotates old CPIO files, keeping `old_count` number of old files. diff --git a/src/ugrd/base/core.py b/src/ugrd/base/core.py index 6d3f2a8e..1ae14f39 100644 --- a/src/ugrd/base/core.py +++ b/src/ugrd/base/core.py @@ -1,5 +1,5 @@ __author__ = "desultory" -__version__ = "4.7.0" +__version__ = "4.7.1" from os import environ, makedev, mknod, uname from pathlib import Path @@ -303,9 +303,7 @@ def deploy_nodes(self) -> None: self.logger.info("Created device node '%s' at path: %s" % (node, node_path)) except PermissionError as e: self.logger.error("Unable to create device node %s at path: %s" % (node, node_path)) - self.logger.info( - "`mknod_cpio` in `ugrd.base` can be used to generate device nodes within the initramfs archive if they cannot be created on the host system." - ) + self.logger.info("When `make_nodes` is disabled, device nodes are synthetically created in the resulting CPIO archive.") raise e diff --git a/src/ugrd/fs/cpio.py b/src/ugrd/fs/cpio.py index f7cd03e0..246bd5aa 100644 --- a/src/ugrd/fs/cpio.py +++ b/src/ugrd/fs/cpio.py @@ -1,5 +1,5 @@ __author__ = "desultory" -__version__ = "3.7.3" +__version__ = "3.8.0" from pathlib import Path @@ -86,13 +86,13 @@ def make_cpio(self) -> None: """ Populates the CPIO archive using the build directory, writes it to the output file, and rotates the output file if necessary. - Creates device nodes in the CPIO archive if the mknod_cpio option is set. + Creates device nodes in the CPIO archive if make_nodes is False. (make_nodes will create actual files instead) Raises FileNotFoundError if the output directory does not exist. """ cpio = self._cpio_archive cpio.append_recursive(self._get_build_path("/"), relative=True) - if self.get("mknod_cpio"): + if not self.get("make_nodes"): for node in self["nodes"].values(): self.logger.debug("Adding CPIO node: %s" % node) cpio.add_chardev(name=node["path"], mode=node["mode"], major=node["major"], minor=node["minor"]) diff --git a/src/ugrd/fs/cpio.toml b/src/ugrd/fs/cpio.toml index 9b1c68be..26d41c45 100644 --- a/src/ugrd/fs/cpio.toml +++ b/src/ugrd/fs/cpio.toml @@ -1,4 +1,3 @@ -mknod_cpio = true cpio_compression = "xz" cpio_rotate = true check_cpio = true @@ -14,7 +13,6 @@ check_cpio = true [custom_parameters] cpio_rotate = "bool" # makes a .old backup of the cpio file if it already exists. -mknod_cpio = "bool" # When enabled, mknod is not used to create device nodes, they are just created in the cpio. cpio_compression = "str" # The compression method to use for the cpio file. XZ and ZSTD are supported. _cpio_archive = "PyCPIO" # The cpio archive object. check_cpio = "bool" # When enabled, the CPIO archive contents are checked for errors.