diff options
Diffstat (limited to 'debian/initramfs-tools.preinst')
-rw-r--r-- | debian/initramfs-tools.preinst | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 3582290..3ec83c6 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -2,13 +2,30 @@ set -e -[ -f /etc/mkinitramfs/initramfs.conf ] && . /etc/mkinitramfs/initramfs.conf +case "$1" in + upgrade) + if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.61"; then + if [ -d /etc/initramfs-tools ]; then + echo + echo "Warning: /etc/initramfs-tools already exists." + echo " Please remove it for upgrade." + echo + exit 1 + fi + if [ -d /etc/mkinitramfs ]; then + mv /etc/mkinitramfs /etc/initramfs-tools + fi + fi + ;; +esac + +[ -f /etc/initramfs-tools/initramfs.conf ] && . /etc/initramfs-tools/initramfs.conf if [ -z ${RESUME} ]; then exit 0 else - mkdir -p /etc/mkinitramfs/conf.d - echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume - sed -i -e "s/RESUME=.*/#RESUME=/" /etc/mkinitramfs/initramfs.conf + mkdir -p /etc/initramfs-tools/conf.d + echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume + sed -i -e "s/RESUME=.*/#RESUME=/" /etc/initramfs-tools/initramfs.conf fi #DEBHELPER# |