skipcpio: return something at end of program
[dracut.git] / 50-dracut.install
blob02827411f64130bc121b6eae25c68c61b37c1cce
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
5 if [[ -f /etc/kernel/cmdline ]]; then
6 readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
7 fi
9 if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
10 readarray -t BOOT_OPTIONS < /proc/cmdline
13 unset noimageifnotneeded
15 for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
16 if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
17 noimageifnotneeded="yes"
18 break
20 done
22 ret=0
23 case "$1" in
24 add)
25 dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2"
26 ret=$?
28 remove)
29 rm -f -- "$3"/initrd
30 ret=$?
32 esac
33 exit $ret