1
0

rewrite scripts

try to provide better syntax and avoid using bash
This commit is contained in:
2024-10-29 05:12:06 +03:00
parent 1e13062902
commit eb2bdc81cb
24 changed files with 363 additions and 247 deletions

View File

@@ -1,25 +1,27 @@
#!/bin/sh -e
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
[ "$1" = configure ] || exit 0
if [ "$1" != configure ]; then
exit 0
fi
version='@abiname@@localversion@'
image_path="/boot/@image-stem@-${version}"
depmod $version
depmod "${version}"
if [ -f /lib/modules/$version/.fresh-install ]; then
if command -v linux-update-symlinks >/dev/null ; then
change=install
else
change=upgrade
fi
linux-update-symlinks $change $version $image_path
rm -f /lib/modules/$version/.fresh-install
[ -f "/lib/modules/${version}/.fresh-install" ] || change=upgrade
if [ -d /etc/kernel/postinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/postinst.d
linux-update-symlinks "${change}" "${version}" "${image_path}"
fi
rm -f "/lib/modules/${version}/.fresh-install"
if [ -d /etc/kernel/postinst.d ] ; then
DEB_MAINT_PARAMS="$*" \
run-parts --report --exit-on-error \
"--arg=${version}" \
"--arg=${image_path}" \
/etc/kernel/postinst.d
fi
exit 0