diff --git a/src/files/etc/pacman.conf b/src/files/etc/pacman.conf new file mode 100644 index 0000000..ac5af69 --- /dev/null +++ b/src/files/etc/pacman.conf @@ -0,0 +1,112 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +Color +ILoveCandy +#NoProgressBar +CheckSpace +#VerbosePkgLists +ParallelDownloads = 5 +DownloadUser = alpm +#DisableSandboxFilesystem +#DisableSandboxSyscalls + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Artix Linux +# packagers with `pacman-key --populate artix`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# kira linux base repository +[kira-base] +SigLevel = Required TrustedOnly +Server = https://repos.kira-linux.org/kira-base/x86_64 + +# The gremlins repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[system-gremlins] +#Include = /etc/pacman.d/mirrorlist + +[system] +Include = /etc/pacman.d/mirrorlist + +#[world-gremlins] +#Include = /etc/pacman.d/mirrorlist + +[world] +Include = /etc/pacman.d/mirrorlist + +#[galaxy-gremlins] +#Include = /etc/pacman.d/mirrorlist + +[galaxy] +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the lib32 repositories as required here. + +#[lib32-gremlins] +#Include = /etc/pacman.d/mirrorlist + +#[lib32] +#Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs \ No newline at end of file diff --git a/src/kira_include.rs b/src/kira_include.rs new file mode 100644 index 0000000..f988ba7 --- /dev/null +++ b/src/kira_include.rs @@ -0,0 +1,4 @@ + + + +const PACMAN_CONF: &str = include_str!("files/etc/pacman.conf"); \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index c4a0079..b87b633 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,6 +33,7 @@ use crate::stages::welcome; use crate::stages::welcome::WelcomeStage; rust_i18n::i18n!("src/locales", fallback = "en"); +mod kira_include; mod kira_color_bar; mod kira_disk_layout; mod kira_system; diff --git a/src/stages/install/mod.rs b/src/stages/install/mod.rs index 0dd8db9..1000ca1 100644 --- a/src/stages/install/mod.rs +++ b/src/stages/install/mod.rs @@ -111,7 +111,7 @@ pub fn init_disk(part_layout: &PartLayout, mnt_dir: &str) -> Result<(), ExecComm Some(PartRole::ROOT) => { if let Some(part_l) = part.partlabel_dev() { if let FSType::BCACHEFS(bc_par) = &part.fs_type { - log::info!("Formating root pertition."); + log::info!("Formating root partition."); kira_system::bcachefs_format( &part_l, bc_par.comp_alg.clone(), @@ -205,10 +205,10 @@ async fn mount_and_init_root_async(part_layout: PartLayout, mnt_dir: String) -> blocking::unblock(move || mount_and_init_root(&part_layout, &mnt_dir)).await } -// async fn install_base(mnt_dir: String) -> Result<(), ExecCommandError> { -// use blocking; -// blocking::unblock(move || init_disk(&part_layout, &mnt_dir)).await -// } +async fn install_base_async(mnt_dir: String) -> Result<(), ExecCommandError> { + use blocking; + blocking::unblock(move || kira_system::basestrap_dinit(&mnt_dir)).await +} fn do_install( k_config: KiraConfig, diff --git a/src/stages/timezone/mod.rs b/src/stages/timezone/mod.rs index b14c906..9e21796 100644 --- a/src/stages/timezone/mod.rs +++ b/src/stages/timezone/mod.rs @@ -90,35 +90,35 @@ fn get_timezones_blocking() -> Result, kira_system::ExecComman } /// Getting list of awailable timezones from system. -fn get_timezones_blocking_depr() -> Result, String> { - use std::process::Command; - //timedatectl list-timezones --no-pager - match Command::new("timedatectl") - .arg("list-timezones") - .arg("--no-pager") - .output() - { - Ok(cmd_output) => { - if cmd_output.status.success() { - //Etc/UTC - match String::from_utf8(cmd_output.stdout) { - Ok(str_tz_list) => Ok(str_tz_list - .split("\n") - .filter(|sb| sb.contains('/')) - .filter_map(|str_t_zone| TimeZoneData::from_str(str_t_zone.trim())) - .collect::>()), - Err(ex) => Err(format!("Exception while converting to UTF8 {}", ex)), - } - } else { - Err(format!( - "Error getting timezones list: {}", - String::from_utf8(cmd_output.stderr).unwrap_or("UNKNOWN".into()) - )) - } - } - Err(ex) => Err(format!("Exception while trying to list time zones {}", ex)), - } -} +// fn get_timezones_blocking_depr() -> Result, String> { +// use std::process::Command; +// //timedatectl list-timezones --no-pager +// match Command::new("timedatectl") +// .arg("list-timezones") +// .arg("--no-pager") +// .output() +// { +// Ok(cmd_output) => { +// if cmd_output.status.success() { +// //Etc/UTC +// match String::from_utf8(cmd_output.stdout) { +// Ok(str_tz_list) => Ok(str_tz_list +// .split("\n") +// .filter(|sb| sb.contains('/')) +// .filter_map(|str_t_zone| TimeZoneData::from_str(str_t_zone.trim())) +// .collect::>()), +// Err(ex) => Err(format!("Exception while converting to UTF8 {}", ex)), +// } +// } else { +// Err(format!( +// "Error getting timezones list: {}", +// String::from_utf8(cmd_output.stderr).unwrap_or("UNKNOWN".into()) +// )) +// } +// } +// Err(ex) => Err(format!("Exception while trying to list time zones {}", ex)), +// } +// } impl TimeZoneStage { pub fn new(k_config: KiraConfig) -> Self {