👷 add x86_64_v3

This commit is contained in:
Vladislav Nepogodin 2022-01-10 03:48:57 +04:00
parent 076a414195
commit c32112e42e
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
3 changed files with 29 additions and 0 deletions

View File

@ -828,6 +828,8 @@ void install_base() noexcept {
spdlog::info(fmt::format("Preparing for pkgs to install: \"{}\"", packages));
#ifdef NDEVENV
utils::try_v3();
// filter_packages
const auto& hostcache = std::get<std::int32_t>(config_data["hostcache"]);
if (hostcache) {

View File

@ -632,6 +632,31 @@ void show_iwctl() noexcept {
}
}
void try_v3() noexcept {
const auto& ret_status = utils::exec("/lib/ld-linux-x86-64.so.2 --help | grep \"x86-64-v3 (supported, searched)\" > /dev/null", true);
if (ret_status != "0") {
spdlog::warn("x86-64-v3 is not supported");
return;
}
spdlog::info("x86-64-v3 is supported");
#ifdef NDEVENV
static constexpr auto pacman_conf = "/etc/pacman.conf";
static constexpr auto pacman_conf_cachyos = "/etc/pacman-more.conf";
static constexpr auto pacman_conf_path_backup = "/etc/pacman.conf.bak";
std::error_code err{};
utils::exec(fmt::format("sed -i 's/Architecture = auto/#Architecture = auto/' {}", pacman_conf_cachyos));
utils::exec(fmt::format("sed -i 's/#<disabled_v3>//g' {}", pacman_conf_cachyos));
spdlog::info("backup old config");
fs::rename(pacman_conf, pacman_conf_path_backup, err);
spdlog::info("CachyOS -v3 Repo changed");
fs::rename(pacman_conf_cachyos, pacman_conf, err);
#endif
}
void set_keymap() noexcept {
auto* config_instance = Config::instance();
auto& config_data = config_instance->data();

View File

@ -38,6 +38,8 @@ void id_system() noexcept;
[[nodiscard]] bool handle_connection() noexcept;
void show_iwctl() noexcept;
void try_v3() noexcept;
void set_keymap() noexcept;
void parse_config() noexcept;
void setup_luks_keyfile() noexcept;