use crystal grub theme, fix #9

axtloss/rework-partitioning
axtlos 3 years ago
parent 77ee32ca63
commit 79de3dd688
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -1,5 +1,6 @@
use crate::internal::exec::*; use crate::internal::exec::*;
use crate::internal::*; use crate::internal::*;
use crate::internal::files::append_file;
use std::path::PathBuf; use std::path::PathBuf;
pub fn install_base_packages() { pub fn install_base_packages() {
@ -38,7 +39,7 @@ pub fn genfstab() {
} }
pub fn install_bootloader_efi(efidir: PathBuf) { pub fn install_bootloader_efi(efidir: PathBuf) {
install::install(vec!["grub", "efibootmgr", "grub-btrfs"]); install::install(vec!["grub", "efibootmgr", "grub-btrfs", "crystal-grub-theme"]);
let efidir = std::path::Path::new("/mnt").join(efidir); let efidir = std::path::Path::new("/mnt").join(efidir);
let efi_str = efidir.to_str().unwrap(); let efi_str = efidir.to_str().unwrap();
if !std::path::Path::new(&format!("/mnt{efi_str}")).exists() { if !std::path::Path::new(&format!("/mnt{efi_str}")).exists() {
@ -67,6 +68,10 @@ pub fn install_bootloader_efi(efidir: PathBuf) {
), ),
"install grub as efi without --removable", "install grub as efi without --removable",
); );
files_eval(
append_file("/mnt/etc/default/grub", "GRUB_THEME=\"/usr/share/grub/themes/crystal/theme.txt\""),
"enable crystal grub theme"
);
exec_eval( exec_eval(
exec_chroot( exec_chroot(
"grub-mkconfig", "grub-mkconfig",
@ -77,7 +82,7 @@ pub fn install_bootloader_efi(efidir: PathBuf) {
} }
pub fn install_bootloader_legacy(device: PathBuf) { pub fn install_bootloader_legacy(device: PathBuf) {
install::install(vec!["grub", "grub-btrfs"]); install::install(vec!["grub", "grub-btrfs", "crystal-grub-theme"]);
if !device.exists() { if !device.exists() {
crash(format!("The device {device:?} does not exist"), 1); crash(format!("The device {device:?} does not exist"), 1);
} }
@ -89,6 +94,10 @@ pub fn install_bootloader_legacy(device: PathBuf) {
), ),
"install grub as legacy", "install grub as legacy",
); );
files_eval(
append_file("/mnt/etc/default/grub", "GRUB_THEME=\"/usr/share/grub/themes/crystal/theme.txt\""),
"enable crystal grub theme"
);
exec_eval( exec_eval(
exec_chroot( exec_chroot(
"grub-mkconfig", "grub-mkconfig",

Loading…
Cancel
Save