#!/bin/sh -e # # Umount SD Cards before suspend to ram or suspend to disk (hibernate) # That is a workaround for a kernel bug. # see launchped bug tracker # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/477106 # Original version by craptree http://www.mydellmini.com/forum/members/craptree.html # Modified by Frank Becker # Last modified: 2010-04-25 case $1 in hibernate|suspend) for device in `ls /dev/mmcblk[0-9]*p[0-9]*`; do if grep --quiet "$device" /proc/mounts; then umount $device || exit 1 fi done ;; thaw|resume) ;; *) echo $1 ;; esac exit 0