diff options
Diffstat (limited to 'image')
-rw-r--r-- | image/backends/iso.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/image/backends/iso.cc b/image/backends/iso.cc index 89d1e84..c70f004 100644 --- a/image/backends/iso.cc +++ b/image/backends/iso.cc @@ -367,15 +367,20 @@ public: std::ifstream kverstream(kverpath); kverstream >> kver; - /* dracut with -r can't autodetect udev directory without udev.pc */ - ::setenv("udevdir", "/lib/udev", 0); - if(run_command("dracut", {"--kver", kver, "-r", target+"/", "-N", + const std::string irdname = "initrd-" + my_arch; + if(run_command("chroot", {target, "dracut", "--kver", kver, "-N", "--force", "-a", "dmsquash-live", - cdpath + "/initrd-" + my_arch}) != 0) { + "/boot/" + irdname}) != 0) { output_error("CD backend", "dracut failed to create initramfs"); return COMMAND_ERROR; } + fs::rename(target + "/boot/" + irdname, cdpath + "/" + irdname, ec); + if(ec) { + output_error("CD backend", "cannot install initrd to CD root"); + return FS_ERROR; + } + /* REQ: ISO.24 */ std::string postscript; if(opts.find("post-script") != opts.end() && |