rewrite scripts
try to provide better syntax and avoid using bash
This commit is contained in:
34
debian/templates/image.postinst.in
vendored
34
debian/templates/image.postinst.in
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user