summaryrefslogtreecommitdiffstats
path: root/debian/systemd-boot.postinst
blob: bb06ea3f919359ebf46613edb6f55c3acb77567f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -e

if [ "$1" = configure ] && [ -z "$2" ] && bootctl --print-esp-path > /dev/null 2>&1; then
    bootctl install --make-machine-id-directory=auto

    # register existing kernel(s)
    for k in /boot/vmlinuz-* ; do
        [ -f "$k" ] || continue
        ver=$(basename "$k" | sed s/^vmlinuz-//)
        kernel-install add "$ver" "$k"
    done
fi

if [ "$1" = configure ] && [ -n "$2" ] && bootctl is-installed > /dev/null 2>&1; then
    bootctl update --graceful
fi

#DEBHELPER#