Last active
November 5, 2017 05:52
-
-
Save CzBiX/8608f3520b92a77c79e0 to your computer and use it in GitHub Desktop.
Patch unity to fix this bug: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1170647
This file contains hidden or 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/bash | |
# Author: CzBiX | |
# URL: https://gist.github.com/CzBiX/8608f3520b92a77c79e0 | |
DEST_PACKAGE="unity" | |
DEST_VERSION="7.3.2+15.10.20151016-0ubuntu1" | |
DEST_FILE="/usr/lib/compiz/libunityshell.so" | |
DEST_FILE_HASH="d1be69f0dc23f8a69441359b9aea27f4" | |
PATCH_DATA="341b76: 909090909090" | |
SUCCESS_MSG="Please log out to make patch work." | |
function failed { | |
echo >&2 $1; | |
exit 1; | |
} | |
[ $(arch) == 'x86_64' ] || failed "only support x86_64." | |
type xxd >/dev/null 2>&1 || failed "xxd not found, please install vim." | |
[ $(apt-cache policy $DEST_PACKAGE | grep Installed | cut -d ' ' -f 4) == $DEST_VERSION ] || failed "$DEST_PACKAGE version not match with '$DEST_VERSION'." | |
[ $(md5sum $DEST_FILE | cut -d ' ' -f 1) == $DEST_FILE_HASH ] || failed "dest file hash not match" | |
echo $PATCH_DATA | sudo xxd -r - $DEST_FILE || failed "patch failed." | |
echo $SUCCESS_MSG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, worked like charm