Commit 3e332215 authored by philm's avatar philm

fix tribe burg crash bug

parent dc52ce67
......@@ -19,7 +19,7 @@ changelog=burg.Changelog
provides=('burg')
md5sums=('f473ed24228a36d08e861279b26584e7'
'fa7e08137c8736c0b90375f09beaa101'
'49e7f85be82eb8044f6acda2e2a1910a'
'b92d16fe62d577ae511056de6b6b2042'
'e8735e895ebe33638b3ad3e586fee018'
'1dff92d9973ed8eae1a9cb4e7dab842f'
'990eba4f3cb1808c97c2972de6957a3c'
......
--- burg-mkconfig.orig 2011-05-23 10:42:25.000000000 +0200
+++ burg-mkconfig 2011-05-23 10:42:25.000000000 +0200
@@ -305,6 +305,16 @@ for i in ${grub_mkconfig_dir}/* ; do
--- burg-mkconfig~ 2011-05-23 15:40:01.000000000 +0200
+++ burg-mkconfig 2011-05-23 15:40:01.000000000 +0200
@@ -29,6 +29,7 @@ datarootdir=${prefix}/share
datadir=${datarootdir}
pkgdatadir=${datadir}/`echo burg | sed "${transform}"`
grub_cfg=""
+resume_hook=1
grub_mkconfig_dir=${sysconfdir}/burg.d
grub_mkdevicemap=${sbindir}/`echo burg-mkdevicemap | sed ${transform}`
@@ -44,6 +45,7 @@ Generate a grub config file
-o, --output=FILE output generated config to FILE [default=stdout]
-h, --help print this message and exit
-v, --version print the version information and exit
+ -s, --skip-resume disable resume hook setup
Report bugs to <bug-grub@gnu.org>.
EOF
@@ -65,6 +67,9 @@ for option in "$@"; do
--output=*)
grub_cfg=`echo "$option" | sed 's/--output=//'`
;;
+ -s | --skip-resume)
+ resume_hook=0
+ ;;
-*)
echo "Unrecognized option \`$option'" 1>&2
usage
@@ -305,6 +310,18 @@ for i in ${grub_mkconfig_dir}/* ; do
esac
done
+echo "Setup resume hook" >&2
+SWAP=`swapon -a | cat /proc/swaps | grep /dev | cut -d" " -f1`
+if [ -z "${SWAP}" ]; then
+if [ "${resume_hook}" == 1 ]; then
+ echo "Setup resume hook" >&2
+ SWAP=`swapon -a | cat /proc/swaps | grep /dev | cut -d" " -f1`
+ if [ -z "${SWAP}" ]; then
+ echo "No swap partition found. Create one to enable hibernation..." >&2
+else
+ else
+ echo "Adding swap partition $SWAP" >&2
+ SWAPUUID=`blkid $SWAP -s UUID -o value`
+ sed -i -e "s~root=/dev~resume=/dev/disk/by-uuid/${SWAPUUID} root=/dev~g" ${grub_cfg}.new
+ fi
+fi
+
if test "x${grub_cfg}" != "x" ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment