diff --git a/README b/README index 57f6290..31ccaa6 100644 --- a/README +++ b/README @@ -33,6 +33,7 @@ dump_boot backup_file replace_string replace_section +remove_section insert_line replace_line remove_line @@ -53,6 +54,8 @@ Similarly, "line match string" and "line replace string" are the search strings You may also use ui_print "" to write messages back to the recovery during the modification process. +Note: the "begin search string" and "end search string" arguments of replace_section and remove_section require any forward slashes (/) to be escaped. + // Instructions 1- Place zImage in the root (dtb should also go here for devices that require a custom one, both will fallback to the original if not included) diff --git a/anykernel.sh b/anykernel.sh index 2f794c5..1257283 100755 --- a/anykernel.sh +++ b/anykernel.sh @@ -115,6 +115,11 @@ replace_section() { sed -i "${line}s;^;${4}\n;" $1; } +# remove_section +remove_section() { + sed -i "/${2}/,/${3}/d" $1; +} + # insert_line insert_line() { if [ -z "$(grep "$2" $1)" ]; then