mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 23:19:29 +02:00
Generate locale (fix #19)
This commit is contained in:
parent
2a987be160
commit
0492847d51
@ -67,6 +67,9 @@ pub enum ErrorKind {
|
|||||||
|
|
||||||
#[fail(display = "Error closing the encrypted device")]
|
#[fail(display = "Error closing the encrypted device")]
|
||||||
LuksClose,
|
LuksClose,
|
||||||
|
|
||||||
|
#[fail(display = "Error setting the locale")]
|
||||||
|
Locale,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Fail for Error {
|
impl Fail for Error {
|
||||||
|
18
src/main.rs
18
src/main.rs
@ -213,6 +213,24 @@ fn create(command: CreateCommand) -> Result<(), Error> {
|
|||||||
)
|
)
|
||||||
.context(ErrorKind::PostInstallation)?;
|
.context(ErrorKind::PostInstallation)?;
|
||||||
|
|
||||||
|
info!("Setting locale");
|
||||||
|
fs::OpenOptions::new()
|
||||||
|
.append(true)
|
||||||
|
.write(true)
|
||||||
|
.open(mount_point.path().join("etc/locale.gen"))
|
||||||
|
.and_then(|mut locale_gen| locale_gen.write_all(b"en_US.UTF-8 UTF-8\n"))
|
||||||
|
.context(ErrorKind::Locale)?;
|
||||||
|
fs::write(
|
||||||
|
mount_point.path().join("etc/locale.conf"),
|
||||||
|
"LANG=en_US.UTF-8",
|
||||||
|
)
|
||||||
|
.context(ErrorKind::Locale)?;
|
||||||
|
arch_chroot
|
||||||
|
.execute()
|
||||||
|
.arg(mount_point.path())
|
||||||
|
.arg("locale-gen")
|
||||||
|
.run(ErrorKind::Locale)?;
|
||||||
|
|
||||||
info!("Generating initramfs");
|
info!("Generating initramfs");
|
||||||
fs::write(mount_point.path().join("etc/mkinitcpio.conf"), MKINITCPIO)
|
fs::write(mount_point.path().join("etc/mkinitcpio.conf"), MKINITCPIO)
|
||||||
.context(ErrorKind::Initramfs)?;
|
.context(ErrorKind::Initramfs)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user