This commit is contained in:
parent
e20248db68
commit
92c2ea4772
4 changed files with 79 additions and 15 deletions
|
@ -82,9 +82,8 @@ func Set_KernelStub(isRoot bool) {
|
|||
kernel_args := fileio.ReadFile(config.Path.CMDLINE)
|
||||
|
||||
// Run and log, check for errors
|
||||
common.ErrorCheck(command.ExecAndLogSudo(isRoot, true,
|
||||
"kernelstub -a "+fmt.Sprintf("\"%s\"", kernel_args),
|
||||
),
|
||||
common.ErrorCheck(
|
||||
command.ExecAndLogSudo(isRoot, true, "kernelstub", "-a", kernel_args),
|
||||
"Error, kernelstub command returned exit code 1",
|
||||
)
|
||||
}
|
||||
|
@ -98,7 +97,7 @@ func Set_Grubby(isRoot bool) string {
|
|||
kernel_args := fileio.ReadFile(config.Path.CMDLINE)
|
||||
|
||||
// Run and log, check for errors
|
||||
err := command.ExecAndLogSudo(isRoot, true, "grubby --update-kernel=ALL "+fmt.Sprintf("--args=%s", kernel_args))
|
||||
err := command.ExecAndLogSudo(isRoot, true, "grubby", "--update-kernel=ALL", fmt.Sprintf("--args=%s", kernel_args))
|
||||
common.ErrorCheck(err, "Error, grubby command returned exit code 1")
|
||||
|
||||
// Return what we did
|
||||
|
|
|
@ -201,7 +201,7 @@ func installPassthrough(config *configs.Config) {
|
|||
// Copy the modules file to /etc/modules
|
||||
configs.CopyToSystem(config.IsRoot, config.Path.ETCMODULES, "/etc/modules")
|
||||
|
||||
if err = command.ExecAndLogSudo(config.IsRoot, true, "update-initramfs -u"); err != nil {
|
||||
if err = command.ExecAndLogSudo(config.IsRoot, true, "update-initramfs", "-u"); err != nil {
|
||||
log.Fatalf("Failed to update initramfs: %s", err)
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ func installPassthrough(config *configs.Config) {
|
|||
// Get systeminfo
|
||||
sysinfo := uname.New()
|
||||
|
||||
if err = command.ExecAndLogSudo(config.IsRoot, true, "dracut -f -v --kver "+sysinfo.Release); err != nil {
|
||||
if err = command.ExecAndLogSudo(config.IsRoot, true, "dracut", "-f", "-v", "--kver", sysinfo.Release); err != nil {
|
||||
log.Fatalf("Failed to update initramfs: %s", err)
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ func installPassthrough(config *configs.Config) {
|
|||
// Copy dracut config to /etc/dracut.conf.d/vfio
|
||||
configs.CopyToSystem(config.IsRoot, config.Path.MKINITCPIO, "/etc/mkinitcpio.conf")
|
||||
|
||||
if err = command.ExecAndLogSudo(config.IsRoot, true, "mkinitcpio -P"); err != nil {
|
||||
if err = command.ExecAndLogSudo(config.IsRoot, true, "mkinitcpio", "-P"); err != nil {
|
||||
log.Fatalf("Failed to update initramfs: %s", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue