make locale stuff actually

axtloss/rework-partitioning
amy 3 years ago
parent 6dad1352ef
commit 73529ea2b5

@ -7,8 +7,8 @@ pub fn set_timezone(timezone: &str) {
"ln", "ln",
vec![ vec![
"-sf".to_string(), "-sf".to_string(),
format!("/usr/share/zoneinfo/{}", timezone), format!("/mnt/usr/share/zoneinfo/{}", timezone),
"/etc/localtime".to_string(), "/mnt/etc/localtime".to_string(),
], ],
), ),
"Set timezone", "Set timezone",
@ -21,29 +21,29 @@ pub fn set_timezone(timezone: &str) {
pub fn set_locale(locale: String) { pub fn set_locale(locale: String) {
files_eval( files_eval(
files::append_file("/etc/locale.gen", "en_US.UTF-8 UTF-8"), files::append_file("/mnt/etc/locale.gen", "en_US.UTF-8 UTF-8"),
"add en_US.UTF-8 UTF-8 to locale.gen", "add en_US.UTF-8 UTF-8 to locale.gen",
); );
files_eval( files_eval(
files::append_file("/etc/locale.gen", locale.as_str()), files::append_file("/mnt/etc/locale.gen", locale.as_str()),
"add locales to locale.gen", "add locales to locale.gen",
); );
exec_eval( exec_eval(
exec_chroot("locale-gen", vec!["".to_string()]), exec_chroot("locale-gen", vec!["".to_string()]),
"generate locales", "generate locales",
); );
files::create_file("/etc/locale.conf"); files::create_file("/mnt/etc/locale.conf");
files_eval( files_eval(
files::append_file("/etc/locale.conf", "LANG=en_US.UTF-8"), files::append_file("/mnt/etc/locale.conf", "LANG=en_US.UTF-8"),
"edit locale.conf", "edit locale.conf",
); );
} }
pub fn set_keyboard(keyboard: &str) { pub fn set_keyboard(keyboard: &str) {
files::create_file("/etc/vconsole.conf"); files::create_file("/mnt/etc/vconsole.conf");
files_eval( files_eval(
files::append_file( files::append_file(
"/etc/vconsole.conf", "/mnt/etc/vconsole.conf",
format!("KEYMAP={}", keyboard).as_str(), format!("KEYMAP={}", keyboard).as_str(),
), ),
"set keyboard layout", "set keyboard layout",

Loading…
Cancel
Save