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,21 +1,23 @@
#!/bin/sh -e
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
if [ "$1" = abort-upgrade ] ; then exit 0 ; fi
if [ "$1" = abort-upgrade ]; then
exit 0
fi
version='@abiname@@localversion@'
image_path="/boot/@image-stem@-${version}"
if [ "$1" = install ]; then
# Create a flag file for postinst
mkdir -p /lib/modules/$version
touch /lib/modules/$version/.fresh-install
mkdir -p "/lib/modules/${version}"
touch "/lib/modules/${version}/.fresh-install"
fi
if [ -d /etc/kernel/preinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/preinst.d
if [ -d /etc/kernel/preinst.d ] ; then
DEB_MAINT_PARAMS="$*" \
run-parts --report --exit-on-error \
"--arg=${version}" \
"--arg=${image_path}" \
/etc/kernel/preinst.d
fi
exit 0