Describe the bug
The device tree support introduced in #319422 has an issue where the name of the device tree file copied to the ESP has the same name for all generations, making all generations boot with the device tree corresponding to the oldest one.
Steps To Reproduce
- Set
hardware.deviceTree.enable = true and hardware.deviceTree.name = "qcom/x1e80100-lenovo-yoga-slim7x.dtb".
- Update your kernel, which also brings with it an updated device tree.
- Observe that all device trees are attempted to be written to
$ESP/EFI/nixos/qcom-x1e80100-lenovo-yoga-slim7x.dtb.efi. If this file already exists it will not be overwritten, making all generations boot with the oldest device tree.
Expected behavior
Each generation boots with the device tree specified in its bootspec.
Additional context
This is an issue with the copy_from_file function:
def copy_from_file(file: str, dry_run: bool = False) -> str:
store_file_path = os.path.realpath(file)
suffix = os.path.basename(store_file_path)
store_dir = os.path.basename(os.path.dirname(store_file_path))
efi_file_path = f"{NIXOS_DIR}/{store_dir}-{suffix}.efi"
if not dry_run:
copy_if_not_exists(store_file_path, f"{BOOT_MOUNT_POINT}{efi_file_path}")
return efi_file_path
This function assumes that file is contained in the root of a store directory, and computes store_dir as the parent of file. In my case, store_dir gets set to qcom, and so the resulting filename will be qcom-x1e80100-lenovo-yoga-slim7x.dtb.efi.
Notify maintainers
@jmbaur
@colemickens you also might be interested
Add a 👍 reaction to issues you find important.
Describe the bug
The device tree support introduced in #319422 has an issue where the name of the device tree file copied to the ESP has the same name for all generations, making all generations boot with the device tree corresponding to the oldest one.
Steps To Reproduce
hardware.deviceTree.enable = trueandhardware.deviceTree.name = "qcom/x1e80100-lenovo-yoga-slim7x.dtb".$ESP/EFI/nixos/qcom-x1e80100-lenovo-yoga-slim7x.dtb.efi. If this file already exists it will not be overwritten, making all generations boot with the oldest device tree.Expected behavior
Each generation boots with the device tree specified in its bootspec.
Additional context
This is an issue with the
copy_from_filefunction:This function assumes that
fileis contained in the root of a store directory, and computesstore_diras the parent offile. In my case,store_dirgets set toqcom, and so the resulting filename will beqcom-x1e80100-lenovo-yoga-slim7x.dtb.efi.Notify maintainers
@jmbaur
@colemickens you also might be interested
Add a 👍 reaction to issues you find important.