Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mxtools/crashkernel/startup-crashmemory
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
21 lines (19 sloc)
698 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Workaround for systemd versions missing certain ConditionXY= features. | |
# This helper is called by startup-crashmemory.service and creates | |
# /node/startup-crashmemory/available | |
# So other services can use | |
# Wants=startup-crashmemory.service | |
# After=startup-crashmemory.service | |
# ConditionPathExists=/node/startup-crashmemory/available | |
# to start a unit only if the memory can be used | |
# | |
kexec_crash_size='0' | |
if [ -e /sys/kernel/kexec_crash_size ]; then | |
kexec_crash_size=$(cat /sys/kernel/kexec_crash_size) | |
fi | |
mkdir -p /node/startup-crashmemory | |
rm /node/startup-crashmemory/* 2>/dev/null | |
if [ "$kexec_crash_size" != "0" ] ; then | |
touch /node/startup-crashmemory/available | |
fi |