]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut-init): remove the heuristic to determine fallback kernel version
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 19 Jul 2025 02:24:47 +0000 (22:24 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 6 Aug 2025 14:10:22 +0000 (10:10 -0400)
If kernel version is not passed in the command line for a dracut invocation then
dracut.sh should be the only place where kernel version is determined.

Remove the heuristic to determine kernel version from dracut-init.sh.

dracut-init.sh

index 82dcdf05429f4abdfc36318cfdfbf50793fe1c27..b57b41339a3ebf4a7c33e6d4ceacacb6fa29cf7a 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-export LC_MESSAGES=C
+export LC_MESSAGES=C kernel
 
 if [[ $EUID == "0" ]] && ! [[ ${DRACUT_NO_XATTR-} ]]; then
     export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr"
@@ -53,11 +53,6 @@ if ! [[ -d $initdir ]]; then
     mkdir -p "$initdir"
 fi
 
-if ! [[ ${kernel-} ]]; then
-    kernel=$(uname -r)
-    export kernel
-fi
-
 srcmods="$(realpath -e "${dracutsysrootdir-}/lib/modules/$kernel")"
 
 [[ ${drivers_dir-} ]] && {