summaryrefslogtreecommitdiffstats
path: root/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
blob: 8c7cad8fe86433891f2b9fcda469e825e4011135 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

case "$root" in
    live:/dev/*)
        {
            printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \
                "${root#live:/dev/}" "${root#live:}"
            printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \
                "${root#live:/dev/}" "${root#live:}"
        } >> /etc/udev/rules.d/99-live-squash.rules
        wait_for_dev -n "${root#live:}"
        ;;
    live:*)
        if [ -f "${root#live:}" ]; then
            /sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root "${root#live:}"
        fi
        ;;
esac