naccyde / rpms / systemd

Forked from rpms/systemd 11 months ago
Clone
594167
From d90268728f268f4e5291d29bc2b899137cd7ddf5 Mon Sep 17 00:00:00 2001
aa0848
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
aa0848
Date: Thu, 16 Dec 2021 14:35:17 +0100
aa0848
Subject: [PATCH] kernel-install: 50-depmod: port to /bin/sh
aa0848
aa0848
(cherry picked from commit b3ceb3d9fff69b33b8665a0137f5177f72c45cc0)
aa0848
aa0848
Related: #2065061
aa0848
---
aa0848
 src/kernel-install/50-depmod.install | 28 +++++++++++++++-------------
aa0848
 1 file changed, 15 insertions(+), 13 deletions(-)
aa0848
aa0848
diff --git a/src/kernel-install/50-depmod.install b/src/kernel-install/50-depmod.install
aa0848
index 2fd959865f..aa1f6b8e0e 100644
aa0848
--- a/src/kernel-install/50-depmod.install
aa0848
+++ b/src/kernel-install/50-depmod.install
aa0848
@@ -1,4 +1,4 @@
aa0848
-#!/usr/bin/env bash
aa0848
+#!/bin/sh
aa0848
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
aa0848
 # ex: ts=8 sw=4 sts=4 et filetype=sh
aa0848
 # SPDX-License-Identifier: LGPL-2.1-or-later
aa0848
@@ -20,23 +20,25 @@
aa0848
 
aa0848
 COMMAND="$1"
aa0848
 KERNEL_VERSION="$2"
aa0848
-ENTRY_DIR_ABS="$3"
aa0848
-KERNEL_IMAGE="$4"
aa0848
-INITRD_OPTIONS_START="5"
aa0848
-
aa0848
-[[ $KERNEL_VERSION ]] || exit 1
aa0848
 
aa0848
 case "$COMMAND" in
aa0848
     add)
aa0848
-        [[ -d "/lib/modules/${KERNEL_VERSION}/kernel" ]] || exit 0
aa0848
-        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
aa0848
-            echo "Running depmod -a ${KERNEL_VERSION}"
aa0848
-        exec depmod -a "${KERNEL_VERSION}"
aa0848
+        [ -d "/lib/modules/$KERNEL_VERSION/kernel" ] || exit 0
aa0848
+        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+depmod -a $KERNEL_VERSION"
aa0848
+        exec depmod -a "$KERNEL_VERSION"
aa0848
         ;;
aa0848
     remove)
aa0848
-        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
aa0848
-            echo "Removing /lib/modules/${KERNEL_VERSION}/modules.dep and associated files"
aa0848
-        exec rm -f /lib/modules/"${KERNEL_VERSION}"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
aa0848
+        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Removing /lib/modules/$KERNEL_VERSION/modules.dep and associated files"
aa0848
+        exec rm -f \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.alias" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.alias.bin" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.builtin.bin" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.dep" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.dep.bin" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.devname" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.softdep" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.symbols" \
aa0848
+            "/lib/modules/$KERNEL_VERSION/modules.symbols.bin"
aa0848
         ;;
aa0848
     *)
aa0848
         exit 0