├── config ├── etc │ ├── issue │ ├── sysctl.d │ │ ├── miner.conf │ │ └── panic.conf │ ├── apt │ │ ├── apt.conf.d │ │ │ └── timeout.conf │ │ └── sources.list │ ├── systemd │ │ ├── system │ │ │ ├── networking.service.d │ │ │ │ └── timeout.conf │ │ │ ├── getty@tty1.service.d │ │ │ │ └── autologin.conf │ │ │ └── xmr-stak.service │ │ └── system.conf │ ├── xmr-stak │ │ ├── cpu.txt │ │ └── config.txt │ ├── casper.conf │ ├── modprobe.d │ │ └── blacklist.conf │ └── usbmount │ │ └── usbmount.conf ├── userlist ├── usr │ └── share │ │ └── plymouth │ │ └── themes │ │ └── ubuntu-text │ │ └── ubuntu-text.plymouth └── boot │ └── grub │ └── grub.cfg ├── .gitignore ├── script ├── xmr-stak ├── libxmr-stak-c.a ├── libxmr-stak-backend.a ├── update-squashfs.sh ├── compile-xmr-stak.sh ├── write-image.sh └── prepare_rootfs.sh ├── README.md └── Makefile /config/etc/issue: -------------------------------------------------------------------------------- 1 | James Miner Live \n \l 2 | 3 | -------------------------------------------------------------------------------- /config/etc/sysctl.d/miner.conf: -------------------------------------------------------------------------------- 1 | vm.nr_hugepages=64 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iso 2 | *.tar.gz 3 | *.zip 4 | rootfs/ 5 | image/ 6 | -------------------------------------------------------------------------------- /config/etc/apt/apt.conf.d/timeout.conf: -------------------------------------------------------------------------------- 1 | Acquire::http::Timeout "3"; 2 | -------------------------------------------------------------------------------- /config/etc/sysctl.d/panic.conf: -------------------------------------------------------------------------------- 1 | kernel.panic = 20 2 | kernel.sysrq = 1 3 | -------------------------------------------------------------------------------- /config/userlist: -------------------------------------------------------------------------------- 1 | iot:internetofshit:10000:10000:miner default user:/home/iot:/bin/bash 2 | -------------------------------------------------------------------------------- /config/etc/systemd/system/networking.service.d/timeout.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | TimeoutStartSec=0 3 | -------------------------------------------------------------------------------- /script/xmr-stak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jamesits/ubuntu-live-miner-x86_64/HEAD/script/xmr-stak -------------------------------------------------------------------------------- /script/libxmr-stak-c.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jamesits/ubuntu-live-miner-x86_64/HEAD/script/libxmr-stak-c.a -------------------------------------------------------------------------------- /script/libxmr-stak-backend.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jamesits/ubuntu-live-miner-x86_64/HEAD/script/libxmr-stak-backend.a -------------------------------------------------------------------------------- /config/etc/xmr-stak/cpu.txt: -------------------------------------------------------------------------------- 1 | "cpu_threads_conf" : 2 | [ 3 | { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : false }, 4 | ] 5 | 6 | 7 | -------------------------------------------------------------------------------- /config/etc/systemd/system/getty@tty1.service.d/autologin.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStart= 3 | ExecStart=-/usr/bin/agetty --autologin siggen --noclear %I $TERM 4 | -------------------------------------------------------------------------------- /config/usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth: -------------------------------------------------------------------------------- 1 | [Plymouth Theme] 2 | Name=Ubuntu Text 3 | Description=Text mode theme based on ubuntu-logo theme 4 | ModuleName=ubuntu-text 5 | 6 | [ubuntu-text] 7 | title=Miner Live! 8 | black=0x000000 9 | white=0xffffff 10 | brown=0xff4012 11 | blue=0x988592 12 | -------------------------------------------------------------------------------- /script/update-squashfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euv 3 | 4 | BOOT=/cdrom 5 | SOURCE=/media/usb1 6 | 7 | mount -o rw,remount /cdrom 8 | 9 | # copy grub config 10 | cp ${SOURCE}/boot/grub/grub.cfg ${BOOT}/boot/grub/grub.cfg 11 | 12 | # copy system image 13 | cp -v ${SOURCE}/casper/* ${BOOT}/casper 14 | 15 | # flush buffer 16 | sync 17 | sync 18 | -------------------------------------------------------------------------------- /config/etc/casper.conf: -------------------------------------------------------------------------------- 1 | # This file should go in /etc/casper.conf 2 | # Supported variables are: 3 | # USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM, FLAVOUR 4 | 5 | export USERNAME="ubuntu" 6 | export USERFULLNAME="default user" 7 | export HOST="miner-live" 8 | export BUILD_SYSTEM="Ubuntu" 9 | 10 | # USERNAME and HOSTNAME as specified above won't be honoured and will be set to 11 | # flavour string acquired at boot time, unless you set FLAVOUR to any 12 | # non-empty string. 13 | 14 | export FLAVOUR="MinerLive!" 15 | -------------------------------------------------------------------------------- /config/boot/grub/grub.cfg: -------------------------------------------------------------------------------- 1 | if loadfont /boot/grub/font.pf3 ; then 2 | set gfxmode=auto 3 | insmod efi_gop 4 | insmod efi_uga 5 | insmod gfxterm 6 | terminal_output gfxterm 7 | fi 8 | 9 | set menu_color_normal=white/black 10 | set menu_color_highlight=black/light-gray 11 | set timeout=2 12 | 13 | menuentry "James Miner Live!" { 14 | set gfxpayload=keep 15 | linux /casper/vmlinuz boot=casper root=/casper/filesystem.squashfs initrd=/casper/initrd.gz quiet splash --- 16 | initrd /casper/initrd.gz 17 | } 18 | 19 | menuentry "Test memory" { 20 | linux16 /install/mt86plus 21 | } 22 | -------------------------------------------------------------------------------- /script/compile-xmr-stak.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euv 3 | 4 | # run as root 5 | 6 | # install build dependencies 7 | apt-get -y install git-core cmake build-essential libmicrohttpd-dev libssl-dev libhwloc-dev 8 | 9 | # get source code 10 | cd /tmp 11 | git clone https://github.com/fireice-uk/xmr-stak.git 12 | 13 | # remove donation 14 | cd xmr-stak 15 | sed -ie "s/2\.0/0\.0/g" xmrstak/donate-level.hpp 16 | 17 | # build 18 | mkdir build 19 | cd build 20 | cmake .. -DCMAKE_BUILD_TYPE=Release -DMICROHTTPD_ENABLE=ON -DOpenSSL_ENABLE=ON -DCPU_ENABLE=ON -DHWLOC_ENABLE=ON -DOpenCL_ENABLE=OFF -DCUDA_ENABLE=OFF 21 | make 22 | 23 | # get binaries from /tmp/xmr-stak/build/bin 24 | cd bin 25 | install xmr-stak libxmr-stak*.a /usr/local/bin 26 | -------------------------------------------------------------------------------- /script/write-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euv 3 | 4 | DEVICE=/dev/mmcblk0 5 | 6 | # create GPT table 7 | sgdisk -og ${DEVICE} 8 | 9 | # create EFI partition 10 | ENDSECTOR=`sgdisk -E ${DEVICE}` 11 | sgdisk -n 1:2048:${ENDSECTOR} -c 1:"SigGen Live!" -t 1:ef00 ${DEVICE} 12 | 13 | # print partition table 14 | sgdisk -p ${DEVICE} 15 | 16 | # format disk 17 | mkfs -t vfat ${DEVICE}p1 18 | 19 | # install grub 20 | mkdir -p /media/efi 21 | mount ${DEVICE}p1 /media/efi 22 | grub-install --force --recheck --root-directory=/media/efi --efi-directory=/media/efi --uefi-secure-boot ${DEVICE} 23 | 24 | # copy grub config 25 | cp /cdrom/boot/grub/grub.cfg /media/efi/boot/grub/grub.cfg 26 | 27 | # copy system image 28 | mkdir -p /media/efi/casper 29 | cp -v /cdrom/casper/* /media/efi/casper 30 | 31 | # flush buffer 32 | sync 33 | sync 34 | -------------------------------------------------------------------------------- /config/etc/systemd/system.conf: -------------------------------------------------------------------------------- 1 | # This file is part of systemd. 2 | # 3 | # systemd is free software; you can redistribute it and/or modify it 4 | # under the terms of the GNU Lesser General Public License as published by 5 | # the Free Software Foundation; either version 2.1 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # Entries in this file show the compile time defaults. 9 | # You can change settings by editing this file. 10 | # Defaults can be restored by simply deleting this file. 11 | # 12 | # See systemd-system.conf(5) for details. 13 | 14 | [Manager] 15 | #LogLevel=info 16 | #LogTarget=journal-or-kmsg 17 | #LogColor=yes 18 | #LogLocation=no 19 | #DumpCore=yes 20 | #ShowStatus=yes 21 | #CrashChangeVT=no 22 | #CrashShell=no 23 | CrashReboot=yes 24 | #CPUAffinity=1 2 25 | #JoinControllers=cpu,cpuacct net_cls,net_prio 26 | #RuntimeWatchdogSec=0 27 | #ShutdownWatchdogSec=10min 28 | #CapabilityBoundingSet= 29 | #SystemCallArchitectures= 30 | #TimerSlackNSec= 31 | #DefaultTimerAccuracySec=1min 32 | #DefaultStandardOutput=journal 33 | #DefaultStandardError=inherit 34 | #DefaultTimeoutStartSec=90s 35 | #DefaultTimeoutStopSec=90s 36 | DefaultRestartSec=3s 37 | DefaultStartLimitInterval=10s 38 | DefaultStartLimitBurst=10 39 | #DefaultEnvironment= 40 | #DefaultCPUAccounting=no 41 | #DefaultBlockIOAccounting=no 42 | #DefaultMemoryAccounting=no 43 | #DefaultTasksAccounting=no 44 | #DefaultTasksMax= 45 | #DefaultLimitCPU= 46 | #DefaultLimitFSIZE= 47 | #DefaultLimitDATA= 48 | #DefaultLimitSTACK= 49 | #DefaultLimitCORE= 50 | #DefaultLimitRSS= 51 | #DefaultLimitNOFILE= 52 | #DefaultLimitAS= 53 | #DefaultLimitNPROC= 54 | #DefaultLimitMEMLOCK= 55 | #DefaultLimitLOCKS= 56 | #DefaultLimitSIGPENDING= 57 | #DefaultLimitMSGQUEUE= 58 | #DefaultLimitNICE= 59 | #DefaultLimitRTPRIO= 60 | #DefaultLimitRTTIME= 61 | -------------------------------------------------------------------------------- /config/etc/modprobe.d/blacklist.conf: -------------------------------------------------------------------------------- 1 | # This file lists those modules which we don't want to be loaded by 2 | # alias expansion, usually so some other driver will be loaded for the 3 | # device instead. 4 | 5 | # evbug is a debug tool that should be loaded explicitly 6 | blacklist evbug 7 | 8 | # these drivers are very simple, the HID drivers are usually preferred 9 | blacklist usbmouse 10 | blacklist usbkbd 11 | 12 | # replaced by e100 13 | blacklist eepro100 14 | 15 | # replaced by tulip 16 | blacklist de4x5 17 | 18 | # causes no end of confusion by creating unexpected network interfaces 19 | blacklist eth1394 20 | 21 | # snd_intel8x0m can interfere with snd_intel8x0, doesn't seem to support much 22 | # hardware on its own (Ubuntu bug #2011, #6810) 23 | blacklist snd_intel8x0m 24 | 25 | # Conflicts with dvb driver (which is better for handling this device) 26 | blacklist snd_aw2 27 | 28 | # causes failure to suspend on HP compaq nc6000 (Ubuntu: #10306) 29 | blacklist i2c_i801 30 | 31 | # replaced by p54pci 32 | blacklist prism54 33 | 34 | # replaced by b43 and ssb. 35 | blacklist bcm43xx 36 | 37 | # most apps now use garmin usb driver directly (Ubuntu: #114565) 38 | blacklist garmin_gps 39 | 40 | # replaced by asus-laptop (Ubuntu: #184721) 41 | blacklist asus_acpi 42 | 43 | # low-quality, just noise when being used for sound playback, causes 44 | # hangs at desktop session start (Ubuntu: #246969) 45 | blacklist snd_pcsp 46 | 47 | # ugly and loud noise, getting on everyone's nerves; this should be done by a 48 | # nice pulseaudio bing (Ubuntu: #77010) 49 | blacklist pcspkr 50 | 51 | # EDAC driver for amd76x clashes with the agp driver preventing the aperture 52 | # from being initialised (Ubuntu: #297750). Blacklist so that the driver 53 | # continues to build and is installable for the few cases where its 54 | # really needed. 55 | blacklist amd76x_edac 56 | 57 | # no Intel ME 58 | blacklist mei_txe 59 | -------------------------------------------------------------------------------- /config/etc/systemd/system/xmr-stak.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=xmr-stak miner 3 | After=network.target 4 | After=syslog.target 5 | 6 | [Install] 7 | WantedBy=multi-user.target 8 | Alias=xmr.service 9 | Alias=miner.service 10 | 11 | [Service] 12 | User=root 13 | Group=root 14 | Type=idle 15 | # Setting this to true can break replication and the Type=notify settings 16 | # See also bind-address mysqld option. 17 | PrivateNetwork=false 18 | #CapabilityBoundingSet= 19 | # Prevent writes to /usr, /boot 20 | ProtectSystem=false 21 | # NoNewPrivileges=true 22 | PrivateDevices=true 23 | # Prevent accessing /home, /root and /run/user 24 | ProtectHome=true 25 | # Execute pre and post scripts as root, otherwise it does it as User= 26 | PermissionsStartOnly=true 27 | # Working directory 28 | WorkingDirectory=/etc/xmr-stak 29 | # apply user provided config file 30 | ExecStartPre=-/bin/cp /cdrom/xmr-stak/config.txt /etc/xmr-stak/config.txt 31 | ExecStartPre=-/bin/cp /cdrom/xmr-stak/cpu.txt /etc/xmr-stak/cpu.txt 32 | ExecStartPre=-/bin/cp /cdrom/xmr-stak/nvidia.txt /etc/xmr-stak/nvidia.txt 33 | ExecStartPre=-/bin/cp /cdrom/xmr-stak/amd.txt /etc/xmr-stak/amd.txt 34 | ExecStartPre=-/bin/cp /cdrom/xmr-stak/xmr-stak /usr/local/bin/xmr-stak 35 | ExecStartPre=-/bin/chmod +x /usr/local/bin/xmr-stak 36 | ExecStart=/usr/local/bin/xmr-stak 37 | #KillMode=process 38 | #KillSignal=SIGTERM 39 | # Don't want to see an automated SIGKILL ever 40 | #SendSIGKILL=no 41 | Restart=always 42 | RestartSec=5s 43 | UMask=007 44 | 45 | # Kernels like killing mysqld when out of memory because its big. 46 | # Lets temper that preference a little. 47 | # OOMScoreAdjust=-600 48 | 49 | # Explicitly start with high IO priority 50 | # BlockIOWeight=1000 51 | 52 | # If you don't use the /tmp directory for SELECT ... OUTFILE and 53 | # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. 54 | PrivateTmp=false 55 | 56 | # Number of files limit. 57 | #LimitNOFILE=16364 58 | 59 | # Maximium core size. 60 | # LimitCore= 61 | 62 | # Nice priority. 63 | # Nice=-5 64 | 65 | # crash-script equalivent 66 | # FailureAction= 67 | -------------------------------------------------------------------------------- /script/prepare_rootfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euv 3 | 4 | # execute in chroot env 5 | if [ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]; then 6 | echo "This script is intended to be executed in chroot environment. Quitting." 7 | exit 1 8 | fi 9 | 10 | export DEBIAN_FRONTEND=noninteractive 11 | export HOME=/root 12 | export LC_ALL=C 13 | 14 | # unmount previous mounted filesystem to prevent error 15 | umount -lf /proc || true 16 | umount -lf /sys || true 17 | umount -lf /dev/pts || true 18 | 19 | # mount things 20 | mount none -t proc /proc || true 21 | mount none -t sysfs /sys || true 22 | mount none -t devpts /dev/pts || true 23 | 24 | # update package list 25 | apt-get update 26 | 27 | # initialize dbus 28 | apt-get install -y dbus 29 | dbus-uuidgen > /var/lib/dbus/machine-id 30 | 31 | # install livecd packages 32 | apt-get -y upgrade 33 | apt-get install -y ubuntu-standard casper lupin-casper discover laptop-detect os-prober plymouth-x11 openssh-server usbmount util-linux gdisk avahi-autoipd 34 | apt-get install -y --install-recommends linux-generic-hwe-16.04 linux-tools-generic-hwe-16.04 linux-tools-common 35 | apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install grub-efi-amd64 grub-efi-amd64-signed 36 | systemctl enable ssh 37 | 38 | # config plymouth 39 | cp /tmp/ubuntu-text.plymouth /usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth 40 | 41 | # set up new user 42 | newusers /tmp/userlist 43 | 44 | # set up user privileges 45 | while read u; do 46 | adduser ${u} sudo 47 | adduser ${u} video 48 | adduser ${u} audio 49 | done < <(cut -d":" -f1 /tmp/userlist) 50 | 51 | # install packages required by xmr-stak and used for debugging 52 | apt-get install -y libhwloc5 hwloc libmicrohttpd10 htop hwloc lm-sensors i7z byobu w3m 53 | systemctl enable xmr-stak.service 54 | 55 | # rebuild initramfs 56 | update-initramfs -u -k all 57 | 58 | # cleanup 59 | rm /var/lib/dbus/machine-id 60 | apt-get autoremove -y --purge 61 | apt-get clean -y 62 | rm -rf /var/lib/apt/lists/* 63 | rm -rf /tmp/* 64 | rm /etc/resolv.conf 65 | ln -s /run/resolvconf/resolv.conf /etc/resolv.conf 66 | 67 | # unmount filesystems 68 | umount -lf /proc || true 69 | umount -lf /sys || true 70 | umount -lf /dev/pts || true 71 | -------------------------------------------------------------------------------- /config/etc/apt/sources.list: -------------------------------------------------------------------------------- 1 | # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to 2 | # newer versions of the distribution. 3 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted 4 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted 5 | 6 | ## Major bug fix updates produced after the final release of the 7 | ## distribution. 8 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted 9 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted 10 | 11 | ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 12 | ## team. Also, please note that software in universe WILL NOT receive any 13 | ## review or updates from the Ubuntu security team. 14 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe 15 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe 16 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe 17 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe 18 | 19 | ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 20 | ## team, and may not be under a free licence. Please satisfy yourself as to 21 | ## your rights to cne the software. Also, please note that software in 22 | ## multiverse WILL NOT receive any review or updates from the Ubuntu 23 | ## security team. 24 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse 25 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse 26 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse 27 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse 28 | 29 | ## N.B. software from this repository may not have been tested as 30 | ## extensively as that contained in the main release, although it includes 31 | ## newer versions of some applications which may provide cneful features. 32 | ## Also, please note that software in backports WILL NOT receive any review 33 | ## or updates from the Ubuntu security team. 34 | deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse 35 | deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse 36 | 37 | ## Uncomment the following two lines to add software from Canonical's 38 | ## 'partner' repository. 39 | ## This software is not part of Ubuntu, but is offered by Canonical and the 40 | ## respective vendors as a service to Ubuntu cners. 41 | deb http://archive.canonical.com/ubuntu xenial partner 42 | deb-src http://archive.canonical.com/ubuntu xenial partner 43 | 44 | deb http://security.ubuntu.com/ubuntu xenial-security main restricted 45 | deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted 46 | deb http://security.ubuntu.com/ubuntu xenial-security universe 47 | deb-src http://security.ubuntu.com/ubuntu xenial-security universe 48 | deb http://security.ubuntu.com/ubuntu xenial-security multiverse 49 | deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse 50 | 51 | -------------------------------------------------------------------------------- /config/etc/usbmount/usbmount.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for the usbmount package, which mounts removable 2 | # storage devices when they are plugged in and unmounts them when they 3 | # are removed. 4 | 5 | # Change to zero to disable usbmount 6 | ENABLED=1 7 | 8 | # Mountpoints: These directories are eligible as mointpoints for 9 | # removable storage devices. A newly plugged in device is mounted on 10 | # the first directory in this list that exists and on which nothing is 11 | # mounted yet. 12 | MOUNTPOINTS="/media/usb0 /media/usb1 /media/usb2 /media/usb3 13 | /media/usb4 /media/usb5 /media/usb6 /media/usb7" 14 | 15 | # Filesystem types: removable storage devices are only mounted if they 16 | # contain a filesystem type which is in this list. 17 | FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus" 18 | 19 | ############################################################################# 20 | # WARNING! # 21 | # # 22 | # The "sync" option may not be a good choice to use with flash drives, as # 23 | # it forces a greater amount of writing operating on the drive. This makes # 24 | # the writing speed considerably lower and also leads to a faster wear out # 25 | # of the disk. # 26 | # # 27 | # If you omit it, don't forget to use the command "sync" to synchronize the # 28 | # data on your disk before removing the drive or you may experience data # 29 | # loss. # 30 | # # 31 | # It is highly recommended that you use the pumount command (as a regular # 32 | # user) before unplugging the device. It makes calling the "sync" command # 33 | # and mounting with the sync option unnecessary---this is similar to other # 34 | # operating system's "safely disconnect the device" option. # 35 | ############################################################################# 36 | # Mount options: Options passed to the mount command with the -o flag. 37 | # See the warning above regarding removing "sync" from the options. 38 | MOUNTOPTIONS="ro,sync,noexec,nodev,noatime,nodiratime" 39 | 40 | # Filesystem type specific mount options: This variable contains a space 41 | # separated list of strings, each which the form "-fstype=TYPE,OPTIONS". 42 | # 43 | # If a filesystem with a type listed here is mounted, the corresponding 44 | # options are appended to those specificed in the MOUNTOPTIONS variable. 45 | # 46 | # For example, "-fstype=vfat,gid=floppy,dmask=0007,fmask=0117" would add 47 | # the options "gid=floppy,dmask=0007,fmask=0117" when a vfat filesystem 48 | # is mounted. 49 | FS_MOUNTOPTIONS="" 50 | 51 | # If set to "yes", more information will be logged via the syslog 52 | # facility. 53 | VERBOSE=no 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ubuntu Auto Miner LiveCD 2 | 3 | Ubuntu LiveCD with xmr-stak pre-installed and pre-configured. Plug and mine! 4 | 5 | * Super light: ~400M rootfs, ~270M memory, <10s boot time 6 | * Super easy: plug, boot, mine 7 | * Super power: latest xmr-stak optimized for newer Intel CPU with large L3/L4 caches 8 | 9 | [Download](https://github.com/Jamesits/ubuntu-live-miner-x86_64/releases/latest) 10 | 11 | ## Caveats 12 | 13 | * CPU mining only. No support for graphics card. 14 | * EFI boot only. Legacy/CSM is not supported nor tested. 15 | * I recommend put the miners into a special LAN segment/VLAN and apply firewall rules (block all incoming requests). 16 | * The embedded `xmr-stak` is built on my Intel i7-4770HQ with `--march=native`. It may cause issues on other platforms. 17 | 18 | ## Usage 19 | 20 | Burn the iso to USB disk using [Rufus](https://rufus.akeo.ie/) or other software, or just create a FAT32 partition with EFI boot flag set and uncompress the files into it. Plug in USB disk to destination PC and it should boot then start mining. 21 | 22 | Login credential: 23 | 24 | * Username `iot` 25 | * Password `internetofshit` 26 | 27 | You can log in using SSH. 28 | 29 | To see miner speed report visit `http://your_miner_ip:9000`. The login credential is the same as above (if not overrided by your own `config.txt`). 30 | 31 | ## Configuration 32 | 33 | ### Networking 34 | 35 | It accepts DHCPv4 and IPv6 SLAAC. 36 | 37 | If you need static IP address, add `ip=IFACE,ADDRESS,NETMASK,GATEWAY[:IFACE,ADDRESS,NETMASK,GATEWAY]*` to `boot/grub/grub.cfg` kernel comandline. 38 | 39 | ### Provide your own xmr-stak config 40 | 41 | Put configuration (`{config,cpu}.txt`) in `xmr-stak` folder in USB disk root. It will be applied at boot. If you want to provide your own `xmr-stak` executable you can put that in too. 42 | 43 | If you don't provide your own config, it will mine Monero using one CPU core as a test load. 44 | 45 | ### Load OS to RAM (Optional) 46 | 47 | You can load the root filesystem to RAM, so you can unplug the USB disk after system boot and it will continue to run. It requires ~460MB of RAM space and the boot time will be slightly longer. 48 | 49 | Edit `boot/grub/grub.cfg`, add `toram` to kernel commandline. 50 | 51 | ## Build 52 | 53 | ### Build xmr-stak binary 54 | 55 | The provided `xmr-stak` binary is built using [this script](script/compile-xmr-stak.sh). 56 | 57 | ### Build Live CD 58 | 59 | Caveat: There are some cases build script will umount `/dev` or `/proc` on build server. **Prepare to hard reset build server at any time.** 60 | 61 | Start from a Ubuntu 16.04 64-bit: 62 | 63 | ```shell 64 | # first execution 65 | sudo make requirements 66 | # otherwise clean build temp files first 67 | sudo make clean 68 | 69 | # then build iso 70 | sudo make all 71 | ``` 72 | 73 | If you got some download error/hash sum mismatch error in the build process, run `sudo make all` again. 74 | 75 | ## Donation 76 | 77 | Please donate if you like my work! 78 | 79 | * BTC `1Cm42dB58VcHFC4HZSToMESGbXJr82JaSZ` 80 | * ETH `0x6fDEb40271b9E027CAF6Fb4feBF5432a9F36EF1F` 81 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION=16.04.4 2 | CODENAME=xenial 3 | ARCH=amd64 4 | VOLUME_ID="Miner_Live_AMD64" 5 | DEBIAN_FRONTEND=noninteractive 6 | 7 | .PHONY: clean clean-cache clean-all requirements restore-rootfs 8 | 9 | clean: 10 | umount -lf rootfs/dev/pts || true 11 | umount -lf rootfs/proc || true 12 | umount -lf rootfs/sys || true 13 | umount -lf rootfs/dev || true 14 | rm -r rootfs || true 15 | rm -r image || true 16 | rm -r miner-$(VERSION)-livecd-$(ARCH).iso || true 17 | 18 | clean-cache: 19 | rm rootfs_cache.tar.gz || true 20 | 21 | clean-all: clean clean-cache 22 | 23 | requirements: 24 | apt-get install dumpet xorriso squashfs-tools gddrescue debootstrap 25 | 26 | ubuntu-$(VERSION)-server-$(ARCH).iso: 27 | wget https://mirrors4.tuna.tsinghua.edu.cn/ubuntu-releases/$(VERSION)/ubuntu-$(VERSION)-server-$(ARCH).iso 28 | 29 | rootfs: 30 | rm -r build/rootfs || true 31 | mkdir -p build/rootfs 32 | debootstrap --arch=$(ARCH) $(CODENAME) build/rootfs http://cn.archive.ubuntu.com/ubuntu 33 | mv build/rootfs rootfs 34 | cp /etc/hosts rootfs/etc/hosts 35 | cp /etc/resolv.conf rootfs/etc/resolv.conf 36 | sed -e "s/xenial/$(CODENAME)/g" config/etc/apt/sources.list > rootfs/etc/apt/sources.list 37 | cp config/etc/modprobe.d/blacklist.conf rootfs/etc/modprobe.d/blacklist.conf 38 | mkdir -p rootfs/etc/systemd/system/networking.service.d 39 | cp config/etc/systemd/system/networking.service.d/timeout.conf rootfs/etc/systemd/system/networking.service.d/timeout.conf 40 | 41 | rootfs_cache.tar.gz: rootfs 42 | tar -cvzf rootfs_cache.tar.gz rootfs 43 | 44 | restore-rootfs: 45 | rm -r rootfs || true 46 | tar -xvzf rootfs_cache.tar.gz 47 | 48 | rootfs/etc/siggen-release: rootfs 49 | mount --bind /dev rootfs/dev 50 | # copy files before chroot 51 | cp config/userlist rootfs/tmp/userlist 52 | cp config/usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth rootfs/tmp/ubuntu-text.plymouth 53 | cp script/write-image.sh rootfs/usr/local/bin/write-image 54 | cp script/update-squashfs.sh rootfs/usr/local/bin/update-squashfs 55 | cp script/prepare_rootfs.sh rootfs/tmp/prepare_rootfs.sh 56 | cp config/etc/apt/apt.conf.d/timeout.conf rootfs/etc/apt/apt.conf.d/timeout.conf 57 | cp config/etc/systemd/system/xmr-stak.service rootfs/etc/systemd/system/xmr-stak.service 58 | cp script/xmr-stak rootfs/usr/local/bin/xmr-stak 59 | cp script/libxmr-stak-backend.a rootfs/usr/local/bin/libxmr-stak-backend.a 60 | cp script/libxmr-stak-c.a rootfs/usr/local/bin/libxmr-stak-c.a 61 | cp -r config/etc/xmr-stak rootfs/etc/xmr-stak 62 | # prepare os 63 | chroot rootfs /tmp/prepare_rootfs.sh 64 | # copy files after chroot 65 | rm rootfs/tmp/prepare_rootfs.sh || true 66 | cp config/etc/casper.conf rootfs/etc/casper.conf 67 | cp config/etc/usbmount/usbmount.conf rootfs/etc/usbmount/usbmount.conf 68 | cp config/etc/sysctl.d/panic.conf rootfs/etc/sysctl.d/panic.conf 69 | cp config/etc/sysctl.d/miner.conf rootfs/etc/sysctl.d/miner.conf 70 | cp config/etc/systemd/system.conf rootfs/etc/systemd/system.conf 71 | cp config/etc/issue rootfs/etc/issue 72 | cp rootfs/etc/os-release rootfs/etc/siggen-release 73 | umount -lf rootfs/dev/pts || true 74 | umount -lf rootfs/sys || true 75 | umount -lf rootfs/proc || true 76 | umount -lf rootfs/dev || true 77 | 78 | miner-$(VERSION)-livecd-$(ARCH).iso: rootfs rootfs/etc/siggen-release ubuntu-$(VERSION)-server-$(ARCH).iso 79 | # extract origin iso 80 | rm -r image || true 81 | xorriso -osirrox on -indev ubuntu-$(VERSION)-server-$(ARCH).iso -extract / image 82 | # remove installation files 83 | rm -r image/dists image/doc image/pics image/pool image/preseed image/install || true 84 | # populate boot files 85 | mkdir -p image/casper image/isolinux 86 | cp -v rootfs/boot/vmlinuz* image/casper/vmlinuz 87 | cp -v rootfs/boot/initrd.img* image/casper/initrd.gz 88 | cp -v config/boot/grub/grub.cfg image/boot/grub/grub.cfg 89 | dd if=ubuntu-$(VERSION)-server-$(ARCH).iso bs=512 count=1 of=image/isolinux/isohdpfx.bin 90 | # make squashfs 91 | rm image/casper/filesystem.squashfs || true 92 | mksquashfs rootfs/ image/casper/filesystem.squashfs 93 | # make iso 94 | sh -c "cd image; xorriso -as mkisofs -isohybrid-mbr isolinux/isohdpfx.bin -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -volid $(VOLUME_ID) -o ../miner-$(VERSION)-livecd-$(ARCH).iso ." 95 | 96 | all: miner-$(VERSION)-livecd-$(ARCH).iso 97 | -------------------------------------------------------------------------------- /config/etc/xmr-stak/config.txt: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * pool_address - Pool address should be in the form "pool.supportxmr.com:3333". Only stratum pools are supported. 4 | * wallet_address - Your wallet, or pool login. 5 | * pool_password - Can be empty in most cases or "x". 6 | * use_nicehash - Limit the nonce to 3 bytes as required by nicehash. 7 | * use_tls - This option will make us connect using Transport Layer Security. 8 | * tls_fingerprint - Server's SHA256 fingerprint. If this string is non-empty then we will check the server's cert against it. 9 | * pool_weight - Pool weight is a number telling the miner how important the pool is. Miner will mine mostly at the pool 10 | * with the highest weight, unless the pool fails. Weight must be an integer larger than 0. 11 | * 12 | * We feature pools up to 1MH/s. For a more complete list see M5M400's pool list at www.moneropools.com 13 | */ 14 | "pool_list" : 15 | [ 16 | {"pool_address" : "pool.electroneum.space:5555", "wallet_address" : "etnkGeJXNi3JyEL3FnKiA6gVcBXHevrx5GyyuQXAUivyYYaej3LYaxo1boFtd39PHLF9UDVWaWtzRVnR7ZAXmnEK1QcPYis4HD", "pool_password" : "x", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 1 }, 17 | ], 18 | 19 | /* 20 | * currency to mine 21 | * allowed values: 'monero' or 'aeon' 22 | */ 23 | "currency" : "monero", 24 | 25 | /* 26 | * Network timeouts. 27 | * Because of the way this client is written it doesn't need to constantly talk (keep-alive) to the server to make 28 | * sure it is there. We detect a buggy / overloaded server by the call timeout. The default values will be ok for 29 | * nearly all cases. If they aren't the pool has most likely overload issues. Low call timeout values are preferable - 30 | * long timeouts mean that we waste hashes on potentially stale jobs. Connection report will tell you how long the 31 | * server usually takes to process our calls. 32 | * 33 | * call_timeout - How long should we wait for a response from the server before we assume it is dead and drop the connection. 34 | * retry_time - How long should we wait before another connection attempt. 35 | * Both values are in seconds. 36 | * giveup_limit - Limit how many times we try to reconnect to the pool. Zero means no limit. Note that stak miners 37 | * don't mine while the connection is lost, so your computer's power usage goes down to idle. 38 | */ 39 | "call_timeout" : 10, 40 | "retry_time" : 30, 41 | "giveup_limit" : 0, 42 | 43 | /* 44 | * Output control. 45 | * Since most people are used to miners printing all the time, that's what we do by default too. This is suboptimal 46 | * really, since you cannot see errors under pages and pages of text and performance stats. Given that we have internal 47 | * performance monitors, there is very little reason to spew out pages of text instead of concise reports. 48 | * Press 'h' (hashrate), 'r' (results) or 'c' (connection) to print reports. 49 | * 50 | * verbose_level - 0 - Don't print anything. 51 | * 1 - Print intro, connection event, disconnect event 52 | * 2 - All of level 1, and new job (block) event if the difficulty is different from the last job 53 | * 3 - All of level 1, and new job (block) event in all cases, result submission event. 54 | * 4 - All of level 3, and automatic hashrate report printing 55 | * 56 | * print_motd - Display messages from your pool operator in the hashrate result. 57 | */ 58 | "verbose_level" : 4, 59 | "print_motd" : true, 60 | 61 | /* 62 | * Automatic hashrate report 63 | * 64 | * h_print_time - How often, in seconds, should we print a hashrate report if verbose_level is set to 4. 65 | * This option has no effect if verbose_level is not 4. 66 | */ 67 | "h_print_time" : 60, 68 | 69 | /* 70 | * Manual hardware AES override 71 | * 72 | * Some VMs don't report AES capability correctly. You can set this value to true to enforce hardware AES or 73 | * to false to force disable AES or null to let the miner decide if AES is used. 74 | * 75 | * WARNING: setting this to true on a CPU that doesn't support hardware AES will crash the miner. 76 | */ 77 | "aes_override" : null, 78 | 79 | /* 80 | * LARGE PAGE SUPPORT 81 | * Large pages need a properly set up OS. It can be difficult if you are not used to systems administration, 82 | * but the performance results are worth the trouble - you will get around 20% boost. Slow memory mode is 83 | * meant as a backup, you won't get stellar results there. If you are running into trouble, especially 84 | * on Windows, please read the common issues in the README. 85 | * 86 | * By default we will try to allocate large pages. This means you need to "Run As Administrator" on Windows. 87 | * You need to edit your system's group policies to enable locking large pages. Here are the steps from MSDN 88 | * 89 | * 1. On the Start menu, click Run. In the Open box, type gpedit.msc. 90 | * 2. On the Local Group Policy Editor console, expand Computer Configuration, and then expand Windows Settings. 91 | * 3. Expand Security Settings, and then expand Local Policies. 92 | * 4. Select the User Rights Assignment folder. 93 | * 5. The policies will be displayed in the details pane. 94 | * 6. In the pane, double-click Lock pages in memory. 95 | * 7. In the Local Security Setting – Lock pages in memory dialog box, click Add User or Group. 96 | * 8. In the Select Users, Service Accounts, or Groups dialog box, add an account that you will run the miner on 97 | * 9. Reboot for change to take effect. 98 | * 99 | * Windows also tends to fragment memory a lot. If you are running on a system with 4-8GB of RAM you might need 100 | * to switch off all the auto-start applications and reboot to have a large enough chunk of contiguous memory. 101 | * 102 | * On Linux you will need to configure large page support "sudo sysctl -w vm.nr_hugepages=128" and increase your 103 | * ulimit -l. To do do this you need to add following lines to /etc/security/limits.conf - "* soft memlock 262144" 104 | * and "* hard memlock 262144". You can also do it Windows-style and simply run-as-root, but this is NOT 105 | * recommended for security reasons. 106 | * 107 | * Memory locking means that the kernel can't swap out the page to disk - something that is unlikely to happen on a 108 | * command line system that isn't starved of memory. I haven't observed any difference on a CLI Linux system between 109 | * locked and unlocked memory. If that is your setup see option "no_mlck". 110 | */ 111 | 112 | /* 113 | * use_slow_memory defines our behaviour with regards to large pages. There are three possible options here: 114 | * always - Don't even try to use large pages. Always use slow memory. 115 | * warn - We will try to use large pages, but fall back to slow memory if that fails. 116 | * no_mlck - This option is only relevant on Linux, where we can use large pages without locking memory. 117 | * It will never use slow memory, but it won't attempt to mlock 118 | * never - If we fail to allocate large pages we will print an error and exit. 119 | */ 120 | "use_slow_memory" : "warn", 121 | 122 | /* 123 | * TLS Settings 124 | * If you need real security, make sure tls_secure_algo is enabled (otherwise MITM attack can downgrade encryption 125 | * to trivially breakable stuff like DES and MD5), and verify the server's fingerprint through a trusted channel. 126 | * 127 | * tls_secure_algo - Use only secure algorithms. This will make us quit with an error if we can't negotiate a secure algo. 128 | */ 129 | "tls_secure_algo" : true, 130 | 131 | /* 132 | * Daemon mode 133 | * 134 | * If you are running the process in the background and you don't need the keyboard reports, set this to true. 135 | * This should solve the hashrate problems on some emulated terminals. 136 | */ 137 | "daemon_mode" : false, 138 | 139 | /* 140 | * Buffered output control. 141 | * When running the miner through a pipe, standard output is buffered. This means that the pipe won't read 142 | * each output line immediately. This can cause delays when running in background. 143 | * Set this option to true to flush stdout after each line, so it can be read immediately. 144 | */ 145 | "flush_stdout" : false, 146 | 147 | /* 148 | * Output file 149 | * 150 | * output_file - This option will log all output to a file. 151 | * 152 | */ 153 | "output_file" : "", 154 | 155 | /* 156 | * Built-in web server 157 | * I like checking my hashrate on my phone. Don't you? 158 | * Keep in mind that you will need to set up port forwarding on your router if you want to access it from 159 | * outside of your home network. Ports lower than 1024 on Linux systems will require root. 160 | * 161 | * httpd_port - Port we should listen on. Default, 0, will switch off the server. 162 | */ 163 | "httpd_port" : 9000, 164 | 165 | /* 166 | * HTTP Authentication 167 | * 168 | * This allows you to set a password to keep people on the Internet from snooping on your hashrate. 169 | * Keep in mind that this is based on HTTP Digest, which is based on MD5. To a determined attacker 170 | * who is able to read your traffic it is as easy to break a bog door latch. 171 | * 172 | * http_login - Login. Empty login disables authentication. 173 | * http_pass - Password. 174 | */ 175 | "http_login" : "iot", 176 | "http_pass" : "internetofshit", 177 | 178 | /* 179 | * prefer_ipv4 - IPv6 preference. If the host is available on both IPv4 and IPv6 net, which one should be choose? 180 | * This setting will only be needed in 2020's. No need to worry about it now. 181 | */ 182 | "prefer_ipv4" : true, 183 | 184 | --------------------------------------------------------------------------------