Remove version argument check from initramfs cleanup script (#3859)
The version argument is not used by the script anymore, hence the check is obsolete. Additionally make use of the currently unused defined MOD_DIR variable. Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
parent
4577254e20
commit
1b6e851212
@ -1,15 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
version="$1"
|
||||
|
||||
[ -x /usr/sbin/update-initramfs ] || exit 0
|
||||
|
||||
# passing the kernel version is required
|
||||
if [ -z "$version" ]; then
|
||||
echo >&2 "W: initramfs-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# avoid running multiple times
|
||||
# This script should be run after the initramfs-tools script
|
||||
# and under the same conditions.
|
||||
@ -25,7 +17,7 @@ MOD_DIR=/lib/modules/
|
||||
files="$(find /boot -maxdepth 1 -name 'initrd.img-*' -o -name 'uInitrd-*')"
|
||||
|
||||
for f in $files; do
|
||||
if [ ! -d /lib/modules/"${f#*-}" ]; then
|
||||
if [ ! -d "$MOD_DIR${f#*-}" ]; then
|
||||
echo "Remove unused generated file: $f"; rm $f
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user