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