]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
chore(base): remove some unused functions
authorJo Zzsi <jozzsicsataban@gmail.com>
Wed, 6 Nov 2024 12:09:03 +0000 (07:09 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 6 Nov 2024 18:50:18 +0000 (13:50 -0500)
modules.d/99base/dracut-lib.sh

index b0e5ee51814333806cb95db72901c8c608988e8d..fe69a6b9d4a625b5cbd0076c9a357981e5935930 100755 (executable)
@@ -308,32 +308,6 @@ getargs() {
     return 1
 }
 
-# Prints value of given option.  If option is a flag and it's present,
-# it just returns 0.  Otherwise 1 is returned.
-# $1 = options separated by commas
-# $2 = option we are interested in
-#
-# Example:
-# $1 = cipher=aes-cbc-essiv:sha256,hash=sha256,verify
-# $2 = hash
-# Output:
-# sha256
-getoptcomma() {
-    local line=",$1,"
-    local opt="$2"
-    local tmp
-
-    case "${line}" in
-        *,${opt}=*,*)
-            tmp="${line#*,"${opt}"=}"
-            echo "${tmp%%,*}"
-            return 0
-            ;;
-        *,${opt},*) return 0 ;;
-    esac
-    return 1
-}
-
 # Splits given string 'str' with separator 'sep' into variables 'var1', 'var2',
 # 'varN'.  If number of fields is less than number of variables, remaining are
 # not set.  If number of fields is greater than number of variables, the last
@@ -469,22 +443,6 @@ check_quiet() {
     fi
 }
 
-check_occurances() {
-    # Count the number of times the character $ch occurs in $str
-    # Return 0 if the count matches the expected number, 1 otherwise
-    local str="$1"
-    local ch="$2"
-    local expected="$3"
-    local count=0
-
-    while [ "${str#*"$ch"}" != "${str}" ]; do
-        str="${str#*"$ch"}"
-        count=$((count + 1))
-    done
-
-    [ $count -eq "$expected" ]
-}
-
 incol2() {
     debug_off
     local check
@@ -797,34 +755,6 @@ inst_hook() {
     mv -f "/tmp/$$-${_job}.sh" "$hookdir/${_hookname}/${_job}.sh"
 }
 
-# inst_mount_hook <mountpoint> <prio> <name> <script>
-#
-# Install a mount hook with priority <prio>,
-# which executes <script> as soon as <mountpoint> is mounted.
-inst_mount_hook() {
-    local _prio="$2" _jobname="$3" _script="$4"
-    local _hookname
-    _hookname="mount-$(str_replace "$1" '/' '\\x2f')"
-    [ -d "$hookdir/${_hookname}" ] || mkdir -p "$hookdir/${_hookname}"
-    inst_hook --hook "$_hookname" --unique --name "${_prio}-${_jobname}" "$_script"
-}
-
-# wait_for_mount <mountpoint>
-#
-# Installs a initqueue-finished script,
-# which will cause the main loop only to exit,
-# if <mountpoint> is mounted.
-wait_for_mount() {
-    local _name
-    _name="$(str_replace "$1" '/' '\\x2f')"
-    printf '. /lib/dracut-lib.sh\nismounted "%s"\n' "$1" \
-        >> "$hookdir/initqueue/finished/ismounted-${_name}.sh"
-    {
-        printf 'ismounted "%s" || ' "$1"
-        printf 'warn "\"%s\" is not mounted"\n' "$1"
-    } >> "$hookdir/emergency/90-${_name}.sh"
-}
-
 killproc() {
     debug_off
     local _exe