]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(dracut): drop unreachable code for dracutbasedir/initdir
authorBenjamin Drung <benjamin.drung@canonical.com>
Tue, 6 Jan 2026 13:34:36 +0000 (14:34 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 7 Jan 2026 13:48:42 +0000 (08:48 -0500)
`dracut.sh` sets the variables `dracutbasedir` and `initdir`. Then it
creates the `initdir` directory. So checking those variables again can
be dropped.

Follow-up: 4cb4917e1222 ("refactor: fold dracut-init.sh into dracut.sh")

dracut.sh

index c02417e090fab00ec17da2f1c8fb9857931b5caa..bc3141f7ca941187266a32fc5651b30204b218cf 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1476,22 +1476,6 @@ fi
 
 export LC_MESSAGES=C kernel
 
-if ! [[ ${dracutbasedir-} ]]; then
-    dracutbasedir=${BASH_SOURCE[0]%/*}
-    [[ $dracutbasedir == dracut-functions* ]] && dracutbasedir="."
-    [[ $dracutbasedir ]] || dracutbasedir="."
-    dracutbasedir="$(readlink -f "$dracutbasedir")"
-fi
-
-if ! [[ ${initdir-} ]]; then
-    dfatal "initdir not set"
-    exit 1
-fi
-
-if ! [[ -d $initdir ]]; then
-    mkdir -p "$initdir"
-fi
-
 srcmods="$(realpath -e "${dracutsysrootdir-}/lib/modules/$kernel")"
 
 [[ ${drivers_dir-} ]] && {