mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 06:59:28 +02:00
Move locale generation before user scripts (#59)
So user scripts can change locale if they wish
This commit is contained in:
parent
38e2cfbf5b
commit
7bba0c8c5a
38
src/main.rs
38
src/main.rs
@ -257,6 +257,25 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
.run()
|
.run()
|
||||||
.context("Failed to delete the root password")?;
|
.context("Failed to delete the root password")?;
|
||||||
|
|
||||||
|
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("Failed to create locale.gen")?;
|
||||||
|
fs::write(
|
||||||
|
mount_point.path().join("etc/locale.conf"),
|
||||||
|
"LANG=en_US.UTF-8",
|
||||||
|
)
|
||||||
|
.context("Failed to write to locale.conf")?;
|
||||||
|
arch_chroot
|
||||||
|
.execute()
|
||||||
|
.arg(mount_point.path())
|
||||||
|
.arg("locale-gen")
|
||||||
|
.run()
|
||||||
|
.context("locale-gen failed")?;
|
||||||
|
|
||||||
if !presets.aur_packages.is_empty() {
|
if !presets.aur_packages.is_empty() {
|
||||||
arch_chroot
|
arch_chroot
|
||||||
.execute()
|
.execute()
|
||||||
@ -406,25 +425,6 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
)
|
)
|
||||||
.context("Failed to write to journald.conf")?;
|
.context("Failed to write to journald.conf")?;
|
||||||
|
|
||||||
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("Failed to create locale.gen")?;
|
|
||||||
fs::write(
|
|
||||||
mount_point.path().join("etc/locale.conf"),
|
|
||||||
"LANG=en_US.UTF-8",
|
|
||||||
)
|
|
||||||
.context("Failed to write to locale.conf")?;
|
|
||||||
arch_chroot
|
|
||||||
.execute()
|
|
||||||
.arg(mount_point.path())
|
|
||||||
.arg("locale-gen")
|
|
||||||
.run()
|
|
||||||
.context("locale-gen failed")?;
|
|
||||||
|
|
||||||
info!("Generating initramfs");
|
info!("Generating initramfs");
|
||||||
fs::write(
|
fs::write(
|
||||||
mount_point.path().join("etc/mkinitcpio.conf"),
|
mount_point.path().join("etc/mkinitcpio.conf"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user