Skip to content

Commit 342b122

Browse files
committed
🚧 utils: remove ucode logic for refind
1 parent b6a85e8 commit 342b122

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

‎src/utils.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,33 +1111,6 @@ void install_refind() noexcept {
11111111
gucc::utils::exec(fmt::format(FMT_COMPILE("sed -i 's|root=.* |root={} |g' /mnt/boot/refind_linux.conf"), mapper_name));
11121112
gucc::utils::exec("sed -i '/Boot with minimal options/d' /mnt/boot/refind_linux.conf");
11131113
}
1114-
// Figure out microcode
1115-
const auto& rootsubvol = gucc::utils::exec(R"(findmnt -o TARGET,SOURCE | awk '/\/mnt / {print $2}' | grep -o '\[.*\]' | cut -d '[' -f2 | cut -d ']' -f1 | sed 's/^\///')");
1116-
const auto& ucode = gucc::utils::exec(fmt::format(FMT_COMPILE("arch-chroot {} pacman -Qqs ucode 2>>/tmp/cachyos-install.log"), mountpoint));
1117-
if (utils::to_int(gucc::utils::exec(fmt::format(FMT_COMPILE("echo {} | wc -l"), ucode))) > 1) {
1118-
// set microcode
1119-
if (gucc::utils::exec_checked("findmnt -o TARGET,SOURCE | grep -q '/mnt/boot '")) {
1120-
// there is a separate boot, path to microcode is at partition root
1121-
gucc::utils::exec(R"(sed -i 's|"$| initrd=/intel-ucode.img initrd=/amd-ucode.img initrd=/initramfs-%v.img"|g' /mnt/boot/refind_linux.conf)");
1122-
} else if (!rootsubvol.empty()) {
1123-
// Initramfs is on the root partition and root is on btrfs subvolume
1124-
gucc::utils::exec(fmt::format(FMT_COMPILE("sed -i 's|\"$| initrd={0}/boot/intel-ucode.img initrd={0}/boot/amd-ucode.img initrd={0}/boot/initramfs-%v.img\"|g' /mnt/boot/refind_linux.conf"), rootsubvol));
1125-
} else {
1126-
// Initramfs is on the root partition
1127-
gucc::utils::exec(R"(sed -i 's|"$| initrd=/boot/intel-ucode.img initrd=/boot/amd-ucode.img initrd=/boot/initramfs-%v.img"|g' /mnt/boot/refind_linux.conf)");
1128-
}
1129-
} else {
1130-
if (gucc::utils::exec_checked("findmnt -o TARGET,SOURCE | grep -q '/mnt/boot '")) {
1131-
// there is a separate boot, path to microcode is at partition root
1132-
gucc::utils::exec(fmt::format(FMT_COMPILE("sed -i 's|\"$| initrd=/{}.img initrd=/initramfs-%v.img\"|g' /mnt/boot/refind_linux.conf"), ucode));
1133-
} else if (!rootsubvol.empty()) {
1134-
// Initramfs is on the root partition and root is on btrfs subvolume
1135-
gucc::utils::exec(fmt::format(FMT_COMPILE("sed -i 's|\"$| initrd={0}/boot/{1}.img initrd={0}/boot/initramfs-%v.img\"|g' /mnt/boot/refind_linux.conf"), rootsubvol, ucode));
1136-
} else {
1137-
// Initramfs is on the root partition
1138-
gucc::utils::exec(fmt::format(FMT_COMPILE("sed -i 's|\"$| initrd=/boot/{}.img initrd=/boot/initramfs-%v.img\"|g' /mnt/boot/refind_linux.conf"), ucode));
1139-
}
1140-
}
11411114

11421115
spdlog::info("Created rEFInd config:");
11431116
const auto& refind_conf_content = gucc::file_utils::read_whole_file(fmt::format(FMT_COMPILE("{}/boot/refind_linux.conf"), mountpoint));

0 commit comments

Comments
 (0)