From f054a1d629ddd6d3d92d2997654ce3cb8cb44541 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Tue, 14 Jan 2025 02:40:57 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20chwd:=20remove=20obsolete=20flag?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vagrantfile | 13 ++++++------- docs/config.md | 15 --------------- settings.json | 3 +-- src/config.cpp | 1 - src/drivers.cpp | 6 +++--- src/simple_tui.cpp | 17 ++++++----------- src/utils.cpp | 13 ------------- 7 files changed, 16 insertions(+), 52 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index b13e1dc..cc147ee 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -70,10 +70,10 @@ Vagrant.configure("2") do |config| # Display the VirtualBox GUI when booting the machine vb.gui = false - + # Customize the amount of CPUs on the VM: vb.cpus = "4" - + # Customize the amount of memory on the VM: vb.memory = "6144" @@ -102,9 +102,9 @@ Vagrant.configure("2") do |config| export NM=llvm-nm export RANLIB=llvm-ranlib - wget https://raw.githubusercontent.com/CachyOS/CachyOS-CLI-ISO/master/archiso/airootfs/etc/pacman-more.conf - mv pacman-more.conf /etc/ - + #wget https://raw.githubusercontent.com/CachyOS/CachyOS-CLI-ISO/master/archiso/airootfs/etc/pacman-more.conf + #mv pacman-more.conf /etc/ + cat << EOF > settings.json { "menus": 1, @@ -121,8 +121,7 @@ Vagrant.configure("2") do |config| "root_pass": "secure", "kernel": "linux-cachyos", "desktop": "kde", - "bootloader": "systemd-boot", - "drivers_type": "free" + "bootloader": "systemd-boot" } EOF diff --git a/docs/config.md b/docs/config.md index 708ad94..5d9411e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -321,21 +321,6 @@ Example configuration: "bootloader": "systemd-boot" ``` --- -### `drivers_type` - -This will detect drivers automatically and install them. - -Valid types: -* `nonfree` -* `free` - -Defaults to `free`. - -Example configuration: -```json -"drivers_type": "free" -``` ---- ### `post_install` This will be launched after install is done. diff --git a/settings.json b/settings.json index f65e672..8be5e87 100644 --- a/settings.json +++ b/settings.json @@ -28,6 +28,5 @@ "root_pass": "secure", "kernel": "linux-cachyos", "desktop": "kde", - "bootloader": "systemd-boot", - "drivers_type": "free" + "bootloader": "systemd-boot" } diff --git a/src/config.cpp b/src/config.cpp index 0691c29..318be7b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -50,7 +50,6 @@ bool Config::initialize() noexcept { s_config->m_data["HEADLESS_MODE"] = 0; s_config->m_data["SERVER_MODE"] = 0; s_config->m_data["GRAPHIC_CARD"] = ""; - s_config->m_data["DRIVERS_TYPE"] = "free"; } return s_config.get(); diff --git a/src/drivers.cpp b/src/drivers.cpp index e6d5a5c..db0fbbf 100644 --- a/src/drivers.cpp +++ b/src/drivers.cpp @@ -54,11 +54,11 @@ void setup_graphics_card() noexcept { const auto& cachepath = std::get(config_data["cachepath"]); #ifdef NDEVENV - const auto& cmd_formatted = fmt::format(FMT_COMPILE("chwd --pmcachedir \"{}\" --pmroot {} -f -i pci {} 2>>/tmp/cachyos-install.log 2>&1"), cachepath, mountpoint, driver); + const auto& cmd_formatted = fmt::format(FMT_COMPILE("chwd --pmcachedir \"{}\" --pmroot {} -f -i {} 2>>/tmp/cachyos-install.log 2>&1"), cachepath, mountpoint, driver); tui::detail::follow_process_log_widget({"/bin/sh", "-c", cmd_formatted}); std::ofstream{fmt::format(FMT_COMPILE("{}/.video_installed"), mountpoint)}; #else - spdlog::debug("chwd --pmcachedir \"{}\" --pmroot {} -f -i pci {} 2>>/tmp/cachyos-install.log 2>&1", cachepath, mountpoint, driver); + spdlog::debug("chwd --pmcachedir \"{}\" --pmroot {} -f -i {} 2>>/tmp/cachyos-install.log 2>&1", cachepath, mountpoint, driver); #endif } @@ -79,7 +79,7 @@ void install_graphics_menu() noexcept { switch (selected) { #ifdef NDEVENV case 0: - utils::arch_chroot("chwd --autoconfigure"sv); + utils::arch_chroot("chwd -a"sv); std::ofstream{fmt::format(FMT_COMPILE("{}/.video_installed"), mountpoint)}; // NOLINT break; #endif diff --git a/src/simple_tui.cpp b/src/simple_tui.cpp index ff6e2fd..0de83d8 100644 --- a/src/simple_tui.cpp +++ b/src/simple_tui.cpp @@ -50,7 +50,6 @@ struct UserSelections { std::string root_pass; std::string kernel; std::string desktop; - std::string drivers_type; std::string post_install; std::string mount_options; std::vector ready_partitions; @@ -401,7 +400,6 @@ UserSelections gather_user_selections() noexcept { const auto& kernel = std::get(config_data["KERNEL"]); const auto& desktop = std::get(config_data["DE"]); auto& bootloader = std::get(config_data["BOOTLOADER"]); - const auto& drivers_type = std::get(config_data["DRIVERS_TYPE"]); const auto& post_install = std::get(config_data["POST_INSTALL"]); const auto& server_mode = std::get(config_data["SERVER_MODE"]); @@ -474,7 +472,6 @@ UserSelections gather_user_selections() noexcept { selections.kernel = kernel; selections.desktop = desktop; - selections.drivers_type = drivers_type; selections.post_install = post_install; selections.server_mode = server_mode != 0; selections.mount_options = mount_opts_info; @@ -573,7 +570,7 @@ void apply_user_selections(const UserSelections& selections) noexcept { #ifdef NDEVENV if (!selections.server_mode) { - utils::arch_chroot(fmt::format(FMT_COMPILE("chwd -a pci {} 0300"), selections.drivers_type)); + utils::arch_chroot("chwd -a"); std::ofstream{fmt::format(FMT_COMPILE("{}/.video_installed"), mountpoint)}; } #endif @@ -601,16 +598,14 @@ void apply_user_selections(const UserSelections& selections) noexcept { fmt::format(FMT_COMPILE("Filesystem: {}"), selections.filesystem), fmt::format(FMT_COMPILE("Filesystem opts: {}"), selections.mount_options), 80); - fmt::print("┌{0:─^{5}}┐\n" - "│{1: ^{5}}│\n" - "│{2: ^{5}}│\n" - "│{3: ^{5}}│\n" - "│{4: ^{5}}│\n" - "└{0:─^{5}}┘\n", + fmt::print("┌{0:─^{4}}┐\n" + "│{1: ^{4}}│\n" + "│{2: ^{4}}│\n" + "│{3: ^{4}}│\n" + "└{0:─^{4}}┘\n", "", fmt::format(FMT_COMPILE("Kernel: {}"), selections.kernel), fmt::format(FMT_COMPILE("Desktop: {}"), (!selections.server_mode) ? selections.desktop : "---"), - fmt::format(FMT_COMPILE("Drivers type: {}"), selections.drivers_type), fmt::format(FMT_COMPILE("Bootloader: {}"), selections.bootloader), 80); } diff --git a/src/utils.cpp b/src/utils.cpp index c563912..dd95c1c 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1972,19 +1972,6 @@ bool parse_config() noexcept { return false; } - std::string drivers_type{"free"}; - if (doc.HasMember("drivers_type")) { - assert(doc["drivers_type"].IsString()); - drivers_type = doc["drivers_type"].GetString(); - - if (drivers_type != "nonfree"sv && drivers_type != "free"sv) { - spdlog::error("Unknown value: {}!", drivers_type); - drivers_type = "free"; - } - } - - config_data["DRIVERS_TYPE"] = drivers_type; - if (doc.HasMember("post_install")) { assert(doc["post_install"].IsString()); config_data["POST_INSTALL"] = std::string{doc["post_install"].GetString()};