summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2006-06-24 13:22:44 +0200
committermaximilian attems <maks@debian.org>2006-06-24 13:22:44 +0200
commitb7618c8e038c6e9a671ef62578bf79327fbc00be (patch)
tree3fb30c9cc93bfa4f74a743824b747cce905a54be /scripts/functions
parent16d9f24976ebbb165e5e8aae17a17ddaeca90a8d (diff)
downloadinitramfs-tools-b7618c8e038c6e9a671ef62578bf79327fbc00be.tar.gz
initramfs-tools-b7618c8e038c6e9a671ef62578bf79327fbc00be.zip
- no longer need to remove initramfs-tools/modules on postrm
ubuntu sync: - change prereqs policy - add check_minver - use it in update-initramfs - fix version to use in update-initramfs
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions39
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index 96a5577..35485c6 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -91,6 +91,14 @@ set_initlist()
reduce_satisfied()
{
deplist="$(render array_${1})"
+ unset tmpdeplist
+ for rs_y in ${deplist}; do
+ if [ ! -f ${initdir}/${rs_y} ]; then
+ continue
+ fi
+ tmpdeplist="${tmpdeplist} ${rs_y}"
+ done
+ deplist=${tmpdeplist}
for rs_x in ${runlist}; do
pop_list_item ${rs_x} ${deplist}
deplist=${tmppop}
@@ -176,6 +184,37 @@ run_scripts()
call_scripts
}
+check_minkver()
+{
+ curversion=${1}
+ initdir=${2}
+ set_initlist
+ if [ -z ${initdir} ]; then
+ DPKG_ARCH=`dpkg --print-installation-architecture`
+ case ${DPKG_ARCH} in
+ ia64|hppa)
+ minversion="2.6.15"
+ ;;
+ *)
+ minversion="2.6.12"
+ ;;
+ esac
+ if dpkg --compare-versions "${curversion}" lt "${minversion}"; then
+ echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2
+ echo "W: not generating requested initramfs for kernel ${curversion}" >&2
+ exit 2
+ fi
+ fi
+ [ -z ${initdir} ] || for cm_x in ${initlist}; do
+ tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2))
+ if dpkg --compare-versions "${curversion}" lt "${tmp}"; then
+ echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2
+ echo "W: not generating requested initramfs for kernel ${curversion}" >&2
+ exit 2
+ fi
+ done
+}
+
# Load custom modules first
load_modules()
{