From b3c17b6f90baa8bd42606ddf8899e4613347fd2c Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Tue, 26 Dec 2023 15:15:42 +0100 Subject: [PATCH] Tidy up debug.log formating --- internal/configs/config_bootloaders.go | 6 +++--- internal/configs/config_dracut.go | 2 +- internal/configs/config_mkinitcpio.go | 4 ++-- internal/configs/config_modprobe.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/configs/config_bootloaders.go b/internal/configs/config_bootloaders.go index 3e1e25e..8001f7d 100644 --- a/internal/configs/config_bootloaders.go +++ b/internal/configs/config_bootloaders.go @@ -79,7 +79,7 @@ func Set_KernelStub() string { kernel_args := fileio.ReadFile(config.Path.CMDLINE) // Write to logger - logger.Printf("Running command:\nsudo kernelstub -a \"%s\"", kernel_args) + logger.Printf("Running command:\nsudo kernelstub -a \"%s\"\n", kernel_args) // Run the command _, err := command.Run("sudo", "kernelstub", "-a", kernel_args) @@ -98,7 +98,7 @@ func Set_Grubby() string { kernel_args := fileio.ReadFile(config.Path.CMDLINE) // Write to logger - logger.Printf("Running command:\nsudo grubby --update-kernel=ALL --args=\"%s\"", kernel_args) + logger.Printf("Running command:\nsudo grubby --update-kernel=ALL --args=\"%s\"\n", kernel_args) // Run the command _, err := command.Run("sudo", "grubby", "--update-kernel=ALL", fmt.Sprintf("--args=%s", kernel_args)) @@ -135,7 +135,7 @@ func Configure_Grub2() { grub_content := fileio.ReadLines(sysfile) // Write to logger - logger.Printf("Read %s:\n%s", sysfile, strings.Join(grub_content, "\n")) + logger.Printf("Read %s:\n%s\n", sysfile, strings.Join(grub_content, "\n")) for _, line := range grub_content { if currentargs_re.MatchString(line) { diff --git a/internal/configs/config_dracut.go b/internal/configs/config_dracut.go index fb392b9..f31a2ff 100644 --- a/internal/configs/config_dracut.go +++ b/internal/configs/config_dracut.go @@ -22,7 +22,7 @@ func Set_Dracut() { } // Write to logger - logger.Printf("Writing to %s:\nadd_drivers+=\" %s \"", dracutConf, strings.Join(vfio_modules(), " ")) + logger.Printf("Writing to %s:\nadd_drivers+=\" %s \"\n", dracutConf, strings.Join(vfio_modules(), " ")) // Write the dracut config file fileio.AppendContent(fmt.Sprintf("add_drivers+=\" %s \"\n", strings.Join(vfio_modules(), " ")), dracutConf) diff --git a/internal/configs/config_mkinitcpio.go b/internal/configs/config_mkinitcpio.go index 369d1ab..a2f6dd6 100644 --- a/internal/configs/config_mkinitcpio.go +++ b/internal/configs/config_mkinitcpio.go @@ -33,7 +33,7 @@ func Set_Mkinitcpio() { mkinitcpio_content := fileio.ReadLines(sysfile) // Write to logger - logger.Printf("Read %s:\n%s", sysfile, strings.Join(mkinitcpio_content, "\n")) + logger.Printf("Read %s:\n%s\n", sysfile, strings.Join(mkinitcpio_content, "\n")) for _, line := range mkinitcpio_content { // If we are at the line starting with MODULES= @@ -47,7 +47,7 @@ func Set_Mkinitcpio() { // If vendor-reset is in the current modules if strings.Contains(line, "vendor-reset") { // Write to logger - logger.Printf("vendor-reset module detected in %s\nMaking sure it will be loaded before vfio", sysfile) + logger.Printf("vendor-reset module detected in %s\nMaking sure it will be loaded before vfio\n", sysfile) // Add vendor-reset first modules = append([]string{"vendor-reset"}, modules...) diff --git a/internal/configs/config_modprobe.go b/internal/configs/config_modprobe.go index 227cd61..63a5dbc 100644 --- a/internal/configs/config_modprobe.go +++ b/internal/configs/config_modprobe.go @@ -22,7 +22,7 @@ func Set_Modprobe(gpu_IDs []string) { if strings.Contains(kernel_args, "vfio_pci.disable_vga=1") { // Write to logger - logger.Printf("User has disabled vfio video output on host, adding disable_vga=1 to the optional hardcoded vfio_pci options") + logger.Printf("User has disabled vfio video output on host, adding disable_vga=1 to the optional hardcoded vfio_pci options\n") vfio_pci_options = append(vfio_pci_options, "disable_vga=1") }