summaryrefslogtreecommitdiffstats
path: root/debian/dracut.postinst
blob: d0b55ed810aa50fea62a8fa66e6de9de14504886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

set -e


mk_initrd() {

    if ls /boot/vmlinu[zx]-* >/dev/null 2>&1; then

    # Regenerate initramfs for all kernel that are installed
    for kversion in `ls /boot/vmlinu[zx]-* | sed -e 's#/boot/vmlinu.-##'`; do
        /etc/kernel/postinst.d/dracut $kversion
    done
    fi
}

if [ "x$1" != xtriggered ]; then
    # activate trigger
    if dpkg-trigger --no-await update-initramfs; then
        echo "update-initramfs: deferring update (trigger activated)"
        exit 0
    fi
else
    mk_initrd
fi

#DEBHELPER#