Functions taken from the grml distribution