Skip to content

Commit

Permalink
refactor: remove talos kernel default args
Browse files Browse the repository at this point in the history
This will make procfs more generic. These args will be defined in Talos
instead.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
  • Loading branch information
Unix4ever authored and talos-bot committed Dec 24, 2020
1 parent a82654e commit 24d06a9
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions procfs/cmdline.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ import (
"sync"
)

// NewDefaultCmdline returns a set of kernel parameters that serve as the base
// for all Talos installations.
// nolint: golint
func NewDefaultCmdline() *Cmdline {
cmdline := NewCmdline("")
cmdline.AppendDefaults()

return cmdline
}

// Key represents a key in a kernel parameter key-value pair.
type Key = string

Expand Down Expand Up @@ -154,26 +144,6 @@ func NewCmdline(parameters string) *Cmdline {
return c
}

// AppendDefaults add the Talos default kernel commandline options to the existing set.
//
// See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt
func (c *Cmdline) AppendDefaults() {
c.Append("init_on_alloc", "1")
c.Append("init_on_free", "1")
c.Append("slab_nomerge", "")
c.Append("pti", "on")
c.Append("consoleblank", "0")
// AWS recommends setting the nvme_core.io_timeout to the highest value possible.
// See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html.
c.Append("nvme_core.io_timeout", "4294967295")
c.Append("random.trust_cpu", "on")
// Disable rate limited printk
c.Append("printk.devkmsg", "on")
c.Append("ima_template", "ima-ng")
c.Append("ima_appraise", "fix")
c.Append("ima_hash", "sha512")
}

// Get gets a kernel parameter.
func (c *Cmdline) Get(k string) (value *Parameter) {
c.Lock()
Expand Down

0 comments on commit 24d06a9

Please sign in to comment.