summaryrefslogtreecommitdiff
path: root/mkinitramfs
diff options
context:
space:
mode:
Diffstat (limited to 'mkinitramfs')
-rwxr-xr-xmkinitramfs23
1 files changed, 22 insertions, 1 deletions
diff --git a/mkinitramfs b/mkinitramfs
index 58d42e1..3f0d79b 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -10,7 +10,7 @@ errors_to="2>/dev/null"
# BUSYBOXDIR="/usr/lib/initramfs-tools/bin/"
BUSYBOXDIR="/bin"
-OPTIONS=`getopt -o d:ko:r: -n "$0" -- "$@"`
+OPTIONS=`getopt -o d:ko:r: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"`
# Check for non-GNU getopt
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
@@ -40,6 +40,14 @@ while true; do
# ignore (FIXME: manpage says differently?!?)
shift 2
;;
+ --supported-host-version)
+ supported_host_version="$2"
+ shift 2
+ ;;
+ --supported-target-version)
+ supported_target_version="$2"
+ shift 2
+ ;;
--)
shift
break
@@ -51,6 +59,19 @@ while true; do
esac
done
+if [ -n "$supported_host_version" ] || [ -n "$supported_target_version" ]; then
+ if [ -n "$supported_host_version" ]; then
+ host_upstream_version="${supported_host_version%%-*}"
+ fi
+ if [ -n "$supported_target_version" ]; then
+ target_upstream_version="${supported_target_version%%-*}"
+ if dpkg --compare-versions "$target_upstream_version" lt "2.6.12"; then
+ exit 1
+ fi
+ fi
+ exit 0
+fi
+
# For dependency ordered mkinitramfs hook scripts.
. /usr/share/initramfs-tools/scripts/functions
. /usr/share/initramfs-tools/hook-functions