]> git.ipfire.org Git - thirdparty/dracut.git/blame - dracut-initramfs-restore.sh
systemd/service-to-run.sh: silence "cp" errors
[thirdparty/dracut.git] / dracut-initramfs-restore.sh
CommitLineData
fb67e4aa
HH
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
5set -e
6cd /run/initramfs
7IMG="/boot/initramfs-$(uname -r).img"
8[ -f .need_shutdown -a -f "$IMG" ] || exit 1
50bc2253
HH
9if zcat "$IMG" | cpio -id >/dev/null 2>&1; then
10 rm .need_shutdown
11elif xzcat "$IMG" | cpio -id >/dev/null 2>&1; then
12 rm .need_shutdown
13else
14 # something failed, so we clean up
15 rm -f /run/initramfs/shutdown
16 exit 1
17fi
18
19exit 0