Remove unnecessary settings on checkisomd5@.service
[platform/upstream/dracut.git] / 50-dracut.install
1 #!/bin/sh
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4
5 if [[ -f /etc/kernel/cmdline ]]; then
6     readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
7 fi
8
9 if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
10     readarray -t BOOT_OPTIONS < /proc/cmdline
11 fi
12
13 unset noimageifnotneeded
14
15 for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
16     if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
17         noimageifnotneeded="yes"
18         break
19     fi
20 done
21
22 ret=0
23 case "$1" in
24     add)
25         dracut ${noimageifnotneeded+--noimageifnotneeded} "$3"/initrd "$2"
26         ret=$?
27         ;;
28     remove)
29         rm -f -- "$3"/initrd
30         ret=$?
31         ;;
32 esac
33 exit $ret