Live Build Error: cp: not a directory/boot/vmlinuz-\*: No such file or directory
When using the live-build tool to create a custom live Debian system, you may encounter the following error:
I: Copying files from built-archive I: Copying files from built-archive/casper I: Copying files from built-archive/casper/files.squashfs to debian-live-base-amd64-bookworm.squashfs cp: cannot stat '/boot/vmlinuz-5.10.0-9-amd64': No such file or directoryUnderstanding the error
This error occurs because the live-build tool is unable to find the necessary files in the specified directory. In this case, the error message indicates that the vmlinuz-5.10.0-9-amd64 file is missing from the /boot directory.
Resolving the error
To resolve this error, you will need to ensure that the necessary files are present in the correct directory. In this case, you can try the following steps:
- Start with a fresh Debian Bookworm installation.
- Follow the live-build documentation to configure your system.
- Use the
sudo lb buildcommand to build your live system. - If you encounter the error, try installing the
firmware-linux-nonfreepackage to ensure that all necessary firmware is present. - Run the
sudo lb buildcommand again to build your live system.
Preventing the error
To prevent this error from occurring in the future, it is recommended that you carefully follow the live-build documentation and ensure that all necessary files are present in the correct directory before running the sudo lb build command.
The live-build tool is a powerful and flexible way to create custom live Debian systems. However, it is important to carefully follow the documentation and ensure that all necessary files are present in the correct directory to avoid errors. By following the steps outlined in this article, you should be able to resolve the cp: not a directory/boot/vmlinuz-*: No such file or directory error and successfully build your custom live Debian system.
References
- live-build documentation
sudo apt-get install firmware-linux-nonfree