File: zfs-env-bootfs.service.in

package info (click to toggle)
zfs-linux 2.1.11-1%2Bdeb12u1
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 77,344 kB
  • sloc: ansic: 376,447; sh: 59,625; python: 7,872; asm: 6,476; makefile: 5,812; perl: 770; sed: 41; awk: 5
file content (23 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[Unit]
Description=Set BOOTFS and BOOTFSFLAGS environment variables for dracut
DefaultDependencies=no
After=zfs-import-cache.service
After=zfs-import-scan.service
Before=zfs-import.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c '                                                                         \
    . /lib/dracut-zfs-lib.sh;                                                                  \
    decode_root_args || exit 0;                                                                \
    [ "$root" = "zfs:AUTO" ] && root="$(@sbindir@/zpool list -H -o bootfs | grep -m1 -vFx -)"; \
    rootflags="$(getarg rootflags=)";                                                          \
    case ",$rootflags," in                                                                     \
        *,zfsutil,*) ;;                                                                        \
        ,,) rootflags=zfsutil ;;                                                               \
        *)  rootflags="zfsutil,$rootflags" ;;                                                  \
    esac;                                                                                      \
    exec systemctl set-environment BOOTFS="$root" BOOTFSFLAGS="$rootflags"'

[Install]
WantedBy=zfs-import.target