-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Hiepler
committed
Sep 2, 2023
1 parent
ff93740
commit 9baad3c
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# modify cmdline.txt | ||
|
||
# @example | ||
# add processor.max_cstate=1 | ||
# remove isolcpus=2,3 | ||
# RPI_CMDLINE_ADD=( "processor.max_cstate=1" ) | ||
# RPI_CMDLINE_REMOVE=( "isolcpus=2,3" ) | ||
|
||
|
||
# load dependencies | ||
plugin_load run || return 1 | ||
|
||
to_array RPI_CMDLINE_ADD | ||
to_array RPI_CMDLINE_REMOVE | ||
|
||
function rpi_cmdline_prerun() { | ||
[[ -n "${RPI_CMDLINE_ADD}" ]] || [[ -n "${RPI_CMDLINE_REMOVE}" ]] || error "RPI_CMDLINE_ADD and RPI_CMDLINE_REMOVE unset" | ||
} | ||
|
||
function rpi_cmdline_run() { | ||
for c in "${RPI_CMDLINE_ADD[@]}" ; do | ||
log "setting ${c} ..." | ||
rpi_append_to_file "${c}" "${RPI_BOOT}/cmdline.txt" || error "adding ${c}" | ||
done | ||
|
||
for c in "${RPI_CMDLINE_REMOVE[@]}" ; do | ||
log "removing ${c} ..." | ||
rpi_remove_pattern_from_file "${c}" "${RPI_BOOT}/cmdline.txt" || error "removing ${c}" | ||
done | ||
} | ||
|
||
function rpi_cmdline_description() { | ||
echo "modify cmdline.txt" | ||
} | ||
|
||
function rpi_cmdline_help_params() { | ||
help_param "RPI_CMDLINE_ADD" "arguments to add" | ||
help_param "RPI_CMDLINE_REMOVE" "arguments to remove" | ||
} |