mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
👷 add x86_64_v3
This commit is contained in:
parent
076a414195
commit
c32112e42e
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user