mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 15:09:30 +02:00
parent
38d0085ba1
commit
f594fc2ffc
33
src/main.rs
33
src/main.rs
@ -225,10 +225,14 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
|
|
||||||
packages.extend(presets.packages);
|
packages.extend(presets.packages);
|
||||||
|
|
||||||
let use_aur = !(presets.aur_packages.is_empty() && command.aur_packages.is_empty());
|
let aur_pacakges = {
|
||||||
if use_aur {
|
let mut p = vec![String::from("shim-signed")];
|
||||||
|
p.extend(presets.aur_packages);
|
||||||
|
p.extend(command.aur_packages);
|
||||||
|
p
|
||||||
|
};
|
||||||
|
|
||||||
packages.extend(constants::AUR_DEPENDENCIES.iter().map(|s| String::from(*s)));
|
packages.extend(constants::AUR_DEPENDENCIES.iter().map(|s| String::from(*s)));
|
||||||
}
|
|
||||||
|
|
||||||
info!("Bootstrapping system");
|
info!("Bootstrapping system");
|
||||||
pacstrap
|
pacstrap
|
||||||
@ -277,7 +281,6 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
.run()
|
.run()
|
||||||
.context("locale-gen failed")?;
|
.context("locale-gen failed")?;
|
||||||
|
|
||||||
if use_aur {
|
|
||||||
info!("Installing AUR packages");
|
info!("Installing AUR packages");
|
||||||
|
|
||||||
arch_chroot
|
arch_chroot
|
||||||
@ -324,8 +327,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
.arg(mount_point.path())
|
.arg(mount_point.path())
|
||||||
.args(&["sudo", "-u", "aur"])
|
.args(&["sudo", "-u", "aur"])
|
||||||
.args(&command.aur_helper.install_command)
|
.args(&command.aur_helper.install_command)
|
||||||
.args(presets.aur_packages)
|
.args(aur_pacakges)
|
||||||
.args(&command.aur_packages)
|
|
||||||
.run()
|
.run()
|
||||||
.context("Failed to install AUR packages")?;
|
.context("Failed to install AUR packages")?;
|
||||||
|
|
||||||
@ -338,7 +340,7 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
.context("Failed to delete temporary aur user")?;
|
.context("Failed to delete temporary aur user")?;
|
||||||
|
|
||||||
fs::remove_file(&aur_sudoers).context("Cannot delete the AUR sudoers temporary file")?;
|
fs::remove_file(&aur_sudoers).context("Cannot delete the AUR sudoers temporary file")?;
|
||||||
}
|
|
||||||
if !presets.scripts.is_empty() {
|
if !presets.scripts.is_empty() {
|
||||||
info!("Running custom scripts");
|
info!("Running custom scripts");
|
||||||
}
|
}
|
||||||
@ -457,6 +459,23 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
.arg(format!("grub-install --target=i386-pc --boot-directory /boot {} && grub-install --target=x86_64-efi --efi-directory /boot --boot-directory /boot --removable && grub-mkconfig -o /boot/grub/grub.cfg", disk_path.display()))
|
.arg(format!("grub-install --target=i386-pc --boot-directory /boot {} && grub-install --target=x86_64-efi --efi-directory /boot --boot-directory /boot --removable && grub-mkconfig -o /boot/grub/grub.cfg", disk_path.display()))
|
||||||
.run().context("Failed to install grub")?;
|
.run().context("Failed to install grub")?;
|
||||||
|
|
||||||
|
let bootloader = mount_point.path().join("boot/EFI/BOOT/BOOTX64.efi");
|
||||||
|
fs::rename(
|
||||||
|
&bootloader,
|
||||||
|
mount_point.path().join("boot/EFI/BOOT/grubx64.efi"),
|
||||||
|
)
|
||||||
|
.context("Cannot move out grub")?;
|
||||||
|
fs::copy(
|
||||||
|
mount_point.path().join("usr/share/shim-signed/mmx64.efi"),
|
||||||
|
mount_point.path().join("boot/EFI/BOOT/mmx64.efi"),
|
||||||
|
)
|
||||||
|
.context("Failed copying mmx64")?;
|
||||||
|
fs::copy(
|
||||||
|
mount_point.path().join("usr/share/shim-signed/shimx64.efi"),
|
||||||
|
bootloader,
|
||||||
|
)
|
||||||
|
.context("Failed copying shim")?;
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"GRUB configuration: {}",
|
"GRUB configuration: {}",
|
||||||
fs::read_to_string(mount_point.path().join("boot/grub/grub.cfg"))
|
fs::read_to_string(mount_point.path().join("boot/grub/grub.cfg"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user