diff options
author | maximilian attems <maks@debian.org> | 2006-07-02 19:45:38 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2006-07-02 19:45:38 +0200 |
commit | af6f5f475221846f88a2bbda39a2a93d67556d07 (patch) | |
tree | faf7ade4e6f6bfa4819b688943c76d891674f2b0 /hook-functions | |
parent | 0d341b8d32810844ce035e89a9e60fb7a7dde4b6 (diff) | |
download | initramfs-tools-af6f5f475221846f88a2bbda39a2a93d67556d07.tar.gz initramfs-tools-af6f5f475221846f88a2bbda39a2a93d67556d07.zip |
- move check_minkver() to hook-functions
Diffstat (limited to 'hook-functions')
-rw-r--r-- | hook-functions | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/hook-functions b/hook-functions index 6d41f2e..fe10cfe 100644 --- a/hook-functions +++ b/hook-functions @@ -226,3 +226,34 @@ EOF } +# minimal supported kernel version +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 +} |