Created
July 11, 2012 03:59
-
-
Save lueo/3087889 to your computer and use it in GitHub Desktop.
Packaging .deb for cgminer 2.9.5 on xubuntu 64-bit (or ubuntu) using fpm
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 | |
TEMP_PATH=/tmp/cgminer | |
CGMINER_FILE=cgminer-2.9.5-x86_64-built | |
echo '=> Getting cgminer...' | |
if [ ! -e $CGMINER_FILE.tar.bz2 ]; then | |
curl -O http://ck.kolivas.org/apps/cgminer/$CGMINER_FILE.tar.bz2 | |
fi | |
tar jxf $CGMINER_FILE.tar.bz2 | |
if [ -d $TEMP_PATH ]; then | |
rm -rf $TEMP_PATH | |
fi | |
mkdir -p $TEMP_PATH/usr/bin | |
mkdir -p $TEMP_PATH/usr/share/doc/cgminer | |
mkdir -p $TEMP_PATH/usr/lib/cgminer | |
mkdir -p $TEMP_PATH/etc/cgminer | |
echo '=> Preparing packages...' | |
mv $CGMINER_FILE/cgminer $TEMP_PATH/usr/lib/cgminer/ | |
mv $CGMINER_FILE/*.cl $TEMP_PATH/usr/lib/cgminer/ | |
mv $CGMINER_FILE/bitstreams $TEMP_PATH/usr/lib/cgminer/ | |
mv $CGMINER_FILE/example.conf $TEMP_PATH/etc/cgminer/ | |
mv $CGMINER_FILE/* $TEMP_PATH/usr/share/doc/cgminer | |
echo '#!/bin/sh | |
set -e | |
CGMINER_PATH=/usr/lib/cgminer | |
KERNEL_PATH=/usr/lib/cgminer | |
CONFIG_FILE=/etc/cgminer/cgminer.conf | |
export DISPLAY=:0 | |
export GPU_USE_SYNC_OBJECTS=1 | |
cd $KERNEL_PATH | |
if [ -f $CONFIG_FILE ]; then | |
exec $CGMINER_PATH/cgminer -K $KERNEL_PATH -c $CONFIG_FILE "$@" | |
else | |
exec $CGMINER_PATH/cgminer -K $KERNEL_PATH "$@" | |
fi | |
' > $TEMP_PATH/usr/bin/cgminer | |
chmod +x $TEMP_PATH/usr/bin/cgminer | |
echo '=> Packaging...' | |
fpm -s dir -t deb -C /tmp/cgminer -n cgminer -v 2.9.5-0 \ | |
-p cgminer-VERSION_ARCH.deb \ | |
-d "curl" \ | |
-d "libncurses5" \ | |
-m "Leonard Huang <lueotw@gmail.com>" \ | |
--description "GPU FPGA overclock monitor fanspeed GCN RPC linux/windows" \ | |
--url "https://github.com/ckolivas/cgminer" \ | |
usr etc | |
echo '=> Cleaning up...' | |
rm $CGMINER_FILE.tar.bz2 | |
rm -rf $CGMINER_FILE | |
echo '=> Finished!' |
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
{ | |
"pools" : [ | |
{ | |
"url" : "http://stratum.ozco.in:3333", | |
"user" : "1303", | |
"pass" : "1234" | |
}, | |
{ | |
"url" : "http://SOME.COOL.POOL:9332", | |
"user" : "1F67IW9UJF551AELKJMF11AXS", | |
"pass" : "x" | |
} | |
] | |
, | |
"intensity" : "8", | |
"gpu-engine" : "500-920,500-920,500-920,600-1125", | |
"gpu-fan" : "100", | |
"gpu-memdiff" : "-125,-125,-125,-150", | |
"gpu-powertune" : "20", | |
"temp-cutoff" : "99", | |
"temp-overheat" : "95", | |
"temp-target" : "90", | |
"gpu-reorder" : true, | |
"api-listen" : true, | |
"api-port" : "4028", | |
"auto-gpu" : true, | |
"failover-only" : true, | |
"gpu-threads" : "2", | |
"api-allow" : "W:192.168.1.0/24" | |
} |
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
[program:cgminer] | |
# With "-T" cgminer could use stdout and stderr for ouput, omit the curses interface. | |
command=cgminer -T | |
# Environment settings below in supervisord are not needed since they already set in your "cgminer" startup script | |
#environment=DISPLAY=":0",GPU_USE_SYNC_OBJECTS="1" | |
process_name=%(program_name)s | |
user=cgminer | |
priority=400 | |
# To prevent potential harm to your hardware due to incorrect configuration | |
autostart=false | |
autorestart=true | |
redirect_stderr=false | |
stdout_logfile=/var/log/%(program_name)s.log | |
stdout_logfile_maxbytes=1MB | |
stdout_logfile_backups=10 | |
stdout_capture_maxbytes=1MB | |
stderr_logfile=/var/log/%(program_name)s-error.log | |
stderr_logfile_maxbytes=1MB | |
stderr_logfile_backups=10 | |
stderr_capture_maxbytes=1MB |
Added the config I am using.
Added a supervisord config file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to edit your cgminer.conf before starting cgminer:
You can daemonize cgminer with supervisord.