pub enum KargsError {
BothEmpty,
}Expand description
Modify kernel arguments in GRUB_CMDLINE_LINUX_DEFAULT, back up the
original file, then run update-grub.
Risk: High. Kernel argument changes affect every boot. Incorrect arguments
can prevent the system from booting. The helper script writes a backup to
/etc/default/grub.sysknife.bak and restores it on update-grub failure.
append — arguments to add (validated before call).
delete — arguments to remove (validated before call).
At least one of append / delete MUST be non-empty — calling with both
empty is a no-op that still rewrites the GRUB config and runs update-grub,
which is wasteful and misleading. The constructor returns
Err(KargsError::BothEmpty) in that case.
The underlying mechanism is a single sudo invocation of the root-owned
helper script GRUB_KARGS_HELPER (no shell involved), which closes the
unconstrained python3, cp, and update-grub sudoers grants.
Variants§
BothEmpty
Trait Implementations§
Source§impl Debug for KargsError
impl Debug for KargsError
Source§impl Display for KargsError
impl Display for KargsError
impl Eq for KargsError
Source§impl Error for KargsError
impl Error for KargsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for KargsError
impl PartialEq for KargsError
impl StructuralPartialEq for KargsError
Auto Trait Implementations§
impl Freeze for KargsError
impl RefUnwindSafe for KargsError
impl Send for KargsError
impl Sync for KargsError
impl Unpin for KargsError
impl UnsafeUnpin for KargsError
impl UnwindSafe for KargsError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more